Skip to content

Commit a5f3cb4

Browse files
author
Tom Schlick
authored
update to allow laravel 7 (#18)
* Update composer.json * Update .gitignore * require laravel 7 for new version * update test to match parent * remove php 7.1 * allow phpunit 8 or 9 * assertRegExp() -> assertMatchesRegularExpression() * more phpunit changes * replace assertNotContains with assertStringNotContainsString * travis config updates * require phpunit ^9.1 * revert assertRegExp change
1 parent a72262a commit a5f3cb4

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ vendor
55
coverage
66
.idea
77
.vscode
8+
.phpunit.result.cache

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
language: php
22

33
php:
4-
- 7.1
54
- 7.2
65
- 7.3
76
- 7.4
87

98
env:
109
matrix:
11-
#- COMPOSER_FLAGS="--prefer-lowest" # Disabled until works w/7.4 (2019-12-04)
10+
- COMPOSER_FLAGS="--prefer-lowest"
1211
- COMPOSER_FLAGS=""
1312

1413
services:
@@ -25,7 +24,7 @@ before_script:
2524
- psql -c 'CREATE ROLE root SUPERUSER LOGIN;' -U postgres
2625

2726
script:
28-
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover --configuration phpunit.xml.travis
27+
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover --configuration phpunit.xml.travis --testdox
2928

3029
after_script:
3130
- php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
}
2323
],
2424
"require": {
25-
"php": "^7.1",
26-
"laravel/framework": "^5.8 | ^6.0"
25+
"php": "^7.2.5",
26+
"laravel/framework": "^7.0"
2727
},
2828
"require-dev": {
2929
"mockery/mockery": "~1.0",
30-
"orchestra/testbench": "^3.7",
31-
"phpunit/phpunit": "^7.0"
30+
"orchestra/testbench": "^5.0",
31+
"phpunit/phpunit": "^8.4|^9.0"
3232
},
3333
"autoload": {
3434
"psr-4": {

tests/MigrateDumpTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ public function test_dump_callsAfterDumpClosure()
3333
$schema_sql = file_get_contents(
3434
database_path() . MigrateDumpCommand::SCHEMA_SQL_PATH_SUFFIX
3535
);
36-
$this->assertNotContains('/*', $schema_sql);
36+
$this->assertStringNotContainsString('/*', $schema_sql);
3737
}
3838
}

tests/MigrateHookTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public function test_handle()
2424
$this->assertEquals(0, $result);
2525

2626
$output_string = $output->fetch();
27-
$this->assertContains('Loaded schema', $output_string);
28-
$this->assertContains('Dumped schema', $output_string);
27+
$this->assertStringContainsString('Loaded schema', $output_string);
28+
$this->assertStringContainsString('Dumped schema', $output_string);
2929
}
3030

3131
public function test_handle_dumpsOnRollback()
@@ -44,7 +44,7 @@ public function test_handle_dumpsOnRollback()
4444
$this->assertEquals(0, $result);
4545

4646
$output_string = $output->fetch();
47-
$this->assertContains('Dumped schema', $output_string);
47+
$this->assertStringContainsString('Dumped schema', $output_string);
4848
}
4949

5050
public function test_handle_doesNotLoadWhenDbHasMigrated()
@@ -61,7 +61,7 @@ public function test_handle_doesNotLoadWhenDbHasMigrated()
6161
$this->assertEquals(0, $result);
6262

6363
$output_string = $output->fetch();
64-
$this->assertNotContains('Loaded schema', $output_string);
64+
$this->assertStringNotContainsString('Loaded schema', $output_string);
6565

6666
$this->assertEquals(1, \DB::table('test_ms')->count());
6767
}

tests/Mysql/MigrateDumpTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ public function test_handle()
1616
$this->assertDirectoryExists($this->schemaSqlDirectory);
1717
$this->assertFileExists($this->schemaSqlPath);
1818
$result_sql = file_get_contents($this->schemaSqlPath);
19-
$this->assertContains('CREATE TABLE `test_ms`', $result_sql);
20-
$this->assertContains('INSERT INTO `migrations`', $result_sql);
21-
$this->assertNotContains(' AUTO_INCREMENT=', $result_sql);
19+
$this->assertStringContainsString('CREATE TABLE `test_ms`', $result_sql);
20+
$this->assertStringContainsString('INSERT INTO `migrations`', $result_sql);
21+
$this->assertStringNotContainsString(' AUTO_INCREMENT=', $result_sql);
2222
$last_character = mb_substr($result_sql, -1);
2323
$this->assertRegExp("/[\r\n]\z/mu", $last_character);
2424
}

tests/Sqlite/SqliteTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ abstract class SqliteTestCase extends TestCase
99
{
1010
protected $dbDefault = 'sqlite';
1111

12-
public static function setUpBeforeClass()
12+
public static function setUpBeforeClass() : void
1313
{
1414
// File must exist before connection will initialize, even if empty.
1515
touch(__DIR__ . '/../../vendor/orchestra/testbench-core/laravel/database/database.sqlite');
1616
}
17-
}
17+
}

0 commit comments

Comments
 (0)