Skip to content

Commit

Permalink
Test LocatorAwareTrait seperately.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Pustułka committed Apr 21, 2017
1 parent 27a9897 commit d58c185
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/TestCase/ORM/Locator/LocatorAwareTraitTest.php
Expand Up @@ -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();
Expand Down

0 comments on commit d58c185

Please sign in to comment.