Skip to content

Commit

Permalink
Make sure the right entityClass is used
Browse files Browse the repository at this point in the history
  • Loading branch information
Berry Goudswaard committed Nov 20, 2014
1 parent cc49704 commit addbf2a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/TestCase/TestSuite/TestCaseTest.php
Expand Up @@ -377,6 +377,7 @@ public function testGetMockForModelWithPlugin() {
$TestPluginComment = $this->getMockForModel('TestPlugin.TestPluginComments', array('save'));

$this->assertInstanceOf('\TestPlugin\Model\Table\TestPluginCommentsTable', $TestPluginComment);
$this->assertEquals('\Cake\ORM\Entity', $TestPluginComment->entityClass());
$TestPluginComment->expects($this->at(0))
->method('save')
->will($this->returnValue(true));
Expand All @@ -387,6 +388,10 @@ public function testGetMockForModelWithPlugin() {
$entity = new \Cake\ORM\Entity(array());
$this->assertTrue($TestPluginComment->save($entity));
$this->assertFalse($TestPluginComment->save($entity));

$TestPluginAuthors = $this->getMockForModel('TestPlugin.Authors', array('doSomething'));
$this->assertInstanceOf('\TestPlugin\Model\Table\AuthorsTable', $TestPluginAuthors);
$this->assertEquals('TestPlugin\Model\Entity\Author', $TestPluginAuthors->entityClass());
}

/**
Expand Down

0 comments on commit addbf2a

Please sign in to comment.