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
*/
trait Expectations
trait Expectable
{
/**
* Creates a new expectation.

View File

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

View File

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

View File

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

View File

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

View File

@ -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<string, string> $uses */
$uses = class_uses($test);
return in_array(TestCase::class, $uses, true);
return in_array(Testable::class, $uses, true);
}
}