-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract "testing" section from readme + Add section "development envi…
…ronment" (#61) * add info * fix
- Loading branch information
Showing
2 changed files
with
66 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Internals | ||
|
||
## Development environment | ||
|
||
For greater ease it is recommended to use docker containers. | ||
|
||
Run container with memcached directly via command: | ||
|
||
```shell | ||
docker run --rm --name yiisoft-cache-memcached-cache --detach --publish 11211:11211 memcached:1.6.23 | ||
``` | ||
|
||
Memcached must be accessible by address `127.0.0.1`. If you use PHP via docker container, run PHP container in network | ||
of memcached container. Use `docker run` command argument for it: | ||
|
||
``` | ||
--network container:yiisoft-cache-memcached-cache | ||
``` | ||
|
||
## Unit testing | ||
|
||
The package is tested with [PHPUnit](https://phpunit.de/). To run tests: | ||
|
||
```shell | ||
./vendor/bin/phpunit | ||
``` | ||
|
||
## Mutation testing | ||
|
||
The package tests are checked with [Infection](https://infection.github.io/) mutation framework with | ||
[Infection Static Analysis Plugin](https://github.com/Roave/infection-static-analysis-plugin). To run it: | ||
|
||
```shell | ||
./vendor/bin/roave-infection-static-analysis-plugin | ||
``` | ||
|
||
## Static analysis | ||
|
||
The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis: | ||
|
||
```shell | ||
./vendor/bin/psalm | ||
``` | ||
|
||
## Code style | ||
|
||
Use [Rector](https://github.com/rectorphp/rector) to make codebase follow some specific rules or | ||
use either newest or any specific version of PHP: | ||
|
||
```shell | ||
./vendor/bin/rector | ||
``` | ||
|
||
## Dependencies | ||
|
||
Use [ComposerRequireChecker](https://github.com/maglnet/ComposerRequireChecker) to detect transitive | ||
[Composer](https://getcomposer.org/) dependencies. |