Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saksmt/open-popo
Simple library for easy testing Plain Old PHP Objects (inspired by open-pojo)
https://github.com/saksmt/open-popo
Last synced: 9 days ago
JSON representation
Simple library for easy testing Plain Old PHP Objects (inspired by open-pojo)
- Host: GitHub
- URL: https://github.com/saksmt/open-popo
- Owner: saksmt
- License: mit
- Created: 2015-11-10T18:22:58.000Z (about 9 years ago)
- Default Branch: develop
- Last Pushed: 2015-11-13T05:09:50.000Z (about 9 years ago)
- Last Synced: 2024-11-15T22:45:11.985Z (about 1 month ago)
- Language: PHP
- Size: 0 Bytes
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
open-popo
=========Small library for quick testing your Plain Old PHP Objects.
*(inspired by open-pojo)*
Installation
============composer require smt/open-popo
Usage
=====Example
-------addRule(GetterMustExist::create())
->addRule(
SetterMustExist::create()
->skip('iWantThisPropertyToHaveNoSetter')
)->addTester(GetterTester::create())
->addTester(FluentSetterTester::create())->validate(PopoClass::fromClassName(Entity::class)
;
}
}Notes (need to rewrite into documentation)
------------------------------------------Available rules:
- `GetterMustExist`
- `SetterMustExist`Available testers:
- `GetSetTester` **deprecated**
- `FluentGetSetTester`**deprecated**
- `GetterTester`
- `SetterTester`
- `FluentSetterTester`Planned:
- Collection rules/testers (`add*`/`remove*`)
Every rule and tester:
- has `skip` method to specify properties to skip
- can be instantiated directly (via `new`) or via factory method (`::create()`)Validator can be instantiated directly (via `new`) or via factory method (`::create()`)
License
=======This package is licensed under [MIT license](https://github.com/saksmt/open-popo/blob/develop/LICENSE)