-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from wmde/doctrine-update-2024
Update Doctrine ORM
- Loading branch information
Showing
4 changed files
with
9 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,10 @@ | |
namespace WMDE\Fundraising\SubscriptionContext\Tests\Integration\DataAccess; | ||
|
||
use Doctrine\ORM\EntityManager; | ||
use Doctrine\ORM\ORMException; | ||
use Doctrine\ORM\Exception\ORMException; | ||
use Doctrine\Persistence\ObjectRepository; | ||
use PHPUnit\Framework\TestCase; | ||
use RuntimeException; | ||
use WMDE\Fundraising\SubscriptionContext\DataAccess\DoctrineSubscriptionRepository; | ||
use WMDE\Fundraising\SubscriptionContext\Domain\Model\Subscription; | ||
use WMDE\Fundraising\SubscriptionContext\Domain\Repositories\SubscriptionRepositoryException; | ||
|
@@ -62,7 +63,10 @@ public function testMultipleSubscriptions_onlySimilarAreCounted(): void { | |
public function testDatabaseLayerExceptionsAreConvertedToDomainExceptions(): void { | ||
$entityManager = $this->createMock( EntityManager::class ); | ||
|
||
$entityManager->expects( $this->once() )->method( 'persist' )->willThrowException( new ORMException() ); | ||
$entityManager->expects( $this->once() )->method( 'persist' )->willThrowException( | ||
new class() extends RuntimeException implements ORMException { | ||
} | ||
); | ||
$repository = new DoctrineSubscriptionRepository( $entityManager ); | ||
$subscription = new Subscription(); | ||
$subscription->setEmail( '[email protected]' ); | ||
|