cyrill / sucre-assertion
Installs: 18
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/cyrill/sucre-assertion
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-10-06 19:49:24 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