Skip to content

Commit

Permalink
getMockForModel should use the correct alias for plugin models
Browse files Browse the repository at this point in the history
  • Loading branch information
dakota committed Oct 6, 2016
1 parent 1ece435 commit cd065f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/TestSuite/TestCase.php
Expand Up @@ -670,6 +670,7 @@ public function getMockForModel($alias, array $methods = [], array $options = []
}

TableRegistry::set($baseClass, $mock);
TableRegistry::set($alias, $mock);

return $mock;
}
Expand Down
1 change: 1 addition & 0 deletions tests/TestCase/TestSuite/TestCaseTest.php
Expand Up @@ -490,6 +490,7 @@ public function testGetMockForModelWithPlugin()

$result = TableRegistry::get('TestPlugin.TestPluginComments');
$this->assertInstanceOf('TestPlugin\Model\Table\TestPluginCommentsTable', $result);
$this->assertSame($TestPluginComment, $result);

$TestPluginComment = $this->getMockForModel('TestPlugin.TestPluginComments', ['save']);

Expand Down

0 comments on commit cd065f3

Please sign in to comment.