@@ -13,7 +13,7 @@ class JoinSpec extends ObjectBehavior
1313{
1414 public function let (): void
1515 {
16- $ this ->beConstructedWith ('user ' , 'authUser ' , 'a ' );
16+ $ this ->beConstructedWith ('user ' , 'authUser ' , Join:: JOIN , 'a ' );
1717 }
1818
1919 public function it_is_a_specification (): void
@@ -46,12 +46,11 @@ public function it_should_use_be_able_to_use_join_conditions(QueryBuilder $query
4646
4747 $ this ->beConstructedWith ('user ' , 'authUser ' );
4848
49- $ this ->setConditionType ($ joinType )->shouldReturn ($ this );
50- $ this ->setCondition ($ joinCondition )->shouldReturn ($ this );
49+ $ join = $ this ->setConditionType ($ joinType )->setCondition ($ joinCondition );
5150
5251 $ queryBuilder ->join ('a.user ' , 'authUser ' , $ joinType , $ joinCondition , null )->shouldBeCalled ()->willReturn ($ queryBuilder );
5352
54- $ this ->modify ($ queryBuilder , 'a ' );
53+ $ join ->modify ($ queryBuilder , 'a ' );
5554 }
5655
5756 public function it_should_be_able_to_set_index_by_for_join (QueryBuilder $ queryBuilder ): void
@@ -62,9 +61,9 @@ public function it_should_be_able_to_set_index_by_for_join(QueryBuilder $queryBu
6261
6362 $ queryBuilder ->join ('a.user ' , 'authUser ' , null , null , $ indexedBy )->shouldBeCalled ()->willReturn ($ queryBuilder );
6463
65- $ this ->setIndexedBy ($ indexedBy)-> shouldReturn ( $ this );
64+ $ join = $ this ->setIndexedBy ($ indexedBy );
6665
67- $ this ->modify ($ queryBuilder , 'a ' );
66+ $ join ->modify ($ queryBuilder , 'a ' );
6867 }
6968
7069 public function it_should_accept_specifications_as_condition (QueryBuilder $ queryBuilder , SpecificationInterface $ specification ): void
@@ -78,9 +77,8 @@ public function it_should_accept_specifications_as_condition(QueryBuilder $query
7877
7978 $ queryBuilder ->join ('a.user ' , 'authUser ' , $ type , $ condition , null )->shouldBeCalled ()->willReturn ($ queryBuilder );
8079
81- $ this ->setConditionType ($ type )->shouldReturn ($ this );
82- $ this ->setCondition ($ specification )->shouldReturn ($ this );
83- $ this ->modify ($ queryBuilder , 'a ' );
80+ $ join = $ this ->setConditionType ($ type )->setCondition ($ specification );
81+ $ join ->modify ($ queryBuilder , 'a ' );
8482 }
8583
8684 public function it_throws_an_exception_when_setting_illegal_type (): void
0 commit comments