/** * Sets the method locator. * If no parameters are passed, it will return the currently used locator. * * @param \CakeDC\OracleDriver\ORM\Locator\LocatorInterface|null $methodLocator LocatorInterface instance. * @return \CakeDC\OracleDriver\ORM\Locator\LocatorInterface */ public function methodLocator(LocatorInterface $methodLocator = null) { if ($methodLocator !== null) { $this->_methodLocator = $methodLocator; } if (!$this->_methodLocator) { $this->_methodLocator = MethodRegistry::locator(); } return $this->_methodLocator; }
/** * Tests methodLocator method * * @return void */ public function testMethodLocator() { $methodLocator = $this->subject->methodLocator(); $this->assertSame(MethodRegistry::locator(), $methodLocator); /* $newLocator = $this->getMock('CakeDC\OracleDriver\ORM\Locator\LocatorInterface'); $subjectLocator = $this->subject->methodLocator($newLocator); $this->assertSame($newLocator, $subjectLocator); */ }
/** * Test that locator() method is returing MethodLocator by default. * * @return void */ public function testLocatorDefault() { $locator = MethodRegistry::locator(); $this->assertInstanceOf('CakeDC\\OracleDriver\\ORM\\Locator\\MethodLocator', $locator); }