mirror of
https://github.com/pestphp/pest.git
synced 2026-03-09 01:07:23 +01:00
More tests
This commit is contained in:
37
tests/Features/DescriptionLess.php
Normal file
37
tests/Features/DescriptionLess.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Pest\PendingCalls\TestCall;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
uses(Gettable::class);
|
||||
|
||||
/**
|
||||
* @return TestCase|TestCall|Gettable
|
||||
*/
|
||||
function get(string $route)
|
||||
{
|
||||
return test()->get($route);
|
||||
}
|
||||
|
||||
trait Gettable
|
||||
{
|
||||
/**
|
||||
* @return TestCase|TestCall|Gettable
|
||||
*/
|
||||
public function get(string $route)
|
||||
{
|
||||
expect($route)->not->toBeEmpty();
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
get('foo'); // not incomplete because closure is created...
|
||||
get('foo')->get('bar')->expect(true)->toBeTrue();
|
||||
get('foo')->expect(true)->toBeTrue();
|
||||
|
||||
describe('a "describe" group of tests', function () {
|
||||
get('foo'); // not incomplete because closure is created...
|
||||
get('foo')->get('bar')->expect(true)->toBeTrue();
|
||||
get('foo')->expect(true)->toBeTrue();
|
||||
});
|
||||
Reference in New Issue
Block a user