noregression/callable-comparator

View on GitHub
src/PHPUnit/Comparator/CallableComparator.php

Summary

Maintainability
A
45 mins
Test Coverage
<?php

namespace NoRegression\PHPUnit\Comparator;

use NoRegression\PHPUnit\Comparator\Callables\CallableInterface;
use NoRegression\PHPUnit\Exporter\Exporter;
use SebastianBergmann\Comparator\Comparator;

class CallableComparator extends Comparator
{
    public function __construct()
    {
        parent::__construct();
        $this->exporter = new Exporter;
    }

    public function accepts($expected, $actual)
    {
        return $expected instanceof CallableInterface;
    }

    public function assertEquals(
        $expected,
        $actual,
        $delta = 0.0,
        $canonicalize = false,
        $ignoreCase = false,
        array &$processed = array()
    ) {
        return call_user_func($expected, $actual);
    }
}