diff --git a/tests/Feature/ActivityStreamTest.php b/tests/Feature/ActivityStreamTest.php index d6a8eec8..3453f220 100644 --- a/tests/Feature/ActivityStreamTest.php +++ b/tests/Feature/ActivityStreamTest.php @@ -5,10 +5,13 @@ declare(strict_types=1); namespace Tests\Feature; use App\Models\Note; +use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class ActivityStreamTest extends TestCase { + use RefreshDatabase; + /** @test */ public function homepageRequestReturnsDataForSiteOwner(): void { diff --git a/tests/Feature/Admin/AdminHomeControllerTest.php b/tests/Feature/Admin/AdminHomeControllerTest.php index af7f0e24..6658710d 100644 --- a/tests/Feature/Admin/AdminHomeControllerTest.php +++ b/tests/Feature/Admin/AdminHomeControllerTest.php @@ -5,12 +5,12 @@ declare(strict_types=1); namespace Tests\Feature\Admin; use App\Models\User; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class AdminHomeControllerTest extends TestCase { - use DatabaseTransactions; + use RefreshDatabase; /** @test */ public function adminHomepageLoads(): void diff --git a/tests/Feature/ArticlesTest.php b/tests/Feature/ArticlesTest.php index 8586d7ff..6f1fa474 100644 --- a/tests/Feature/ArticlesTest.php +++ b/tests/Feature/ArticlesTest.php @@ -5,11 +5,14 @@ declare(strict_types=1); namespace Tests\Feature; use App\Models\Article; +use Illuminate\Foundation\Testing\RefreshDatabase; use Jonnybarnes\IndieWeb\Numbers; use Tests\TestCase; class ArticlesTest extends TestCase { + use RefreshDatabase; + /** @test */ public function articlesPageLoads(): void { diff --git a/tests/Feature/BridgyPosseTest.php b/tests/Feature/BridgyPosseTest.php index 08c35d5b..3cb891a1 100644 --- a/tests/Feature/BridgyPosseTest.php +++ b/tests/Feature/BridgyPosseTest.php @@ -6,10 +6,13 @@ namespace Tests\Feature; use App\Models\Contact; use App\Models\Note; +use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class BridgyPosseTest extends TestCase { + use RefreshDatabase; + /** @test */ public function notesWeWantCopiedToTwitterShouldHaveNecessaryMarkup(): void { diff --git a/tests/Feature/ContactsTest.php b/tests/Feature/ContactsTest.php index c06dddc1..211af20b 100644 --- a/tests/Feature/ContactsTest.php +++ b/tests/Feature/ContactsTest.php @@ -5,10 +5,13 @@ declare(strict_types=1); namespace Tests\Feature; use App\Models\Contact; +use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class ContactsTest extends TestCase { + use RefreshDatabase; + /** * Check the `/contacts` page gives a good response. * diff --git a/tests/Feature/FeedsTest.php b/tests/Feature/FeedsTest.php index b74952bd..6d5f46a7 100644 --- a/tests/Feature/FeedsTest.php +++ b/tests/Feature/FeedsTest.php @@ -4,10 +4,15 @@ declare(strict_types=1); namespace Tests\Feature; +use App\Models\Article; +use App\Models\Note; +use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class FeedsTest extends TestCase { + use RefreshDatabase; + /** * Test the blog RSS feed. * @@ -15,6 +20,7 @@ class FeedsTest extends TestCase */ public function blogRssFeedIsPresent(): void { + Article::factory()->count(3)->create(); $response = $this->get('/blog/feed.rss'); $response->assertHeader('Content-Type', 'application/rss+xml; charset=utf-8'); $response->assertOk(); @@ -27,6 +33,7 @@ class FeedsTest extends TestCase */ public function notesRssFeedIsPresent(): void { + Note::factory()->count(3)->create(); $response = $this->get('/notes/feed.rss'); $response->assertHeader('Content-Type', 'application/rss+xml; charset=utf-8'); $response->assertOk(); @@ -39,6 +46,7 @@ class FeedsTest extends TestCase */ public function blogAtomFeedIsPresent(): void { + Article::factory()->count(3)->create(); $response = $this->get('/blog/feed.atom'); $response->assertHeader('Content-Type', 'application/atom+xml; charset=utf-8'); $response->assertOk(); @@ -47,6 +55,7 @@ class FeedsTest extends TestCase /** @test */ public function blogJf2FeedIsPresent(): void { + Article::factory()->count(3)->create(); $response = $this->get('/blog/feed.jf2'); $response->assertHeader('Content-Type', 'application/jf2feed+json'); $response->assertJson([ @@ -72,6 +81,7 @@ class FeedsTest extends TestCase */ public function notesAtomFeedIsPresent(): void { + Note::factory()->count(3)->create(); $response = $this->get('/notes/feed.atom'); $response->assertHeader('Content-Type', 'application/atom+xml; charset=utf-8'); $response->assertOk(); @@ -84,6 +94,7 @@ class FeedsTest extends TestCase */ public function blogJsonFeedIsPresent(): void { + Article::factory()->count(3)->create(); $response = $this->get('/blog/feed.json'); $response->assertHeader('Content-Type', 'application/json'); $response->assertOk(); @@ -96,6 +107,7 @@ class FeedsTest extends TestCase */ public function notesJsonFeedIsPresent(): void { + Note::factory()->count(3)->create(); $response = $this->get('/notes/feed.json'); $response->assertHeader('Content-Type', 'application/json'); $response->assertOk(); @@ -104,6 +116,7 @@ class FeedsTest extends TestCase /** @test */ public function notesJf2FeedIsPresent(): void { + Note::factory()->count(3)->create(); $response = $this->get('/notes/feed.jf2'); $response->assertHeader('Content-Type', 'application/jf2feed+json'); $response->assertJson([ @@ -130,6 +143,7 @@ class FeedsTest extends TestCase */ public function jsonFeedsHaveRequiredAttributes(): void { + Note::factory()->count(3)->create(); $response = $this->get('/notes/feed.json'); $data = json_decode($response->content()); foreach ($data->items as $item) { diff --git a/tests/Feature/MicropubMediaTest.php b/tests/Feature/MicropubMediaTest.php index 50be6114..6ae6972e 100644 --- a/tests/Feature/MicropubMediaTest.php +++ b/tests/Feature/MicropubMediaTest.php @@ -6,7 +6,7 @@ namespace Tests\Feature; use App\Jobs\ProcessMedia; use App\Models\Media; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Http\UploadedFile; use Illuminate\Support\Facades\Queue; use Illuminate\Support\Facades\Storage; @@ -15,7 +15,7 @@ use Tests\TestToken; class MicropubMediaTest extends TestCase { - use DatabaseTransactions; + use RefreshDatabase; use TestToken; /** @test */ diff --git a/tests/Feature/NotesControllerTest.php b/tests/Feature/NotesControllerTest.php index d44c3492..19db5216 100644 --- a/tests/Feature/NotesControllerTest.php +++ b/tests/Feature/NotesControllerTest.php @@ -5,10 +5,13 @@ declare(strict_types=1); namespace Tests\Feature; use App\Models\Note; +use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class NotesControllerTest extends TestCase { + use RefreshDatabase; + /** * Test the `/notes` page returns 200, this should * mean the database is being hit. diff --git a/tests/Feature/OwnYourGramTest.php b/tests/Feature/OwnYourGramTest.php index bbed744f..29a61ce8 100644 --- a/tests/Feature/OwnYourGramTest.php +++ b/tests/Feature/OwnYourGramTest.php @@ -4,14 +4,14 @@ declare(strict_types=1); namespace Tests\Feature; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Support\Carbon; use Tests\TestCase; use Tests\TestToken; class OwnYourGramTest extends TestCase { - use DatabaseTransactions; + use RefreshDatabase; use TestToken; /** @test */ diff --git a/tests/Feature/PlacesTest.php b/tests/Feature/PlacesTest.php index e6247ff5..ba7c69d8 100644 --- a/tests/Feature/PlacesTest.php +++ b/tests/Feature/PlacesTest.php @@ -5,10 +5,13 @@ declare(strict_types=1); namespace Tests\Feature; use App\Models\Place; +use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class PlacesTest extends TestCase { + use RefreshDatabase; + /** * Test the `/places` page for OK response. * diff --git a/tests/Feature/ReDownloadWebMentionsTest.php b/tests/Feature/ReDownloadWebMentionsTest.php index 94199cb2..6d46548f 100644 --- a/tests/Feature/ReDownloadWebMentionsTest.php +++ b/tests/Feature/ReDownloadWebMentionsTest.php @@ -6,12 +6,15 @@ namespace Tests\Feature; use App\Jobs\DownloadWebMention; use App\Models\WebMention; +use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\Queue; use Tests\TestCase; class ReDownloadWebMentionsTest extends TestCase { + use RefreshDatabase; + /** @test */ public function downloadJobGetsQueued(): void { diff --git a/tests/Feature/SearchControllerTest.php b/tests/Feature/SearchControllerTest.php index d4ef1436..2eefef99 100644 --- a/tests/Feature/SearchControllerTest.php +++ b/tests/Feature/SearchControllerTest.php @@ -5,10 +5,13 @@ declare(strict_types=1); namespace Tests\Feature; use App\Models\Note; +use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class SearchControllerTest extends TestCase { + use RefreshDatabase; + /** @test */ public function searchPageReturnsResult(): void { diff --git a/tests/Feature/SwarmTest.php b/tests/Feature/SwarmTest.php index aaec89d8..599cadb7 100644 --- a/tests/Feature/SwarmTest.php +++ b/tests/Feature/SwarmTest.php @@ -5,7 +5,7 @@ declare(strict_types=1); namespace Tests\Feature; use App\Jobs\SendWebMentions; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Queue; use Tests\TestCase; @@ -13,7 +13,7 @@ use Tests\TestToken; class SwarmTest extends TestCase { - use DatabaseTransactions; + use RefreshDatabase; use TestToken; /** diff --git a/tests/Feature/WebMentionsControllerTest.php b/tests/Feature/WebMentionsControllerTest.php index 258f6c77..870aa282 100644 --- a/tests/Feature/WebMentionsControllerTest.php +++ b/tests/Feature/WebMentionsControllerTest.php @@ -6,11 +6,14 @@ namespace Tests\Feature; use App\Jobs\ProcessWebMention; use App\Models\Note; +use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Support\Facades\Queue; use Tests\TestCase; class WebMentionsControllerTest extends TestCase { + use RefreshDatabase; + /** @test */ public function webmentionEndpointCanServeBrowserRequest(): void { diff --git a/tests/Unit/Jobs/AddClientToDatabaseJobTest.php b/tests/Unit/Jobs/AddClientToDatabaseJobTest.php index d2f12d87..fb8cd504 100644 --- a/tests/Unit/Jobs/AddClientToDatabaseJobTest.php +++ b/tests/Unit/Jobs/AddClientToDatabaseJobTest.php @@ -5,12 +5,12 @@ declare(strict_types=1); namespace Tests\Unit\Jobs; use App\Jobs\AddClientToDatabase; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class AddClientToDatabaseJobTest extends TestCase { - use DatabaseTransactions; + use RefreshDatabase; /** @test */ public function clientIsAddedToDatabaseByJob(): void diff --git a/tests/Unit/Jobs/ProcessBookmarkJobTest.php b/tests/Unit/Jobs/ProcessBookmarkJobTest.php index ba1b4e6f..fb7c62db 100644 --- a/tests/Unit/Jobs/ProcessBookmarkJobTest.php +++ b/tests/Unit/Jobs/ProcessBookmarkJobTest.php @@ -8,13 +8,13 @@ use App\Exceptions\InternetArchiveException; use App\Jobs\ProcessBookmark; use App\Models\Bookmark; use App\Services\BookmarkService; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; use Ramsey\Uuid\Uuid; use Tests\TestCase; class ProcessBookmarkJobTest extends TestCase { - use DatabaseTransactions; + use RefreshDatabase; /** @test */ public function screenshotAndArchiveLinkAreSavedByJob(): void diff --git a/tests/Unit/Jobs/ProcessWebMentionJobTest.php b/tests/Unit/Jobs/ProcessWebMentionJobTest.php index f49615b1..b753fb40 100644 --- a/tests/Unit/Jobs/ProcessWebMentionJobTest.php +++ b/tests/Unit/Jobs/ProcessWebMentionJobTest.php @@ -14,14 +14,14 @@ use GuzzleHttp\Handler\MockHandler; use GuzzleHttp\HandlerStack; use GuzzleHttp\Psr7\Response; use Illuminate\FileSystem\FileSystem; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Support\Facades\Queue; use Jonnybarnes\WebmentionsParser\Parser; use Tests\TestCase; class ProcessWebMentionJobTest extends TestCase { - use DatabaseTransactions; + use RefreshDatabase; protected function tearDown(): void { diff --git a/tests/Unit/LikesTest.php b/tests/Unit/LikesTest.php index 6e11661f..32687829 100644 --- a/tests/Unit/LikesTest.php +++ b/tests/Unit/LikesTest.php @@ -5,12 +5,12 @@ declare(strict_types=1); namespace Tests\Unit; use App\Models\Like; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class LikesTest extends TestCase { - use DatabaseTransactions; + use RefreshDatabase; /** @test */ public function weCanSetTheAuthorUrl(): void