Skip to content

Commit

Permalink
Update tests/Doctrine/Tests/ORM/Functional/Ticket/GH10532Test.php
Browse files Browse the repository at this point in the history
Co-authored-by: Grégoire Paris <postmaster@greg0ire.fr>
  • Loading branch information
mpdude and greg0ire authored Jun 3, 2023
1 parent 5289d44 commit ba0967c
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions tests/Doctrine/Tests/ORM/Functional/Ticket/GH10532Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,27 @@ public function testDeletes(): void
$con = $this->_em->getConnection();

// The "c" entity
$con->insert('gh10532_x', ['id' => 1, 'discr' => 'C']);
$con->insert('gh10532_c', ['id' => 1]);
$c = $this->_em->find(GH10532C::class, 1);
$con->insert('gh10532_x', ['discr' => 'C']);
$cId = $con->lastInsertId();
$con->insert('gh10532_c', ['id' => $cId]);
$c = $this->_em->find(GH10532C::class, $cId);

// The "a2" entity
$con->insert('gh10532_a', ['id' => 2, 'gh10532x_id' => 1]);
$a2 = $this->_em->find(GH10532A::class, 2);
$con->insert('gh10532_a', ['gh10532x_id' => $cId]);
$a2Id = $con->lastInsertId();
$a2 = $this->_em->find(GH10532A::class, $a2Id);

// The "b" entity
$con->insert('gh10532_x', ['id' => 3, 'discr' => 'B']);
$con->insert('gh10532_b', ['id' => 3, 'gh10532a_id' => 2]);
$b = $this->_em->find(GH10532B::class, 3);
$con->insert('gh10532_x', ['discr' => 'B']);
$bId = $con->lastInsertId();
$con->insert('gh10532_b', ['id' => $bId, 'gh10532a_id' => $a2Id]);
$b = $this->_em->find(GH10532B::class, $bId);

// The "a1" entity
$con->insert('gh10532_a', ['id' => 4, 'gh10532x_id' => 3]);
$a1 = $this->_em->find(GH10532A::class, 4);
$con->insert('gh10532_a', ['gh10532x_id' => $bId]);
$a1Id = $con->lastInsertId();
$a1 = $this->_em->find(GH10532A::class, $a1Id);


/*
* The following would make the deletions happen in an order
Expand Down

0 comments on commit ba0967c

Please sign in to comment.