Skip to content

Commit 5b52b1c

Browse files
committed
upgrade to laravel 6
1 parent 812f429 commit 5b52b1c

File tree

10 files changed

+54
-41
lines changed

10 files changed

+54
-41
lines changed

.travis.yml

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,35 @@
11
language: php
22

3-
php:
4-
- 7.0
5-
- 7.1
6-
- 7.2
7-
- 7.3
3+
cache:
4+
directories:
5+
- $HOME/.composer/cache
86

9-
env:
10-
matrix:
11-
- COMPOSER_FLAGS="--prefer-lowest"
12-
- COMPOSER_FLAGS=""
7+
matrix:
8+
fast_finish: true
9+
include:
10+
- php: 7.2
11+
env: LARAVEL='5.8.*' TESTBENCH='3.8.*' COMPOSER_FLAGS='--prefer-lowest'
12+
- php: 7.2
13+
env: LARAVEL='5.8.*' TESTBENCH='3.8.*' COMPOSER_FLAGS='--prefer-stable'
14+
- php: 7.3
15+
env: LARAVEL='5.8.*' TESTBENCH='3.8.*' COMPOSER_FLAGS='--prefer-lowest'
16+
- php: 7.3
17+
env: LARAVEL='5.8.*' TESTBENCH='3.8.*' COMPOSER_FLAGS='--prefer-stable'
18+
- php: 7.2
19+
env: LARAVEL='6.*' TESTBENCH='4.*' COMPOSER_FLAGS='--prefer-lowest'
20+
- php: 7.2
21+
env: LARAVEL='6.*' TESTBENCH='4.*' COMPOSER_FLAGS='--prefer-stable'
22+
- php: 7.3
23+
env: LARAVEL='6.*' TESTBENCH='4.*' COMPOSER_FLAGS='--prefer-lowest'
24+
- php: 7.3
25+
env: LARAVEL='6.*' TESTBENCH='4.*' COMPOSER_FLAGS='--prefer-stable'
1326

14-
before_script:
15-
- travis_retry composer self-update
16-
- travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source
27+
before_install:
28+
- travis_retry composer self-update
29+
- travis_retry composer require --no-update --no-interaction "illuminate/support:${LARAVEL}" "orchestra/testbench:${TESTBENCH}"
30+
31+
install:
32+
- travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction --no-suggest
1733

1834
script:
19-
- vendor/bin/phpunit
20-
35+
- vendor/bin/phpunit

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to `laravel-db-snapshots` will be documented in this file
44

5+
## 1.3.0 - 2019-09-04
6+
7+
- add support for Laravel 6
8+
- drop anything below Laravel 5.8
9+
- drop anything below PHP 7.2
10+
511
## 1.2.4 - 2019-07-01
612

713
- fix for load command in production

