Skip to content

Commit

Permalink
Updating the delete product test to verify
Browse files Browse the repository at this point in the history
that the product is not in the database.
  • Loading branch information
cyrilverloop committed Nov 25, 2022
1 parent fd37973 commit 40b4f08
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/tests/Page/Product/ShowTest.php
Expand Up @@ -4,6 +4,7 @@

namespace App\Tests\Page\Product;

use App\Entity\Product;
use App\Tests\Page\Product\ProductFixture;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

Expand Down Expand Up @@ -155,5 +156,10 @@ public function testCanDeleteProduct(): void
$client->followRedirect();

$this->assertResponseIsSuccessful();

$entityManager = static::$kernel->getContainer()->get('doctrine')->getManager();
$deletedProduct = $entityManager->find(Product::class, 1);

self::assertNull($deletedProduct, 'The Product has not been deleted.');
}
}

0 comments on commit 40b4f08

Please sign in to comment.