Skip to content

Commit

Permalink
Merge branch '4.4' into 5.1
Browse files Browse the repository at this point in the history
* 4.4:
  Use createMock() and use import instead of FQCN
  • Loading branch information
nicolas-grekas committed Jan 27, 2021
2 parents 3dd1c05 + a1eab2f commit cee600a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Tests/Caster/PdoCasterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
namespace Symfony\Component\VarDumper\Tests\Caster;

use PHPUnit\Framework\TestCase;
use Symfony\Component\VarDumper\Caster\ConstStub;
use Symfony\Component\VarDumper\Caster\EnumStub;
use Symfony\Component\VarDumper\Caster\PdoCaster;
use Symfony\Component\VarDumper\Cloner\Stub;
use Symfony\Component\VarDumper\Test\VarDumperTestTrait;
Expand All @@ -34,10 +36,10 @@ public function testCastPdo()

$cast = PdoCaster::castPdo($pdo, [], new Stub(), false);

$this->assertInstanceOf(\Symfony\Component\VarDumper\Caster\EnumStub::class, $cast["\0~\0attributes"]);
$this->assertInstanceOf(EnumStub::class, $cast["\0~\0attributes"]);

$attr = $cast["\0~\0attributes"] = $cast["\0~\0attributes"]->value;
$this->assertInstanceOf(\Symfony\Component\VarDumper\Caster\ConstStub::class, $attr['CASE']);
$this->assertInstanceOf(ConstStub::class, $attr['CASE']);
$this->assertSame('NATURAL', $attr['CASE']->class);
$this->assertSame('BOTH', $attr['DEFAULT_FETCH_MODE']->class);

Expand Down
4 changes: 2 additions & 2 deletions Tests/Dumper/ServerDumperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ServerDumperTest extends TestCase

public function testDumpForwardsToWrappedDumperWhenServerIsUnavailable()
{
$wrappedDumper = $this->getMockBuilder(DataDumperInterface::class)->getMock();
$wrappedDumper = $this->createMock(DataDumperInterface::class);

$dumper = new ServerDumper(self::VAR_DUMPER_SERVER, $wrappedDumper);

Expand All @@ -39,7 +39,7 @@ public function testDumpForwardsToWrappedDumperWhenServerIsUnavailable()

public function testDump()
{
$wrappedDumper = $this->getMockBuilder(DataDumperInterface::class)->getMock();
$wrappedDumper = $this->createMock(DataDumperInterface::class);
$wrappedDumper->expects($this->never())->method('dump'); // test wrapped dumper is not used

$cloner = new VarCloner();
Expand Down

0 comments on commit cee600a

Please sign in to comment.