mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
feat: toHaveAllMethodsDocumented and toHaveAllPropertiesDocumented
This commit is contained in:
@ -715,6 +715,14 @@
|
||||
✓ failures with custom message
|
||||
✓ not failures
|
||||
|
||||
PASS Tests\Features\Expect\toHaveAllMethodsDocumented
|
||||
✓ it passes
|
||||
✓ it fails
|
||||
|
||||
PASS Tests\Features\Expect\toHaveAllPropertiesDocumented
|
||||
✓ it passes
|
||||
✓ it fails
|
||||
|
||||
PASS Tests\Features\Expect\toHaveAttribute
|
||||
✓ class has attribute
|
||||
✓ opposite class has attribute
|
||||
@ -1525,4 +1533,4 @@
|
||||
WARN Tests\Visual\Version
|
||||
- visual snapshot of help command output
|
||||
|
||||
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 24 skipped, 1068 passed (2614 assertions)
|
||||
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 24 skipped, 1072 passed (2620 assertions)
|
||||
13
tests/Features/Expect/toHaveAllMethodsDocumented.php
Normal file
13
tests/Features/Expect/toHaveAllMethodsDocumented.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
use Pest\Arch\Exceptions\ArchExpectationFailedException;
|
||||
use Pest\Expectation;
|
||||
use Tests\Fixtures\Inheritance\ExampleTest;
|
||||
|
||||
it('passes', function () {
|
||||
expect(Expectation::class)->toHaveAllMethodsDocumented();
|
||||
});
|
||||
|
||||
it('fails', function () {
|
||||
expect(ExampleTest::class)->toHaveAllMethodsDocumented();
|
||||
})->throws(ArchExpectationFailedException::class);
|
||||
13
tests/Features/Expect/toHaveAllPropertiesDocumented.php
Normal file
13
tests/Features/Expect/toHaveAllPropertiesDocumented.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
use Pest\Arch\Exceptions\ArchExpectationFailedException;
|
||||
use Pest\Expectation;
|
||||
use Tests\Fixtures\Inheritance\ExampleTest;
|
||||
|
||||
it('passes', function () {
|
||||
expect(Expectation::class)->toHaveAllPropertiesDocumented();
|
||||
});
|
||||
|
||||
it('fails', function () {
|
||||
expect(ExampleTest::class)->toHaveAllPropertiesDocumented();
|
||||
})->throws(ArchExpectationFailedException::class);
|
||||
@ -4,7 +4,7 @@ use Pest\Arch\Exceptions\ArchExpectationFailedException;
|
||||
use Pest\Expectation;
|
||||
|
||||
it('passes', function () {
|
||||
expect(Expectation::class)->toHaveLineCountLessThan(1000);
|
||||
expect(Expectation::class)->toHaveLineCountLessThan(2000);
|
||||
});
|
||||
|
||||
it('fails', function () {
|
||||
|
||||
@ -4,6 +4,8 @@ namespace Tests\Fixtures\Inheritance;
|
||||
|
||||
class ExampleTest extends Base\ExampleTest
|
||||
{
|
||||
protected $foo;
|
||||
|
||||
public function testExample()
|
||||
{
|
||||
$this->assertTrue(true);
|
||||
|
||||
@ -16,7 +16,7 @@ $run = function () {
|
||||
|
||||
test('parallel', function () use ($run) {
|
||||
expect($run('--exclude-group=integration'))
|
||||
->toContain('Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 19 skipped, 1054 passed (2582 assertions)')
|
||||
->toContain('Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 19 skipped, 1058 passed (2588 assertions)')
|
||||
->toContain('Parallel: 3 processes');
|
||||
})->skipOnWindows();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user