-
-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
82 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
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,39 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* UserFrosting (http://www.userfrosting.com) | ||
* | ||
* @link https://github.com/userfrosting/UserFrosting | ||
* @copyright Copyright (c) 2013-2024 Alexander Weissman & Louis Charette | ||
* @license https://github.com/userfrosting/UserFrosting/blob/master/LICENSE.md (MIT License) | ||
*/ | ||
|
||
namespace UserFrosting\Tests\App\Controller; | ||
|
||
use UserFrosting\App\Bakery\HelloCommand; | ||
use UserFrosting\App\MyApp; | ||
use UserFrosting\Testing\BakeryTester; | ||
use UserFrosting\Testing\TestCase; | ||
|
||
/** | ||
* Test for HelloCommand bakery command. | ||
* | ||
* N.B.: This file is sage to edit or delete. | ||
*/ | ||
class HelloCommandTest extends TestCase | ||
{ | ||
protected string $mainSprinkle = MyApp::class; | ||
|
||
public function testCommand(): void | ||
{ | ||
/** @var HelloCommand */ | ||
$command = $this->ci->get(HelloCommand::class); | ||
$result = BakeryTester::runCommand($command); | ||
|
||
// Assert some output | ||
$this->assertSame(0, $result->getStatusCode()); | ||
$this->assertStringContainsString('Hello world', $result->getDisplay()); | ||
} | ||
} |
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