Skip to content

Commit

Permalink
Use real classes for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu committed Apr 6, 2021
1 parent 48089de commit 9e8232b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/Doctrine/Tests/Persistence/Mapping/DriverChainTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use Doctrine\Persistence\Mapping\Driver\MappingDriverChain;
use Doctrine\Persistence\Mapping\MappingException;
use Doctrine\Tests\DoctrineTestCase;
use Doctrine\Tests\Persistence\Mapping\Fixtures\Manager\Manager;
use Doctrine\Tests\Persistence\Mapping\Fixtures\Model;
use stdClass;

class DriverChainTest extends DoctrineTestCase
Expand Down Expand Up @@ -93,12 +95,10 @@ public function testIsTransient(): void
*/
public function testDefaultDriver(): void
{
$companyDriver = $this->createMock(MappingDriver::class);
$defaultDriver = $this->createMock(MappingDriver::class);
/** @psalm-var class-string */
$entityClassName = 'Doctrine\Tests\ORM\Mapping\DriverChainEntity';
/** @psalm-var class-string */
$managerClassName = 'Doctrine\Tests\Models\Company\CompanyManager';
$companyDriver = $this->createMock(MappingDriver::class);
$defaultDriver = $this->createMock(MappingDriver::class);
$entityClassName = Model::class;
$managerClassName = Manager::class;
$chain = new MappingDriverChain();

$companyDriver->expects($this->never())
Expand All @@ -118,7 +118,7 @@ public function testDefaultDriver(): void
self::assertNull($chain->getDefaultDriver());

$chain->setDefaultDriver($defaultDriver);
$chain->addDriver($companyDriver, 'Doctrine\Tests\Models\Company');
$chain->addDriver($companyDriver, 'Doctrine\Tests\Persistence\Mapping\Fixtures\Manager');

self::assertSame($defaultDriver, $chain->getDefaultDriver());

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

namespace Doctrine\Tests\Persistence\Mapping\Fixtures\Manager;

final class Manager
{
}
9 changes: 9 additions & 0 deletions tests/Doctrine/Tests/Persistence/Mapping/Fixtures/Model.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

namespace Doctrine\Tests\Persistence\Mapping\Fixtures;

final class Model
{
}

0 comments on commit 9e8232b

Please sign in to comment.