Skip to content

Commit

Permalink
Extract "testing" section from readme + Add section "development envi…
Browse files Browse the repository at this point in the history
…ronment" (#61)

* add info

* fix
  • Loading branch information
vjik committed Feb 17, 2024
1 parent 415561e commit f980f12
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 31 deletions.
40 changes: 9 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ a distributed applications (e.g. with several servers, load balancers, etc.).
The package could be installed with composer:

```
composer require yiisoft/cache-memcached --prefer-dist
composer require yiisoft/cache-memcached
```

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

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

## Testing
## Documentation

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

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. To run it:

```shell
./vendor/bin/infection
```

### Static analysis
## License

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

```shell
./vendor/bin/psalm
```
Maintained by [Yii Software](https://www.yiiframework.com/).

### Support the project
## Support the project

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

### Follow updates
## Follow updates

[![Official website](https://img.shields.io/badge/Powered_by-Yii_Framework-green.svg?style=flat)](https://www.yiiframework.com/)
[![Twitter](https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555?style=flat)](https://twitter.com/yiiframework)
[![Telegram](https://img.shields.io/badge/telegram-join-1DA1F2?style=flat&logo=telegram)](https://t.me/yii3en)
[![Facebook](https://img.shields.io/badge/facebook-join-1DA1F2?style=flat&logo=facebook&logoColor=ffffff)](https://www.facebook.com/groups/yiitalk)
[![Slack](https://img.shields.io/badge/slack-join-1DA1F2?style=flat&logo=slack)](https://yiiframework.com/go/slack)

## License

The Yii Cache Library - Memcached Handler is free software. It is released under the terms of the BSD License.
Please see [`LICENSE`](./LICENSE.md) for more information.

Maintained by [Yii Software](https://www.yiiframework.com/).
57 changes: 57 additions & 0 deletions docs/internals.md
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.

0 comments on commit f980f12

Please sign in to comment.