Skip to content

Commit 12da4f2

Browse files
committed
Remove PurgeDatabaseTrait usage
1 parent 12ff104 commit 12da4f2

File tree

8 files changed

+20
-52
lines changed

8 files changed

+20
-52
lines changed

tests/Application/src/Tests/Controller/BlogPostApiTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
use Sylius\Bundle\ResourceBundle\ResourceBundleInterface;
1919
use Symfony\Component\HttpFoundation\Response;
2020
use Tests\ApiTestCase;
21-
use Tests\PurgeDatabaseTrait;
2221
use Zenstruck\Foundry\Test\Factories;
22+
use Zenstruck\Foundry\Test\ResetDatabase;
2323

2424
final class BlogPostApiTest extends ApiTestCase
2525
{
2626
use Factories;
27-
use PurgeDatabaseTrait;
27+
use ResetDatabase;
2828

2929
#[Test]
3030
public function it_allows_creating_a_blog_post(): void

tests/Application/src/Tests/Controller/BookApiTest.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
use PHPUnit\Framework\Attributes\Test;
2222
use Symfony\Component\HttpFoundation\Response;
2323
use Tests\ApiTestCase;
24-
use Tests\PurgeDatabaseTrait;
2524
use Zenstruck\Foundry\Test\Factories;
25+
use Zenstruck\Foundry\Test\ResetDatabase;
2626

2727
class BookApiTest extends ApiTestCase
2828
{
2929
use Factories;
30-
use PurgeDatabaseTrait;
30+
use ResetDatabase;
3131

3232
#[Test]
3333
public function it_allows_creating_a_book(): void
@@ -132,8 +132,7 @@ public function it_allows_removing_a_book(): void
132132
$this->assertResponseIsSuccessful();
133133
$this->assertResponseStatusCodeSame(Response::HTTP_NO_CONTENT);
134134

135-
$deletedBook = $this->getContainer()->get('app.repository.book')->find($bookId);
136-
$this->assertNull($deletedBook);
135+
$this->assertEquals(0, $this->getContainer()->get('app.repository.book')->count());
137136
}
138137

139138
#[Test]
@@ -668,4 +667,9 @@ private function markAsSkippedIfNecessary(): void
668667
$this->markTestSkipped();
669668
}
670669
}
670+
671+
public function assert()
672+
{
673+
return $this->assertEquals();
674+
}
671675
}

tests/Application/src/Tests/Controller/ComicBookApiTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
use PHPUnit\Framework\Attributes\Test;
2020
use Symfony\Component\HttpFoundation\Response;
2121
use Tests\ApiTestCase;
22-
use Tests\PurgeDatabaseTrait;
2322
use Zenstruck\Foundry\Test\Factories;
23+
use Zenstruck\Foundry\Test\ResetDatabase;
2424

2525
final class ComicBookApiTest extends ApiTestCase
2626
{
2727
use Factories;
28-
use PurgeDatabaseTrait;
28+
use ResetDatabase;
2929

3030
#[Test]
3131
public function it_allows_creating_a_comic_book(): void

tests/Application/src/Tests/Controller/GedmoApiTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
use PHPUnit\Framework\Attributes\Test;
1717
use Symfony\Component\HttpFoundation\Response;
1818
use Tests\ApiTestCase;
19-
use Tests\PurgeDatabaseTrait;
19+
use Zenstruck\Foundry\Test\ResetDatabase;
2020

2121
final class GedmoApiTest extends ApiTestCase
2222
{
23-
use PurgeDatabaseTrait;
23+
use ResetDatabase;
2424

2525
#[Test]
2626
public function it_allows_creating_a_comic_book(): void

tests/Application/src/Tests/Controller/PullRequestApiTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
use PHPUnit\Framework\Attributes\Test;
1818
use Symfony\Component\HttpFoundation\Response;
1919
use Tests\ApiTestCase;
20-
use Tests\PurgeDatabaseTrait;
2120
use Zenstruck\Foundry\Test\Factories;
21+
use Zenstruck\Foundry\Test\ResetDatabase;
2222

2323
final class PullRequestApiTest extends ApiTestCase
2424
{
2525
use Factories;
26-
use PurgeDatabaseTrait;
26+
use ResetDatabase;
2727

2828
#[Test]
2929
public function it_allows_creating_a_pull_request(): void

tests/Application/src/Tests/Controller/SubscriptionJsonApiTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
use PHPUnit\Framework\Attributes\Test;
2020
use Symfony\Component\HttpFoundation\Response;
2121
use Tests\ApiTestCase;
22-
use Tests\PurgeDatabaseTrait;
2322
use Zenstruck\Foundry\Test\Factories;
23+
use Zenstruck\Foundry\Test\ResetDatabase;
2424

2525
final class SubscriptionJsonApiTest extends ApiTestCase
2626
{
2727
use Factories;
28-
use PurgeDatabaseTrait;
28+
use ResetDatabase;
2929

3030
#[Test]
3131
public function it_allows_showing_a_subscription(): void

tests/Application/src/Tests/Controller/SubscriptionXmlApiTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
use PHPUnit\Framework\Attributes\Test;
2020
use Symfony\Component\HttpFoundation\Response;
2121
use Tests\ApiTestCase;
22-
use Tests\PurgeDatabaseTrait;
2322
use Zenstruck\Foundry\Test\Factories;
23+
use Zenstruck\Foundry\Test\ResetDatabase;
2424

2525
final class SubscriptionXmlApiTest extends ApiTestCase
2626
{
2727
use Factories;
28-
use PurgeDatabaseTrait;
28+
use ResetDatabase;
2929

3030
private static array $headersWithContentType = [
3131
'CONTENT_TYPE' => 'application/xml',

tests/PurgeDatabaseTrait.php

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

0 commit comments

Comments
 (0)