Skip to content

Commit

Permalink
Merge pull request #1523 from scyzoryck/test-orm-30
Browse files Browse the repository at this point in the history
Allow`doctrine/orm` 3.0
  • Loading branch information
scyzoryck committed Dec 9, 2023
2 parents f240275 + 11f21f3 commit 83ede54
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ jobs:
if: ${{ matrix.composer-stability }}
run: composer config minimum-stability ${{ matrix.composer-stability }}

- name: Uninstall Doctrine ODM
run: composer remove doctrine/phpcr-odm jackalope/jackalope-doctrine-dbal --no-update --dev

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v1"
with:
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"require-dev": {
"ext-pdo_sqlite": "*",
"doctrine/coding-standard": "^12.0",
"doctrine/orm": "^2.14",
"doctrine/orm": "^2.14 || ^3.0",
"doctrine/persistence": "^2.5.2 || ^3.0",
"doctrine/phpcr-odm": "^1.5.2 || ^2.0",
"jackalope/jackalope-doctrine-dbal": "^1.3",
Expand Down Expand Up @@ -72,5 +72,6 @@
"branch-alias": {
"dev-master": "3.x-dev"
}
}
},
"minimum-stability": "dev"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping">
<embeddable name="JMS\Serializer\Tests\Fixtures\Doctrine\Embeddable\BlogPostSeo">
<field name="metaTitle" column="meta_title" type="string" nullable="false"/>
</embeddable>
Expand Down
1 change: 1 addition & 0 deletions tests/Serializer/Doctrine/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ private function createEntityManager(Connection $con)
$cfg->setMetadataDriverImpl(new AttributeDriver([
__DIR__ . '/../../Fixtures/Doctrine/SingleTableInheritance',
]));
AnnotationReader::addGlobalIgnoredNamespace('Doctrine\ORM\Mapping');
} else {
$cfg->setMetadataDriverImpl(new AnnotationDriver(new AnnotationReader(), [
__DIR__ . '/../../Fixtures/Doctrine/SingleTableInheritance',
Expand Down
5 changes: 2 additions & 3 deletions tests/Serializer/Doctrine/ObjectConstructorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
use ReflectionClass;
use RuntimeException;
use SimpleXMLElement;

use function assert;

Check failure on line 61 in tests/Serializer/Doctrine/ObjectConstructorTest.php

View workflow job for this annotation

GitHub Actions / Coding Standards (7.2)

Expected 1 line between different types of use statement, found 0.

class ObjectConstructorTest extends TestCase
Expand Down Expand Up @@ -471,8 +470,7 @@ public function testArrayKeyExistsOnObject(): void
protected function setUp(): void
{
$this->visitor = $this->getMockBuilder(DeserializationVisitorInterface::class)->getMock();
$this->context = $this->getMockBuilder('JMS\Serializer\DeserializationContext')->getMock();

$this->context = $this->getMockBuilder(DeserializationContext::class)->getMock();
$connection = $this->createConnection();
$entityManager = $this->createEntityManager($connection);

Expand Down Expand Up @@ -528,6 +526,7 @@ private function createEntityManager(Connection $con, ?Configuration $cfg = null
$cfg = new Configuration();

if (PHP_VERSION_ID >= 80000 && class_exists(AttributeDriver::class)) {
AnnotationReader::addGlobalIgnoredNamespace('Doctrine\ORM\Mapping');
$cfg->setMetadataDriverImpl(new AttributeDriver([
__DIR__ . '/../../Fixtures/Doctrine/Entity',
__DIR__ . '/../../Fixtures/Doctrine/IdentityFields',
Expand Down

0 comments on commit 83ede54

Please sign in to comment.