/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. * This file is part of the Prophecy.
  4. * (c) Konstantin Kudryashov <ever.zet@gmail.com>
  5. * Marcello Duarte <marcello.duarte@gmail.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Prophecy\Comparator;
  11. use Prophecy\Prophecy\ProphecyInterface;
  12. use SebastianBergmann\Comparator\ObjectComparator;
  13. class ProphecyComparator extends ObjectComparator
  14. {
  15. public function accepts($expected, $actual)
  16. {
  17. return is_object($expected) && is_object($actual) && $actual instanceof ProphecyInterface;
  18. }
  19. public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = array())
  20. {
  21. parent::assertEquals($expected, $actual->reveal(), $delta, $canonicalize, $ignoreCase, $processed);
  22. }
  23. }