2017 © Pedro Peláez
 

library extra-matcher

Additional matchers for Kahlan.

image

kahlan/extra-matcher

Additional matchers for Kahlan.

  • Monday, June 11, 2018
  • by jails
  • Repository
  • 7 Watchers
  • 5 Stars
  • 396 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 3 Versions
  • 2 % Grown

The README.md

Kahlan Additional Matchers

Build Status Code Coverage, (*1)

Installation

via Composer

$ composer require --dev kahlan/extra-matcher

Registration

To manually register the matchers you want, add them in your kahlan-config.php config file like in the following example:, (*2)

use Kahlan\Extra\Matcher\ExtraMatchers;

ExtraMatchers::register(['toBeOneOf', ...]);

Or in case you want to register all matchers, you can simply write:, (*3)

use Kahlan\Extra\Matcher\ExtraMatchers;

ExtraMatchers::register();

Documentation

toBeOneOf($expected) // strict comparison, (*4)

it("passes if $actual is present in $expected", function() {
    expect(3)->toBeOneOf([1, 2, 3]);
});

toEqualOneOf($expected) // loose comparison, (*5)

it("passes if $actual is present in $expected", function() {
    expect("3")->toEqualOneOf([1, 2, 3]);
});

toImplement($expected) // object implements expected interface, (*6)

namespace App\Spec;

it("passes if $actual implements $expected", function() {

    interface Foo { }
    class Bar implements Foo {}

    $actual = new Bar();
    expect($actual)->toImplement('App\Spec\Foo');
});

The Versions

11/06 2018

dev-master

9999999-dev

Additional matchers for Kahlan.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

by CrysaLEAD

12/11 2017

dev-samsonasik-patch-1

dev-samsonasik-patch-1

Additional matchers for Kahlan.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

by CrysaLEAD

07/04 2017

1.0.0

1.0.0.0

Additional matchers for Kahlan.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

by CrysaLEAD