From 22c169fd60784b3e202f09a4f26f736c464ff118 Mon Sep 17 00:00:00 2001 From: tomschlick Date: Sun, 29 Jan 2023 07:05:22 +0000 Subject: [PATCH] Fix styling --- tests/IntEnum.php | 1 - tests/LaravelEnumsTest.php | 42 ++++++++++++++++---------------------- tests/StringEnum.php | 1 - tests/TestCase.php | 1 - 4 files changed, 18 insertions(+), 27 deletions(-) diff --git a/tests/IntEnum.php b/tests/IntEnum.php index e2583bd..69030d2 100644 --- a/tests/IntEnum.php +++ b/tests/IntEnum.php @@ -14,4 +14,3 @@ enum IntEnum: int case TWO = 2; case THREE = 3; } - diff --git a/tests/LaravelEnumsTest.php b/tests/LaravelEnumsTest.php index 8ba70c7..3398793 100644 --- a/tests/LaravelEnumsTest.php +++ b/tests/LaravelEnumsTest.php @@ -2,43 +2,37 @@ declare(strict_types=1); - use ReturnEarly\LaravelEnums\Tests\IntEnum; use ReturnEarly\LaravelEnums\Tests\StringEnum; -test('int enums can be called statically for a value', function() { +test('int enums can be called statically for a value', function () { $this->assertEquals(1, IntEnum::ONE()); }); - -test('string enums can be called statically for a value', function() { +test('string enums can be called statically for a value', function () { $this->assertEquals('A', StringEnum::A()); }); - -test('an enum can be checked with is', function() { +test('an enum can be checked with is', function () { $this->assertTrue(IntEnum::ONE->is(IntEnum::ONE)); $this->assertFalse(IntEnum::ONE->is(IntEnum::TWO)); }); - -test('an enum can be checked with is not', function() { +test('an enum can be checked with is not', function () { $this->assertTrue(IntEnum::ONE->isNot(IntEnum::TWO)); $this->assertFalse(IntEnum::ONE->isNot(IntEnum::ONE)); }); - -test('an int enum can check if its value is between others', function() { +test('an int enum can check if its value is between others', function () { $this->assertTrue(IntEnum::TWO->isBetween(IntEnum::ONE, IntEnum::THREE)); $this->assertFalse(IntEnum::ONE->isBetween(IntEnum::TWO, IntEnum::THREE)); }); - -test('an int enum can check if the collection contains its value', function() { +test('an int enum can check if the collection contains its value', function () { $this->assertTrue(IntEnum::contains('2')); }); -test('an enum can manifest as a collection', function() { +test('an enum can manifest as a collection', function () { $this->assertEquals( [ IntEnum::ONE, @@ -49,7 +43,7 @@ ); }); -test('an enum can get its values as a collection', function() { +test('an enum can get its values as a collection', function () { $this->assertEquals( [ 1, @@ -60,7 +54,7 @@ ); }); -test('an enum can get its names as a collection', function() { +test('an enum can get its names as a collection', function () { $this->assertEquals( [ 'ONE', @@ -71,7 +65,7 @@ ); }); -test('an enum can get its values as a select array', function() { +test('an enum can get its values as a select array', function () { $this->assertEquals( [ 1 => 'ONE', @@ -82,38 +76,38 @@ ); }); -test('an enum can get its values between two others excluding those others', function() { +test('an enum can get its values between two others excluding those others', function () { expect(IntEnum::valuesBetween(IntEnum::ONE, IntEnum::THREE, false)->toArray()) ->toHaveCount(1); }); -test('an enum can get its values between two others including those others', function() { +test('an enum can get its values between two others including those others', function () { expect(IntEnum::valuesBetween(IntEnum::ONE, IntEnum::THREE, true)->toArray()) ->toHaveCount(3); }); -test('an enum can check if it is any of a list of enums', function() { +test('an enum can check if it is any of a list of enums', function () { $this->assertTrue(IntEnum::ONE->isAny([IntEnum::ONE, IntEnum::TWO])); $this->assertFalse(IntEnum::ONE->isAny([IntEnum::TWO, IntEnum::THREE])); }); -test('an enum can be created from a value', function() { +test('an enum can be created from a value', function () { $this->assertEquals(IntEnum::ONE, IntEnum::fromValue(1)); }); -test('an enum can be created from another enum', function() { +test('an enum can be created from another enum', function () { $this->assertEquals(IntEnum::ONE, IntEnum::fromValue(IntEnum::ONE)); }); -test('an enum can get its name', function() { +test('an enum can get its name', function () { $this->assertEquals('ONE', IntEnum::ONE->name()); }); -test('an enum can get its value', function() { +test('an enum can get its value', function () { $this->assertEquals(1, IntEnum::ONE->value()); }); -test('a missing method throws a bad method call exception', function() { +test('a missing method throws a bad method call exception', function () { $this->expectException(BadMethodCallException::class); IntEnum::FOUR(); }); diff --git a/tests/StringEnum.php b/tests/StringEnum.php index e018106..acd4578 100644 --- a/tests/StringEnum.php +++ b/tests/StringEnum.php @@ -14,4 +14,3 @@ enum StringEnum: string case B = 'B'; case C = 'C'; } - diff --git a/tests/TestCase.php b/tests/TestCase.php index 85b5a6c..2f219c9 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -16,6 +16,5 @@ protected function getPackageProviders($app): array public function getEnvironmentSetUp($app) { - } }