Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CDbTestCase Class Reference
Inheritance diagram for CDbTestCase:
AccountRelationsTest ApalinesTest BasicPersonalisationRuleTest BulkTest CommentRelationsAndScopesTest CommentsModuleAccessMethodsTest CommentsModuleTest CommentTest FriendshipTest FriendsModuleTest historyTest LanguageTest LikeTest MainNavigationTreeTest NotificationManagerTest PersonalisationAttributeTest ProfileFieldScopeTest ProfileFieldTest ProfileTest RegistrationFormTest RememberPagesTest RWebUserTest SearchApiTest ShoppingcartTest ShoppingcartTest UserIdentityTest VoteTest

Public Member Functions

 __get ($name)
 __call ($name, $params)
 getFixtureManager ()
 getFixtureData ($name)
 getFixtureRecord ($name, $alias)

Protected Member Functions

 setUp ()

Protected Attributes

 $fixtures = false

Detailed Description

Definition at line 40 of file CDbTestCase.php.

Member Function Documentation

CDbTestCase::__call (   $name,
  $params 
)

PHP magic method. This method is overridden so that named fixture ActiveRecord instances can be accessed in terms of a method call.

Parameters
string$namemethod name
string$paramsmethod parameters
Returns
mixed the property value

Definition at line 72 of file CDbTestCase.php.

References getFixtureManager().

{
if(is_array($this->fixtures) && isset($params[0]) && ($record=$this->getFixtureManager()->getRecord($name,$params[0]))!==false)
return $record;
else
throw new Exception("Unknown method '$name' for class '".get_class($this)."'.");
}
CDbTestCase::__get (   $name)

PHP magic method. This method is overridden so that named fixture data can be accessed like a normal property.

Parameters
string$namethe property name
Returns
mixed the property value

Definition at line 57 of file CDbTestCase.php.

References getFixtureManager().

{
if(is_array($this->fixtures) && ($rows=$this->getFixtureManager()->getRows($name))!==false)
return $rows;
else
throw new Exception("Unknown property '$name' for class '".get_class($this)."'.");
}
CDbTestCase::getFixtureData (   $name)
Parameters
string$namethe fixture name (the key value in fixtures).
Returns
array the named fixture data

Definition at line 92 of file CDbTestCase.php.

References getFixtureManager().

{
return $this->getFixtureManager()->getRows($name);
}
CDbTestCase::getFixtureManager ( )
Returns
CDbFixtureManager the database fixture manager

Definition at line 83 of file CDbTestCase.php.

Referenced by __call(), __get(), getFixtureData(), getFixtureRecord(), and setUp().

{
return Yii::app()->getComponent('fixture');
}
CDbTestCase::getFixtureRecord (   $name,
  $alias 
)
Parameters
string$namethe fixture name (the key value in fixtures).
string$aliasthe alias of the fixture data row
Returns
CActiveRecord the ActiveRecord instance corresponding to the specified alias in the named fixture. False is returned if there is no such fixture or the record cannot be found.

Definition at line 103 of file CDbTestCase.php.

References getFixtureManager().

{
return $this->getFixtureManager()->getRecord($name,$alias);
}
CDbTestCase::setUp ( )
protected

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 in ApalinesTest, historyTest, LanguageTest, MainNavigationTreeTest, BulkTest, CommentsModuleAccessMethodsTest, LikeTest, ShoppingcartTest, and SearchApiTest.

Definition at line 113 of file CDbTestCase.php.

References getFixtureManager().

{
if(is_array($this->fixtures))
$this->getFixtureManager()->load($this->fixtures);
}

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