Skip to content

Commit

Permalink
Fix phpspec tests
Browse files Browse the repository at this point in the history
  • Loading branch information
loic425 committed Jun 5, 2024
1 parent 65aebc0 commit 51f5aa3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
7 changes: 4 additions & 3 deletions src/Bundle/spec/Doctrine/PHPCRODM/DataSourceSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
use Doctrine\Common\Collections\Expr\Comparison;
use Doctrine\Common\Collections\Expr\Value;
use Doctrine\ODM\PHPCR\Query\Builder\ConstraintComparison;
use Doctrine\ODM\PHPCR\Query\Builder\ConstraintOrx;
use Doctrine\ODM\PHPCR\Query\Builder\OrderBy;
use Doctrine\ODM\PHPCR\Query\Builder\Ordering;
use Doctrine\ODM\PHPCR\Query\Builder\QueryBuilder;
use Doctrine\ODM\PHPCR\Query\Builder\WhereOr;
use Doctrine\ODM\PHPCR\Query\Query;
use Pagerfanta\Pagerfanta;
use PhpSpec\ObjectBehavior;
Expand Down Expand Up @@ -47,7 +47,7 @@ function it_should_restrict_with_or_condition(
ExpressionBuilderInterface $expressionBuilder,
Comparison $comparison,
Value $value,
ConstraintOrx $constraint,
WhereOr $constraint,
ConstraintComparison $comparisonConstraint,
): void {
$this->beConstructedWith($queryBuilder, $expressionBuilder);
Expand Down Expand Up @@ -91,12 +91,13 @@ function it_should_get_the_data(
QueryBuilder $queryBuilder,
ExpressionBuilderInterface $expressionBuilder,
Query $query,
OrderBy $orderBy,
): void {
$this->beConstructedWith($queryBuilder, $expressionBuilder);

$expressionBuilder->getOrderBys()->willReturn([]);

$queryBuilder->orderBy()->willReturn(null);
$queryBuilder->orderBy()->willReturn($orderBy);
$queryBuilder->getQuery()->willReturn($query);
$query->setMaxResults(Argument::any())->willReturn($query);
$query->setFirstResult(Argument::any())->willReturn($query);
Expand Down
14 changes: 7 additions & 7 deletions src/Bundle/spec/Doctrine/PHPCRODM/ExpressionBuilderSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace spec\Sylius\Bundle\GridBundle\Doctrine\PHPCRODM;

use Doctrine\Common\Collections\Expr\Comparison;
use Doctrine\Common\Collections\Expr\Expression;
use Doctrine\Common\Collections\ExpressionBuilder as CollectionsExpressionBuilder;
use PhpSpec\ObjectBehavior;
use Sylius\Bundle\GridBundle\Doctrine\PHPCRODM\ExtraComparison;
Expand All @@ -29,19 +29,19 @@ function let(CollectionsExpressionBuilder $expressionBuilder): void
}

function it_builds_andx(
Comparison $comparison,
Expression $expression,
CollectionsExpressionBuilder $expressionBuilder,
): void {
$this->andX([$comparison]);
$expressionBuilder->andX([$comparison])->shouldHaveBeenCalled();
$this->andX($expression);
$expressionBuilder->andX($expression)->shouldHaveBeenCalled();
}

function it_builds_orx(
Comparison $comparison,
Expression $expression,
CollectionsExpressionBuilder $expressionBuilder,
): void {
$this->orX([$comparison]);
$expressionBuilder->orX([$comparison])->shouldHaveBeenCalled();
$this->orX($expression);
$expressionBuilder->orX($expression)->shouldHaveBeenCalled();
}

function it_builds_equals(
Expand Down

0 comments on commit 51f5aa3

Please sign in to comment.