From 8d670b4ed75572b1bb552d3a58b57562df2cc76e Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Tue, 15 Jun 2021 23:05:57 +0100 Subject: [PATCH] refactor: renames traits --- src/Concerns/{Expectations.php => Expectable.php} | 2 +- src/Concerns/{TestCase.php => Testable.php} | 2 +- src/Factories/TestCaseFactory.php | 4 ++-- src/HigherOrderExpectation.php | 4 ++-- src/Logging/JUnit.php | 4 ++-- src/Logging/TeamCity.php | 12 ++++++------ 6 files changed, 14 insertions(+), 14 deletions(-) rename src/Concerns/{Expectations.php => Expectable.php} (93%) rename src/Concerns/{TestCase.php => Testable.php} (99%) diff --git a/src/Concerns/Expectations.php b/src/Concerns/Expectable.php similarity index 93% rename from src/Concerns/Expectations.php rename to src/Concerns/Expectable.php index 27264f93..371bf8d4 100644 --- a/src/Concerns/Expectations.php +++ b/src/Concerns/Expectable.php @@ -9,7 +9,7 @@ use Pest\Expectation; /** * @internal */ -trait Expectations +trait Expectable { /** * Creates a new expectation. diff --git a/src/Concerns/TestCase.php b/src/Concerns/Testable.php similarity index 99% rename from src/Concerns/TestCase.php rename to src/Concerns/Testable.php index 650b94d1..5c72e0f3 100644 --- a/src/Concerns/TestCase.php +++ b/src/Concerns/Testable.php @@ -17,7 +17,7 @@ use Throwable; * * @internal */ -trait TestCase +trait Testable { /** * The test case description. Contains the first diff --git a/src/Factories/TestCaseFactory.php b/src/Factories/TestCaseFactory.php index b78c67bf..6efe63f4 100644 --- a/src/Factories/TestCaseFactory.php +++ b/src/Factories/TestCaseFactory.php @@ -79,8 +79,8 @@ final class TestCaseFactory * @var array */ public $traits = [ - Concerns\TestCase::class, - Concerns\Expectations::class, + Concerns\Testable::class, + Concerns\Expectable::class, ]; /** diff --git a/src/HigherOrderExpectation.php b/src/HigherOrderExpectation.php index 7907ccb0..90044d6a 100644 --- a/src/HigherOrderExpectation.php +++ b/src/HigherOrderExpectation.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace Pest; -use Pest\Concerns\Expectations; +use Pest\Concerns\Expectable; /** * @internal @@ -13,7 +13,7 @@ use Pest\Concerns\Expectations; */ final class HigherOrderExpectation { - use Expectations; + use Expectable; /** * @var Expectation diff --git a/src/Logging/JUnit.php b/src/Logging/JUnit.php index 440bf5cd..da15a9b9 100644 --- a/src/Logging/JUnit.php +++ b/src/Logging/JUnit.php @@ -18,7 +18,7 @@ use DOMElement; use Exception; use function get_class; use function method_exists; -use Pest\Concerns\TestCase; +use Pest\Concerns\Testable; use PHPUnit\Framework\AssertionFailedError; use PHPUnit\Framework\ExceptionWrapper; use PHPUnit\Framework\SelfDescribing; @@ -266,7 +266,7 @@ final class JUnit extends Printer implements TestListener /** * A test started. * - * @param Test|TestCase $test + * @param Test|Testable $test */ public function startTest(Test $test): void { diff --git a/src/Logging/TeamCity.php b/src/Logging/TeamCity.php index 16ea016f..fded41e4 100644 --- a/src/Logging/TeamCity.php +++ b/src/Logging/TeamCity.php @@ -5,7 +5,7 @@ declare(strict_types=1); namespace Pest\Logging; use function getmypid; -use Pest\Concerns\TestCase; +use Pest\Concerns\Testable; use PHPUnit\Framework\AssertionFailedError; use PHPUnit\Framework\Test; use PHPUnit\Framework\TestResult; @@ -109,7 +109,7 @@ final class TeamCity extends DefaultResultPrinter } /** - * @param Test|TestCase $test + * @param Test|Testable $test */ public function startTest(Test $test): void { @@ -127,7 +127,7 @@ final class TeamCity extends DefaultResultPrinter } /** - * @param Test|TestCase $test + * @param Test|Testable $test */ public function endTest(Test $test, float $time): void { @@ -144,7 +144,7 @@ final class TeamCity extends DefaultResultPrinter } /** - * @param Test|TestCase $test + * @param Test|Testable $test */ public function addError(Test $test, Throwable $t, float $time): void { @@ -154,7 +154,7 @@ final class TeamCity extends DefaultResultPrinter /** * @phpstan-ignore-next-line * - * @param Test|TestCase $test + * @param Test|Testable $test */ public function addWarning(Test $test, Warning $e, float $time): void { @@ -208,6 +208,6 @@ final class TeamCity extends DefaultResultPrinter /** @var array $uses */ $uses = class_uses($test); - return in_array(TestCase::class, $uses, true); + return in_array(Testable::class, $uses, true); } }