Skip to content

Commit 81a5cfe

Browse files
committed
Remove FakesData trait
1 parent ba236a3 commit 81a5cfe

File tree

4 files changed

+16
-32
lines changed

4 files changed

+16
-32
lines changed

tests/BrowserKitTestCase.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,26 @@
22

33
namespace Tests;
44

5+
use Illuminate\Foundation\Testing\WithFaker;
56
use Laravel\BrowserKitTesting\TestCase as BaseTestCase;
67

78
abstract class BrowserKitTestCase extends BaseTestCase
89
{
9-
use CreatesApplication, CreatesUsers, FakesData, HttpAssertions;
10+
use CreatesApplication, CreatesUsers, HttpAssertions;
1011

1112
public $baseUrl = 'http://localhost';
1213

14+
protected function setUpTraits()
15+
{
16+
$uses = parent::setUpTraits();
17+
18+
if (isset($uses[WithFaker::class])) {
19+
$this->setUpFaker();
20+
}
21+
22+
return $uses;
23+
}
24+
1325
protected function dispatch($job)
1426
{
1527
return $job->handle();

tests/FakesData.php

Lines changed: 0 additions & 29 deletions
This file was deleted.

tests/Feature/SubscriptionsTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
use App\Jobs\CreateReply;
88
use App\Jobs\CreateThread;
99
use App\Models\Subscription;
10+
use Illuminate\Foundation\Testing\WithFaker;
1011
use Tests\BrowserKitTestCase;
1112
use App\Notifications\NewReplyNotification;
1213
use Illuminate\Support\Facades\Notification;
1314
use Illuminate\Foundation\Testing\DatabaseMigrations;
1415

1516
class SubscriptionsTest extends BrowserKitTestCase
1617
{
17-
use DatabaseMigrations;
18+
use DatabaseMigrations, WithFaker;
1819

1920
/** @test */
2021
public function users_receive_notifications_for_new_replies_to_threads_where_they_are_subscribed_to()

tests/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
abstract class TestCase extends IlluminateTestCase
88
{
9-
use CreatesApplication, CreatesUsers, FakesData, HttpAssertions;
9+
use CreatesApplication, CreatesUsers, HttpAssertions;
1010

1111
protected function dispatch($job)
1212
{

0 commit comments

Comments
 (0)