toBeTrue(); expect(class_exists(Symfony\Component\Security\Csrf\CsrfToken::class))->toBeTrue(); expect(class_exists(Symfony\Component\Security\Csrf\TokenStorage\NativeSessionTokenStorage::class))->toBeTrue(); expect(class_exists(Symfony\Component\Security\Csrf\TokenGenerator\UriSafeTokenGenerator::class))->toBeTrue(); }); test('the Symfony CSRF package is resolved by Composer, not committed', function () use ($root) { $disabled_functions = array_filter(array_map('trim', explode(',', (string) ini_get('disable_functions')))); if (!function_exists('exec') || in_array('exec', $disabled_functions, true)) { test()->markTestSkipped('exec is disabled, so Composer package tracking cannot be inspected'); } if (!file_exists($root . '/.git')) { test()->markTestSkipped('not a git checkout, so Composer package tracking cannot be inspected'); } $tracked = []; $status = 0; exec('git -C ' . escapeshellarg($root) . ' ls-files include/vendor/symfony/security-csrf/', $tracked, $status); if ($status !== 0) { test()->markTestSkipped('git could not inspect Composer package tracking'); } expect($tracked)->toBe([]); }); test('composer.json declares the dependency', function () use ($root) { $composer = json_decode(file_get_contents($root . '/composer.json'), true); expect($composer['require'])->toHaveKey('symfony/security-csrf'); });