File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,15 @@ protected function buildExpect(MethodCall $methodCall): Expr
6262 );
6363 }
6464
65+ private function getActualPosition (): int
66+ {
67+ if ($ this ->oldName === 'assertThat ' ) {
68+ return 0 ;
69+ }
70+
71+ return $ this ->argumentCount >= 3 ? 1 : 0 ;
72+ }
73+
6574 /**
6675 * Extract the expected arguments.
6776 *
@@ -70,7 +79,7 @@ protected function buildExpect(MethodCall $methodCall): Expr
7079 */
7180 private function expected (array $ args ): array
7281 {
73- $ actualPosition = $ this ->argumentCount >= 3 ? 1 : 0 ;
82+ $ actualPosition = $ this ->getActualPosition () ;
7483
7584 unset($ args [$ actualPosition ]);
7685
@@ -84,7 +93,7 @@ private function expected(array $args): array
8493 */
8594 private function actual (array $ args ): Arg |VariadicPlaceholder
8695 {
87- $ actualPosition = $ this ->argumentCount >= 3 ? 1 : 0 ;
96+ $ actualPosition = $ this ->getActualPosition () ;
8897
8998 $ actualArgument = $ args [$ actualPosition ];
9099
Original file line number Diff line number Diff line change @@ -1213,7 +1213,7 @@ public function test_assert_matches_regular_expression()
12131213 class MyTest {
12141214 public function test_assert_that()
12151215 {
1216- $this->assertThat(new IsTrue(), true );
1216+ $this->assertThat(true, new IsTrue());
12171217 }
12181218 }
12191219 ' ;
You can’t perform that action at this time.
0 commit comments