Skip to content

Commit

Permalink
Update CalculationArchiveServiceTest.php
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentmuller committed Jan 22, 2025
1 parent 293c66e commit 08f8fc2
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions tests/Service/CalculationArchiveServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
use App\Tests\TranslatorMockTrait;
use Doctrine\ORM\Query;
use Doctrine\ORM\QueryBuilder;
use Doctrine\ORM\UnexpectedResultException;
use PHPUnit\Framework\MockObject\Exception;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
Expand Down Expand Up @@ -177,7 +176,6 @@ public function testGetDateMaxConstraintDate(): void
public function testGetDateMaxConstraintException(): void
{
$this->setCalculationStates();
$this->setCalculationsException();
$service = $this->createService();
$actual = $service->getDateMaxConstraint();
self::assertNull($actual);
Expand Down Expand Up @@ -215,7 +213,6 @@ public function testGetDateMinConstraintDate(): void
public function testGetDateMinConstraintException(): void
{
$this->setCalculationStates();
$this->setCalculationsException();
$service = $this->createService();
$actual = $service->getDateMinConstraint();
self::assertNull($actual);
Expand Down Expand Up @@ -407,26 +404,6 @@ private function setCalculations(array $calculations = []): void
->willReturn($queryBuilder);
}

/**
* @throws Exception
*/
private function setCalculationsException(): void
{
$query = $this->createMock(Query::class);
$query->method('getSingleScalarResult')
->willThrowException(new UnexpectedResultException());

$queryBuilder = $this->createMock(QueryBuilder::class);
$queryBuilder->method('getQuery')
->willReturn($query);

$queryBuilder->method('select')
->willReturn($queryBuilder);

$this->calculationRepository->method('createQueryBuilder')
->willReturn($queryBuilder);
}

/**
* @throws Exception
*/
Expand Down

0 comments on commit 08f8fc2

Please sign in to comment.