composer.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,16 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.0",
20-
"illuminate/support": "^5.4.30",
19+
"php": "^7.2",
20+
"illuminate/support": "^5.8|^6.0",
2121
"league/flysystem": "^1.0.41",
2222
"spatie/db-dumper": "^2.11",
23-
"spatie/laravel-migrate-fresh": "^1.4.1",
2423
"spatie/temporary-directory": "^1.1"
2524
},
2625
"require-dev": {
27-
"mockery/mockery": "^0.9.8",
28-
"orchestra/testbench": "^3.4.10",
29-
"phpunit/phpunit": "^6.5 || ^7.0"
26+
"mockery/mockery": "^1.0",
27+
"orchestra/testbench": "^3.8|^4.0",
28+
"phpunit/phpunit": "^8.0"
3029
},
3130
"autoload": {
3231
"psr-4": {

phpunit.xml.dist

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,4 @@
1919
<directory suffix=".php">src/</directory>
2020
</whitelist>
2121
</filter>
22-
<logging>
23-
<log type="tap" target="build/report.tap"/>
24-
<log type="junit" target="build/report.junit.xml"/>
25-
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
26-
<log type="coverage-text" target="build/coverage.txt"/>
27-
<log type="coverage-clover" target="build/logs/clover.xml"/>
28-
</logging>
2922
</phpunit>

src/Snapshot.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ public function createdAt(): Carbon
8383

8484
protected function dropAllCurrentTables()
8585
{
86-
$tableDropper = TableDropperFactory::create(DB::getDriverName());
87-
88-
$tableDropper->dropAllTables();
86+
DB::connection(DB::getDefaultConnection())
87+
->getSchemaBuilder()
88+
->dropAllTables();
8989

9090
DB::reconnect();
9191
}

tests/Commands/DeleteTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class DeleteTest extends TestCase
1111
/** @var \Spatie\DbSnapshots\Commands\Delete|m\Mock */
1212
protected $command;
1313

14-
public function setUp()
14+
public function setUp(): void
1515
{
1616
parent::setUp();
1717

tests/Commands/LoadTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class LoadTest extends TestCase
1212
/** @var \Spatie\DbSnapshots\Commands\Delete|m\Mock */
1313
protected $command;
1414

15-
public function setUp()
15+
public function setUp(): void
1616
{
1717
parent::setUp();
1818

tests/DbDumperFactoryTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
class DbDumperFactoryTest extends TestCase
1212
{
13-
public function setUp()
13+
public function setUp(): void
1414
{
1515
parent::setUp();
1616

@@ -96,7 +96,7 @@ public function it_can_add_named_options_to_the_dump_command()
9696

9797
$this->app['config']->set('database.connections.mysql.dump', $dumpConfig);
9898

99-
$this->assertContains('--single-transaction', $this->getDumpCommand('mysql'));
99+
$this->assertStringContainsString('--single-transaction', $this->getDumpCommand('mysql'));
100100
}
101101

102102
/** @test */
@@ -106,7 +106,7 @@ public function it_can_add_named_options_with_an_array_value_to_the_dump_command
106106

107107
$this->app['config']->set('database.connections.mysql.dump', $dumpConfig);
108108

109-
$this->assertContains(implode(' ', $dumpConfig['include_tables']), $this->getDumpCommand('mysql'));
109+
$this->assertStringContainsString(implode(' ', $dumpConfig['include_tables']), $this->getDumpCommand('mysql'));
110110
}
111111

112112
/** @test */
@@ -116,13 +116,13 @@ public function it_can_add_arbritrary_options_to_the_dump_command()
116116

117117
$this->app['config']->set('database.connections.mysql.dump', $dumpConfig);
118118

119-
$this->assertContains($dumpConfig['add_extra_option'], $this->getDumpCommand('mysql'));
119+
$this->assertStringContainsString($dumpConfig['add_extra_option'], $this->getDumpCommand('mysql'));
120120
}
121121

122122
/** @test */
123123
public function it_adds_the_inserts_option_to_the_pgsql_dump_command()
124124
{
125-
$this->assertContains('--inserts', $this->getDumpCommand('pgsql'));
125+
$this->assertStringContainsString('--inserts', $this->getDumpCommand('pgsql'));
126126
}
127127

128128
protected function getDumpCommand(string $connectionName): string

tests/SnapshotRepositoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class SnapshotRepositoryTest extends TestCase
1010
/** @var \Spatie\DbSnapshots\SnapshotRepository */
1111
protected $repository;
1212

13-
public function setUp()
13+
public function setUp(): void
1414
{
1515
parent::setUp();
1616

tests/TestCase.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
abstract class TestCase extends Orchestra
1414
{
15-
/** @var FilesystemAdapter */
15+
/** @var \Illuminate\Filesystem\FilesystemAdapter */
1616
protected $disk;
1717

18-
public function setUp()
18+
public function setUp(): void
1919
{
2020
parent::setUp();
2121

@@ -126,7 +126,7 @@ protected function seeInConsoleOutput($searchStrings)
126126
$output = Artisan::output();
127127

128128
foreach ($searchStrings as $searchString) {
129-
$this->assertContains((string) $searchString, $output);
129+
$this->assertStringContainsString((string) $searchString, $output);
130130
}
131131
}
132132
}

0 commit comments

Comments
 (0)