tetssssss
This commit is contained in:
parent
6f07d70436
commit
8063e7bec9
28 changed files with 771 additions and 273 deletions
|
@ -1,10 +1,12 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\Entity\DrinkType;
|
||||
use App\Entity\PropertyChangeLog;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
test('Update Listener', function () {
|
||||
test('Update Listener', function (): void {
|
||||
$drinkType = new DrinkType();
|
||||
$drinkType->setName('test');
|
||||
$drinkType->setWantedStock(10);
|
||||
|
@ -16,26 +18,34 @@ test('Update Listener', function () {
|
|||
$em->flush();
|
||||
|
||||
$propertyLogRepository = $em->getRepository(PropertyChangeLog::class);
|
||||
$logs = $propertyLogRepository->findBy(['entityClass' => DrinkType::class]);
|
||||
$logs = $propertyLogRepository->findBy([
|
||||
'entityClass' => DrinkType::class,
|
||||
]);
|
||||
expect($logs)->toHaveCount(2);
|
||||
|
||||
$drinkType->setWantedStock(15);
|
||||
$em->persist($drinkType);
|
||||
$em->flush();
|
||||
|
||||
$logs = $propertyLogRepository->findBy(['entityClass' => DrinkType::class]);
|
||||
$logs = $propertyLogRepository->findBy([
|
||||
'entityClass' => DrinkType::class,
|
||||
]);
|
||||
expect($logs)->toHaveCount(3);
|
||||
|
||||
$drinkType->setCurrentStock(15);
|
||||
$em->persist($drinkType);
|
||||
$em->flush();
|
||||
|
||||
$logs = $propertyLogRepository->findBy(['entityClass' => DrinkType::class]);
|
||||
$logs = $propertyLogRepository->findBy([
|
||||
'entityClass' => DrinkType::class,
|
||||
]);
|
||||
expect($logs)->toHaveCount(4);
|
||||
|
||||
$drinkType->setDescription('test');
|
||||
$em->persist($drinkType);
|
||||
$em->flush();
|
||||
$logs = $propertyLogRepository->findBy(['entityClass' => DrinkType::class]);
|
||||
$logs = $propertyLogRepository->findBy([
|
||||
'entityClass' => DrinkType::class,
|
||||
]);
|
||||
expect($logs)->toHaveCount(4);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue