-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1446 from ciaranmcnulty/allow-phpunit-10
Allow phpunit 10
- Loading branch information
Showing
5 changed files
with
68 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
integration/PhpSpec/Formatter/Presenter/Differ/ObjectEngineTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpSpec\Formatter\Presenter\Differ; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use SebastianBergmann\Exporter\Exporter; | ||
|
||
class ObjectEngineTest extends TestCase | ||
{ | ||
/** @var ObjectEngine */ | ||
private $engine; | ||
|
||
/** @var Exporter */ | ||
private $exporter; | ||
|
||
/** @var StringEngine */ | ||
private $stringDiffer; | ||
|
||
public function setUp() : void | ||
{ | ||
$this->exporter = new Exporter(); | ||
$this->stringDiffer = $this->createMock(StringEngine::class); | ||
$this->engine = new ObjectEngine($this->exporter, $this->stringDiffer); | ||
} | ||
|
||
/** @test */ | ||
public function it_is_an_differ_engine() | ||
{ | ||
self::assertInstanceOf(DifferEngine::class, $this->engine); | ||
} | ||
|
||
/** @test */ | ||
public function it_does_not_support_scalars() | ||
{ | ||
self::assertFalse($this->engine->supports(1, 2)); | ||
} | ||
|
||
/** @test */ | ||
public function it_only_supports_objects() | ||
{ | ||
self::assertTrue($this->engine->supports(new \StdClass(), new \StdClass())); | ||
} | ||
|
||
/** @test */ | ||
public function it_converts_objects_to_string_and_diffs_the_result() | ||
{ | ||
$this->stringDiffer->method('compare') | ||
->willReturn('-DateTime+ArrayObject'); | ||
|
||
$diff = $this->engine->compare(new \DateTime(), new \ArrayObject()); | ||
|
||
self::assertSame('-DateTime+ArrayObject', $diff); | ||
} | ||
} |
43 changes: 0 additions & 43 deletions
43
spec/PhpSpec/Formatter/Presenter/Differ/ObjectEngineSpec.php
This file was deleted.
Oops, something went wrong.