PageRenderTime 34ms CodeModel.GetById 26ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/vendor/phpspec/prophecy/src/Prophecy/Comparator/ProphecyComparator.php

https://bitbucket.org/alan_cordova/api-sb-map
PHP | 28 lines | 15 code | 5 blank | 8 comment | 2 complexity | 9f6358effa1f179f9618d3fa531cd98b MD5 | raw file
 1<?php
 2
 3/*
 4 * This file is part of the Prophecy.
 5 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
 6 *     Marcello Duarte <marcello.duarte@gmail.com>
 7 *
 8 * For the full copyright and license information, please view the LICENSE
 9 * file that was distributed with this source code.
10 */
11
12namespace Prophecy\Comparator;
13
14use Prophecy\Prophecy\ProphecyInterface;
15use SebastianBergmann\Comparator\ObjectComparator;
16
17class ProphecyComparator extends ObjectComparator
18{
19    public function accepts($expected, $actual)
20    {
21        return is_object($expected) && is_object($actual) && $actual instanceof ProphecyInterface;
22    }
23
24    public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = array())
25    {
26        parent::assertEquals($expected, $actual->reveal(), $delta, $canonicalize, $ignoreCase, $processed);
27    }
28}