Skip to content

Commit 68a6656

Browse files
committed
backport doctrine 2.6 behat feature fix
1 parent f039498 commit 68a6656

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

features/bootstrap/FeatureContext.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ public function thereIsACompositeIdentifierObject()
338338
$item = new CompositeItem();
339339
$item->setField1('foobar');
340340
$this->manager->persist($item);
341+
$this->manager->flush();
341342

342343
for ($i = 0; $i < 4; ++$i) {
343344
$label = new CompositeLabel();
@@ -349,6 +350,8 @@ public function thereIsACompositeIdentifierObject()
349350
$rel->setValue('somefoobardummy');
350351

351352
$this->manager->persist($label);
353+
// since doctrine 2.6 we need existing identifiers on relations
354+
$this->manager->flush();
352355
$this->manager->persist($rel);
353356
}
354357

@@ -401,12 +404,16 @@ public function thereIsARelatedDummyWithFriends(int $nb)
401404
$relatedDummy = new RelatedDummy();
402405
$relatedDummy->setName('RelatedDummy with friends');
403406
$this->manager->persist($relatedDummy);
407+
$this->manager->flush();
404408

405409
for ($i = 1; $i <= $nb; ++$i) {
406410
$friend = new DummyFriend();
407411
$friend->setName('Friend-'.$i);
408412

409413
$this->manager->persist($friend);
414+
// since doctrine 2.6 we need existing identifiers on relations
415+
// See https://github.com/doctrine/doctrine2/pull/6701
416+
$this->manager->flush();
410417

411418
$relation = new RelatedToDummyFriend();
412419
$relation->setName('Relation-'.$i);

phpstan.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ parameters:
1010
- '#Call to an undefined method PHPUnit_Framework_MockObject_MockObject::[a-zA-Z0-9_]+\(\)#'
1111

1212
# False positives
13-
- '#Parameter \#2 \$dqlPart of method Doctrine\\ORM\\QueryBuilder::add\(\) expects Doctrine\\ORM\\Query\\Expr\\Base, Doctrine\\ORM\\Query\\Expr\\Join\[\] given#' # Fixed in Doctrine's master
1413
- '#Call to an undefined method Doctrine\\Common\\Persistence\\ObjectManager::getConnection\(\)#'
1514
- '#Class Symfony\\Component\\ExpressionLanguage\\ExpressionLanguage not found and could not be autoloaded#'

0 commit comments

Comments
 (0)