2017 © Pedro PelĂĄez
 

library leo

Next level assertion and matcher library for PHP

image

peridot-php/leo

Next level assertion and matcher library for PHP

  • Wednesday, August 16, 2017
  • by brianium
  • Repository
  • 4 Watchers
  • 36 Stars
  • 86,825 Installations
  • PHP
  • 71 Dependents
  • 0 Suggesters
  • 5 Forks
  • 6 Open issues
  • 15 Versions
  • 7 % Grown

The README.md

Leo logo, (*1)

Leo

Next level assertion library for PHP, (*2)

Current version image Current build status image [![Current Scrutinizer code quality image][scrutinizer-image]][current scrutinizer code quality] ![Current coverage status image][coverage-image], (*3)

Visit the main site and documentation at peridot-php.github.io/leo/., (*4)

Expect Interface

Leo supports a chainable interface for writing assertions via the expect function:, (*5)

expect($obj)->to->have->property('name');
expect($value)->to->be->ok
expect($fn)->to->throw('InvalidArgumentException', 'Expected message');
expect($array)->to->be->an('array');
expect($result)->to->not->be->empty;

Assert Interface

Leo supports a more object oriented, non-chainable interface via Assert:, (*6)

use Peridot\Leo\Interfaces\Assert;

$assert = new Assert();
$assert->ok(true);
$assert->doesNotThrow($fn, 'Exception');
$assert->isResource(tmpfile());
$assert->notEqual($actual, $expected);

Detailed error messages

Leo matchers generate detailed error messages for failed assertions:, (*7)

Leo messages, (*8)

Plugins

Leo can be easily customized. For an example see LeoHttpFoundation. Read more on the plugin guide., (*9)

Running Tests

make test

Generating Docs

Documentation is generated via ApiGen. Simply run:, (*10)

make docs

Thanks

Leo was inspired by several great projects:, (*11)

And of course our work on Peridot gave incentive to make a useful complement., (*12)

The Versions

16/08 2017

dev-master

9999999-dev

Next level assertion and matcher library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

testing assert matcher expect expectation

16/08 2017

1.6.1

1.6.1.0

Next level assertion and matcher library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

testing assert matcher expect expectation

21/09 2016

1.6.0

1.6.0.0

Next level assertion and matcher library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

testing assert matcher expect expectation

20/09 2016

dev-fix-hhvm-build

dev-fix-hhvm-build

Next level assertion and matcher library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

testing assert matcher expect expectation

02/03 2016

1.5.0

1.5.0.0

Next level assertion and matcher library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

testing assert matcher expect expectation

23/10 2015

dev-keys-contain

dev-keys-contain

Next level assertion and matcher library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

testing assert matcher expect expectation

20/02 2015

1.4.0

1.4.0.0

Next level assertion and matcher library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

testing assert matcher expect expectation

14/02 2015

1.3.2

1.3.2.0

Next level assertion and matcher library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

testing assert matcher expect expectation

12/02 2015

1.3.1

1.3.1.0

Next level assertion and matcher library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

testing assert matcher expect expectation

29/01 2015

1.3.0

1.3.0.0

Next level assertion and matcher library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

testing assert matcher expect expectation

28/01 2015

1.2.1

1.2.1.0

Next level assertion and matcher library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

testing assert matcher expect expectation

22/12 2014

1.2.0

1.2.0.0

Next level assertion and matcher library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

testing assert matcher expect expectation

21/12 2014

1.1.0

1.1.0.0

Next level assertion library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

21/12 2014

1.0.1

1.0.1.0

Next level assertion library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

20/12 2014

1.0.0

1.0.0.0

Next level assertion library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires