Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
ProfileFieldScopeTest.php
1 <?php
2 
3 class ProfileFieldScopeTest extends CDbTestCase
4 {
5 
6  public $fixtures = array(
7  'profiles_fields' => 'ProfileField'
8  );
9 
10  public static function setUpBeforeClass()
11  {
12  Yii::app()->getModule('user');
13 
14  }
15 
16  public function testScopeVisibleAll()
17  {
18  $this->assertCount(7, ProfileField::model()->forAll()->findAll());
19  }
20 
21  public function testScopeVisibleForUser()
22  {
23  $this->assertCount(9, ProfileField::model()->forUser()->findAll());
24  }
25 
26  public function testScopeVisibleForOwner()
27  {
28  $this->assertCount(10, ProfileField::model()->forOwner()->findAll());
29  }
30 
31  public function testScopeVisibleForRegistration()
32  {
33  $this->assertCount(10, ProfileField::model()->forRegistration()->findAll());
34  }
35 
36  public function testWidgetView()
37  {
38  $profile = new Profile();
39  $this->profiles_fields('birthday')->widgetView($profile);
40  }
41 
42  public function testWidgetEdit()
43  {
44  Yii::app()->setComponent('assetManager',$this->getMock('CAssetManager'));
45  $profile = new Profile();
46  $this->profiles_fields('birthday')->widgetEdit($profile);
47  }
48 
49 
50 
51 
52 
53 
54 
55 }