codetetic / pest-plugin-symfony
Pest Symfony Plugin
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/codetetic/pest-plugin-symfony
Requires
- php: ^8.2
- pestphp/pest: 2.*
- symfony/browser-kit: 6.4.*
- symfony/dependency-injection: 6.4.*
- symfony/dom-crawler: 6.4.*
- symfony/framework-bundle: 6.4.*
- symfony/http-foundation: 6.4.*
- symfony/http-kernel: 6.4.*
- symfony/mailer: 6.4.*
- symfony/mime: 6.4.*
Requires (Dev)
- ext-ctype: *
- ext-iconv: *
- doctrine/dbal: ^3
- doctrine/doctrine-bundle: ^2.14
- doctrine/doctrine-migrations-bundle: ^3.4
- doctrine/orm: ^3.3
- laravel/pint: ^1.22
- phpdocumentor/reflection-docblock: ^5.6
- phpstan/phpdoc-parser: ^2.1
- rector/rector: ^2.0
- symfony/asset: 6.4.*
- symfony/asset-mapper: 6.4.*
- symfony/cache: 6.4.*
- symfony/clock: 6.4.*
- symfony/config: 6.4.*
- symfony/console: 6.4.*
- symfony/css-selector: 6.4.*
- symfony/debug-bundle: 6.4.*
- symfony/doctrine-messenger: 6.4.*
- symfony/dotenv: 6.4.*
- symfony/error-handler: 6.4.*
- symfony/event-dispatcher: 6.4.*
- symfony/expression-language: 6.4.*
- symfony/filesystem: 6.4.*
- symfony/finder: 6.4.*
- symfony/flex: ^2
- symfony/form: 6.4.*
- symfony/http-client: 6.4.*
- symfony/intl: 6.4.*
- symfony/maker-bundle: ^1.0
- symfony/monolog-bridge: 6.4.*
- symfony/monolog-bundle: ^3.0
- symfony/notifier: 6.4.*
- symfony/options-resolver: 6.4.*
- symfony/password-hasher: 6.4.*
- symfony/phpunit-bridge: 6.4.*
- symfony/process: 6.4.*
- symfony/property-access: 6.4.*
- symfony/property-info: 6.4.*
- symfony/routing: 6.4.*
- symfony/runtime: 6.4.*
- symfony/security-bundle: 6.4.*
- symfony/security-core: 6.4.*
- symfony/security-csrf: 6.4.*
- symfony/security-http: 6.4.*
- symfony/serializer: 6.4.*
- symfony/stimulus-bundle: ^2.25
- symfony/stopwatch: 6.4.*
- symfony/string: 6.4.*
- symfony/translation: 6.4.*
- symfony/twig-bundle: 6.4.*
- symfony/ux-turbo: ^2.25
- symfony/validator: 6.4.*
- symfony/var-dumper: 6.4.*
- symfony/var-exporter: 6.4.*
- symfony/web-link: 6.4.*
- symfony/web-profiler-bundle: 6.4.*
- symfony/yaml: 6.4.*
- twig/extra-bundle: ^2.12|^3.0
- twig/twig: ^2.12|^3.0
Conflicts
This package is auto-updated.
Last update: 2025-11-30 15:38:38 UTC
README
This project is a Pest Symfony Plugin that enhances testing capabilities for Symfony applications using Pest.
Prerequisites
- PHP 8.2 or higher
- PestPHP 2.36 or higher
- Symfony 6.4 or higher
- Composer
Installation
Install the package via Composer:
composer require --dev codetetic/pest-plugin-symfony
Usage
This plugin provides a set of functions to enhance the Pest testing framework for Symfony applications.
Setup
// Pest.php uses(Pest\Symfony\WebTestCase::class)->in('Application'); Pest\Symfony\Web\extend(expect()); uses(Pest\Symfony\KernelTestCase::class)->in('Integration'); Pest\Symfony\Kernel\extend(expect());
Example Tests
Below are some example tests that demonstrate the features of this plugin:
Basic Application Example
<?php use function Pest\Symfony\Web\createClient; use function Pest\Symfony\Web\getRequest; use function Pest\Symfony\Web\getResponse; it('can get a 200 response from /example', function (): void { createClient()->request('GET', '/example'); expect(getResponse())->toHaveIsSuccessful(); expect(getRequest()->getMethod())->toBe('GET'); expect(getResponse()->getContent())->toMatchSnapshot(); });
Basic Integration Example
<?php use function Pest\Symfony\Kernel\getContainer; it('can get and use service', function (): void { expect( getContainer() ->get(App\Service\ExampleService::class) ->string('string') )->toBe('string'); });
License
This project is licensed under the MIT License. See the LICENSE.md file for details.
Contributing
Contributions are welcome! Please submit a pull request or create an issue for any bugs or feature requests.
Contact
For any inquiries, please contact Peter Measham at github@codetetic.co.uk.