cyrill / sucre-assertion
1.1.0
2013-11-30 15:35 UTC
Requires
- php: >=5.4.0
Requires (Dev)
- mikey179/vfsstream: >=1.2.0
- mockery/mockery: dev-master@dev
- phpunit/phpunit: >=3.7.0
This package is not auto-updated.
Last update: 2025-01-13 15:55:45 UTC
README
Sucre/Assertion is simple loosely-coupled assertion PHP library.
Requirement
- PHP 5.4 or later
Installation
Download the composer.phar
.
$ curl -s http://getcomposer.org/installer | php
Run Composer: php composer.phar require "cyrill/sucre-assertion"
Usage
<?php reqire __DIR__.'/composer/autoload.php'; use Sucre\Assertion; // Assertion::disable(); // if you disable Sucre\Assertion (ie. production) try { Assertion::factory() ->mustString($string) ->mustNull(null) ->assert(); } catch (Exception $e) { // If passed values is not fulfilled. "assert" methods throw Sucre\Assertion\CompositeAssertionException // $e->getFirstException(); // $e->getLastException(); // $e->getExceptions(); echo $e; }
How to test?
Sucre\Assertion is tested by PHPUnit.
Run composer composer install --dev
.
All you have to do is to run phpunit
.
License
The MIT License