Test types
End-to-End Tests
High-level user-flow tests that exercise the full application stack from the browser.
Integration Tests (Behat)
BDD-style tests written in Gherkin that simulate user interactions in a real browser.
Functional Tests (PHPUnit)
PHPUnit-based tests that verify the integration of services, repositories, controllers, and commands.
k6 Performance Tests
Load and performance tests written with k6 to identify bottlenecks under realistic traffic.
Debug Behat Tests
Techniques and tools for debugging failing Behat scenarios.
Functional tests (PHPUnit)
Functional tests check the integration of different application layers. Write them for:- Controllers — verify request/response cycles and form submissions
- Commands — verify console command output and side effects
- Repositories — verify database queries return expected results
- Services — verify business logic through real container services
Test environment setup
Install the application in test mode
Test environments do not support all install command options. Adjust
oro_test_framework.install_options in config/config.yml if needed.Writing a functional test
ExtendOro\Bundle\TestFrameworkBundle\Test\WebTestCase and initialize the client in setUp():
@dbIsolationPerTest annotation wraps each test method in a transaction that is rolled back on completion, keeping the database clean between tests.
Loading fixtures
- Implement
Doctrine\Common\DataFixtures\FixtureInterface, or - Be a path to a nelmio/alice YAML file.
Testing a controller
Testing a command
UserunCommand() to execute console commands and assert output: