Download the PHP package smt/open-popo without Composer
On this page you can find all versions of the php package smt/open-popo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download smt/open-popo
More information about smt/open-popo
Files in smt/open-popo
Download smt/open-popo
More information about smt/open-popo
Files in smt/open-popo
Vendor smt
Package open-popo
Short Description Simple library for easy testing Plain Old PHP Objects (inspired by open-pojo)
License MIT
Homepage https://github.com/saksmt/open-popo
Package open-popo
Short Description Simple library for easy testing Plain Old PHP Objects (inspired by open-pojo)
License MIT
Homepage https://github.com/saksmt/open-popo
Please rate this library. Is it a good library?
Informations about the package open-popo
open-popo
Small library for quick testing your Plain Old PHP Objects.
(inspired by open-pojo)
Installation
composer require smt/open-popo
Usage
Example
<?php
use Smt\OpenPopo\Reflection\PopoClass;
use Smt\OpenPopo\Validator\Validator;
use Smt\OpenPopo\Rule\Impl\GetterMustExist;
use Smt\OpenPopo\Rule\Impl\SetterMustExist;
use Smt\OpenPopo\Tester\Impl\GetterTester;
use Smt\OpenPopo\Tester\Impl\FluentSetterTester; // You can also remove "Fluent" prefix if you don't want to check
// this functional
class EntityTest extends PHPUnit_Framework_TestCase
{
public function testAll()
{
Validator::create()
->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
deprecatedFluentGetSetTester
deprecatedGetterTester
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
All versions of open-popo with dependencies
PHP Build Version
Package Version
Requires
phpunit/phpunit Version
~5
The package smt/open-popo contains the following files
Loading the files please wait ....