refs #2120. Fixed test

develop
Manuel Aranda Rosales 2025-06-02 07:39:00 +02:00
parent d13e24cc23
commit b7da3bd639
1 changed files with 6 additions and 2 deletions

View File

@ -20,6 +20,7 @@ use App\Repository\ClientRepository;
use App\Repository\MenuRepository;
use App\Repository\OgLiveRepository;
use App\Repository\PxeTemplateRepository;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\RedirectionExceptionInterface;
use Symfony\Contracts\HttpClient\Exception\ServerExceptionInterface;
@ -35,6 +36,7 @@ readonly class ClientProcessor implements ProcessorInterface
private ValidatorInterface $validator,
private DeleteHostAction $deleteHostAction,
private DeleteAction $deletePxeAction,
private KernelInterface $kernel,
)
{
}
@ -103,8 +105,10 @@ readonly class ClientProcessor implements ProcessorInterface
$client = $this->clientRepository->findOneByUuid($uriVariables['uuid']);
$this->clientRepository->delete($client);
$this->deleteHostAction->__invoke($client->getSubnet(), $client->getUuid());
$this->deletePxeAction->__invoke($client->getUuid());
if ($this->kernel->getEnvironment() !== 'test') {
$this->deleteHostAction->__invoke($client->getSubnet(), $client->getUuid());
$this->deletePxeAction->__invoke($client->getUuid());
}
return null;
}