Skip to content

Commit d4237ff

Browse files
committed
Introduce sso_provider_roles_eb6 to prepare for custom doctrine types - Update tests to delete sso_provider_roles_eb6 as well
1 parent ab9ee51 commit d4237ff

4 files changed

Lines changed: 50 additions & 0 deletions

File tree

src/OpenConext/EngineBlockFunctionalTestingBundle/Fixtures/ServiceRegistryFixture.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,32 @@ public function save()
116116
$this->entityManager->flush();
117117
}
118118

119+
/**
120+
* This call duplicate database call has been added to temporary push to both sso_provider_roles_eb5
121+
* and sso_provider_roles_eb6
122+
*
123+
* TODO: Remove this code after sso_provider_roles_eb5 has been phased out
124+
*/
119125
public function reset()
120126
{
121127
$queryBuilder = $this->entityManager->getConnection()->createQueryBuilder();
122128
$queryBuilder
123129
->delete('sso_provider_roles_eb5')
124130
->execute();
125131

132+
$this->entityManager->getConnection()->createQueryBuilder()
133+
->delete('sso_provider_roles_eb6')
134+
->execute();
135+
126136
return $this;
127137
}
128138

139+
/**
140+
* This call duplicate database call has been added to temporary push to both sso_provider_roles_eb5
141+
* and sso_provider_roles_eb6
142+
*
143+
* TODO: Remove this code after sso_provider_roles_eb5 has been phased out
144+
*/
129145
public function remove($entityId, $role)
130146
{
131147
$queryBuilder = $this->entityManager->getConnection()->createQueryBuilder();
@@ -136,6 +152,13 @@ public function remove($entityId, $role)
136152
->setParameter('entityId', $entityId)
137153
->setParameter('type', $role)
138154
->execute();
155+
$this->entityManager->getConnection()->createQueryBuilder()
156+
->delete('sso_provider_roles_eb6', 'roles')
157+
->where('roles.entity_id = :entityId')
158+
->andWhere('roles.type = :type')
159+
->setParameter('entityId', $entityId)
160+
->setParameter('type', $role)
161+
->execute();
139162

140163
return $this;
141164
}

tests/functional/OpenConext/EngineBlockBundle/Controller/Api/AttributeReleasePolicyControllerApiTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,11 +478,20 @@ private function addServiceProviderFixture(ServiceProvider $serviceProvider)
478478
$em->flush();
479479
}
480480

481+
/**
482+
* This call {->delete('sso_provider_roles_eb5')} has been added to temporary push to both sso_provider_roles_eb5
483+
* and sso_provider_roles_eb6
484+
*
485+
* TODO: Remove this code after sso_provider_roles_eb5 has been phased out
486+
*/
481487
private function clearMetadataFixtures()
482488
{
483489
$queryBuilder = $this->getContainer()->get('doctrine')->getConnection()->createQueryBuilder();
484490
$queryBuilder
485491
->delete('sso_provider_roles_eb5')
486492
->execute();
493+
$this->getContainer()->get('doctrine')->getConnection()->createQueryBuilder()
494+
->delete('sso_provider_roles_eb6')
495+
->execute();
487496
}
488497
}

tests/functional/OpenConext/EngineBlockBundle/Controller/Api/ConnectionsControllerTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,12 +394,21 @@ private function disableMetadataPushApiFeatureFor(Client $client)
394394
$client->getContainer()->set('engineblock.features', $featureToggles);
395395
}
396396

397+
/**
398+
* This call {->delete('sso_provider_roles_eb5')} has been added to temporary push to both sso_provider_roles_eb5
399+
* and sso_provider_roles_eb6
400+
*
401+
* TODO: Remove this code after sso_provider_roles_eb5 has been phased out
402+
*/
397403
private function clearMetadataFixtures()
398404
{
399405
$queryBuilder = $this->getContainer()->get('doctrine')->getConnection()->createQueryBuilder();
400406
$queryBuilder
401407
->delete('sso_provider_roles_eb5')
402408
->execute();
409+
$this->getContainer()->get('doctrine')->getConnection()->createQueryBuilder()
410+
->delete('sso_provider_roles_eb6')
411+
->execute();
403412
}
404413

405414
/**

tests/functional/OpenConext/EngineBlockBundle/Controller/Api/ConsentControllerTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,21 @@ private function addServiceProviderFixture(ServiceProvider $serviceProvider)
297297
$em->flush();
298298
}
299299

300+
/**
301+
* This call {->delete('sso_provider_roles_eb5')} has been added to temporary push to both sso_provider_roles_eb5
302+
* and sso_provider_roles_eb6
303+
*
304+
* TODO: Remove this code after sso_provider_roles_eb5 has been phased out
305+
*/
300306
private function clearMetadataFixtures()
301307
{
302308
$queryBuilder = $this->getContainer()->get('doctrine')->getConnection()->createQueryBuilder();
303309
$queryBuilder
304310
->delete('sso_provider_roles_eb5')
305311
->execute();
312+
$this->getContainer()->get('doctrine')->getConnection()->createQueryBuilder()
313+
->delete('sso_provider_roles_eb6')
314+
->execute();
306315
}
307316

308317
private function clearConsentFixtures()

0 commit comments

Comments
 (0)