File tree Expand file tree Collapse file tree 3 files changed +11
-15
lines changed Expand file tree Collapse file tree 3 files changed +11
-15
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,8 @@ final class RequiresProcessorTest extends TestCase
23
23
public function testProcessProcessesRequirement () : void
24
24
{
25
25
$ requirement = $ this ->createMock (Requirement::class);
26
- $ requirement ->expects ($ this -> once ())->method ('getName ' )->willReturn ('Foobar ' );
27
- $ requirement ->expects ($ this -> once ())->method ('check ' )->with ('42 ' )->willReturn (null );
26
+ $ requirement ->expects (self :: once ())->method ('getName ' )->willReturn ('Foobar ' );
27
+ $ requirement ->expects (self :: once ())->method ('check ' )->with ('42 ' )->willReturn (null );
28
28
29
29
$ processor = new RequiresProcessor ([$ requirement ]);
30
30
$ processor ->process ('Foobar 42 ' );
@@ -33,8 +33,8 @@ public function testProcessProcessesRequirement() : void
33
33
public function testProcessProcessesRequirementWithoutValue () : void
34
34
{
35
35
$ requirement = $ this ->createMock (Requirement::class);
36
- $ requirement ->expects ($ this -> once ())->method ('getName ' )->willReturn ('Foobar ' );
37
- $ requirement ->expects ($ this -> once ())->method ('check ' )->with ('' )->willReturn (null );
36
+ $ requirement ->expects (self :: once ())->method ('getName ' )->willReturn ('Foobar ' );
37
+ $ requirement ->expects (self :: once ())->method ('check ' )->with ('' )->willReturn (null );
38
38
39
39
$ processor = new RequiresProcessor ([$ requirement ]);
40
40
$ processor ->process ('Foobar ' );
Original file line number Diff line number Diff line change @@ -34,17 +34,17 @@ protected function setUp() : void
34
34
35
35
public function testVerifySucceeds () : void
36
36
{
37
- $ this ->context ->expects ($ this -> atLeastOnce ())->method ('getExpression ' )->willReturn ('a + b === 3 ' );
38
- $ this ->context ->expects ($ this -> atLeastOnce ())->method ('getValues ' )->willReturn (['a ' => 1 , 'b ' => 2 ]);
37
+ $ this ->context ->expects (self :: atLeastOnce ())->method ('getExpression ' )->willReturn ('a + b === 3 ' );
38
+ $ this ->context ->expects (self :: atLeastOnce ())->method ('getValues ' )->willReturn (['a ' => 1 , 'b ' => 2 ]);
39
39
40
40
$ expectation = new ExpressionExpectation ($ this ->context );
41
41
$ expectation ->verify ();
42
42
}
43
43
44
44
public function testVerifyFails () : void
45
45
{
46
- $ this ->context ->expects ($ this -> atLeastOnce ())->method ('getExpression ' )->willReturn ('a + b === 3 ' );
47
- $ this ->context ->expects ($ this -> atLeastOnce ())->method ('getValues ' )->willReturn (['a ' => 1 , 'b ' => 7 ]);
46
+ $ this ->context ->expects (self :: atLeastOnce ())->method ('getExpression ' )->willReturn ('a + b === 3 ' );
47
+ $ this ->context ->expects (self :: atLeastOnce ())->method ('getValues ' )->willReturn (['a ' => 1 , 'b ' => 7 ]);
48
48
49
49
$ expectation = new ExpressionExpectation ($ this ->context );
50
50
Original file line number Diff line number Diff line change @@ -20,12 +20,8 @@ trait PHPUnitCompat
20
20
{
21
21
public function expectExceptionMessageMatches (string $ regularExpression ) : void
22
22
{
23
- if (\is_callable ('parent::expectExceptionMessageMatches ' )) {
24
- parent ::expectExceptionMessageMatches ($ regularExpression );
25
-
26
- return ;
27
- }
28
-
29
- parent ::expectExceptionMessageRegExp ($ regularExpression );
23
+ \is_callable ('parent::expectExceptionMessageMatches ' )
24
+ ? parent ::expectExceptionMessageMatches ($ regularExpression )
25
+ : parent ::expectExceptionMessageRegExp ($ regularExpression );
30
26
}
31
27
}
You can’t perform that action at this time.
0 commit comments