| @@ 25-56 (lines=32) @@ | ||
| 22 | /** |
|
| 23 | * @mixin InnerJoin |
|
| 24 | */ |
|
| 25 | final class InnerJoinSpec extends ObjectBehavior |
|
| 26 | { |
|
| 27 | public function let(): void |
|
| 28 | { |
|
| 29 | $this->beConstructedWith('user', 'authUser', null); |
|
| 30 | } |
|
| 31 | ||
| 32 | public function it_is_a_query_modifier(): void |
|
| 33 | { |
|
| 34 | $this->shouldHaveType(QueryModifier::class); |
|
| 35 | } |
|
| 36 | ||
| 37 | public function it_joins_with_default_dql_alias(QueryBuilder $qb): void |
|
| 38 | { |
|
| 39 | $qb->innerJoin('a.user', 'authUser')->shouldBeCalled(); |
|
| 40 | ||
| 41 | $this->modify($qb, 'a'); |
|
| 42 | } |
|
| 43 | ||
| 44 | public function it_joins_in_context(QueryBuilder $qb): void |
|
| 45 | { |
|
| 46 | $this->beConstructedWith('user', 'authUser', 'x'); |
|
| 47 | ||
| 48 | $qb->innerJoin('x.user', 'authUser')->shouldBeCalled(); |
|
| 49 | ||
| 50 | $qb->getDQLPart('join')->willReturn([]); |
|
| 51 | $qb->getAllAliases()->willReturn([]); |
|
| 52 | $qb->join('root.x', 'x')->willReturn($qb); |
|
| 53 | ||
| 54 | $this->modify($qb, 'root'); |
|
| 55 | } |
|
| 56 | } |
|
| 57 | ||
| @@ 25-56 (lines=32) @@ | ||
| 22 | /** |
|
| 23 | * @mixin Join |
|
| 24 | */ |
|
| 25 | final class JoinSpec extends ObjectBehavior |
|
| 26 | { |
|
| 27 | public function let(): void |
|
| 28 | { |
|
| 29 | $this->beConstructedWith('user', 'authUser', null); |
|
| 30 | } |
|
| 31 | ||
| 32 | public function it_is_a_query_modifier(): void |
|
| 33 | { |
|
| 34 | $this->shouldHaveType(QueryModifier::class); |
|
| 35 | } |
|
| 36 | ||
| 37 | public function it_joins_with_default_dql_alias(QueryBuilder $qb): void |
|
| 38 | { |
|
| 39 | $qb->join('a.user', 'authUser')->shouldBeCalled(); |
|
| 40 | ||
| 41 | $this->modify($qb, 'a'); |
|
| 42 | } |
|
| 43 | ||
| 44 | public function it_joins_in_context(QueryBuilder $qb): void |
|
| 45 | { |
|
| 46 | $this->beConstructedWith('user', 'authUser', 'x'); |
|
| 47 | ||
| 48 | $qb->join('x.user', 'authUser')->shouldBeCalled(); |
|
| 49 | ||
| 50 | $qb->getDQLPart('join')->willReturn([]); |
|
| 51 | $qb->getAllAliases()->willReturn([]); |
|
| 52 | $qb->join('root.x', 'x')->willReturn($qb); |
|
| 53 | ||
| 54 | $this->modify($qb, 'root'); |
|
| 55 | } |
|
| 56 | } |
|
| 57 | ||
| @@ 25-56 (lines=32) @@ | ||
| 22 | /** |
|
| 23 | * @mixin LeftJoin |
|
| 24 | */ |
|
| 25 | final class LeftJoinSpec extends ObjectBehavior |
|
| 26 | { |
|
| 27 | public function let(): void |
|
| 28 | { |
|
| 29 | $this->beConstructedWith('user', 'authUser', null); |
|
| 30 | } |
|
| 31 | ||
| 32 | public function it_is_a_query_modifier(): void |
|
| 33 | { |
|
| 34 | $this->shouldHaveType(QueryModifier::class); |
|
| 35 | } |
|
| 36 | ||
| 37 | public function it_joins_with_default_dql_alias(QueryBuilder $qb): void |
|
| 38 | { |
|
| 39 | $qb->leftJoin('a.user', 'authUser')->shouldBeCalled(); |
|
| 40 | ||
| 41 | $this->modify($qb, 'a'); |
|
| 42 | } |
|
| 43 | ||
| 44 | public function it_joins_in_context(QueryBuilder $qb): void |
|
| 45 | { |
|
| 46 | $this->beConstructedWith('user', 'authUser', 'x'); |
|
| 47 | ||
| 48 | $qb->leftJoin('x.user', 'authUser')->shouldBeCalled(); |
|
| 49 | ||
| 50 | $qb->getDQLPart('join')->willReturn([]); |
|
| 51 | $qb->getAllAliases()->willReturn([]); |
|
| 52 | $qb->join('root.x', 'x')->willReturn($qb); |
|
| 53 | ||
| 54 | $this->modify($qb, 'root'); |
|
| 55 | } |
|
| 56 | } |
|
| 57 | ||