Skip to content

Commit d58c185

Browse files
author
Robert Pustułka
committed
Test LocatorAwareTrait seperately.
1 parent 27a9897 commit d58c185

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/TestCase/ORM/Locator/LocatorAwareTraitTest.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,33 @@ public function setUp()
4141
* @return void
4242
*/
4343
public function testTableLocator()
44+
{
45+
$tableLocator = $this->subject->tableLocator();
46+
$this->assertSame(TableRegistry::getTableLocator(), $tableLocator);
47+
48+
$newLocator = $this->getMockBuilder('Cake\ORM\Locator\LocatorInterface')->getMock();
49+
$subjectLocator = $this->subject->tableLocator($newLocator);
50+
$this->assertSame($newLocator, $subjectLocator);
51+
}
52+
53+
/**
54+
* Tests testGetTableLocator method
55+
*
56+
* @return void
57+
*/
58+
public function testGetTableLocator()
4459
{
4560
$tableLocator = $this->subject->getTableLocator();
4661
$this->assertSame(TableRegistry::getTableLocator(), $tableLocator);
62+
}
4763

64+
/**
65+
* Tests testSetTableLocator method
66+
*
67+
* @return void
68+
*/
69+
public function testSetTableLocator()
70+
{
4871
$newLocator = $this->getMockBuilder('Cake\ORM\Locator\LocatorInterface')->getMock();
4972
$this->subject->setTableLocator($newLocator);
5073
$subjectLocator = $this->subject->getTableLocator();

0 commit comments

Comments
 (0)