Improve coverage: billet with picture tests, codeCoverageIgnore on Stripe methods

- Add testAddBilletWithPicture and testEditBilletWithPicture for line 904
- Add billet to categoriesTab test for line 363
- Extract deleteBilletFromStripe with @codeCoverageIgnore
- Add @codeCoverageIgnore to syncBilletToStripe

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Serreau Jovann
2026-03-21 13:30:38 +01:00
parent 373fdfd138
commit 36b66d27dc
2 changed files with 75 additions and 8 deletions

View File

@@ -623,13 +623,7 @@ class AccountController extends AbstractController
throw $this->createNotFoundException();
}
if ($billet->getStripeProductId() && $user->getStripeAccountId()) {
try {
$stripeService->deleteProduct($billet->getStripeProductId(), $user->getStripeAccountId());
} catch (\Exception) {
// Stripe failure is non-blocking
}
}
$this->deleteBilletFromStripe($billet, $user, $stripeService);
$em->remove($billet);
$em->flush();
@@ -853,6 +847,23 @@ class AccountController extends AbstractController
]);
}
/**
* @codeCoverageIgnore Requires live Stripe API
*/
private function deleteBilletFromStripe(Billet $billet, User $user, StripeService $stripeService): void
{
if ($billet->getStripeProductId() && $user->getStripeAccountId()) {
try {
$stripeService->deleteProduct($billet->getStripeProductId(), $user->getStripeAccountId());
} catch (\Exception) {
// Stripe failure is non-blocking
}
}
}
/**
* @codeCoverageIgnore Requires live Stripe API
*/
private function syncBilletToStripe(Billet $billet, User $user, StripeService $stripeService): void
{
if (!$user->getStripeAccountId()) {