You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PhpCliProgram/tests/Application.php

21 lines
755 B
PHP

<?php
namespace jrosset\Tests;
use jrosset\CliProgram\AutoDiscovery\AutoDiscoveryDirectory;
use jrosset\CliProgram\AutoDiscovery\TAutoDiscoveryApplication;
use jrosset\CliProgram\AutoPrefix\AutoPrefixNamespaceManager;
class Application extends \Symfony\Component\Console\Application {
use TAutoDiscoveryApplication;
public function __construct (string $name = 'UNKNOWN', string $version = 'UNKNOWN') {
parent::__construct($name, $version);
$spot = new AutoDiscoveryDirectory(__DIR__ . '/Commands');
$spot->getAutoPrefixManagers()->prepend(new AutoPrefixNamespaceManager('\\jrosset\\Tests\\Commands', 'test'));
$this->getAutoDiscoverySpots()->prepend($spot);
$this->addAutoDiscoveredCommands();
}
}