Skip to content

Commit

Permalink
Introduce sso_provider_roles_eb6 to prepare for custom doctrine types…
Browse files Browse the repository at this point in the history
… - Update tests to delete sso_provider_roles_eb6 as well
  • Loading branch information
Stephan-Kok committed Oct 21, 2021
1 parent ab9ee51 commit dec52ec
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ public function remove($entityId, $role)
->setParameter('entityId', $entityId)
->setParameter('type', $role)
->execute();
$this->entityManager->getConnection()->createQueryBuilder()
->delete('sso_provider_roles_eb6', 'roles')
->where('roles.entity_id = :entityId')
->andWhere('roles.type = :type')
->setParameter('entityId', $entityId)
->setParameter('type', $role)
->execute();

return $this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,11 +478,20 @@ private function addServiceProviderFixture(ServiceProvider $serviceProvider)
$em->flush();
}

/**
* This call {->delete('sso_provider_roles_eb5')} has been added to temporary push to both sso_provider_roles_eb5
* and sso_provider_roles_eb6
*
* TODO: Remove this code after sso_provider_roles_eb5 has been phased out
*/
private function clearMetadataFixtures()
{
$queryBuilder = $this->getContainer()->get('doctrine')->getConnection()->createQueryBuilder();
$queryBuilder
->delete('sso_provider_roles_eb5')
->execute();
$this->getContainer()->get('doctrine')->getConnection()->createQueryBuilder()
->delete('sso_provider_roles_eb6')
->execute();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -394,12 +394,21 @@ private function disableMetadataPushApiFeatureFor(Client $client)
$client->getContainer()->set('engineblock.features', $featureToggles);
}

/**
* This call {->delete('sso_provider_roles_eb5')} has been added to temporary push to both sso_provider_roles_eb5
* and sso_provider_roles_eb6
*
* TODO: Remove this code after sso_provider_roles_eb5 has been phased out
*/
private function clearMetadataFixtures()
{
$queryBuilder = $this->getContainer()->get('doctrine')->getConnection()->createQueryBuilder();
$queryBuilder
->delete('sso_provider_roles_eb5')
->execute();
$this->getContainer()->get('doctrine')->getConnection()->createQueryBuilder()
->delete('sso_provider_roles_eb6')
->execute();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,21 @@ private function addServiceProviderFixture(ServiceProvider $serviceProvider)
$em->flush();
}

/**
* This call {->delete('sso_provider_roles_eb5')} has been added to temporary push to both sso_provider_roles_eb5
* and sso_provider_roles_eb6
*
* TODO: Remove this code after sso_provider_roles_eb5 has been phased out
*/
private function clearMetadataFixtures()
{
$queryBuilder = $this->getContainer()->get('doctrine')->getConnection()->createQueryBuilder();
$queryBuilder
->delete('sso_provider_roles_eb5')
->execute();
$this->getContainer()->get('doctrine')->getConnection()->createQueryBuilder()
->delete('sso_provider_roles_eb6')
->execute();
}

private function clearConsentFixtures()
Expand Down

0 comments on commit dec52ec

Please sign in to comment.