You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#### Other notes about writing unit/integration tests
382
383
383
384
* When using data providers, define them immediately below the corresponding test method.
384
385
* When a test method has only one data provider, it is considered best practice to closely couple the test and data provider methods via their names. I.e. the data provider's name should match the test method name, replacing the "test" prefix with "data". For example, the data provider for a method named `testSomething()` should be `dataSomething()`.
@@ -396,6 +397,24 @@ To run the tests specific to the use of `PHP_CODESNIFFER_CBF === true`:
396
397
Generally speaking, it is a good idea to always add a call to `expectNoStdoutOutput()` in any test using the `assertStderrOutput*()` assertions to make sure there is no output leaking to `stdOut`.
397
398
398
399
400
+
401
+
### Writing End-to-End Tests
402
+
403
+
Bash-based end-to-end tests can be written using the [Bashunit](https://bashunit.typeddevs.com/) test tooling.
404
+
405
+
To install bashunit, follow the [installation guide](https://bashunit.typeddevs.com/installation).
406
+
407
+
You can then run the bashunit tests on Linux/Mac/WSL, like so:
408
+
```bash
409
+
./lib/bashunit -p tests/EndToEnd
410
+
```
411
+
412
+
> Note: these tests will not run in the Windows native CMD shell. When on Windows, either use WSL or use the "git bash" shell.
413
+
414
+
When writing end-to-end tests, please use fixtures for the "files under scan" to make the tests stable.
415
+
These fixtures can be placed in the `tests/EndToEnd/Fixtures` subdirectory.
416
+
417
+
399
418
### Submitting Your Pull Request
400
419
401
420
Some guidelines for submitting pull requests (PRs) and improving the chance that your PR will be merged:
0 commit comments