From 546d19fd841b5805a7a7010b7bab0818e8e2fedb Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Thu, 12 May 2022 20:03:22 +0100 Subject: [PATCH] chore: cs --- src/Expectation.php | 2 +- tests/Features/Coverage.php | 2 +- tests/Features/Expect/toBe.php | 2 +- tests/Features/Expect/toHaveProperties.php | 10 +++++----- tests/Features/Expect/unless.php | 4 ++-- tests/Features/Expect/when.php | 4 ++-- tests/Unit/Actions/AddsTests.php | 2 +- tests/Unit/Support/Reflection.php | 2 +- tests/Unit/TestSuite.php | 12 ++++++------ tests/Visual/Help.php | 2 +- tests/Visual/Success.php | 2 +- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/Expectation.php b/src/Expectation.php index 3bc3bbd8..76bd0d35 100644 --- a/src/Expectation.php +++ b/src/Expectation.php @@ -723,7 +723,7 @@ final class Expectation try { Assert::assertTrue(Arr::has($array, $key)); - /* @phpstan-ignore-next-line */ + /* @phpstan-ignore-next-line */ } catch (ExpectationFailedException $exception) { throw new ExpectationFailedException("Failed asserting that an array has the key '$key'", $exception->getComparisonFailure()); } diff --git a/tests/Features/Coverage.php b/tests/Features/Coverage.php index e43ae180..7af61548 100644 --- a/tests/Features/Coverage.php +++ b/tests/Features/Coverage.php @@ -8,7 +8,7 @@ use Symfony\Component\Console\Output\ConsoleOutput; it('has plugin')->assertTrue(class_exists(CoveragePlugin::class)); it('adds coverage if --coverage exist', function () { - $plugin = new CoveragePlugin(new ConsoleOutput()); + $plugin = new CoveragePlugin(new ConsoleOutput()); $testSuite = TestSuite::getInstance(); expect($plugin->coverage)->toBeFalse(); diff --git a/tests/Features/Expect/toBe.php b/tests/Features/Expect/toBe.php index ef2bce5a..d73760b3 100644 --- a/tests/Features/Expect/toBe.php +++ b/tests/Features/Expect/toBe.php @@ -5,7 +5,7 @@ use PHPUnit\Framework\ExpectationFailedException; expect(true)->toBeTrue()->and(false)->toBeFalse(); test('strict comparisons', function () { - $nuno = new stdClass(); + $nuno = new stdClass(); $dries = new stdClass(); expect($nuno)->toBe($nuno)->not->toBe($dries); diff --git a/tests/Features/Expect/toHaveProperties.php b/tests/Features/Expect/toHaveProperties.php index ad3da1b0..aae1303c 100644 --- a/tests/Features/Expect/toHaveProperties.php +++ b/tests/Features/Expect/toHaveProperties.php @@ -3,24 +3,24 @@ use PHPUnit\Framework\ExpectationFailedException; test('pass', function () { - $object = new stdClass(); + $object = new stdClass(); $object->name = 'Jhon'; - $object->age = 21; + $object->age = 21; expect($object)->toHaveProperties(['name', 'age']); }); test('failures', function () { - $object = new stdClass(); + $object = new stdClass(); $object->name = 'Jhon'; expect($object)->toHaveProperties(['name', 'age']); })->throws(ExpectationFailedException::class); test('not failures', function () { - $object = new stdClass(); + $object = new stdClass(); $object->name = 'Jhon'; - $object->age = 21; + $object->age = 21; expect($object)->not->toHaveProperties(['name', 'age']); })->throws(ExpectationFailedException::class); diff --git a/tests/Features/Expect/unless.php b/tests/Features/Expect/unless.php index 9f11c7ef..0dabe2bb 100644 --- a/tests/Features/Expect/unless.php +++ b/tests/Features/Expect/unless.php @@ -3,9 +3,9 @@ use PHPUnit\Framework\ExpectationFailedException; beforeEach(function () { - $this->unlessObject = new stdClass(); + $this->unlessObject = new stdClass(); $this->unlessObject->trueValue = true; - $this->unlessObject->foo = 'foo'; + $this->unlessObject->foo = 'foo'; }); it('pass', function () { diff --git a/tests/Features/Expect/when.php b/tests/Features/Expect/when.php index db9fa4f1..3b62e2f8 100644 --- a/tests/Features/Expect/when.php +++ b/tests/Features/Expect/when.php @@ -3,9 +3,9 @@ use PHPUnit\Framework\ExpectationFailedException; beforeEach(function () { - $this->whenObject = new stdClass(); + $this->whenObject = new stdClass(); $this->whenObject->trueValue = true; - $this->whenObject->foo = 'foo'; + $this->whenObject->foo = 'foo'; }); it('pass', function () { diff --git a/tests/Unit/Actions/AddsTests.php b/tests/Unit/Actions/AddsTests.php index 31f30505..58a11ceb 100644 --- a/tests/Unit/Actions/AddsTests.php +++ b/tests/Unit/Actions/AddsTests.php @@ -23,7 +23,7 @@ test('default php unit tests', function () { }); it('removes warnings', function () { - $testSuite = new TestSuite(); + $testSuite = new TestSuite(); $warningTestCase = new WarningTestCase('No tests found in class "Pest\TestCase".'); $testSuite->addTest($warningTestCase); diff --git a/tests/Unit/Support/Reflection.php b/tests/Unit/Support/Reflection.php index 7ad76b0d..7e98bd76 100644 --- a/tests/Unit/Support/Reflection.php +++ b/tests/Unit/Support/Reflection.php @@ -10,7 +10,7 @@ it('gets file name from closure', function () { }); it('gets property values', function () { - $class = new class() { + $class = new class() { private $foo = 'bar'; }; diff --git a/tests/Unit/TestSuite.php b/tests/Unit/TestSuite.php index 84212879..b6c49f3f 100644 --- a/tests/Unit/TestSuite.php +++ b/tests/Unit/TestSuite.php @@ -8,7 +8,7 @@ use Pest\TestSuite; it('does not allow to add the same test description twice', function () { $testSuite = new TestSuite(getcwd(), 'tests'); - $test = function () {}; + $test = function () {}; $testSuite->tests->set(new TestCaseFactory(__FILE__, 'foo', $test)); $testSuite->tests->set(new TestCaseFactory(__FILE__, 'foo', $test)); })->throws( @@ -18,7 +18,7 @@ it('does not allow to add the same test description twice', function () { it('alerts users about tests with arguments but no input', function () { $testSuite = new TestSuite(getcwd(), 'tests'); - $test = function (int $arg) {}; + $test = function (int $arg) {}; $testSuite->tests->set(new TestCaseFactory(__FILE__, 'foo', $test)); })->throws( DatasetMissing::class, @@ -27,7 +27,7 @@ it('alerts users about tests with arguments but no input', function () { it('can return an array of all test suite filenames', function () { $testSuite = TestSuite::getInstance(getcwd(), 'tests'); - $test = function () {}; + $test = function () {}; $testSuite->tests->set(new TestCaseFactory(__FILE__, 'foo', $test)); $testSuite->tests->set(new TestCaseFactory(__FILE__, 'bar', $test)); @@ -39,9 +39,9 @@ it('can return an array of all test suite filenames', function () { it('can filter the test suite filenames to those with the only method', function () { $testSuite = new TestSuite(getcwd(), 'tests'); - $test = function () {}; + $test = function () {}; - $testWithOnly = new TestCaseFactory(__FILE__, 'foo', $test); + $testWithOnly = new TestCaseFactory(__FILE__, 'foo', $test); $testWithOnly->only = true; $testSuite->tests->set($testWithOnly); @@ -59,7 +59,7 @@ it('does not filter the test suite filenames to those with the only method when $test = function () {}; - $testWithOnly = new TestCaseFactory(__FILE__, 'foo', $test); + $testWithOnly = new TestCaseFactory(__FILE__, 'foo', $test); $testWithOnly->only = true; $testSuite->tests->set($testWithOnly); diff --git a/tests/Visual/Help.php b/tests/Visual/Help.php index e015108f..8088f9d3 100644 --- a/tests/Visual/Help.php +++ b/tests/Visual/Help.php @@ -8,7 +8,7 @@ test('visual snapshot of help command output', function () { if (getenv('REBUILD_SNAPSHOTS')) { $outputBuffer = new BufferedOutput(); - $plugin = new Help($outputBuffer); + $plugin = new Help($outputBuffer); $plugin(); diff --git a/tests/Visual/Success.php b/tests/Visual/Success.php index 4885255e..c64344f5 100644 --- a/tests/Visual/Success.php +++ b/tests/Visual/Success.php @@ -2,7 +2,7 @@ test('visual snapshot of test suite on success', function () { $testsPath = dirname(__DIR__); - $snapshot = implode(DIRECTORY_SEPARATOR, [ + $snapshot = implode(DIRECTORY_SEPARATOR, [ $testsPath, '.snapshots', 'success.txt',