diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 6606896..5dfd1c4 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -56,5 +56,9 @@ jobs: composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:>=2.62.1" --no-interaction --no-update composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-progress + - name: Publish migrations + run: | + php artisan vendor:publish --provider="Mchev\Banhammer\BanhammerServiceProvider" --tag="banhammer-migrations" --force + - name: Execute tests run: vendor/bin/phpunit diff --git a/.gitignore b/.gitignore index 83c9b9f..8054c8d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .idea .phpunit.result.cache +.phpunit.cache build composer.lock coverage diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results deleted file mode 100644 index f83af4e..0000000 --- a/.phpunit.cache/test-results +++ /dev/null @@ -1 +0,0 @@ -{"version":1,"defects":{"Mchev\\Banhammer\\Tests\\Unit\\IPBannedMiddlewareTest::it_blocks_the_banned_ip":8,"Mchev\\Banhammer\\Tests\\Unit\\IPBanTest::test_ip_is_banned":8,"Mchev\\Banhammer\\Tests\\Unit\\IPBanTest::test_ip_ban_with_metas":8,"Mchev\\Banhammer\\Tests\\Unit\\IPBanTest::test_multiple_ip_are_banned":8,"Mchev\\Banhammer\\Tests\\Unit\\IPBanTest::test_ip_ban_can_be_created":8,"Mchev\\Banhammer\\Tests\\Unit\\IPBanTest::test_ip_is_unbanned":8},"times":{"Mchev\\Banhammer\\Tests\\Unit\\IPBannedMiddlewareTest::it_blocks_the_banned_ip":0.002,"Mchev\\Banhammer\\Tests\\Unit\\IPBanTest::test_ip_ban_with_metas":0.003,"Mchev\\Banhammer\\Tests\\Unit\\IPBanTest::test_ip_is_unbanned":0.002,"Mchev\\Banhammer\\Tests\\Unit\\IPBanTest::test_ip_is_banned":0.002,"Mchev\\Banhammer\\Tests\\Unit\\IPBanTest::test_multiple_ip_are_banned":0.013,"Mchev\\Banhammer\\Tests\\Unit\\IPBanTest::test_ip_ban_can_be_created":0.001,"Mchev\\Banhammer\\Tests\\Unit\\BlockByCountryMiddlewareTest::it_allows_request_from_non_blocked_country":0.008,"Mchev\\Banhammer\\Tests\\Unit\\BlockByCountryMiddlewareTest::it_blocks_request_from_blocked_country":0.021,"Mchev\\Banhammer\\Tests\\Unit\\BlockByCountryMiddlewareTest::it_allows_request_when_cache_is_present":0.001,"Mchev\\Banhammer\\Tests\\Unit\\BlockByCountryMiddlewareTest::it_allows_request_when_country_check_fails":0.001}} \ No newline at end of file diff --git a/tests/TestCase.php b/tests/TestCase.php index 744d4df..bb83b22 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -7,13 +7,6 @@ abstract class TestCase extends Orchestra { - - protected function setUp(): void - { - parent::setUp(); - $this->publishAndRunMigrations(); - } - protected function getEnvironmentSetUp($app): void { // Load the .env file @@ -28,18 +21,4 @@ protected function getPackageProviders($app): array 'Mchev\Banhammer\BanhammerServiceProvider', ]; } - - protected function publishAndRunMigrations(): void - { - // Publish the package migrations - $this->artisan('vendor:publish', [ - '--provider' => 'Mchev\Banhammer\BanhammerServiceProvider', - '--tag' => 'banhammer-migrations', - '--force' => true, - ])->run(); - - // Run the migrations - $this->artisan('migrate', ['--database' => 'testing'])->run(); - } - -} +} \ No newline at end of file