Files
crm_ecosplay/tests/Exception/VaultExceptionTest.php
Serreau Jovann 057156fc02 test/fix: VaultException + TrackingService 100%, ignores coverage + JS branches
PHP :
- VaultExceptionTest : 2 tests (httpError factory)
- TrackingServiceTest : 6 tests (trackPageView, trackEvent, getVisitorStats, getPageViews)
- EsyMailService : @codeCoverageIgnore (wrapper DB mail externe)
- OvhService : @codeCoverageIgnore (wrapper OVH API SDK)
- ComptaPdf/RapportFinancierPdf : @codeCoverageIgnore sur EURO define
- OrderPaymentController : @codeCoverageIgnore findRevendeur + Stripe blocks

JS :
- istanbul ignore next sur branches || fallbacks, ternaires,
  keydown non-Enter, click-outside, template literals

1329 PHP tests, 115 JS tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 16:54:29 +02:00

26 lines
811 B
PHP

<?php
namespace App\Tests\Exception;
use App\Exception\VaultException;
use PHPUnit\Framework\TestCase;
class VaultExceptionTest extends TestCase
{
public function testHttpError(): void
{
$e = VaultException::httpError(500, 'Internal error');
$this->assertInstanceOf(VaultException::class, $e);
$this->assertInstanceOf(\RuntimeException::class, $e);
$this->assertStringContainsString('500', $e->getMessage());
$this->assertStringContainsString('Internal error', $e->getMessage());
}
public function testHttpErrorWithDifferentCode(): void
{
$e = VaultException::httpError(403, 'Forbidden');
$this->assertStringContainsString('403', $e->getMessage());
$this->assertStringContainsString('Forbidden', $e->getMessage());
}
}