diff --git a/tests/TestCase/ORM/Locator/LocatorAwareTraitTest.php b/tests/TestCase/ORM/Locator/LocatorAwareTraitTest.php index bad8a5d565f..fb2689ab062 100644 --- a/tests/TestCase/ORM/Locator/LocatorAwareTraitTest.php +++ b/tests/TestCase/ORM/Locator/LocatorAwareTraitTest.php @@ -41,10 +41,33 @@ public function setUp() * @return void */ public function testTableLocator() + { + $tableLocator = $this->subject->tableLocator(); + $this->assertSame(TableRegistry::getTableLocator(), $tableLocator); + + $newLocator = $this->getMockBuilder('Cake\ORM\Locator\LocatorInterface')->getMock(); + $subjectLocator = $this->subject->tableLocator($newLocator); + $this->assertSame($newLocator, $subjectLocator); + } + + /** + * Tests testGetTableLocator method + * + * @return void + */ + public function testGetTableLocator() { $tableLocator = $this->subject->getTableLocator(); $this->assertSame(TableRegistry::getTableLocator(), $tableLocator); + } + /** + * Tests testSetTableLocator method + * + * @return void + */ + public function testSetTableLocator() + { $newLocator = $this->getMockBuilder('Cake\ORM\Locator\LocatorInterface')->getMock(); $this->subject->setTableLocator($newLocator); $subjectLocator = $this->subject->getTableLocator();