diff --git a/tests/Console/ModelsCommand/PhpAttributesClosureInAttribute/Models/ClosureInAttribute.php b/tests/Console/ModelsCommand/PhpAttributesClosureInAttribute/Models/ClosureInAttribute.php new file mode 100644 index 0000000..99fa888 --- /dev/null +++ b/tests/Console/ModelsCommand/PhpAttributesClosureInAttribute/Models/ClosureInAttribute.php @@ -0,0 +1,14 @@ + true)] +class ClosureInAttribute extends Model +{ + protected $table = 'simples'; +} diff --git a/tests/Console/ModelsCommand/PhpAttributesClosureInAttribute/Test.php b/tests/Console/ModelsCommand/PhpAttributesClosureInAttribute/Test.php new file mode 100644 index 0000000..1208731 --- /dev/null +++ b/tests/Console/ModelsCommand/PhpAttributesClosureInAttribute/Test.php @@ -0,0 +1,27 @@ +app->make(ModelsCommand::class); + + $tester = $this->runCommand($command, [ + '--write' => true, + ]); + + $this->assertSame(0, $tester->getStatusCode()); + $this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay()); + $this->assertMatchesMockedSnapshot(); + } +} diff --git a/tests/Console/ModelsCommand/PhpAttributesClosureInAttribute/__snapshots__/Test__test__1.php b/tests/Console/ModelsCommand/PhpAttributesClosureInAttribute/__snapshots__/Test__test__1.php new file mode 100644 index 0000000..77e0f03 --- /dev/null +++ b/tests/Console/ModelsCommand/PhpAttributesClosureInAttribute/__snapshots__/Test__test__1.php @@ -0,0 +1,22 @@ +|ClosureInAttribute newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|ClosureInAttribute newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|ClosureInAttribute query() + * @method static \Illuminate\Database\Eloquent\Builder|ClosureInAttribute whereId($value) + * @mixin \Eloquent + */ +#[SomeClosureAttr(fn() => true)] +class ClosureInAttribute extends Model +{ + protected $table = 'simples'; +}