@@ -158,34 +158,25 @@ public function testJoin(): void
158158 {
159159 $ select = new Select ();
160160
161- // First mutation
162161 $ result = $ select ->join ('foo ' , 'x = y ' );
163162
164- // Verify fluent interface
165163 self ::assertSame ($ select , $ result );
166164
167- // Verify the first mutation occurred
168165 $ joins = $ select ->getRawState ('joins ' );
169166 self ::assertInstanceOf (Join::class, $ joins );
170- self ::assertEquals (
171- [
172- [
173- 'name ' => 'foo ' ,
174- 'on ' => 'x = y ' ,
175- 'columns ' => [Select::SQL_STAR ],
176- 'type ' => Select::JOIN_INNER ,
177- ],
178- ],
179- $ joins ->getJoins ()
180- );
167+ $ joinList = $ joins ->getJoins ();
168+ self ::assertCount (1 , $ joinList );
169+ self ::assertInstanceOf (TableIdentifier::class, $ joinList [0 ]['name ' ]);
170+ self ::assertEquals ('foo ' , $ joinList [0 ]['name ' ]->getTable ());
171+ self ::assertEquals ('x = y ' , $ joinList [0 ]['on ' ]);
172+ self ::assertEquals (Select::JOIN_INNER , $ joinList [0 ]['type ' ]);
181173
182- // Second mutation to verify mutability (joins accumulate)
183174 $ select ->join ('bar ' , 'a = b ' );
184175
185- // Verify the instance was actually mutated
186176 $ joins2 = $ select ->getRawState ('joins ' );
187177 self ::assertCount (2 , $ joins2 ->getJoins ());
188- self ::assertEquals ('bar ' , $ joins2 ->getJoins ()[1 ]['name ' ]);
178+ self ::assertInstanceOf (TableIdentifier::class, $ joins2 ->getJoins ()[1 ]['name ' ]);
179+ self ::assertEquals ('bar ' , $ joins2 ->getJoins ()[1 ]['name ' ]->getTable ());
189180 }
190181
191182 #[TestDox('unit test: Test join() exception with bad join ' )]
@@ -631,10 +622,12 @@ public function testReset(): void
631622 $ select ->join ('foo ' , 'id = boo ' );
632623 $ joins = $ select ->getRawState (Select::JOINS );
633624 self ::assertInstanceOf (Join::class, $ joins );
634- self ::assertEquals (
635- [['name ' => 'foo ' , 'on ' => 'id = boo ' , 'columns ' => ['* ' ], 'type ' => 'INNER ' ]],
636- $ joins ->getJoins ()
637- );
625+ $ joinList = $ joins ->getJoins ();
626+ self ::assertCount (1 , $ joinList );
627+ self ::assertInstanceOf (TableIdentifier::class, $ joinList [0 ]['name ' ]);
628+ self ::assertEquals ('foo ' , $ joinList [0 ]['name ' ]->getTable ());
629+ self ::assertEquals ('id = boo ' , $ joinList [0 ]['on ' ]);
630+ self ::assertEquals ('INNER ' , $ joinList [0 ]['type ' ]);
638631 $ select ->reset (Select::JOINS );
639632 $ emptyJoins = $ select ->getRawState (Select::JOINS );
640633 self ::assertInstanceOf (Join::class, $ emptyJoins );
0 commit comments