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