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>
26 lines
811 B
PHP
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());
|
|
}
|
|
}
|