Skip to content

Commit f980f12

Browse files
authored
Extract "testing" section from readme + Add section "development environment" (#61)
* add info * fix
1 parent 415561e commit f980f12

File tree

2 files changed

+66
-31
lines changed

2 files changed

+66
-31
lines changed

README.md

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ a distributed applications (e.g. with several servers, load balancers, etc.).
3131
The package could be installed with composer:
3232

3333
```
34-
composer require yiisoft/cache-memcached --prefer-dist
34+
composer require yiisoft/cache-memcached
3535
```
3636

3737
## Configuration
@@ -124,47 +124,25 @@ To work with values in a more efficient manner, batch operations should be used:
124124

125125
This package can be used as a cache handler for the [Yii Caching Library](https://github.com/yiisoft/cache).
126126

127-
## Testing
127+
## Documentation
128128

129-
### Unit testing
129+
- [Internals](docs/internals.md)
130130

131-
The package is tested with [PHPUnit](https://phpunit.de/). To run tests:
132-
133-
```shell
134-
./vendor/bin/phpunit
135-
```
136-
137-
### Mutation testing
138-
139-
The package tests are checked with [Infection](https://infection.github.io/) mutation framework. To run it:
140-
141-
```shell
142-
./vendor/bin/infection
143-
```
144-
145-
### Static analysis
131+
## License
146132

147-
The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis:
133+
The Yii Cache Library - Memcached Handler is free software. It is released under the terms of the BSD License.
134+
Please see [`LICENSE`](./LICENSE.md) for more information.
148135

149-
```shell
150-
./vendor/bin/psalm
151-
```
136+
Maintained by [Yii Software](https://www.yiiframework.com/).
152137

153-
### Support the project
138+
## Support the project
154139

155140
[![Open Collective](https://img.shields.io/badge/Open%20Collective-sponsor-7eadf1?logo=open%20collective&logoColor=7eadf1&labelColor=555555)](https://opencollective.com/yiisoft)
156141

157-
### Follow updates
142+
## Follow updates
158143

159144
[![Official website](https://img.shields.io/badge/Powered_by-Yii_Framework-green.svg?style=flat)](https://www.yiiframework.com/)
160145
[![Twitter](https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555?style=flat)](https://twitter.com/yiiframework)
161146
[![Telegram](https://img.shields.io/badge/telegram-join-1DA1F2?style=flat&logo=telegram)](https://t.me/yii3en)
162147
[![Facebook](https://img.shields.io/badge/facebook-join-1DA1F2?style=flat&logo=facebook&logoColor=ffffff)](https://www.facebook.com/groups/yiitalk)
163148
[![Slack](https://img.shields.io/badge/slack-join-1DA1F2?style=flat&logo=slack)](https://yiiframework.com/go/slack)
164-
165-
## License
166-
167-
The Yii Cache Library - Memcached Handler is free software. It is released under the terms of the BSD License.
168-
Please see [`LICENSE`](./LICENSE.md) for more information.
169-
170-
Maintained by [Yii Software](https://www.yiiframework.com/).

docs/internals.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Internals
2+
3+
## Development environment
4+
5+
For greater ease it is recommended to use docker containers.
6+
7+
Run container with memcached directly via command:
8+
9+
```shell
10+
docker run --rm --name yiisoft-cache-memcached-cache --detach --publish 11211:11211 memcached:1.6.23
11+
```
12+
13+
Memcached must be accessible by address `127.0.0.1`. If you use PHP via docker container, run PHP container in network
14+
of memcached container. Use `docker run` command argument for it:
15+
16+
```
17+
--network container:yiisoft-cache-memcached-cache
18+
```
19+
20+
## Unit testing
21+
22+
The package is tested with [PHPUnit](https://phpunit.de/). To run tests:
23+
24+
```shell
25+
./vendor/bin/phpunit
26+
```
27+
28+
## Mutation testing
29+
30+
The package tests are checked with [Infection](https://infection.github.io/) mutation framework with
31+
[Infection Static Analysis Plugin](https://github.com/Roave/infection-static-analysis-plugin). To run it:
32+
33+
```shell
34+
./vendor/bin/roave-infection-static-analysis-plugin
35+
```
36+
37+
## Static analysis
38+
39+
The code is statically analyzed with [Psalm](https://psalm.dev/). To run static analysis:
40+
41+
```shell
42+
./vendor/bin/psalm
43+
```
44+
45+
## Code style
46+
47+
Use [Rector](https://github.com/rectorphp/rector) to make codebase follow some specific rules or
48+
use either newest or any specific version of PHP:
49+
50+
```shell
51+
./vendor/bin/rector
52+
```
53+
54+
## Dependencies
55+
56+
Use [ComposerRequireChecker](https://github.com/maglnet/ComposerRequireChecker) to detect transitive
57+
[Composer](https://getcomposer.org/) dependencies.

0 commit comments

Comments
 (0)