Revert #1629 - _Allow adding custom Macroable classes_ (#1707)

* Revert #1629 - Allow adding custom Macroable classes

* Add Macros test
This commit is contained in:
erikn69
2025-05-14 20:21:17 +02:00
committed by GitHub
parent 0fa96e572d
commit c775aec1bb
6 changed files with 41 additions and 36 deletions
@@ -6,18 +6,26 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\GeneratorCommand\GenerateIdeHe
use Barryvdh\LaravelIdeHelper\Console\GeneratorCommand;
use Barryvdh\LaravelIdeHelper\Tests\Console\GeneratorCommand\AbstractGeneratorCommand;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\DB;
class Test extends AbstractGeneratorCommand
{
public function testGenerator(): void
{
Arr::macro('arr_custom_macro',function(){});
DB::macro('db_custom_macro',function(){});
$command = $this->app->make(GeneratorCommand::class);
$tester = $this->runCommand($command);
$this->assertSame(0, $tester->getStatusCode());
$this->assertStringContainsString('A new helper file was written to _ide_helper.php', $tester->getDisplay());
$this->assertStringContainsString('public static function configure($basePath = null)', $this->mockFilesystemOutput);
$this->assertStringContainsString('public static function arr_custom_macro()', $this->mockFilesystemOutput);
$this->assertStringContainsString('public static function db_custom_macro()', $this->mockFilesystemOutput);
}
public function testFilename(): void