protected function setUp()
 {
     $this->paths = new PathCollection(array('Sample.commands' => array(FIXTURES_ROOT . '/Web/Runner/Invoker')));
     $this->container = new DependencyInjectionContainer();
     $this->cache = $this->container->getInstanceOfWith('ReflectionCache', array(array('component', 'ClassReflectionCache'), array('component', 'MethodReflectionCache')));
     $this->actionNaming = new ActionNameStrategy();
     $this->naming = new CommandNameStrategy();
     $this->object = new CommandActionInvoker($this->paths, $this->container, $this->cache, $this->actionNaming, $this->naming);
 }
 public function testGetInstanceOfWith_DefinedComponent_AnotherArguments()
 {
     $this->object->define('punch_service')->setClass('DependsOnPunchable')->addArgument('component', 'WeakPunch');
     $strong = $this->object->getInstanceOfWith('punch_service', array(array('component', 'StrongPunch')));
     $this->assertThat($strong, $this->isInstanceOf('DependsOnPunchable'));
     $this->assertThat($strong->punchable, $this->isInstanceOf('StrongPunch'));
     $weak = $this->object->getInstanceOf('punch_service')->punchable;
     $this->assertThat($weak, $this->isInstanceOf('WeakPunch'));
     $this->assertThat($this->object->getInstanceOf('punch_service')->punchable, $this->identicalTo($weak));
 }