Skip to content

Commit 00cef51

Browse files
committed
PHPUnit 7 or 8 depending on Orchestra version
1 parent 3ccfaed commit 00cef51

File tree

3 files changed

+27
-26
lines changed

3 files changed

+27
-26
lines changed

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@ php:
55
- 7.3
66

77
env:
8-
- ILLUMINATE_VERSION=5.6.* ORCHESTRA_TESTBENCH_VERSION=3.6
9-
- ILLUMINATE_VERSION=5.7.* ORCHESTRA_TESTBENCH_VERSION=3.7
10-
- ILLUMINATE_VERSION=5.8.* ORCHESTRA_TESTBENCH_VERSION=3.8
11-
- ILLUMINATE_VERSION=6.0.* ORCHESTRA_TESTBENCH_VERSION=4.0
8+
- ILLUMINATE_VERSION=5.6.* PHPUNIT_VERSION=7.* ORCHESTRA_TESTBENCH_VERSION=3.6
9+
- ILLUMINATE_VERSION=5.7.* PHPUNIT_VERSION=7.* ORCHESTRA_TESTBENCH_VERSION=3.7
10+
- ILLUMINATE_VERSION=5.8.* PHPUNIT_VERSION=8.* ORCHESTRA_TESTBENCH_VERSION=3.8
11+
- ILLUMINATE_VERSION=6.0.* PHPUNIT_VERSION=8.* ORCHESTRA_TESTBENCH_VERSION=4.0
1212

1313
cache:
1414
directories:
1515
- $HOME/.composer/cache
1616

1717
before_install:
1818
- if [ -n "$ILLUMINATE_VERSION" ] ; then composer require illuminate/support:${ILLUMINATE_VERSION} illuminate/console:${ILLUMINATE_VERSION} --no-update; fi
19+
- if [ -n "$PHPUNIT_VERSION" ] ; then composer require --dev phpunit/phpunit:${PHPUNIT_VERSION} --no-update; fi
1920
- if [ -n "$ORCHESTRA_TESTBENCH_VERSION" ] ; then composer require --dev orchestra/testbench:${ORCHESTRA_TESTBENCH_VERSION} --no-update; fi
2021

2122
install:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"dragonmantank/cron-expression": "^2.0"
1717
},
1818
"require-dev": {
19-
"phpunit/phpunit": "^7.0",
19+
"phpunit/phpunit": "^8.3",
2020
"orchestra/testbench": "~3.6"
2121
},
2222
"autoload": {

tests/Integration/ListSchedulerTest.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,42 +20,42 @@ public function testListSchedulerCommand_withTasksAndTableStyle()
2020
$consoleOutput = explode("\n", trim(\Illuminate\Support\Facades\Artisan::output()));
2121
$cron = \Cron\CronExpression::factory('0 10 * * *');
2222

23-
self::assertContains('test:command:name', $consoleOutput[3]);
24-
self::assertContains('Description of event', $consoleOutput[3]);
25-
self::assertContains('0 10 * * *', $consoleOutput[3]);
26-
self::assertContains($cron->getNextRunDate()->format('Y-m-d H:i:s'), $consoleOutput[3]);
23+
self::assertStringContainsString('test:command:name', $consoleOutput[3]);
24+
self::assertStringContainsString('Description of event', $consoleOutput[3]);
25+
self::assertStringContainsString('0 10 * * *', $consoleOutput[3]);
26+
self::assertStringContainsString($cron->getNextRunDate()->format('Y-m-d H:i:s'), $consoleOutput[3]);
2727

2828
// get description from the command class
29-
self::assertContains('test:command:two', $consoleOutput[4]);
30-
self::assertContains('Description of test command', $consoleOutput[4]);
29+
self::assertStringContainsString('test:command:two', $consoleOutput[4]);
30+
self::assertStringContainsString('Description of test command', $consoleOutput[4]);
3131

32-
self::assertContains('ls -lah', $consoleOutput[5]);
32+
self::assertStringContainsString('ls -lah', $consoleOutput[5]);
3333

34-
self::assertContains('0 13 * * *', $consoleOutput[6]);
35-
self::assertContains('Closure', $consoleOutput[6]);
36-
self::assertContains('A description for a scheduled callback', $consoleOutput[6]);
34+
self::assertStringContainsString('0 13 * * *', $consoleOutput[6]);
35+
self::assertStringContainsString('Closure', $consoleOutput[6]);
36+
self::assertStringContainsString('A description for a scheduled callback', $consoleOutput[6]);
3737

38-
self::assertContains('0 14 * * *', $consoleOutput[7]);
39-
self::assertContains('Closure', $consoleOutput[7]);
40-
self::assertContains('TestJob', $consoleOutput[7]);
38+
self::assertStringContainsString('0 14 * * *', $consoleOutput[7]);
39+
self::assertStringContainsString('Closure', $consoleOutput[7]);
40+
self::assertStringContainsString('TestJob', $consoleOutput[7]);
4141
}
4242

4343
public function testListSchedulerCommand_withTasksAndCronStyle()
4444
{
4545
\Illuminate\Support\Facades\Artisan::call('schedule:list', ['--cron' => true]);
4646
$consoleOutput = explode("\n", trim(\Illuminate\Support\Facades\Artisan::output()));
4747

48-
self::assertContains('test:command:name', $consoleOutput[0]);
49-
self::assertContains('artisan', $consoleOutput[0]);
50-
self::assertContains('0 10 * * *', $consoleOutput[0]);
51-
self::assertContains((DIRECTORY_SEPARATOR === '\\') ? 'NUL' : '/dev/null', $consoleOutput[0]);
48+
self::assertStringContainsString('test:command:name', $consoleOutput[0]);
49+
self::assertStringContainsString('artisan', $consoleOutput[0]);
50+
self::assertStringContainsString('0 10 * * *', $consoleOutput[0]);
51+
self::assertStringContainsString((DIRECTORY_SEPARATOR === '\\') ? 'NUL' : '/dev/null', $consoleOutput[0]);
5252

53-
self::assertContains('test:command:two', $consoleOutput[1]);
53+
self::assertStringContainsString('test:command:two', $consoleOutput[1]);
5454

55-
self::assertContains('ls -lah', $consoleOutput[2]);
55+
self::assertStringContainsString('ls -lah', $consoleOutput[2]);
5656

57-
self::assertContains('Closure', $consoleOutput[3]);
57+
self::assertStringContainsString('Closure', $consoleOutput[3]);
5858

59-
self::assertContains('Closure', $consoleOutput[4]);
59+
self::assertStringContainsString('Closure', $consoleOutput[4]);
6060
}
6161
}

0 commit comments

Comments
 (0)