public function testArguments() { $argument = new DependencyCallArgument(); $call = new DependencyCall('methodName'); $call->addArgument($argument); $expected = array($argument); $this->assertEquals($expected, $call->getArguments()); $call->addArgument($argument); $expected[] = $argument; $this->assertEquals($expected, $call->getArguments()); $call->clearArguments(); $this->assertNull($call->getArguments()); }
/** * Adds a call to this dependency. * @param DependencyCall $call The call to add * @return */ public function addCall(DependencyCall $call) { if ($call->getMethodName() == '__construct') { $this->constructorArguments = $call->getArguments(); return; } $this->calls[] = $call; }