Example #1
0
 public function testCallMethod()
 {
     $definition = new Definition($this->container, 'League\\Di\\Stub\\Corge');
     $definition->withMethod('setInt', array(1));
     $reflection = new \ReflectionMethod($definition, 'callMethods');
     $reflection->setAccessible(true);
     $object = new Corge();
     $objectWithMethodsCalled = $reflection->invoke($definition, $object);
     $this->assertAttributeEquals(1, 'int', $objectWithMethodsCalled, 'Running callMethod on a given object should call the method and pass the args.');
 }