mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
chore: style
This commit is contained in:
@ -32,8 +32,7 @@ final class BootSubscribers implements Bootstrapper
|
|||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly Container $container,
|
private readonly Container $container,
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Boots the list of Subscribers.
|
* Boots the list of Subscribers.
|
||||||
|
|||||||
@ -24,9 +24,7 @@ final class EachExpectation
|
|||||||
*
|
*
|
||||||
* @param Expectation<TValue> $original
|
* @param Expectation<TValue> $original
|
||||||
*/
|
*/
|
||||||
public function __construct(private readonly Expectation $original)
|
public function __construct(private readonly Expectation $original) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new expectation.
|
* Creates a new expectation.
|
||||||
|
|||||||
@ -36,9 +36,7 @@ final class OppositeExpectation
|
|||||||
*
|
*
|
||||||
* @param Expectation<TValue> $original
|
* @param Expectation<TValue> $original
|
||||||
*/
|
*/
|
||||||
public function __construct(private readonly Expectation $original)
|
public function __construct(private readonly Expectation $original) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Asserts that the value array not has the provided $keys.
|
* Asserts that the value array not has the provided $keys.
|
||||||
|
|||||||
@ -9,7 +9,5 @@ namespace Pest\Factories\Covers;
|
|||||||
*/
|
*/
|
||||||
final class CoversClass
|
final class CoversClass
|
||||||
{
|
{
|
||||||
public function __construct(public string $class)
|
public function __construct(public string $class) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,7 +9,5 @@ namespace Pest\Factories\Covers;
|
|||||||
*/
|
*/
|
||||||
final class CoversFunction
|
final class CoversFunction
|
||||||
{
|
{
|
||||||
public function __construct(public string $function)
|
public function __construct(public string $function) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,4 @@ namespace Pest\Factories\Covers;
|
|||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
final class CoversNothing
|
final class CoversNothing {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
@ -17,8 +17,7 @@ final class ServiceMessage
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly string $type,
|
private readonly string $type,
|
||||||
private readonly array $parameters,
|
private readonly array $parameters,
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
public function toString(): string
|
public function toString(): string
|
||||||
{
|
{
|
||||||
|
|||||||
@ -14,9 +14,7 @@ abstract class Subscriber
|
|||||||
/**
|
/**
|
||||||
* Creates a new Subscriber instance.
|
* Creates a new Subscriber instance.
|
||||||
*/
|
*/
|
||||||
public function __construct(private readonly TeamCityLogger $logger)
|
public function __construct(private readonly TeamCityLogger $logger) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new TeamCityLogger instance.
|
* Creates a new TeamCityLogger instance.
|
||||||
|
|||||||
@ -7,6 +7,4 @@ namespace Pest\Matchers;
|
|||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
final class Any
|
final class Any {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
@ -63,8 +63,7 @@ final class ResultPrinter
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly OutputInterface $output,
|
private readonly OutputInterface $output,
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
public function print(string $buffer): void
|
public function print(string $buffer): void
|
||||||
{
|
{
|
||||||
@ -79,9 +78,7 @@ final class ResultPrinter
|
|||||||
$this->output->write(OutputFormatter::escape($buffer));
|
$this->output->write(OutputFormatter::escape($buffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function flush(): void
|
public function flush(): void {}
|
||||||
{
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$this->compactPrinter = CompactPrinter::default();
|
$this->compactPrinter = CompactPrinter::default();
|
||||||
|
|||||||
@ -21,8 +21,7 @@ final class SnapshotRepository
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
readonly private string $testsPath,
|
readonly private string $testsPath,
|
||||||
readonly private string $snapshotsPath,
|
readonly private string $snapshotsPath,
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the snapshot exists.
|
* Checks if the snapshot exists.
|
||||||
|
|||||||
@ -24,8 +24,7 @@ final class EnsureTeamCityEnabled implements ConfiguredSubscriber
|
|||||||
private readonly InputInterface $input,
|
private readonly InputInterface $input,
|
||||||
private readonly OutputInterface $output,
|
private readonly OutputInterface $output,
|
||||||
private readonly TestSuite $testSuite,
|
private readonly TestSuite $testSuite,
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs the subscriber.
|
* Runs the subscriber.
|
||||||
|
|||||||
@ -30,8 +30,7 @@ final class ExpectationPipeline
|
|||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly Closure $closure
|
private readonly Closure $closure
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new instance of Expectation Pipeline with given closure.
|
* Creates a new instance of Expectation Pipeline with given closure.
|
||||||
|
|||||||
@ -16,7 +16,6 @@ final class NullClosure
|
|||||||
*/
|
*/
|
||||||
public static function create(): Closure
|
public static function create(): Closure
|
||||||
{
|
{
|
||||||
return Closure::fromCallable(function (): void {
|
return Closure::fromCallable(function (): void {});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,9 +10,7 @@ use Tests\Fixtures\Covers\CoversTrait;
|
|||||||
|
|
||||||
$runCounter = 0;
|
$runCounter = 0;
|
||||||
|
|
||||||
function testCoversFunction()
|
function testCoversFunction() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
it('uses the correct PHPUnit attribute for class', function () {
|
it('uses the correct PHPUnit attribute for class', function () {
|
||||||
$attributes = (new ReflectionClass($this))->getAttributes();
|
$attributes = (new ReflectionClass($this))->getAttributes();
|
||||||
|
|||||||
@ -3,8 +3,7 @@
|
|||||||
use PHPUnit\Framework\ExpectationFailedException;
|
use PHPUnit\Framework\ExpectationFailedException;
|
||||||
|
|
||||||
test('pass', function () {
|
test('pass', function () {
|
||||||
expect(function () {
|
expect(function () {})->toBeCallable();
|
||||||
})->toBeCallable();
|
|
||||||
expect(null)->not->toBeCallable();
|
expect(null)->not->toBeCallable();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -4,13 +4,9 @@ use PHPUnit\Framework\ExpectationFailedException;
|
|||||||
|
|
||||||
$object = new class
|
$object = new class
|
||||||
{
|
{
|
||||||
public function foo(): void
|
public function foo(): void {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function bar(): void
|
public function bar(): void {}
|
||||||
{
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
test('pass', function () use ($object) {
|
test('pass', function () use ($object) {
|
||||||
|
|||||||
@ -43,9 +43,7 @@ test('pass with `__toString`', function () {
|
|||||||
|
|
||||||
$object = new class($this->snapshotable)
|
$object = new class($this->snapshotable)
|
||||||
{
|
{
|
||||||
public function __construct(protected string $snapshotable)
|
public function __construct(protected string $snapshotable) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
@ -61,9 +59,7 @@ test('pass with `toString`', function () {
|
|||||||
|
|
||||||
$object = new class($this->snapshotable)
|
$object = new class($this->snapshotable)
|
||||||
{
|
{
|
||||||
public function __construct(protected string $snapshotable)
|
public function __construct(protected string $snapshotable) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function toString()
|
public function toString()
|
||||||
{
|
{
|
||||||
@ -97,9 +93,7 @@ test('pass with `toArray`', function () {
|
|||||||
|
|
||||||
$object = new class($this->snapshotable)
|
$object = new class($this->snapshotable)
|
||||||
{
|
{
|
||||||
public function __construct(protected string $snapshotable)
|
public function __construct(protected string $snapshotable) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function toArray()
|
public function toArray()
|
||||||
{
|
{
|
||||||
@ -125,9 +119,7 @@ test('pass with `toSnapshot`', function () {
|
|||||||
|
|
||||||
$object = new class($this->snapshotable)
|
$object = new class($this->snapshotable)
|
||||||
{
|
{
|
||||||
public function __construct(protected string $snapshotable)
|
public function __construct(protected string $snapshotable) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function toSnapshot()
|
public function toSnapshot()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,9 +2,7 @@
|
|||||||
|
|
||||||
use PHPUnit\Framework\ExpectationFailedException;
|
use PHPUnit\Framework\ExpectationFailedException;
|
||||||
|
|
||||||
class CustomException extends Exception
|
class CustomException extends Exception {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
test('passes', function () {
|
test('passes', function () {
|
||||||
expect(function () {
|
expect(function () {
|
||||||
@ -15,15 +13,13 @@ test('passes', function () {
|
|||||||
})->toThrow(Exception::class);
|
})->toThrow(Exception::class);
|
||||||
expect(function () {
|
expect(function () {
|
||||||
throw new RuntimeException();
|
throw new RuntimeException();
|
||||||
})->toThrow(function (RuntimeException $e) {
|
})->toThrow(function (RuntimeException $e) {});
|
||||||
});
|
|
||||||
expect(function () {
|
expect(function () {
|
||||||
throw new RuntimeException('actual message');
|
throw new RuntimeException('actual message');
|
||||||
})->toThrow(function (Exception $e) {
|
})->toThrow(function (Exception $e) {
|
||||||
expect($e->getMessage())->toBe('actual message');
|
expect($e->getMessage())->toBe('actual message');
|
||||||
});
|
});
|
||||||
expect(function () {
|
expect(function () {})->not->toThrow(Exception::class);
|
||||||
})->not->toThrow(Exception::class);
|
|
||||||
expect(function () {
|
expect(function () {
|
||||||
throw new RuntimeException('actual message');
|
throw new RuntimeException('actual message');
|
||||||
})->toThrow('actual message');
|
})->toThrow('actual message');
|
||||||
@ -35,22 +31,18 @@ test('passes', function () {
|
|||||||
})->toThrow(RuntimeException::class, 'actual message');
|
})->toThrow(RuntimeException::class, 'actual message');
|
||||||
expect(function () {
|
expect(function () {
|
||||||
throw new RuntimeException('actual message');
|
throw new RuntimeException('actual message');
|
||||||
})->toThrow(function (RuntimeException $e) {
|
})->toThrow(function (RuntimeException $e) {}, 'actual message');
|
||||||
}, 'actual message');
|
|
||||||
expect(function () {
|
expect(function () {
|
||||||
throw new CustomException('foo');
|
throw new CustomException('foo');
|
||||||
})->toThrow(new CustomException('foo'));
|
})->toThrow(new CustomException('foo'));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('failures 1', function () {
|
test('failures 1', function () {
|
||||||
expect(function () {
|
expect(function () {})->toThrow(RuntimeException::class);
|
||||||
})->toThrow(RuntimeException::class);
|
|
||||||
})->throws(ExpectationFailedException::class, 'Exception "'.RuntimeException::class.'" not thrown.');
|
})->throws(ExpectationFailedException::class, 'Exception "'.RuntimeException::class.'" not thrown.');
|
||||||
|
|
||||||
test('failures 2', function () {
|
test('failures 2', function () {
|
||||||
expect(function () {
|
expect(function () {})->toThrow(function (RuntimeException $e) {});
|
||||||
})->toThrow(function (RuntimeException $e) {
|
|
||||||
});
|
|
||||||
})->throws(ExpectationFailedException::class, 'Exception "'.RuntimeException::class.'" not thrown.');
|
})->throws(ExpectationFailedException::class, 'Exception "'.RuntimeException::class.'" not thrown.');
|
||||||
|
|
||||||
test('failures 3', function () {
|
test('failures 3', function () {
|
||||||
@ -77,8 +69,7 @@ test('failures 5', function () {
|
|||||||
})->throws(ExpectationFailedException::class, 'Failed asserting that \'actual message\' [ASCII](length: 14) contains "expected message" [ASCII](length: 16).');
|
})->throws(ExpectationFailedException::class, 'Failed asserting that \'actual message\' [ASCII](length: 14) contains "expected message" [ASCII](length: 16).');
|
||||||
|
|
||||||
test('failures 6', function () {
|
test('failures 6', function () {
|
||||||
expect(function () {
|
expect(function () {})->toThrow('actual message');
|
||||||
})->toThrow('actual message');
|
|
||||||
})->throws(ExpectationFailedException::class, 'Exception with message "actual message" not thrown');
|
})->throws(ExpectationFailedException::class, 'Exception with message "actual message" not thrown');
|
||||||
|
|
||||||
test('failures 7', function () {
|
test('failures 7', function () {
|
||||||
@ -106,15 +97,11 @@ test('not failures', function () {
|
|||||||
})->throws(ExpectationFailedException::class);
|
})->throws(ExpectationFailedException::class);
|
||||||
|
|
||||||
test('closure missing parameter', function () {
|
test('closure missing parameter', function () {
|
||||||
expect(function () {
|
expect(function () {})->toThrow(function () {});
|
||||||
})->toThrow(function () {
|
|
||||||
});
|
|
||||||
})->throws(InvalidArgumentException::class, 'The given closure must have a single parameter type-hinted as the class string.');
|
})->throws(InvalidArgumentException::class, 'The given closure must have a single parameter type-hinted as the class string.');
|
||||||
|
|
||||||
test('closure missing type-hint', function () {
|
test('closure missing type-hint', function () {
|
||||||
expect(function () {
|
expect(function () {})->toThrow(function ($e) {});
|
||||||
})->toThrow(function ($e) {
|
|
||||||
});
|
|
||||||
})->throws(InvalidArgumentException::class, 'The given closure\'s parameter must be type-hinted as the class string.');
|
})->throws(InvalidArgumentException::class, 'The given closure\'s parameter must be type-hinted as the class string.');
|
||||||
|
|
||||||
it('can handle a non-defined exception', function () {
|
it('can handle a non-defined exception', function () {
|
||||||
|
|||||||
@ -6,8 +6,5 @@ namespace Tests\Fixtures\Arch\ToBeInvokable\IsInvokable;
|
|||||||
|
|
||||||
class InvokableClass
|
class InvokableClass
|
||||||
{
|
{
|
||||||
public function __invoke(): void
|
public function __invoke(): void {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,8 +6,5 @@ namespace Tests\Fixtures\Arch\ToBeInvokable\IsInvokable;
|
|||||||
|
|
||||||
class ParentInvokableClass
|
class ParentInvokableClass
|
||||||
{
|
{
|
||||||
public function __invoke(): void
|
public function __invoke(): void {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,8 +6,5 @@ namespace Tests\Fixtures\Arch\ToBeInvokable\IsNotInvokable;
|
|||||||
|
|
||||||
class IsNotInvokableClass
|
class IsNotInvokableClass
|
||||||
{
|
{
|
||||||
public function handle(): void
|
public function handle(): void {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,4 @@ namespace Tests\Fixtures\Arch\ToHaveAttribute\Attributes;
|
|||||||
use Attribute;
|
use Attribute;
|
||||||
|
|
||||||
#[Attribute()]
|
#[Attribute()]
|
||||||
class AsAttribute
|
class AsAttribute {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
@ -7,6 +7,4 @@ namespace Tests\Fixtures\Arch\ToHaveAttribute\HaveAttribute;
|
|||||||
use Tests\Fixtures\Arch\ToHaveAttribute\Attributes\AsAttribute;
|
use Tests\Fixtures\Arch\ToHaveAttribute\Attributes\AsAttribute;
|
||||||
|
|
||||||
#[AsAttribute]
|
#[AsAttribute]
|
||||||
class HaveAttributeClass
|
class HaveAttributeClass {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
@ -4,6 +4,4 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Tests\Fixtures\Arch\ToHaveAttribute\NotHaveAttribute;
|
namespace Tests\Fixtures\Arch\ToHaveAttribute\NotHaveAttribute;
|
||||||
|
|
||||||
class NotHaveAttributeClass
|
class NotHaveAttributeClass {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
@ -6,8 +6,5 @@ namespace Tests\Fixtures\Arch\ToHaveConstructor\HasConstructor;
|
|||||||
|
|
||||||
class HasConstructor
|
class HasConstructor
|
||||||
{
|
{
|
||||||
public function __construct()
|
public function __construct() {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,4 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Tests\Fixtures\Arch\ToHaveConstructor\HasNoConstructor;
|
namespace Tests\Fixtures\Arch\ToHaveConstructor\HasNoConstructor;
|
||||||
|
|
||||||
class HasNoConstructor
|
class HasNoConstructor {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
@ -6,8 +6,5 @@ namespace Tests\Fixtures\Arch\ToHaveDestructor\HasDestructor;
|
|||||||
|
|
||||||
class HasDestructor
|
class HasDestructor
|
||||||
{
|
{
|
||||||
public function __destruct()
|
public function __destruct() {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,4 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Tests\Fixtures\Arch\ToHaveDestructor\HasNoDestructor;
|
namespace Tests\Fixtures\Arch\ToHaveDestructor\HasNoDestructor;
|
||||||
|
|
||||||
class HasNoDestructor
|
class HasNoDestructor {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
@ -6,8 +6,5 @@ namespace Tests\Fixtures\Arch\ToHaveMethod\HasMethod;
|
|||||||
|
|
||||||
class HasMethod
|
class HasMethod
|
||||||
{
|
{
|
||||||
public function foo(): void
|
public function foo(): void {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,8 +6,5 @@ namespace Tests\Fixtures\Arch\ToHaveMethod\HasMethod;
|
|||||||
|
|
||||||
trait HasMethodTrait
|
trait HasMethodTrait
|
||||||
{
|
{
|
||||||
public function foo(): void
|
public function foo(): void {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,8 +6,5 @@ namespace Tests\Fixtures\Arch\ToHaveMethod\HasMethod;
|
|||||||
|
|
||||||
class ParentHasMethodClass
|
class ParentHasMethodClass
|
||||||
{
|
{
|
||||||
public function foo(): void
|
public function foo(): void {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,8 +6,5 @@ namespace Tests\Fixtures\Arch\ToHaveMethod\HasNoMethod;
|
|||||||
|
|
||||||
class HasNoMethodClass
|
class HasNoMethodClass
|
||||||
{
|
{
|
||||||
public function bar(): void
|
public function bar(): void {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,4 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Tests\Fixtures\Arch\ToHavePrefix\HasNoPrefix;
|
namespace Tests\Fixtures\Arch\ToHavePrefix\HasNoPrefix;
|
||||||
|
|
||||||
class ClassWithout
|
class ClassWithout {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
@ -4,6 +4,4 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Tests\Fixtures\Arch\ToHavePrefix\HasPrefix;
|
namespace Tests\Fixtures\Arch\ToHavePrefix\HasPrefix;
|
||||||
|
|
||||||
class PrefixClassWith
|
class PrefixClassWith {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
@ -4,6 +4,4 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Tests\Fixtures\Arch\ToHaveSuffix\HasNoSuffix;
|
namespace Tests\Fixtures\Arch\ToHaveSuffix\HasNoSuffix;
|
||||||
|
|
||||||
class ClassWithout
|
class ClassWithout {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
@ -4,6 +4,4 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Tests\Fixtures\Arch\ToHaveSuffix\HasSuffix;
|
namespace Tests\Fixtures\Arch\ToHaveSuffix\HasSuffix;
|
||||||
|
|
||||||
class ClassWithSuffix
|
class ClassWithSuffix {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
@ -4,7 +4,5 @@ namespace Tests\Fixtures\Covers;
|
|||||||
|
|
||||||
class CoversClass1
|
class CoversClass1
|
||||||
{
|
{
|
||||||
public function foo()
|
public function foo() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,4 @@
|
|||||||
|
|
||||||
namespace Tests\Fixtures\Covers;
|
namespace Tests\Fixtures\Covers;
|
||||||
|
|
||||||
class CoversClass2
|
class CoversClass2 {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
@ -2,6 +2,4 @@
|
|||||||
|
|
||||||
namespace Tests\Fixtures\Covers;
|
namespace Tests\Fixtures\Covers;
|
||||||
|
|
||||||
class CoversClass3
|
class CoversClass3 {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
@ -2,6 +2,4 @@
|
|||||||
|
|
||||||
namespace Tests\Fixtures\Covers;
|
namespace Tests\Fixtures\Covers;
|
||||||
|
|
||||||
trait CoversTrait
|
trait CoversTrait {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
@ -50,21 +50,15 @@ it('cannot resolve a parameter without type', function () {
|
|||||||
|
|
||||||
class ClassWithDependency
|
class ClassWithDependency
|
||||||
{
|
{
|
||||||
public function __construct(Container $container)
|
public function __construct(Container $container) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ClassWithSubDependency
|
class ClassWithSubDependency
|
||||||
{
|
{
|
||||||
public function __construct(ClassWithDependency $param)
|
public function __construct(ClassWithDependency $param) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ClassWithoutTypeParameter
|
class ClassWithoutTypeParameter
|
||||||
{
|
{
|
||||||
public function __construct($param)
|
public function __construct($param) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,8 +3,7 @@
|
|||||||
use Pest\Support\Reflection;
|
use Pest\Support\Reflection;
|
||||||
|
|
||||||
it('gets file name from closure', function () {
|
it('gets file name from closure', function () {
|
||||||
$fileName = Reflection::getFileNameFromClosure(function () {
|
$fileName = Reflection::getFileNameFromClosure(function () {});
|
||||||
});
|
|
||||||
|
|
||||||
expect($fileName)->toBe(__FILE__);
|
expect($fileName)->toBe(__FILE__);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -19,8 +19,7 @@ it('does not allow to add the same test description twice', function () {
|
|||||||
it('alerts users about tests with arguments but no input', function () {
|
it('alerts users about tests with arguments but no input', function () {
|
||||||
$testSuite = new TestSuite(getcwd(), 'tests');
|
$testSuite = new TestSuite(getcwd(), 'tests');
|
||||||
|
|
||||||
$method = new TestCaseMethodFactory('foo', 'bar', function (int $arg) {
|
$method = new TestCaseMethodFactory('foo', 'bar', function (int $arg) {});
|
||||||
});
|
|
||||||
|
|
||||||
$testSuite->tests->set($method);
|
$testSuite->tests->set($method);
|
||||||
})->throws(
|
})->throws(
|
||||||
|
|||||||
Reference in New Issue
Block a user