tetssssss

This commit is contained in:
lubiana 2025-06-10 19:05:55 +02:00
parent 6f07d70436
commit 8063e7bec9
Signed by: lubiana
SSH key fingerprint: SHA256:vW1EA0fRR3Fw+dD/sM0K+x3Il2gSry6YRYHqOeQwrfk
28 changed files with 771 additions and 273 deletions

View file

@ -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);
});