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; } }
/** * 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; }