Skip to content

Commit 0218f78

Browse files
authored
Merge pull request #1588 from soyuka/fix-doctrine
use doctrine 2.6
2 parents d5532d5 + 6c2e4a1 commit 0218f78

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"behat/symfony2-extension": "^2.1.1",
3434
"behatch/contexts": "dev-master",
3535
"doctrine/doctrine-bundle": "^1.6.3",
36-
"doctrine/orm": ">=2.5.2 <2.6",
36+
"doctrine/orm": "^2.5.2",
3737
"doctrine/annotations": "^1.2",
3838
"friendsofsymfony/user-bundle": "^2.0",
3939
"guzzlehttp/guzzle": "^6.0",

features/bootstrap/FeatureContext.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,7 @@ public function thereIsACompositeIdentifierObject()
560560
$item = new CompositeItem();
561561
$item->setField1('foobar');
562562
$this->manager->persist($item);
563+
$this->manager->flush();
563564

564565
for ($i = 0; $i < 4; ++$i) {
565566
$label = new CompositeLabel();
@@ -571,6 +572,8 @@ public function thereIsACompositeIdentifierObject()
571572
$rel->setValue('somefoobardummy');
572573

573574
$this->manager->persist($label);
575+
// since doctrine 2.6 we need existing identifiers on relations
576+
$this->manager->flush();
574577
$this->manager->persist($rel);
575578
}
576579

@@ -623,12 +626,16 @@ public function thereIsARelatedDummyWithFriends(int $nb)
623626
$relatedDummy = new RelatedDummy();
624627
$relatedDummy->setName('RelatedDummy with friends');
625628
$this->manager->persist($relatedDummy);
629+
$this->manager->flush();
626630

627631
for ($i = 1; $i <= $nb; ++$i) {
628632
$friend = new DummyFriend();
629633
$friend->setName('Friend-'.$i);
630634

631635
$this->manager->persist($friend);
636+
// since doctrine 2.6 we need existing identifiers on relations
637+
// See https://github.com/doctrine/doctrine2/pull/6701
638+
$this->manager->flush();
632639

633640
$relation = new RelatedToDummyFriend();
634641
$relation->setName('Relation-'.$i);
@@ -740,6 +747,8 @@ public function createPeopleWithPets()
740747

741748
$this->manager->persist($person);
742749
$this->manager->persist($pet);
750+
// since doctrine 2.6 we need existing identifiers on relations
751+
$this->manager->flush();
743752
$this->manager->persist($personToPet);
744753

745754
$person->pets->add($personToPet);

0 commit comments

Comments
 (0)