chore: cs

This commit is contained in:
Nuno Maduro
2022-05-12 20:03:22 +01:00
parent c1b32b9ffb
commit 546d19fd84
11 changed files with 22 additions and 22 deletions

View File

@ -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());
}

View File

@ -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();

View File

@ -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);

View File

@ -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);

View File

@ -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 () {

View File

@ -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 () {

View File

@ -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);

View File

@ -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';
};

View File

@ -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);

View File

@ -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();

View File

@ -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',