/** * 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); */ }
/** * 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; }
/** * Output parameter method call test * * @return void */ public function testOutParameterMethodCall() { $method = MethodRegistry::get('CalcTwice', ['method' => 'CALC.TWICE']); $request = $method->newRequest(['A' => 5]); $this->assertTrue($request->isNew()); $this->assertTrue($method->execute($request)); $this->assertFalse($request->isNew()); $this->assertEquals($request->get('B'), 10); $this->assertEquals($request[':result'], 'OK'); $this->assertEquals($request->result(), 'OK'); }
/** * Test the clear() method. * * @return void */ public function testClear() { $locator = $this->_setMockLocator(); $locator->expects($this->once())->method('clear'); MethodRegistry::clear(); }
public function tearDown() { MethodRegistry::clear(); parent::tearDown(); }
/** * Get the data this panel wants to store. * * @return array */ public function data() { return ['methods' => array_map(function ($method) { return $method->method(); }, MethodRegistry::genericInstances()), 'loggers' => $this->_loggers]; }