Skip to content

Commit

Permalink
Don't load missing plugins.
Browse files Browse the repository at this point in the history
Instead we should throw an exception like other parts of the framework
do.
  • Loading branch information
markstory committed Jul 12, 2018
1 parent 11777be commit fbd8a17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Shell/Task/ExtractTask.php
Expand Up @@ -16,6 +16,7 @@

use Cake\Console\Shell;
use Cake\Core\App;
use Cake\Core\Exception\MissingPluginException;
use Cake\Core\Plugin;
use Cake\Filesystem\File;
use Cake\Filesystem\Folder;
Expand Down Expand Up @@ -169,7 +170,7 @@ public function main()
} elseif (isset($this->params['plugin'])) {
$plugin = Inflector::camelize($this->params['plugin']);
if (!Plugin::isLoaded($plugin)) {
Plugin::load($plugin);
throw new MissingPluginException(['plugin' => $plugin]);
}
$this->_paths = [Plugin::classPath($plugin)];
$this->params['plugin'] = $plugin;
Expand Down
2 changes: 2 additions & 0 deletions tests/TestCase/Shell/Task/ExtractTaskTest.php
Expand Up @@ -268,6 +268,7 @@ public function testExtractExcludePlugins()
public function testExtractPlugin()
{
static::setAppNamespace();
$this->loadPlugins(['TestPlugin']);

$this->Task = $this->getMockBuilder('Cake\Shell\Task\ExtractTask')
->setMethods(['_isExtractingApp', 'in', 'out', 'err', 'clear', '_stop'])
Expand All @@ -292,6 +293,7 @@ public function testExtractPlugin()
public function testExtractVendoredPlugin()
{
static::setAppNamespace();
$this->loadPlugins(['Company/TestPluginThree']);

$this->Task = $this->getMockBuilder('Cake\Shell\Task\ExtractTask')
->setMethods(['_isExtractingApp', 'in', 'out', 'err', 'clear', '_stop'])
Expand Down

0 comments on commit fbd8a17

Please sign in to comment.