コード例 #1
0
 public function testInvalidMethodCall()
 {
     $this->setExpectedException('\\Borobudur\\DependencyInjection\\Exception\\InvalidArgumentException');
     $methodCall = new Definition\MethodCall();
     try {
         $methodCall->add('');
     } catch (\Exception $e) {
         $this->assertEquals('Method name cannot be empty.', $e->getMessage());
         throw $e;
     }
 }
コード例 #2
0
 /**
  * Shortcut add method call.
  *
  * @param string $method
  * @param array  $arguments
  *
  * @return static
  */
 public function addMethodCall($method, array $arguments = array())
 {
     $this->call->add($method, $arguments);
     return $this;
 }