mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 18:13:11 +00:00
* allow model_locations to have glob patterns This if statement check for a valid directory was happening to early. It was checking the string that contained the wildcards to see if it is a valid directory and always failing. Need to check after the foreach starts. fixes #1058 . * test(#1059) Allow glob directories * Fix tests to chdir() into where to expect the glob to work * Update CHANGELOG.md Co-authored-by: Markus Podar <[email protected]>
45 lines
1.0 KiB
PHP
45 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\AllowGlobDirectory;
|
|
|
|
use Barryvdh\LaravelIdeHelper\Console\ModelsCommand;
|
|
use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\AbstractModelsCommand;
|
|
|
|
final class Test extends AbstractModelsCommand
|
|
{
|
|
/** @var string */
|
|
private $cwd;
|
|
|
|
protected function setUp(): void
|
|
{
|
|
parent::setUp();
|
|
|
|
$this->cwd = getcwd();
|
|
}
|
|
|
|
protected function tearDown(): void
|
|
{
|
|
chdir($this->cwd);
|
|
|
|
parent::tearDown();
|
|
}
|
|
|
|
public function test(): void
|
|
{
|
|
$command = $this->app->make(ModelsCommand::class);
|
|
|
|
chdir(__DIR__);
|
|
|
|
$tester = $this->runCommand($command, [
|
|
'--dir' => ['Services/*/Models'],
|
|
'--write' => true,
|
|
]);
|
|
|
|
$this->assertSame(0, $tester->getStatusCode());
|
|
$this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay());
|
|
$this->assertMatchesMockedSnapshot();
|
|
}
|
|
}
|