Skip to content

Commit

Permalink
Include AppShell when scanning application for shells/commands.
Browse files Browse the repository at this point in the history
Refs #12153
  • Loading branch information
markstory committed May 30, 2018
1 parent cfaa31c commit bdf8ffc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Console/CommandScanner.php
Expand Up @@ -64,13 +64,13 @@ public function scanApp()
App::path('Shell')[0],
$appNamespace . '\Shell\\',
'',
['app']
[]
);
$appCommands = $this->scanDir(
App::path('Command')[0],
$appNamespace . '\Command\\',
'',
['app']
[]
);

return array_merge($appShells, $appCommands);
Expand Down
2 changes: 2 additions & 0 deletions tests/TestCase/Console/CommandCollectionTest.php
Expand Up @@ -204,11 +204,13 @@ public function testAutoDiscoverApp()
$collection = new CommandCollection();
$collection->addMany($collection->autoDiscover());

$this->assertTrue($collection->has('app'));
$this->assertTrue($collection->has('demo'));
$this->assertTrue($collection->has('i18m'));
$this->assertTrue($collection->has('sample'));
$this->assertTrue($collection->has('testing_dispatch'));

$this->assertSame('TestApp\Shell\AppShell', $collection->get('app'));
$this->assertSame('TestApp\Command\DemoCommand', $collection->get('demo'));
$this->assertSame('TestApp\Shell\I18mShell', $collection->get('i18m'));
$this->assertSame('TestApp\Shell\SampleShell', $collection->get('sample'));
Expand Down

0 comments on commit bdf8ffc

Please sign in to comment.