mirror of
https://github.com/doctrine/data-fixtures.git
synced 2026-03-23 22:32:13 +01:00
@@ -25,12 +25,12 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-sqlite3": "*",
|
||||
"doctrine/coding-standard": "^13",
|
||||
"doctrine/coding-standard": "^14",
|
||||
"doctrine/dbal": "^3.5 || ^4",
|
||||
"doctrine/mongodb-odm": "^1.3.0 || ^2.0.0",
|
||||
"doctrine/orm": "^2.14 || ^3",
|
||||
"fig/log-test": "^1",
|
||||
"phpstan/phpstan": "2.1.22",
|
||||
"phpstan/phpstan": "2.1.30",
|
||||
"phpunit/phpunit": "10.5.45",
|
||||
"symfony/cache": "^6.4 || ^7",
|
||||
"symfony/var-exporter": "^6.4 || ^7"
|
||||
|
||||
@@ -277,19 +277,7 @@ parameters:
|
||||
path: tests/Common/DataFixtures/DependentFixtureTest.php
|
||||
|
||||
-
|
||||
message: '#^Call to method expects\(\) on an unknown class Doctrine\\ODM\\PHPCR\\DocumentManager\.$#'
|
||||
identifier: class.notFound
|
||||
count: 5
|
||||
path: tests/Common/DataFixtures/Executor/PHPCRExecutorTest.php
|
||||
|
||||
-
|
||||
message: '#^Method Doctrine\\Tests\\Common\\DataFixtures\\Executor\\PHPCRExecutorTest\:\:getDocumentManager\(\) has invalid return type Doctrine\\ODM\\PHPCR\\DocumentManager\.$#'
|
||||
identifier: class.notFound
|
||||
count: 1
|
||||
path: tests/Common/DataFixtures/Executor/PHPCRExecutorTest.php
|
||||
|
||||
-
|
||||
message: '#^Parameter \#1 \$dm of class Doctrine\\Common\\DataFixtures\\Executor\\PHPCRExecutor constructor expects Doctrine\\ODM\\PHPCR\\DocumentManagerInterface, Doctrine\\ODM\\PHPCR\\DocumentManager&PHPUnit\\Framework\\MockObject\\MockObject given\.$#'
|
||||
message: '#^Parameter \#1 \$dm of class Doctrine\\Common\\DataFixtures\\Executor\\PHPCRExecutor constructor expects Doctrine\\ODM\\PHPCR\\DocumentManagerInterface, Doctrine\\Tests\\Mock\\PHPCRDocumentManager&PHPUnit\\Framework\\MockObject\\MockObject given\.$#'
|
||||
identifier: argument.type
|
||||
count: 5
|
||||
path: tests/Common/DataFixtures/Executor/PHPCRExecutorTest.php
|
||||
|
||||
@@ -6,6 +6,7 @@ parameters:
|
||||
- tests
|
||||
excludePaths:
|
||||
- tests/Mock/ForwardCompatibleEntityManager.php
|
||||
- tests/Mock/PHPCRDocumentManager.php
|
||||
|
||||
includes:
|
||||
- phpstan-baseline.neon
|
||||
|
||||
@@ -9,6 +9,7 @@ use Doctrine\Common\DataFixtures\FixtureInterface;
|
||||
use Doctrine\Common\DataFixtures\Purger\PHPCRPurgerInterface;
|
||||
use Doctrine\ODM\PHPCR\DocumentManager;
|
||||
use Doctrine\Tests\Common\DataFixtures\BaseTestCase;
|
||||
use Doctrine\Tests\Mock\PHPCRDocumentManager;
|
||||
use Exception;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
@@ -121,19 +122,14 @@ class PHPCRExecutorTest extends BaseTestCase
|
||||
return $this->createMock(PHPCRPurgerInterface::class);
|
||||
}
|
||||
|
||||
private function getDocumentManager(): DocumentManager&MockObject
|
||||
private function getDocumentManager(): PHPCRDocumentManager&MockObject
|
||||
{
|
||||
if (! class_exists(DocumentManager::class)) {
|
||||
$this->markTestSkipped('Missing doctrine/phpcr-odm');
|
||||
}
|
||||
|
||||
return $this
|
||||
->getMockBuilder(DocumentManager::class)
|
||||
->addMethods([
|
||||
'transactional',
|
||||
'flush',
|
||||
'clear',
|
||||
])
|
||||
->getMockBuilder(PHPCRDocumentManager::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
}
|
||||
|
||||
13
tests/Mock/PHPCRDocumentManager.php
Normal file
13
tests/Mock/PHPCRDocumentManager.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\Tests\Mock;
|
||||
|
||||
use Closure;
|
||||
use Doctrine\ODM\PHPCR\DocumentManager;
|
||||
|
||||
abstract class PHPCRDocumentManager extends DocumentManager
|
||||
{
|
||||
abstract public function transactional(Closure $func): void;
|
||||
}
|
||||
Reference in New Issue
Block a user