assertEquals('foobar', $command->getName()); } public function testCommandExecution() { $hit = false; $command = new Command("foobar", function () use (&$hit) { $hit=true; }); $context = new Context("foobar", []); $command->call($context); $this->assertEquals(true, $hit); } public function testCommandReflection() { $command = new Command("test", function (string $a, ?int $b, bool $c = false) { }); $expect = [ 'a' => 'string', 'b' => 'int', 'c' => '?bool' ]; $this->assertEquals($expect, $command->parameters()); } }