kahlan\Matcher::register PHP Method

register() public static method

Registers a matcher.
public static register ( string $name, string $class, string $target = '' )
$name string The name of the matcher.
$class string A fully-namespaced class name.
$target string An optionnal target class name.
    public static function register($name, $class, $target = '')
    {
        static::$_matchers[$name][$target] = $class;
    }

Usage Example

Exemplo n.º 1
0
<?php

use kahlan\Matcher;
class NoNamespace
{
    public function hello()
    {
        return "Hello World!";
    }
}
function test()
{
    return "It's a test";
}
if (true) {
    echo "Hello World!";
}
Matcher::register('toBe', 'kahlan\\matcher\\ToBe');
Box::share('kahlan.suite', function () {
    return new Suite();
});
?>

Outside PHP Tags

<?php 
for ($i = 0; $i < 10; $i++) {
    echo "Success";
}
All Usage Examples Of kahlan\Matcher::register