mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
Simplify test by mocking filesystem always (#1019)
This commit is contained in:
@@ -97,7 +97,7 @@ class ModelsCommand extends Command
|
||||
$filename = $this->option('filename');
|
||||
$this->write = $this->option('write');
|
||||
$this->dirs = array_merge(
|
||||
$this->laravel['config']->get('ide-helper.model_locations'),
|
||||
$this->laravel['config']->get('ide-helper.model_locations', []),
|
||||
$this->option('dir')
|
||||
);
|
||||
$model = $this->argument('model');
|
||||
@@ -272,7 +272,15 @@ class ModelsCommand extends Command
|
||||
{
|
||||
$models = array();
|
||||
foreach ($this->dirs as $dir) {
|
||||
$dir = base_path() . '/' . $dir;
|
||||
if (is_dir(base_path($dir))) {
|
||||
$dir = base_path($dir);
|
||||
}
|
||||
|
||||
if (!is_dir($dir)) {
|
||||
$this->error("Cannot locate directory '{'$dir}'");
|
||||
continue;
|
||||
}
|
||||
|
||||
$dirs = glob($dir, GLOB_ONLYDIR);
|
||||
foreach ($dirs as $dir) {
|
||||
if (file_exists($dir)) {
|
||||
|
||||
Reference in New Issue
Block a user