コード例 #1
0
 /**
  * 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);
     */
 }
コード例 #2
0
 /**
  * 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;
 }
コード例 #3
0
 /**
  * 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');
 }
コード例 #4
0
 /**
  * Test the clear() method.
  *
  * @return void
  */
 public function testClear()
 {
     $locator = $this->_setMockLocator();
     $locator->expects($this->once())->method('clear');
     MethodRegistry::clear();
 }
コード例 #5
0
 public function tearDown()
 {
     MethodRegistry::clear();
     parent::tearDown();
 }
コード例 #6
0
 /**
  * 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];
 }