@@ -36,6 +36,9 @@ public function testDisplaySchedule()
36
36
$ this ->schedule ->command ('inspire ' )->twiceDaily (14 , 18 );
37
37
$ this ->schedule ->command ('foobar ' , ['a ' => 'b ' ])->everyMinute ();
38
38
$ this ->schedule ->job (FooJob::class)->everyMinute ();
39
+ $ this ->schedule ->job (new FooParamJob ('test ' ))->everyMinute ();
40
+ $ this ->schedule ->job (FooJob::class)->name ('foo-named-job ' )->everyMinute ();
41
+ $ this ->schedule ->job (new FooParamJob ('test ' ))->name ('foo-named-param-job ' )->everyMinute ();
39
42
$ this ->schedule ->command ('inspire ' )->cron ('0 9,17 * * * ' );
40
43
$ this ->schedule ->command ('inspire ' )->cron ("0 10 \t* * * " );
41
44
$ this ->schedule ->call (FooCall::class)->everyMinute ();
@@ -51,9 +54,12 @@ public function testDisplaySchedule()
51
54
->expectsOutput (' 0 14,18 * * * php artisan inspire ........ Next Due: 14 hours from now ' )
52
55
->expectsOutput (' * * * * * php artisan foobar a= ' .ProcessUtils::escapeArgument ('b ' ).' ... Next Due: 1 minute from now ' )
53
56
->expectsOutput (' * * * * * Illuminate\Tests\Integration\Console\Scheduling\FooJob Next Due: 1 minute from now ' )
57
+ ->expectsOutput (' * * * * * Illuminate\Tests\Integration\Console\Scheduling\FooParamJob Next Due: 1 minute from now ' )
58
+ ->expectsOutput (' * * * * * foo-named-job .............. Next Due: 1 minute from now ' )
59
+ ->expectsOutput (' * * * * * foo-named-param-job ........ Next Due: 1 minute from now ' )
54
60
->expectsOutput (' 0 9,17 * * * php artisan inspire ......... Next Due: 9 hours from now ' )
55
61
->expectsOutput (' 0 10 * * * php artisan inspire ........ Next Due: 10 hours from now ' )
56
- ->expectsOutput (' * * * * * Closure at: Illuminate\Tests\Integration\Console\Scheduling\FooCall Next Due: 1 minute from now ' )
62
+ ->expectsOutput (' * * * * * Illuminate\Tests\Integration\Console\Scheduling\FooCall Next Due: 1 minute from now ' )
57
63
->expectsOutput (' * * * * * Closure at: Illuminate\Tests\Integration\Console\Scheduling\FooCall::fooFunction Next Due: 1 minute from now ' )
58
64
->expectsOutput (' * * * * * Closure at: ' .$ closureFilePath .': ' .$ closureLineNumber .' Next Due: 1 minute from now ' );
59
65
}
@@ -64,6 +70,9 @@ public function testDisplayScheduleWithSort()
64
70
$ this ->schedule ->command ('inspire ' )->twiceDaily (14 , 18 );
65
71
$ this ->schedule ->command ('foobar ' , ['a ' => 'b ' ])->everyMinute ();
66
72
$ this ->schedule ->job (FooJob::class)->everyMinute ();
73
+ $ this ->schedule ->job (new FooParamJob ('test ' ))->everyMinute ();
74
+ $ this ->schedule ->job (FooJob::class)->name ('foo-named-job ' )->everyMinute ();
75
+ $ this ->schedule ->job (new FooParamJob ('test ' ))->name ('foo-named-param-job ' )->everyMinute ();
67
76
$ this ->schedule ->command ('inspire ' )->cron ('0 9,17 * * * ' );
68
77
$ this ->schedule ->command ('inspire ' )->cron ("0 10 \t* * * " );
69
78
$ this ->schedule ->call (FooCall::class)->everyMinute ();
@@ -77,7 +86,10 @@ public function testDisplayScheduleWithSort()
77
86
->assertSuccessful ()
78
87
->expectsOutput (' * * * * * php artisan foobar a= ' .ProcessUtils::escapeArgument ('b ' ).' ... Next Due: 1 minute from now ' )
79
88
->expectsOutput (' * * * * * Illuminate\Tests\Integration\Console\Scheduling\FooJob Next Due: 1 minute from now ' )
80
- ->expectsOutput (' * * * * * Closure at: Illuminate\Tests\Integration\Console\Scheduling\FooCall Next Due: 1 minute from now ' )
89
+ ->expectsOutput (' * * * * * Illuminate\Tests\Integration\Console\Scheduling\FooParamJob Next Due: 1 minute from now ' )
90
+ ->expectsOutput (' * * * * * foo-named-job .............. Next Due: 1 minute from now ' )
91
+ ->expectsOutput (' * * * * * foo-named-param-job ........ Next Due: 1 minute from now ' )
92
+ ->expectsOutput (' * * * * * Illuminate\Tests\Integration\Console\Scheduling\FooCall Next Due: 1 minute from now ' )
81
93
->expectsOutput (' * * * * * Closure at: Illuminate\Tests\Integration\Console\Scheduling\FooCall::fooFunction Next Due: 1 minute from now ' )
82
94
->expectsOutput (' * * * * * Closure at: ' .$ closureFilePath .': ' .$ closureLineNumber .' Next Due: 1 minute from now ' )
83
95
->expectsOutput (' 0 9,17 * * * php artisan inspire ......... Next Due: 9 hours from now ' )
@@ -117,6 +129,13 @@ class FooJob
117
129
{
118
130
}
119
131
132
+ class FooParamJob
133
+ {
134
+ public function __construct ($ param )
135
+ {
136
+ }
137
+ }
138
+
120
139
class FooCall
121
140
{
122
141
public function __invoke (): void
0 commit comments