-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mior Muhammad Zaki <[email protected]>
- Loading branch information
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Integration\Generators; | ||
|
||
use Illuminate\Tests\Integration\Generators\TestCase; | ||
|
||
class ClassMakeCommandTest extends TestCase | ||
{ | ||
public function testItCanGenerateClassFile() | ||
{ | ||
$this->artisan('make:class', ['name' => 'Reverb']) | ||
->assertExitCode(0); | ||
|
||
$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'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Integration\Generators; | ||
|
||
use Illuminate\Tests\Integration\Generators\TestCase; | ||
|
||
class InterfaceMakeCommandTest extends TestCase | ||
{ | ||
public function testItCanGenerateEnumFile() | ||
{ | ||
$this->artisan('make:interface', ['name' => 'Gateway']) | ||
->assertExitCode(0); | ||
|
||
$this->assertFileContains([ | ||
'namespace App;', | ||
'interface Gateway', | ||
], 'app/Gateway.php'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Illuminate\Tests\Integration\Generators; | ||
|
||
class TraitMakeCommandTest extends TestCase | ||
{ | ||
public function testItCanGenerateTraitFile() | ||
{ | ||
$this->artisan('make:trait', ['name' => 'FooTrait']) | ||
->assertExitCode(0); | ||
|
||
$this->assertFileContains([ | ||
'namespace App;', | ||
'trait FooTrait', | ||
], 'app/FooTrait.php'); | ||
} | ||
} |