public static function setUpBeforeClass() { parent::setUpBeforeClass(); ZurmoDatabaseCompatibilityUtil::createActualPermissionsCacheTable(); ZurmoDatabaseCompatibilityUtil::dropStoredFunctionsAndProcedures(); SecurityTestHelper::createSuperAdmin(); $super = User::getByUsername('super'); Yii::app()->user->userModel = $super; StarredUtil::createStarredTables(); $account = new Account(); $account->owner = $super; $account->name = 'Test Account0'; $account->officePhone = '1234567890'; $account->save(); StarredUtil::markModelAsStarred($account); $account = new Account(); $account->owner = $super; $account->name = 'Test Account1'; $account->officePhone = '1234567891'; $account->save(); }
/** * @depends testCreateStarredTables */ public function testIsModelStarred() { $super = User::getByUsername('super'); Yii::app()->user->userModel = $super; $account = new Account(); $account->owner = $super; $account->name = 'Test Account'; $account->officePhone = '1234567890'; $this->assertTrue($account->save()); $this->assertFalse(StarredUtil::isModelStarred($account)); StarredUtil::markModelAsStarred($account); $this->assertTrue(StarredUtil::isModelStarred($account)); }