Artisan::all PHP Method

all() public static method

Get all of the commands registered with the console.
public static all ( ) : array
return array
        public static function all()
        {
            //Method inherited from \Illuminate\Foundation\Console\Kernel
            return \Someline\Console\Kernel::all();
        }

Usage Example

 public function testRegisterCommandsIsCalled()
 {
     require_once 'fixtures/ServiceProviderMock.php';
     $serviceProvider = new ServiceProviderMock($this->app);
     $serviceProvider->register();
     $this->assertTrue($serviceProvider->registerCommandIsFired, 'pass if the commandloadertrait call the registerCommand sucessfully ' . PHP_EOL . 'see "' . CommandLoaderTrait::class . '::registerCommands()"');
     $this->assertArrayHasKey('skimia.phpunit.command.test', Artisan::all(), 'pass if the command is registered in artisan');
     $this->assertTrue(get_class(Artisan::all()['skimia.phpunit.command.test']) == CommandMock::class, 'pass if the command registered is really the command defined in the ServiceProviderMock');
 }