Skip to content

Commit

Permalink
Upgrade to ORM 2.10
Browse files Browse the repository at this point in the history
- As of ORM 2.10 Doctrine annotations require an exta package called
  doctrine/annotations (requires symfony/cache). See:
  - https://www.doctrine-project.org/projects/doctrine-orm/en/2.10/reference/annotations-reference.html
  - https://github.com/doctrine/orm/blob/2.10.x/UPGRADE.md#upgrade-to-29
  • Loading branch information
Ian Neilson authored and gregcorbett committed Sep 12, 2024
1 parent 9b44f2e commit 4f99e4c
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 44 deletions.
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"name": "stfc-egi/gocdb",
"description": "A web portal and REST style API for e-Infrastructure topology managment",
"require": {
"doctrine/orm": "2.9.*",
"symfony/cache": "*"
"doctrine/orm": "2.10.*",
"symfony/cache": "*",
"doctrine/annotations": "*"
},
"require-dev": {
"phpunit/phpunit": "4.8.*",
Expand Down
144 changes: 109 additions & 35 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions tests/doctrine/DoctrineCleanInsert1Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ public function testRollback()
* first have to delete the services that holds the FK to the site (one site
* to many services).
*
* @expectedException \Doctrine\DBAL\DBALException
* @expectedException \Doctrine\DBAL\Exception
*/
public function testExpectedFK_ViolationOnSiteDeleteWithoutCascade()
{
Expand Down Expand Up @@ -536,7 +536,9 @@ public function testExpectedFK_ViolationOnSiteDeleteWithoutCascade()
// services first as we have no cascade-delete option set.
$this->em->remove($refetchedSite);
$this->em->flush();
$this->fail('Should not get to this point - DBALException expected');
$this->fail(
'Should not get to this point - \Doctrine\DBAL\Exception expected'
);
}


Expand Down Expand Up @@ -702,7 +704,7 @@ public function testServiceToEndpointCascadeDelete_WithNoDTs()
* association to a downtime (this relationship would need to be deleted first
* to allow the endpoint to be deleted cleanly by the cascade).
*
* @expectedException \Doctrine\DBAL\DBALException
* @expectedException \Doctrine\DBAL\Exception
*/
public function testExpectedFK_ViolationOnServiceToEndpointCascadeDelete_WithDTs()
{
Expand Down Expand Up @@ -751,8 +753,10 @@ public function testExpectedFK_ViolationOnServiceToEndpointCascadeDelete_WithDTs
// services first as we have no cascade-delete option set.
$this->em->remove($se);
$this->em->flush();
$this->fail('Should not get to this point - DBALException expected');
}
$this->fail(
'Should not get to this point - \Doctrine\DBAL\Exception expected'
);
}

/**
* Show how Bidirectional relationships must be correctly managed in
Expand Down
4 changes: 2 additions & 2 deletions tests/doctrine/RolesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public function testRoleDiscriminatorNGI()
* Add a role type, user, NGI and a role linking
* them all together. Assert that $newRole->getOwnedEntity()
* returns an instance of NGI.
* @expectedException \Doctrine\DBAL\DBALException
* @expectedException \Doctrine\DBAL\Exception
*/
public function testRoleTypeIntegrityConstraint()
{
Expand Down Expand Up @@ -248,7 +248,7 @@ public function testRoleTypeIntegrityConstraint()

/**
* Ensure no duplicate role types are inserted
* @expectedException \Doctrine\DBAL\DBALException
* @expectedException \Doctrine\DBAL\Exception
*/
public function testDuplicateRoleTypes()
{
Expand Down

0 comments on commit 4f99e4c

Please sign in to comment.