/** * testEntityReference method * * @access public * @return void */ function testEntityReference() { $View = new TestView($this->PostsController); $View->model = 'Post'; $View->field = 'title'; $this->assertEqual($View->entity(), array('Post', 'title')); $View->association = 'Comment'; $View->field = 'user_id'; $this->assertEqual($View->entity(), array('Comment', 'user_id')); }
/** * testEntityReference method * * @access public * @return void */ function testEntityReference() { $View = new TestView($this->PostsController); $View->model = 'Post'; $View->field = 'title'; $this->assertEqual($View->entity(), array('Post', 'title')); $View->association = 'Comment'; $View->field = 'user_id'; $this->assertEqual($View->entity(), array('Comment', 'user_id')); $View->model = 0; $View->association = null; $View->field = 'Node'; $View->fieldSuffix = 'title'; $View->entityPath = '0.Node.title'; $expected = array(0, 'Node', 'title'); $this->assertEqual($View->entity(), $expected); $View->model = 'HelperTestTag'; $View->field = 'HelperTestTag'; $View->modelId = null; $View->association = null; $View->fieldSuffix = null; $View->entityPath = 'HelperTestTag'; $expected = array('HelperTestTag', 'HelperTestTag'); $this->assertEqual($View->entity(), $expected); }