-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from hmazter/update-test-and-include-laravel-54
Update test with integration tests
- Loading branch information
Showing
9 changed files
with
84 additions
and
51 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
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
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,37 @@ | ||
<?php | ||
|
||
use Illuminate\Contracts\Console\Kernel; | ||
|
||
class ListSchedulerIntegrationTest extends TestCase | ||
{ | ||
/** | ||
* Resolve application Console Kernel implementation. | ||
* | ||
* @param \Illuminate\Foundation\Application $app | ||
*/ | ||
protected function resolveApplicationConsoleKernel($app) | ||
{ | ||
$app->singleton(Kernel::class, MockConsoleKernel::class); | ||
} | ||
|
||
public function testListSchedulerCommand_withTasksAndTableStyle() | ||
{ | ||
\Illuminate\Support\Facades\Artisan::call('schedule:list'); | ||
$consoleOutput = trim(\Illuminate\Support\Facades\Artisan::output()); | ||
|
||
self::assertContains('test:command:name', $consoleOutput); | ||
self::assertContains('Description of command', $consoleOutput); | ||
self::assertContains('0 10 * * *', $consoleOutput); | ||
} | ||
|
||
public function testListSchedulerCommand_withTasksAndCronStyle() | ||
{ | ||
\Illuminate\Support\Facades\Artisan::call('schedule:list', ['--cron' => true]); | ||
$consoleOutput = trim(\Illuminate\Support\Facades\Artisan::output()); | ||
|
||
self::assertContains('test:command:name', $consoleOutput); | ||
self::assertContains('artisan', $consoleOutput); | ||
self::assertContains('0 10 * * *', $consoleOutput); | ||
self::assertContains((DIRECTORY_SEPARATOR === '\\') ? 'NUL' : '/dev/null', $consoleOutput); | ||
} | ||
} |
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,9 @@ | ||
<?php | ||
|
||
class MockConsoleKernel extends \Orchestra\Testbench\Console\Kernel | ||
{ | ||
protected function schedule(\Illuminate\Console\Scheduling\Schedule $schedule) | ||
{ | ||
$schedule->command('test:command:name')->dailyAt('10:00')->description('Description of command'); | ||
} | ||
} |
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,16 @@ | ||
<?php | ||
|
||
class TestCase extends Orchestra\Testbench\TestCase | ||
{ | ||
/** | ||
* @param \Illuminate\Foundation\Application $app | ||
* | ||
* @return array | ||
*/ | ||
protected function getPackageProviders($app) | ||
{ | ||
return [ | ||
Hmazter\LaravelScheduleList\ScheduleListServiceProvider::class | ||
]; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.