From 956698efc986ca78c3f696aef5ac7ca5133924ac Mon Sep 17 00:00:00 2001 From: Jonas Staudenmeir Date: Tue, 18 Dec 2018 04:39:18 +0100 Subject: [PATCH] Test SQLite --- .travis.yml | 3 +++ tests/BelongsToJsonTest.php | 3 ++- tests/HasManyJsonTest.php | 3 ++- tests/config/database.php | 4 ++++ tests/config/database.travis.php | 4 ++++ 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index cd748db..6328a46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ services: env: global: - COVERAGE=no + - DB=mysql - RELEASE=stable matrix: @@ -25,6 +26,8 @@ matrix: - php: 7.3 - php: 7.3 env: RELEASE=lowest + - php: 7.3 + env: DB=sqlite allow_failures: - php: 7.3 env: RELEASE=lowest diff --git a/tests/BelongsToJsonTest.php b/tests/BelongsToJsonTest.php index 6bfae3a..3ddfeb2 100644 --- a/tests/BelongsToJsonTest.php +++ b/tests/BelongsToJsonTest.php @@ -14,7 +14,8 @@ protected function setUp() { parent::setUp(); - if (! method_exists(DB::connection()->query(), 'whereJsonContains')) { + if (! method_exists(DB::connection()->query(), 'whereJsonContains') + || DB::connection()->getDriverName() === 'sqlite') { $this->markTestSkipped(); } } diff --git a/tests/HasManyJsonTest.php b/tests/HasManyJsonTest.php index 950b6f1..48007db 100644 --- a/tests/HasManyJsonTest.php +++ b/tests/HasManyJsonTest.php @@ -14,7 +14,8 @@ protected function setUp() { parent::setUp(); - if (! method_exists(DB::connection()->query(), 'whereJsonContains')) { + if (! method_exists(DB::connection()->query(), 'whereJsonContains') + || DB::connection()->getDriverName() === 'sqlite') { $this->markTestSkipped(); } } diff --git a/tests/config/database.php b/tests/config/database.php index 4ce1717..1c0d5b7 100644 --- a/tests/config/database.php +++ b/tests/config/database.php @@ -27,4 +27,8 @@ 'schema' => 'public', 'sslmode' => 'prefer', ], + 'sqlite' => [ + 'driver' => 'sqlite', + 'database' => ':memory:' + ], ]; diff --git a/tests/config/database.travis.php b/tests/config/database.travis.php index 06096e3..0fb202f 100644 --- a/tests/config/database.travis.php +++ b/tests/config/database.travis.php @@ -15,4 +15,8 @@ 'strict' => true, 'engine' => null, ], + 'sqlite' => [ + 'driver' => 'sqlite', + 'database' => ':memory:' + ], ];