* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Console\Tests\CommandLoader; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\CommandLoader\FactoryCommandLoader; class FactoryCommandLoaderTest extends TestCase { public function testHas() { $loader = new FactoryCommandLoader(array( 'foo' => function () { return new Command('foo'); }, 'bar' => function () { return new Command('bar'); }, )); $this->assertTrue($loader->has('foo')); $this->assertTrue($loader->has('bar')); $this->assertFalse($loader->has('baz')); } public function testGet() { $loader = new FactoryCommandLoader(array( 'foo' => function () { return new Command('foo'); }, 'bar' => function () { return new Command('bar'); }, )); $this->assertInstanceOf(Command::class, $loader->get('foo')); $this->assertInstanceOf(Command::class, $loader->get('bar')); } /** * @expectedException \Symfony\Component\Console\Exception\CommandNotFoundException */ public function testGetUnknownCommandThrows() { (new FactoryCommandLoader(array()))->get('unknown'); } public function testGetCommandNames() { $loader = new FactoryCommandLoader(array( 'foo' => function () { return new Command('foo'); }, 'bar' => function () { return new Command('bar'); }, )); $this->assertSame(array('foo', 'bar'), $loader->getNames()); } } __halt_compiler();----SIGNATURE:----WLwyI+jgc3CSwC3+s5GlGn3YL5fYlb7dEj7VwJ9Mpneb7BoZiBQFPXPG/ee8NjTKJ9sken8qyLPadaSGB6PwJbXFqw7MVCEyMRYbgupGt3f+setpmyUG3bUrJ6YpCA7I9u92oo/FrPZWgnOxMjhFP5Bokzvu7OTGBvxPjflwhIZcAro9t60vxKQ4uDO+WsW/FHPXS4DYUD/XNhtff9ZofrndmqNoa/rfHlJmCC+n+I0lFDwfD/nEId5IC6kczh3zBAKoeY0Xi/JBr/QZZKFE7IE77u4L2mfrcf92CbxJKe+01Q3Ug131sGjHpr8ZzCSrIZwYf5LsVaO3xqcTlgo37ZKEZpzKF2zwLRIPd8xOswp4mzmx9bS9yV3WWSSlEzqgZkcUfi1k+NVTbysv2t0noPQEs6eevFGIwAw9/tP8fjSDFTySyuY3uQ7FAaFQksYGoTFI697KT4YJyLErZgEVOhgGs0viW8tt6gD4daXLtcZoHZn5CPmKhXtuB5T0xbjXjCbByMX83eCWGtjU9nrZ3Kl7v6oKlmHtFhEawHj5OIntGDd8ZEwkS6M8xHZQPiIWlxG0fi4jBh59RM++F2vOLojah39oxwsxcpWNvvJ44R65i1RZi5c/huTdmY0JOkmzEiz4RuYz7jJsKsSeeOHAdz7Zc93vOkNvF5mmf1WKBvQ=----ATTACHMENT:----ODYxODM3OTI2MTk4NjU2NSA4OTU5MzUyNTQ0NjcxMDMxIDM3NjcyOTUxMzMzOTA5OQ==