/** * Test validating agains a MixedRelationsModel */ public function testValidateDynamicClauses() { $super = User::getByUsername('super'); Yii::app()->user->userModel = $super; $searchForm = new ASearchFormTestModel(new MixedRelationsModel()); $searchForm->dynamicClauses = array(array('structurePosition' => '1', 'attributeIndexOrDerivedType' => 'primaryA', 'primaryA' => array('name' => 'xtz'))); $searchForm->dynamicStructure = '1'; $searchForm->validateDynamicClauses('dynamicClauses', array()); $this->assertFalse($searchForm->hasErrors()); $searchForm->clearErrors(); }