Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wickedone/muppet
unit testing your setters, getters, adders, removers, issers and whatevers
https://github.com/wickedone/muppet
infection integration-testing mutation mutation-testing php phpunit tdd test testing testing-tools unit-test unit-testing
Last synced: about 1 month ago
JSON representation
unit testing your setters, getters, adders, removers, issers and whatevers
- Host: GitHub
- URL: https://github.com/wickedone/muppet
- Owner: wickedOne
- License: mit
- Archived: true
- Created: 2021-10-29T11:24:32.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-04-05T17:27:40.000Z (over 2 years ago)
- Last Synced: 2024-09-28T20:04:34.877Z (about 1 month ago)
- Topics: infection, integration-testing, mutation, mutation-testing, php, phpunit, tdd, test, testing, testing-tools, unit-test, unit-testing
- Language: PHP
- Homepage:
- Size: 137 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# muppet
unit testing your getters, setters, adders, removers, issers and whatevers.[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2FwickedOne%2Fmuppet%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/wickedOne/muppet/master)
[![Type Coverage](https://shepherd.dev/github/wickedOne/muppet/coverage.svg)](https://shepherd.dev/github/wickedOne/muppet)
[![codecov](https://codecov.io/gh/wickedOne/muppet/branch/master/graph/badge.svg)](https://codecov.io/gh/solrphp/solarium-bundle)
[![PHPStan static analysis](https://github.com/wickedOne/muppet/actions/workflows/phpstan.yml/badge.svg)](https://github.com/solrphp/solarium-bundle/actions/workflows/phpstan.yml)
[![coding standards](https://github.com/wickedOne/muppet/actions/workflows/coding-standards.yml/badge.svg)](https://github.com/solrphp/solarium-bundle/actions/workflows/coding-standards.yml)## installation
to add this library to your dev dependencies use
```bash
composer require --dev wickedone/muppet
```## but why?
a lot has been written about the necessity of testing your getters and setters or why it shouldn't been done.
from my personal perspective, testing getters and setters provide a stable level of coverage
and thus the ability to pin your ci to a minimum coverage value.## what it does
this library doesn't promise to generate perfect, non failing tests out of the box (though it tries).
it does however generate test classes which are easy to modify and, most importantly, are compatible with [infection](https://infection.github.io/guide/) (i.e. not too much black magic fuckery).## usage
```php
$config = new Config(
'~/Code/Project/src', // base dir
'~/Code/Project/tests/Unit', // tests dir
// namespace fragments
[
'Awesome',
'Namespace',
'Tests',
'Unit',
],
'foo ' // author (optional)
);(new Generator($config))
->generate('MyEntity')
;
```## assumptions
because we love those...- iterable properties use adders and removers rather than setters
- removers return booleans: true on removal, false otherwise
- ``Tests`` is part of the tests namespace## symfony integration
please see the [muppet-bundle](https://github.com/wickedOne/muppet-bundle)