Skip to content

Commit 3e7d33e

Browse files
committed
Add Macros test
1 parent e1a8494 commit 3e7d33e

File tree

1 file changed

+8
-0
lines changed
  • tests/Console/GeneratorCommand/GenerateIdeHelper

1 file changed

+8
-0
lines changed

tests/Console/GeneratorCommand/GenerateIdeHelper/Test.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,26 @@
66

77
use Barryvdh\LaravelIdeHelper\Console\GeneratorCommand;
88
use Barryvdh\LaravelIdeHelper\Tests\Console\GeneratorCommand\AbstractGeneratorCommand;
9+
use Illuminate\Support\Arr;
10+
use Illuminate\Support\Facades\DB;
911

1012
class Test extends AbstractGeneratorCommand
1113
{
1214
public function testGenerator(): void
1315
{
16+
Arr::macro('arr_custom_macro',function(){});
17+
DB::macro('db_custom_macro',function(){});
18+
1419
$command = $this->app->make(GeneratorCommand::class);
1520

1621
$tester = $this->runCommand($command);
1722

1823
$this->assertSame(0, $tester->getStatusCode());
24+
1925
$this->assertStringContainsString('A new helper file was written to _ide_helper.php', $tester->getDisplay());
2026
$this->assertStringContainsString('public static function configure($basePath = null)', $this->mockFilesystemOutput);
27+
$this->assertStringContainsString('public static function arr_custom_macro()', $this->mockFilesystemOutput);
28+
$this->assertStringContainsString('public static function db_custom_macro()', $this->mockFilesystemOutput);
2129
}
2230

2331
public function testFilename(): void

0 commit comments

Comments
 (0)