From e4098b3cc1685195ad97fdb7354f041710ed7167 Mon Sep 17 00:00:00 2001 From: Brandon Lis Date: Wed, 13 Nov 2019 10:51:36 -0800 Subject: [PATCH 1/2] Fix Tests --- composer.json | 2 +- phpunit.xml | 3 +-- tests/CacheTest.php | 2 +- tests/EncoderTest.php | 2 +- tests/HasherTest.php | 2 +- tests/IntegrationTest.php | 2 +- tests/InvalidatorTest.php | 2 +- tests/ManagerTest.php | 2 +- tests/RedisTest.php | 2 +- tests/TaggerTest.php | 2 +- tests/TestCase.php | 4 ++-- 11 files changed, 12 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index 4326450..155bfb7 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "phpunit/phpunit": "~7.0", "codeclimate/php-test-reporter": "dev-master", "orchestra/testbench": "~3.7", - "laracasts/TestDummy": "~2.3", + "laracasts/testdummy": "~2.3", "mockery/mockery": "^1.0" }, "suggest": { diff --git a/phpunit.xml b/phpunit.xml index 122452c..5001ee3 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -7,8 +7,7 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" - stopOnFailure="false" - syntaxCheck="false"> + stopOnFailure="false"> diff --git a/tests/CacheTest.php b/tests/CacheTest.php index f102f85..fe26471 100644 --- a/tests/CacheTest.php +++ b/tests/CacheTest.php @@ -6,7 +6,7 @@ class CacheTest extends TestCase { private $cache; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/EncoderTest.php b/tests/EncoderTest.php index abd5e68..d50a50d 100644 --- a/tests/EncoderTest.php +++ b/tests/EncoderTest.php @@ -8,7 +8,7 @@ class EncoderTest extends TestCase { private $encoder; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/HasherTest.php b/tests/HasherTest.php index 369b90d..b30088d 100644 --- a/tests/HasherTest.php +++ b/tests/HasherTest.php @@ -9,7 +9,7 @@ class HasherTest extends TestCase { private $hasher; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/IntegrationTest.php b/tests/IntegrationTest.php index 47bb199..a8a5ed8 100644 --- a/tests/IntegrationTest.php +++ b/tests/IntegrationTest.php @@ -11,7 +11,7 @@ class IntegrationTest extends TestCase { private $cache; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/InvalidatorTest.php b/tests/InvalidatorTest.php index b3a65b3..3421624 100644 --- a/tests/InvalidatorTest.php +++ b/tests/InvalidatorTest.php @@ -8,7 +8,7 @@ class InvalidatorTest extends TestCase private $invalidator; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/ManagerTest.php b/tests/ManagerTest.php index 58289be..2ec9db8 100644 --- a/tests/ManagerTest.php +++ b/tests/ManagerTest.php @@ -9,7 +9,7 @@ class ManagerTest extends TestCase { private $stub; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/RedisTest.php b/tests/RedisTest.php index 958ae1b..7e3323d 100644 --- a/tests/RedisTest.php +++ b/tests/RedisTest.php @@ -8,7 +8,7 @@ class RedisTest extends TestCase { private $redis; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/TaggerTest.php b/tests/TaggerTest.php index bd3a6a8..65d63bc 100644 --- a/tests/TaggerTest.php +++ b/tests/TaggerTest.php @@ -13,7 +13,7 @@ class TaggerTest extends TestCase private $redis; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/TestCase.php b/tests/TestCase.php index 4d39604..693f4c3 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -20,7 +20,7 @@ public function __construct($name = null, array $data = [], $dataName = '') $this->useArtisan = version_compare('5.4', Application::VERSION, '>'); } - public function setUp() + public function setUp(): void { parent::setUp(); @@ -41,7 +41,7 @@ public function setUp() DB::beginTransaction(); } - public function tearDown() + public function tearDown(): void { DB::rollback(); From b3c9a3c4c549e2b1f8fe3efdc5cd1e02fbde51fe Mon Sep 17 00:00:00 2001 From: Brandon Lis Date: Wed, 13 Nov 2019 12:00:32 -0800 Subject: [PATCH 2/2] Make all tests pass by removing the redis prefix in the Laravel config --- tests/TestCase.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/TestCase.php b/tests/TestCase.php index 693f4c3..c964dba 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -67,5 +67,7 @@ protected function getEnvironmentSetUp($app) 'database' => ':memory:', 'prefix' => '', ]); + //If the database redis has a prefix, Lada fails to flush the cache + $app['config']->set('database.redis.options.prefix', false); } } \ No newline at end of file