From 7656e00c4015ab655b10eea46b467154cd34cc43 Mon Sep 17 00:00:00 2001 From: Mike Bronner Date: Tue, 9 Jan 2018 18:50:41 -0800 Subject: [PATCH] Transition to Orchestral Testbench --- composer.json | 9 +++++--- phpunit.xml | 8 +++++-- tests/BrowserTestCase.php | 18 +++++++++++++++ tests/CreatesApplication.php | 27 ++++++++++++++--------- tests/FeatureTestCase.php | 8 +++++++ tests/TestCase.php | 8 ------- tests/Unit/CachedBuilderTest.php | 4 ++-- tests/Unit/CachedModelTest.php | 4 ++-- tests/Unit/Console/Commands/FlushTest.php | 4 ++-- tests/Unit/DisabledCachedBuilderTest.php | 4 ++-- tests/Unit/DisabledCachedModelTest.php | 4 ++-- tests/Unit/Traits/CachableTest.php | 4 ++-- tests/UnitTestCase.php | 8 +++++++ 13 files changed, 74 insertions(+), 36 deletions(-) create mode 100644 tests/BrowserTestCase.php create mode 100644 tests/FeatureTestCase.php delete mode 100644 tests/TestCase.php create mode 100644 tests/UnitTestCase.php diff --git a/composer.json b/composer.json index d8b31e1..b724a9d 100644 --- a/composer.json +++ b/composer.json @@ -16,11 +16,14 @@ "require-dev": { "codedungeon/phpunit-result-printer": "^0.4.4", "fzaninotto/faker": "~1.4", - "laravel/laravel": "5.5.*", "mockery/mockery": "0.9.*", - "phpmd/phpmd": "^2.6", - "phpunit/phpunit": "5.7.*", + "orchestra/database": "^3.5", + "orchestra/testbench-browser-kit": "^3.5", + "orchestra/testbench-dusk": "3.5.x-dev@dev", + "orchestra/testbench": "^3.5", "php-coveralls/php-coveralls" : "*", + "phpmd/phpmd": "*", + "phpunit/phpunit": "*", "sebastian/phpcpd": "*", "symfony/thanks": "^1.0" }, diff --git a/phpunit.xml b/phpunit.xml index 2be4735..ebd5c58 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -13,6 +13,10 @@ syntaxCheck="false" > + + ./tests/Browser + + ./tests/Feature @@ -29,10 +33,10 @@ + - - + diff --git a/tests/BrowserTestCase.php b/tests/BrowserTestCase.php new file mode 100644 index 0000000..4e665e3 --- /dev/null +++ b/tests/BrowserTestCase.php @@ -0,0 +1,18 @@ +make(Kernel::class)->bootstrap(); - $app->make(Factory::class)->load(__DIR__ . '/database/factories'); - $app->afterResolving('migrator', function ($migrator) { - $migrator->path(__DIR__ . '/database/migrations'); - }); - $app->register(LaravelModelCachingService::class); + parent::setUp(); - return $app; + $this->withFactories(__DIR__ . '/database/factories'); + $this->loadMigrationsFrom(realpath(__DIR__ . '/database/migrations')); + } + + /** + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + protected function getPackageProviders($app) + { + return [ + LaravelModelCachingService::class, + ConsoleServiceProvider::class, + ]; } } diff --git a/tests/FeatureTestCase.php b/tests/FeatureTestCase.php new file mode 100644 index 0000000..c68771a --- /dev/null +++ b/tests/FeatureTestCase.php @@ -0,0 +1,8 @@ +