Skip to content

Commit 2520af2

Browse files
committed
Merge branch 'develop'
2 parents 2183e9f + 2861b27 commit 2520af2

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99

1010
**FRT automatically executes the associated PHPUnit test for a changed source code file.**
1111

12-
It takes a different approach to [spatie/phpunit-watcher](https://packagist.org/packages/spatie/phpunit-watcher), a mature und well-developed testing tool. Its goal is to automatically re-execute the entire PHPUnit test suite when source code files are changed. The `phpunit-watcher watch` command starts an own watch process which executes the *full* test suite once a file has changed. However, the executed tests can, however, be restricted to *specific* tests using the `--filter` option. This means that regardless of which file is changed or saved, only the specified unit tests are executed.
12+
**Comparison with spatie/phpunit-watcher:** [spatie/phpunit-watcher](https://packagist.org/packages/spatie/phpunit-watcher) re-executes the *entire* PHPUnit test suite once a source code file has changed. The executed tests can be restricted to *specific* tests using the `--filter` option. This means that regardless of which file is changed or saved, only the specified unit tests are executed.
1313

1414
```bash
1515
$ vendor/bin/phpunit-watcher watch
1616
$ vendor/bin/phpunit-watcher watch --filter=certain_test
1717
```
1818

19-
Compared to this package, *tomkyle/find-run-test* takes a different approach: After saving a file, only the PHPUnit test associated with the modified file is executed.
19+
**tomkyle/find-run-test takes a different approach:** After saving a file, only the PHPUnit test associated with the modified file is executed.
2020

2121
| COMPARISON | tomkyle/frt | spatie/phpunit-watcher |
2222
| -------------------------------------- | ---------------------------------- | ------------------------------ |
@@ -32,7 +32,7 @@ Compared to this package, *tomkyle/find-run-test* takes a different approach: Af
3232
Install FRT with Composer:
3333

3434
```bash
35-
$ composer require tomkyle/find-run-test
35+
$ composer require --dev tomkyle/find-run-test
3636
```
3737

3838
## How it works
@@ -44,11 +44,14 @@ The `vendor/bin/frt` executable expects the PHP file of which the source code ha
4444
$ vendor/bin/frt src/MyClass.php
4545
```
4646

47-
2. FRT will look for any PHPUnit file inside the project’s `tests` directory.
47+
2. FRT will look for matching PHPUnit tests inside the project’s `tests` directory.
4848

49-
3. If there is a test file `MyClassTest.php`, FRT will execute it using PHPUnit’s `--filter` option.
49+
3. If there is a test file `MyClassTest.php`, FRT will hand it over to PHPUnit, like so:
50+
```bash
51+
$ vendor/bin/phpunit --filter=MyClassTest.php
52+
```
5053

51-
## Usage
54+
## Automation
5255

5356
Our goal is to automate testing as much as possible, and so do we with running unit tests. In the Node-based app developing world, [Chokidar](https://www.npmjs.com/package/chokidar) is one of the go-to file watching libraries, most often used for frontend building with *webpack, gulp, workbox,* and such. We will utilize it for FRT.
5457

@@ -168,7 +171,7 @@ Watching "src/**/*.php" ..
168171
```bash
169172
$ git clone git@github.com:tomkyle/frt.git
170173
$ composer install
171-
$ npm install
174+
$ pnpm install
172175
```
173176

174177
### Watch source and run various tests

0 commit comments

Comments
 (0)