Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
MainNavigationTreeTest Class Reference
Inheritance diagram for MainNavigationTreeTest:
CDbTestCase

Public Member Functions

 setUp ()
 tearDown ()
 testConstructorNoActiveElement ()
 testExtractBranch (NavigationTree $navigationTree)
 testConstructorIsActiveElement ()
 testPersonalize ()
- Public Member Functions inherited from CDbTestCase
 __get ($name)
 __call ($name, $params)
 getFixtureManager ()
 getFixtureData ($name)
 getFixtureRecord ($name, $alias)

Static Public Member Functions

static setUpBeforeClass ()

Protected Attributes

 $fixtures
 $startFolderId = '10002.580'
 $activeElement = '10002.4'
- Protected Attributes inherited from CDbTestCase
 $fixtures = false

Detailed Description

Definition at line 5 of file MainNavigationTreeTest.php.

Member Function Documentation

MainNavigationTreeTest::setUp ( )

Sets up the fixture before executing a test method. If you override this method, make sure the parent implementation is invoked. Otherwise, the database fixtures will not be managed properly.

Reimplemented from CDbTestCase.

Definition at line 25 of file MainNavigationTreeTest.php.

{
Yii::app()->cache->flush();
$this->_oldRepositoryApi = Yii::app()->repositoryApi;
$mock = $this->getMock('RepositoryApi', array('requestNavigation', 'requestActivePath', 'request'));
$mock->expects($this->any())
->method('requestNavigation')
->will($this->returnValue(file_get_contents(Yii::getPathOfAlias('site.tests.runtime.navigation') . '/requestNavigation.api')));
$mock->expects($this->any())
->method('request')
// ->with($this->identicalTo(array('filter' => 'object.contentid==10002.580', 'type' => 'php')), $this->identicalTo(array('updatetimestamp')))
->will($this->returnValue('a:2:{s:6:"status";s:2:"ok";s:9:"10002.580";a:6:{s:9:"contentid";s:9:"10002.580";s:6:"obj_id";s:3:"580";s:8:"obj_type";s:5:"10002";s:9:"mother_id";s:1:"0";s:11:"mother_type";s:5:"10002";s:10:"attributes";a:1:{s:15:"updatetimestamp";s:10:"1338894653";}}}'));
Yii::app()->setComponent('repositoryApi', $mock);
}
MainNavigationTreeTest::testExtractBranch ( NavigationTree  $navigationTree)

testConstructorNoActiveElement

Definition at line 68 of file MainNavigationTreeTest.php.

References NavigationTree\extractBranch().

{
$contentId = '10002.3216';
$branch = NavigationTree::extractBranch($navigationTree->data, $contentId);
$this->assertEquals($branch['contentid'], $contentId);
$this->assertCount(7, $branch['children']);
}

Member Data Documentation

MainNavigationTreeTest::$fixtures
protected
Initial value:
array(
'user' => 'User',
'personalisationAttributes' => 'PersonalisationAttribute',
'userPersonalisationAttributes' => 'UserPersonalisationAttribute',
)

Definition at line 7 of file MainNavigationTreeTest.php.


The documentation for this class was generated from the following file: