From 87aa6ed1dae408e0e528d26bbbf7bcb5796b17df Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Sun, 12 May 2019 10:50:38 -0500 Subject: [PATCH] Fix tests for 5.8 --- tests/AcarsTest.php | 2 +- tests/ApiTest.php | 2 +- tests/AwardsTest.php | 2 +- tests/FinanceTest.php | 2 +- tests/FlightTest.php | 2 +- tests/ImporterTest.php | 2 +- tests/MathTest.php | 4 ---- tests/MetarTest.php | 4 ++-- tests/PIREPTest.php | 4 ++-- tests/SubfleetTest.php | 2 +- tests/TestCase.php | 9 +++++++-- tests/UserTest.php | 2 +- tests/UtilsTest.php | 4 ---- 13 files changed, 19 insertions(+), 22 deletions(-) diff --git a/tests/AcarsTest.php b/tests/AcarsTest.php index ac87b130..0c0032e9 100644 --- a/tests/AcarsTest.php +++ b/tests/AcarsTest.php @@ -11,7 +11,7 @@ class AcarsTest extends TestCase { protected $settingsRepo; - public function setUp() + public function setUp(): void { parent::setUp(); $this->addData('base'); diff --git a/tests/ApiTest.php b/tests/ApiTest.php index d1b9031c..7329aa0d 100644 --- a/tests/ApiTest.php +++ b/tests/ApiTest.php @@ -9,7 +9,7 @@ use App\Services\FareService; */ class ApiTest extends TestCase { - public function setUp() + public function setUp(): void { parent::setUp(); $this->addData('base'); diff --git a/tests/AwardsTest.php b/tests/AwardsTest.php index 42c075de..1d1f51e7 100644 --- a/tests/AwardsTest.php +++ b/tests/AwardsTest.php @@ -7,7 +7,7 @@ class AwardsTest extends TestCase private $awardSvc; private $pirepSvc; - public function setUp() + public function setUp(): void { parent::setUp(); $this->awardSvc = app(\App\Services\AwardService::class); diff --git a/tests/FinanceTest.php b/tests/FinanceTest.php index 7dd7a488..0fd40cad 100644 --- a/tests/FinanceTest.php +++ b/tests/FinanceTest.php @@ -21,7 +21,7 @@ class FinanceTest extends TestCase /** * @throws Exception */ - public function setUp() + public function setUp(): void { parent::setUp(); $this->addData('base'); diff --git a/tests/FlightTest.php b/tests/FlightTest.php index d11a1d84..b6f125f8 100644 --- a/tests/FlightTest.php +++ b/tests/FlightTest.php @@ -12,7 +12,7 @@ class FlightTest extends TestCase protected $flightSvc; protected $settingsRepo; - public function setUp() + public function setUp(): void { parent::setUp(); $this->addData('base'); diff --git a/tests/ImporterTest.php b/tests/ImporterTest.php index 1544377a..4fc5d935 100644 --- a/tests/ImporterTest.php +++ b/tests/ImporterTest.php @@ -12,7 +12,7 @@ class ImporterTest extends TestCase private $importSvc; private $fareSvc; - public function setUp() + public function setUp(): void { parent::setUp(); $this->importBaseClass = new \App\Interfaces\ImportExport(); diff --git a/tests/MathTest.php b/tests/MathTest.php index 593b375a..4e927c28 100644 --- a/tests/MathTest.php +++ b/tests/MathTest.php @@ -4,10 +4,6 @@ use App\Support\Math; class MathTest extends TestCase { - public function setUp() - { - } - /** * Test adding/subtracting a percentage */ diff --git a/tests/MetarTest.php b/tests/MetarTest.php index ff46ced6..4da27a3f 100644 --- a/tests/MetarTest.php +++ b/tests/MetarTest.php @@ -10,9 +10,9 @@ class MetarTest extends TestCase { private $settingsRepo; - public function setUp() + public function setUp(): void { - parent::setUp(); // TODO: Change the autogenerated stub + parent::setUp(); $this->settingsRepo = app(SettingRepository::class); } diff --git a/tests/PIREPTest.php b/tests/PIREPTest.php index f131e76b..4e7722cf 100644 --- a/tests/PIREPTest.php +++ b/tests/PIREPTest.php @@ -15,9 +15,9 @@ class PIREPTest extends TestCase protected $pirepSvc; protected $settingsRepo; - public function setUp() + public function setUp(): void { - parent::setUp(); // TODO: Change the autogenerated stub + parent::setUp(); $this->addData('base'); $this->pirepSvc = app('App\Services\PirepService'); diff --git a/tests/SubfleetTest.php b/tests/SubfleetTest.php index e13fd1c0..20012417 100644 --- a/tests/SubfleetTest.php +++ b/tests/SubfleetTest.php @@ -6,7 +6,7 @@ class SubfleetTest extends TestCase protected $ac_svc; protected $ICAO = 'B777'; - public function setUp() + public function setUp(): void { parent::setUp(); $this->addData('base'); diff --git a/tests/TestCase.php b/tests/TestCase.php index 7927b169..ad28cbd9 100755 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -19,7 +19,7 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase protected $app; protected $baseUrl = 'http://localhost'; - protected $connectionsToTransact = ['testing']; + protected $connectionsToTransact = ['test']; protected $user; @@ -30,13 +30,18 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase /** * @throws Exception */ - public function setUp() + public function setUp() : void { parent::setUp(); Artisan::call('database:create', ['--reset' => true]); Artisan::call('migrate:refresh', ['--env' => 'unittest']); } + public function tearDown() : void + { + parent::tearDown(); + } + /** * Creates the application. Required to be implemented * diff --git a/tests/UserTest.php b/tests/UserTest.php index d3955bac..905d8d46 100644 --- a/tests/UserTest.php +++ b/tests/UserTest.php @@ -8,7 +8,7 @@ class UserTest extends TestCase protected $settingsRepo; protected $userSvc; - public function setUp() + public function setUp(): void { parent::setUp(); $this->userSvc = app(UserService::class); diff --git a/tests/UtilsTest.php b/tests/UtilsTest.php index 24145391..6c0f4003 100644 --- a/tests/UtilsTest.php +++ b/tests/UtilsTest.php @@ -4,10 +4,6 @@ use App\Facades\Utils; class UtilsTest extends TestCase { - public function setUp() - { - } - public function testDates() { $carbon = new \Carbon\Carbon('2018-04-28T12:55:40Z');