mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
feat: support for deprecated, notices, and warnings
This commit is contained in:
@ -18,7 +18,3 @@
|
||||
##teamcity[testIgnored name='build this one.' message='This test was ignored.' details='' flowId='1234']
|
||||
##teamcity[testFinished name='build this one.' duration='100000' flowId='1234']
|
||||
##teamcity[testSuiteFinished name='Tests/tests/Failure' flowId='1234']
|
||||
|
||||
[90mTests:[39m [31;1m2 failed[39;22m[90m,[39m[39m [39m[33;1m1 risky[39;22m[90m,[39m[39m [39m[36;1m2 todos[39;22m[90m,[39m[39m [39m[33;1m1 skipped[39;22m[90m (2 assertions)[39m
|
||||
[90mDuration:[39m [39m1.00s[39m
|
||||
|
||||
|
||||
@ -4,7 +4,3 @@
|
||||
##teamcity[testStarted name='can also pass' locationHint='pest_qn://tests/.tests/SuccessOnly.php::can also pass' flowId='1234']
|
||||
##teamcity[testFinished name='can also pass' duration='100000' flowId='1234']
|
||||
##teamcity[testSuiteFinished name='Tests/tests/SuccessOnly' flowId='1234']
|
||||
|
||||
[90mTests:[39m [32;1m2 passed[39;22m[90m (2 assertions)[39m
|
||||
[90mDuration:[39m [39m1.00s[39m
|
||||
|
||||
|
||||
@ -139,6 +139,10 @@
|
||||
✓ it is a test
|
||||
✓ it uses correct parent class
|
||||
|
||||
DEPR Tests\Features\Deprecated
|
||||
! deprecated → str_contains(): Passing null to parameter #2 ($needle) of type string is deprecated
|
||||
! user deprecated → Since foo 1.0: This is a deprecation description
|
||||
|
||||
PASS Tests\Features\Exceptions
|
||||
✓ it gives access the the underlying expectException
|
||||
✓ it catch exceptions
|
||||
@ -646,9 +650,9 @@
|
||||
✓ it skips with falsy closure condition
|
||||
✓ it can be used in higher order tests
|
||||
|
||||
PASS Tests\Features\Helpers
|
||||
WARN Tests\Features\Helpers
|
||||
✓ it can set/get properties on $this
|
||||
✓ it throws error if property do not exist
|
||||
! it gets null if property do not exist → Undefined property Tests\Features\Helpers::$wqdwqdqw
|
||||
✓ it allows to call underlying protected/private methods
|
||||
✓ it throws error if method do not exist
|
||||
✓ it can forward unexpected calls to any global function
|
||||
@ -678,6 +682,9 @@
|
||||
✓ it is a test
|
||||
✓ it is a higher order message test
|
||||
|
||||
NOTI Tests\Features\Notices
|
||||
! notice → This is a notice description
|
||||
|
||||
PASS Tests\Features\PendingHigherOrderTests
|
||||
✓ get 'foo'
|
||||
✓ get 'foo' → get 'bar' → expect true → toBeTrue
|
||||
@ -750,6 +757,10 @@
|
||||
↓ something todo later chained and with function body
|
||||
✓ it does something within a file with a todo
|
||||
|
||||
WARN Tests\Features\Warnings
|
||||
! warning → Undefined property: P\Tests\Features\Warnings::$fooqwdfwqdfqw
|
||||
! user warning → This is a warning description
|
||||
|
||||
PASS Tests\Fixtures\DirectoryWithTests\ExampleTest
|
||||
✓ it example 1
|
||||
|
||||
@ -917,4 +928,4 @@
|
||||
PASS Tests\Visual\Version
|
||||
✓ visual snapshot of help command output
|
||||
|
||||
Tests: 4 incomplete, 4 todos, 18 skipped, 634 passed (1560 assertions)
|
||||
Tests: 2 deprecated, 3 warnings, 4 incomplete, 1 notice, 4 todos, 18 skipped, 633 passed (1564 assertions)
|
||||
7
tests/Features/Notices.php
Normal file
7
tests/Features/Notices.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
test('notice', function () {
|
||||
trigger_error('This is a notice description', E_USER_NOTICE);
|
||||
|
||||
expect(true)->toBeTrue();
|
||||
});
|
||||
@ -15,6 +15,6 @@ $run = function () {
|
||||
};
|
||||
|
||||
test('parallel', function () use ($run) {
|
||||
expect($run())->toContain('Tests: 4 incomplete, 4 todos, 15 skipped, 627 passed (1551 assertions)')
|
||||
expect($run())->toContain('Tests: 2 deprecated, 3 warnings, 4 incomplete, 1 notice, 4 todos, 15 skipped, 626 passed (1555 assertions)')
|
||||
->toContain('Parallel: 3 processes');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user