Exemplo n.º 1
0
 public function testCallableIsExecutedInHandlerMethod()
 {
     $resolver = new SelfHandlingResolver();
     $resolver->setApplication(function ($a) {
         return $a * 2;
     });
     $command = new Command\Command($resolver);
     $this->assertEquals(4, $command->dispatch(new CommandStub(2)));
 }
Exemplo n.º 2
0
 public function testPostVariablesAutomaticallyResolved()
 {
     $_POST = array('a_really-long_variable-name' => 'alan');
     $command = new Command\Command(new SelfHandlingResolver());
     $this->assertEquals('alan', $command->dispatch('CommandStubTwo'));
 }
Exemplo n.º 3
0
 public function testTar($file)
 {
     $tar = new \Archips\TarGz();
     $command = new \Command\Command($tar);
     return $command->extractFile($file);
 }