refactor: renames traits

This commit is contained in:
Nuno Maduro
2021-06-15 23:05:57 +01:00
parent 624f6e0acc
commit 8d670b4ed7
6 changed files with 14 additions and 14 deletions

View File

@ -9,7 +9,7 @@ use Pest\Expectation;
/** /**
* @internal * @internal
*/ */
trait Expectations trait Expectable
{ {
/** /**
* Creates a new expectation. * Creates a new expectation.

View File

@ -17,7 +17,7 @@ use Throwable;
* *
* @internal * @internal
*/ */
trait TestCase trait Testable
{ {
/** /**
* The test case description. Contains the first * The test case description. Contains the first

View File

@ -79,8 +79,8 @@ final class TestCaseFactory
* @var array <int, string> * @var array <int, string>
*/ */
public $traits = [ public $traits = [
Concerns\TestCase::class, Concerns\Testable::class,
Concerns\Expectations::class, Concerns\Expectable::class,
]; ];
/** /**

View File

@ -4,7 +4,7 @@ declare(strict_types=1);
namespace Pest; namespace Pest;
use Pest\Concerns\Expectations; use Pest\Concerns\Expectable;
/** /**
* @internal * @internal
@ -13,7 +13,7 @@ use Pest\Concerns\Expectations;
*/ */
final class HigherOrderExpectation final class HigherOrderExpectation
{ {
use Expectations; use Expectable;
/** /**
* @var Expectation * @var Expectation

View File

@ -18,7 +18,7 @@ use DOMElement;
use Exception; use Exception;
use function get_class; use function get_class;
use function method_exists; use function method_exists;
use Pest\Concerns\TestCase; use Pest\Concerns\Testable;
use PHPUnit\Framework\AssertionFailedError; use PHPUnit\Framework\AssertionFailedError;
use PHPUnit\Framework\ExceptionWrapper; use PHPUnit\Framework\ExceptionWrapper;
use PHPUnit\Framework\SelfDescribing; use PHPUnit\Framework\SelfDescribing;
@ -266,7 +266,7 @@ final class JUnit extends Printer implements TestListener
/** /**
* A test started. * A test started.
* *
* @param Test|TestCase $test * @param Test|Testable $test
*/ */
public function startTest(Test $test): void public function startTest(Test $test): void
{ {

View File

@ -5,7 +5,7 @@ declare(strict_types=1);
namespace Pest\Logging; namespace Pest\Logging;
use function getmypid; use function getmypid;
use Pest\Concerns\TestCase; use Pest\Concerns\Testable;
use PHPUnit\Framework\AssertionFailedError; use PHPUnit\Framework\AssertionFailedError;
use PHPUnit\Framework\Test; use PHPUnit\Framework\Test;
use PHPUnit\Framework\TestResult; 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 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 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 public function addError(Test $test, Throwable $t, float $time): void
{ {
@ -154,7 +154,7 @@ final class TeamCity extends DefaultResultPrinter
/** /**
* @phpstan-ignore-next-line * @phpstan-ignore-next-line
* *
* @param Test|TestCase $test * @param Test|Testable $test
*/ */
public function addWarning(Test $test, Warning $e, float $time): void public function addWarning(Test $test, Warning $e, float $time): void
{ {
@ -208,6 +208,6 @@ final class TeamCity extends DefaultResultPrinter
/** @var array<string, string> $uses */ /** @var array<string, string> $uses */
$uses = class_uses($test); $uses = class_uses($test);
return in_array(TestCase::class, $uses, true); return in_array(Testable::class, $uses, true);
} }
} }