@@ -42,7 +42,7 @@ |
||
| 42 | 42 | $listener = new TestListenerAdapter; |
| 43 | 43 | $listener->add($this->extension); |
| 44 | 44 | |
| 45 | - $this->result = new TestResult; |
|
| 45 | + $this->result = new TestResult; |
|
| 46 | 46 | $this->result->addListener($listener); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -102,7 +102,7 @@ |
||
| 102 | 102 | |
| 103 | 103 | $actual = Xml::xmlToVariable($dom->documentElement); |
| 104 | 104 | |
| 105 | - $this->assertSame($expected, (array) $actual); |
|
| 105 | + $this->assertSame($expected, (array)$actual); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | public function testXmlToVariableCanConstructObjectsWithConstructorArgumentsRecursively(): void |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | $this->assertFalse(\FOO); |
| 381 | 381 | $this->assertTrue(\BAR); |
| 382 | 382 | $this->assertFalse($GLOBALS['foo']); |
| 383 | - $this->assertTrue((bool) $_ENV['foo']); |
|
| 383 | + $this->assertTrue((bool)$_ENV['foo']); |
|
| 384 | 384 | $this->assertEquals(1, \getenv('foo')); |
| 385 | 385 | $this->assertEquals('bar', $_POST['foo']); |
| 386 | 386 | $this->assertEquals('bar', $_GET['foo']); |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | $this->assertEquals('putenv', \getenv('foo')); |
| 438 | 438 | |
| 439 | 439 | if ($backupFoo === false) { |
| 440 | - \putenv('foo'); // delete variable from environment |
|
| 440 | + \putenv('foo'); // delete variable from environment |
|
| 441 | 441 | } else { |
| 442 | 442 | \putenv("foo=$backupFoo"); |
| 443 | 443 | } |
@@ -125,19 +125,19 @@ discard block |
||
| 125 | 125 | public function requirementsProvider(): array |
| 126 | 126 | { |
| 127 | 127 | return [ |
| 128 | - ['testOne', []], |
|
| 129 | - ['testTwo', ['PHPUnit' => ['version' => '1.0', 'operator' => '']]], |
|
| 130 | - ['testThree', ['PHP' => ['version' => '2.0', 'operator' => '']]], |
|
| 131 | - ['testFour', [ |
|
| 128 | + ['testOne', []], |
|
| 129 | + ['testTwo', ['PHPUnit' => ['version' => '1.0', 'operator' => '']]], |
|
| 130 | + ['testThree', ['PHP' => ['version' => '2.0', 'operator' => '']]], |
|
| 131 | + ['testFour', [ |
|
| 132 | 132 | 'PHPUnit' => ['version' => '2.0', 'operator' => ''], |
| 133 | 133 | 'PHP' => ['version' => '1.0', 'operator' => ''], |
| 134 | 134 | ]], |
| 135 | - ['testFive', ['PHP' => ['version' => '5.4.0RC6', 'operator' => '']]], |
|
| 136 | - ['testSix', ['PHP' => ['version' => '5.4.0-alpha1', 'operator' => '']]], |
|
| 137 | - ['testSeven', ['PHP' => ['version' => '5.4.0beta2', 'operator' => '']]], |
|
| 138 | - ['testEight', ['PHP' => ['version' => '5.4-dev', 'operator' => '']]], |
|
| 139 | - ['testNine', ['functions' => ['testFunc']]], |
|
| 140 | - ['testTen', ['extensions' => ['testExt']]], |
|
| 135 | + ['testFive', ['PHP' => ['version' => '5.4.0RC6', 'operator' => '']]], |
|
| 136 | + ['testSix', ['PHP' => ['version' => '5.4.0-alpha1', 'operator' => '']]], |
|
| 137 | + ['testSeven', ['PHP' => ['version' => '5.4.0beta2', 'operator' => '']]], |
|
| 138 | + ['testEight', ['PHP' => ['version' => '5.4-dev', 'operator' => '']]], |
|
| 139 | + ['testNine', ['functions' => ['testFunc']]], |
|
| 140 | + ['testTen', ['extensions' => ['testExt']]], |
|
| 141 | 141 | ['testEleven', [ |
| 142 | 142 | 'OS' => 'SunOS', |
| 143 | 143 | 'OSFAMILY' => 'Solaris', |
@@ -515,12 +515,12 @@ discard block |
||
| 515 | 515 | public function missingRequirementsProvider(): array |
| 516 | 516 | { |
| 517 | 517 | return [ |
| 518 | - ['testOne', []], |
|
| 519 | - ['testNine', ['Function testFunc is required.']], |
|
| 520 | - ['testTen', ['Extension testExt is required.']], |
|
| 521 | - ['testAlwaysSkip', ['PHPUnit >= 1111111 is required.']], |
|
| 522 | - ['testAlwaysSkip2', ['PHP >= 9999999 is required.']], |
|
| 523 | - ['testAlwaysSkip3', ['Operating system matching /DOESNOTEXIST/i is required.']], |
|
| 518 | + ['testOne', []], |
|
| 519 | + ['testNine', ['Function testFunc is required.']], |
|
| 520 | + ['testTen', ['Extension testExt is required.']], |
|
| 521 | + ['testAlwaysSkip', ['PHPUnit >= 1111111 is required.']], |
|
| 522 | + ['testAlwaysSkip2', ['PHP >= 9999999 is required.']], |
|
| 523 | + ['testAlwaysSkip3', ['Operating system matching /DOESNOTEXIST/i is required.']], |
|
| 524 | 524 | ['testAllPossibleRequirements', [ |
| 525 | 525 | 'PHP >= 99-dev is required.', |
| 526 | 526 | 'PHPUnit >= 9-dev is required.', |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | |
| 119 | 119 | public function testExceptionInSetUp(): void |
| 120 | 120 | { |
| 121 | - $test = new \ExceptionInSetUpTest('testSomething'); |
|
| 121 | + $test = new \ExceptionInSetUpTest('testSomething'); |
|
| 122 | 122 | $test->run(); |
| 123 | 123 | |
| 124 | 124 | $this->assertTrue($test->setUp); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | public function testExceptionInAssertPreConditions(): void |
| 132 | 132 | { |
| 133 | - $test = new \ExceptionInAssertPreConditionsTest('testSomething'); |
|
| 133 | + $test = new \ExceptionInAssertPreConditionsTest('testSomething'); |
|
| 134 | 134 | $test->run(); |
| 135 | 135 | |
| 136 | 136 | $this->assertTrue($test->setUp); |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | public function testExceptionInTest(): void |
| 144 | 144 | { |
| 145 | - $test = new \ExceptionInTest('testSomething'); |
|
| 145 | + $test = new \ExceptionInTest('testSomething'); |
|
| 146 | 146 | $test->run(); |
| 147 | 147 | |
| 148 | 148 | $this->assertTrue($test->setUp); |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | public function testExceptionInAssertPostConditions(): void |
| 156 | 156 | { |
| 157 | - $test = new \ExceptionInAssertPostConditionsTest('testSomething'); |
|
| 157 | + $test = new \ExceptionInAssertPostConditionsTest('testSomething'); |
|
| 158 | 158 | $test->run(); |
| 159 | 159 | |
| 160 | 160 | $this->assertTrue($test->setUp); |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | |
| 167 | 167 | public function testExceptionInTearDown(): void |
| 168 | 168 | { |
| 169 | - $test = new \ExceptionInTearDownTest('testSomething'); |
|
| 169 | + $test = new \ExceptionInTearDownTest('testSomething'); |
|
| 170 | 170 | $test->run(); |
| 171 | 171 | |
| 172 | 172 | $this->assertTrue($test->setUp); |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | |
| 181 | 181 | public function testExceptionInTestIsDetectedInTeardown(): void |
| 182 | 182 | { |
| 183 | - $test = new \ExceptionInTestDetectedInTeardown('testSomething'); |
|
| 183 | + $test = new \ExceptionInTestDetectedInTeardown('testSomething'); |
|
| 184 | 184 | $test->run(); |
| 185 | 185 | |
| 186 | 186 | $this->assertTrue($test->exceptionDetected); |
@@ -558,7 +558,7 @@ discard block |
||
| 558 | 558 | |
| 559 | 559 | public function testSkipsIfRequiresNonExistingExtension(): void |
| 560 | 560 | { |
| 561 | - $test = new \RequirementsTest('testTen'); |
|
| 561 | + $test = new \RequirementsTest('testTen'); |
|
| 562 | 562 | $test->run(); |
| 563 | 563 | |
| 564 | 564 | $this->assertEquals( |
@@ -569,7 +569,7 @@ discard block |
||
| 569 | 569 | |
| 570 | 570 | public function testSkipsIfRequiresExtensionWithAMinimumVersion(): void |
| 571 | 571 | { |
| 572 | - $test = new \RequirementsTest('testSpecificExtensionVersion'); |
|
| 572 | + $test = new \RequirementsTest('testSpecificExtensionVersion'); |
|
| 573 | 573 | $test->run(); |
| 574 | 574 | |
| 575 | 575 | $this->assertEquals( |
@@ -580,7 +580,7 @@ discard block |
||
| 580 | 580 | |
| 581 | 581 | public function testSkipsProvidesMessagesForAllSkippingReasons(): void |
| 582 | 582 | { |
| 583 | - $test = new \RequirementsTest('testAllPossibleRequirements'); |
|
| 583 | + $test = new \RequirementsTest('testAllPossibleRequirements'); |
|
| 584 | 584 | $test->run(); |
| 585 | 585 | |
| 586 | 586 | $this->assertEquals( |
@@ -627,7 +627,7 @@ discard block |
||
| 627 | 627 | |
| 628 | 628 | public function testRequiringASetting(): void |
| 629 | 629 | { |
| 630 | - $test = new \RequirementsTest('testSettingDisplayErrorsOn'); |
|
| 630 | + $test = new \RequirementsTest('testSettingDisplayErrorsOn'); |
|
| 631 | 631 | |
| 632 | 632 | // Get this so we can return it to whatever it was before the test. |
| 633 | 633 | $displayErrorsVal = \ini_get('display_errors'); |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | //Stop |
| 56 | 56 | $result->stopOnIncomplete(true); |
| 57 | 57 | $result->addError($test, $throwable, $time); |
| 58 | - $this->assertAttributeEquals(2 * $time, 'time', $result); |
|
| 58 | + $this->assertAttributeEquals(2*$time, 'time', $result); |
|
| 59 | 59 | $this->assertAttributeCount(2, 'notImplemented', $result); |
| 60 | 60 | $this->assertAttributeEquals(true, 'stop', $result); |
| 61 | 61 | //Final checks |
@@ -589,7 +589,7 @@ discard block |
||
| 589 | 589 | ->method('doSomethingElse') |
| 590 | 590 | ->will( |
| 591 | 591 | $this->returnCallback( |
| 592 | - function () use (&$actualArguments): void { |
|
| 592 | + function() use (&$actualArguments): void { |
|
| 593 | 593 | $actualArguments = \func_get_args(); |
| 594 | 594 | } |
| 595 | 595 | ) |
@@ -617,7 +617,7 @@ discard block |
||
| 617 | 617 | ->method('doSomethingElse') |
| 618 | 618 | ->will( |
| 619 | 619 | $this->returnCallback( |
| 620 | - function () use (&$actualArguments): void { |
|
| 620 | + function() use (&$actualArguments): void { |
|
| 621 | 621 | $actualArguments = \func_get_args(); |
| 622 | 622 | } |
| 623 | 623 | ) |
@@ -846,7 +846,7 @@ discard block |
||
| 846 | 846 | $foo->expects($this->any()) |
| 847 | 847 | ->method('bar') |
| 848 | 848 | ->will($this->returnCallback( |
| 849 | - function (&$a, &$b, $c): void { |
|
| 849 | + function(&$a, &$b, $c): void { |
|
| 850 | 850 | $b = 1; |
| 851 | 851 | } |
| 852 | 852 | )); |
@@ -1000,7 +1000,7 @@ discard block |
||
| 1000 | 1000 | /** @var PHPUnit\Framework\MockObject\MockObject|StringableClass $mock */ |
| 1001 | 1001 | $mock = $this->getMockBuilder(StringableClass::class)->getMock(); |
| 1002 | 1002 | |
| 1003 | - $this->assertIsString((string) $mock); |
|
| 1003 | + $this->assertIsString((string)$mock); |
|
| 1004 | 1004 | } |
| 1005 | 1005 | |
| 1006 | 1006 | public function testStringableClassCanBeMocked(): void |
@@ -1010,7 +1010,7 @@ discard block |
||
| 1010 | 1010 | |
| 1011 | 1011 | $mock->method('__toString')->willReturn('foo'); |
| 1012 | 1012 | |
| 1013 | - $this->assertSame('foo', (string) $mock); |
|
| 1013 | + $this->assertSame('foo', (string)$mock); |
|
| 1014 | 1014 | } |
| 1015 | 1015 | |
| 1016 | 1016 | public function traversableProvider(): array |
@@ -1032,7 +1032,7 @@ discard block |
||
| 1032 | 1032 | $callCount = 0; |
| 1033 | 1033 | |
| 1034 | 1034 | $mock->expects($this->exactly($expectedNumberOfCalls))->method('bar') |
| 1035 | - ->with($this->callback(function ($argument) use (&$callCount) { |
|
| 1035 | + ->with($this->callback(function($argument) use (&$callCount) { |
|
| 1036 | 1036 | return $argument === 'call_' . $callCount++; |
| 1037 | 1037 | })); |
| 1038 | 1038 | |
@@ -1076,7 +1076,7 @@ discard block |
||
| 1076 | 1076 | ->disableAutoReturnValueGeneration() |
| 1077 | 1077 | ->getMock(); |
| 1078 | 1078 | |
| 1079 | - (string) $mock; |
|
| 1079 | + (string)$mock; |
|
| 1080 | 1080 | |
| 1081 | 1081 | try { |
| 1082 | 1082 | $mock->__phpunit_verify(); |
@@ -980,7 +980,7 @@ discard block |
||
| 980 | 980 | |
| 981 | 981 | public function testAssertObjectHasAttributeMultiByteAttribute(): void |
| 982 | 982 | { |
| 983 | - $object = new \stdClass; |
|
| 983 | + $object = new \stdClass; |
|
| 984 | 984 | $object->{'東京'} = 2020; |
| 985 | 985 | |
| 986 | 986 | $this->assertObjectHasAttribute('東京', $object); |
@@ -1015,7 +1015,7 @@ discard block |
||
| 1015 | 1015 | |
| 1016 | 1016 | public function testAssertObjectNotHasAttributeMultiByteAttribute(): void |
| 1017 | 1017 | { |
| 1018 | - $object = new \stdClass; |
|
| 1018 | + $object = new \stdClass; |
|
| 1019 | 1019 | $object->{'東京'} = 2020; |
| 1020 | 1020 | |
| 1021 | 1021 | $this->assertObjectNotHasAttribute('長野', $object); |
@@ -2059,7 +2059,7 @@ discard block |
||
| 2059 | 2059 | { |
| 2060 | 2060 | $this->assertThat( |
| 2061 | 2061 | null, |
| 2062 | - $this->callback(function ($other) { |
|
| 2062 | + $this->callback(function($other) { |
|
| 2063 | 2063 | return true; |
| 2064 | 2064 | }) |
| 2065 | 2065 | ); |
@@ -2768,7 +2768,7 @@ discard block |
||
| 2768 | 2768 | |
| 2769 | 2769 | public function testCallableTypeCanBeAsserted(): void |
| 2770 | 2770 | { |
| 2771 | - $this->assertIsCallable(function () { |
|
| 2771 | + $this->assertIsCallable(function() { |
|
| 2772 | 2772 | }); |
| 2773 | 2773 | |
| 2774 | 2774 | try { |
@@ -2915,7 +2915,7 @@ discard block |
||
| 2915 | 2915 | $this->assertIsNotCallable(null); |
| 2916 | 2916 | |
| 2917 | 2917 | try { |
| 2918 | - $this->assertIsNotCallable(function () { |
|
| 2918 | + $this->assertIsNotCallable(function() { |
|
| 2919 | 2919 | }); |
| 2920 | 2920 | } catch (AssertionFailedError $e) { |
| 2921 | 2921 | return; |
@@ -3099,7 +3099,7 @@ discard block |
||
| 3099 | 3099 | [0, 0], |
| 3100 | 3100 | // floats |
| 3101 | 3101 | [2.3, 2.3], |
| 3102 | - [1 / 3, 1 - 2 / 3], |
|
| 3102 | + [1/3, 1 - 2/3], |
|
| 3103 | 3103 | [\log(0), \log(0)], |
| 3104 | 3104 | // arrays |
| 3105 | 3105 | [[], []], |
@@ -3359,8 +3359,8 @@ discard block |
||
| 3359 | 3359 | ['0', 0], |
| 3360 | 3360 | [2.3, '2.3'], |
| 3361 | 3361 | ['2.3', 2.3], |
| 3362 | - [(string) (1 / 3), 1 - 2 / 3], |
|
| 3363 | - [1 / 3, (string) (1 - 2 / 3)], |
|
| 3362 | + [(string)(1/3), 1 - 2/3], |
|
| 3363 | + [1/3, (string)(1 - 2/3)], |
|
| 3364 | 3364 | ['string representation', new \ClassWithToString], |
| 3365 | 3365 | [new \ClassWithToString, 'string representation'], |
| 3366 | 3366 | ]; |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | 8, |
| 43 | 43 | ]; |
| 44 | 44 | |
| 45 | - $constraints = \array_map(function (int $count) { |
|
| 45 | + $constraints = \array_map(function(int $count) { |
|
| 46 | 46 | return \CountConstraint::fromCount($count); |
| 47 | 47 | }, $counts); |
| 48 | 48 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | 'is rich in unsaturated fats', |
| 64 | 64 | ]; |
| 65 | 65 | |
| 66 | - $constraints = \array_map(function (string $name) { |
|
| 66 | + $constraints = \array_map(function(string $name) { |
|
| 67 | 67 | return \NamedConstraint::fromName($name); |
| 68 | 68 | }, $names); |
| 69 | 69 | |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | { |
| 230 | 230 | return \implode( |
| 231 | 231 | ' and ', |
| 232 | - \array_map(function (Constraint $constraint) { |
|
| 232 | + \array_map(function(Constraint $constraint) { |
|
| 233 | 233 | return $constraint->toString(); |
| 234 | 234 | }, $constraints) |
| 235 | 235 | ); |