Skip to content

Commit

Permalink
add testItCanGenerateInvokableClassFile
Browse files Browse the repository at this point in the history
  • Loading branch information
milwad-dev committed Mar 7, 2024
1 parent 5cacb5f commit edb4b80
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/Integration/Generators/ClassMakeCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ public function testItCanGenerateClassFile()
$this->assertFileContains([
'namespace App;',
'class Reverb',
'public function __construct()',
], 'app/Reverb.php');
}

public function testItCanGenerateInvokableClassFile()
{
$this->artisan('make:class', ['name' => 'Notification', '--invokable' => true])
->assertExitCode(0);

$this->assertFileContains([
'namespace App;',
'class Notification',
'public function __construct()',
'public function __invoke()',
], 'app/Notification.php');
}
}

0 comments on commit edb4b80

Please sign in to comment.