mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
chore: adjusts tests
This commit is contained in:
@ -1286,6 +1286,13 @@
|
||||
! user warning → This is a warning description
|
||||
! a "describe" group of tests → user warning → This is a warning description
|
||||
|
||||
PASS Tests\Features\Wip
|
||||
✓ it may have an associated assignee [@nunomaduro]
|
||||
✓ it may have an associated issue #1
|
||||
✓ it may have an associated PR #1
|
||||
✓ it may have an associated note
|
||||
// a note
|
||||
|
||||
WARN Tests\Fixtures\CollisionTest
|
||||
- error
|
||||
- success
|
||||
@ -1308,7 +1315,7 @@
|
||||
PASS Tests\Hooks\BeforeEachTest
|
||||
✓ global beforeEach execution order
|
||||
|
||||
PASS Tests\Overrides\VersionsTest
|
||||
FAIL Tests\Overrides\VersionsTest
|
||||
✓ versions with dataset "Runner/Filter/NameFilterIterator.php"
|
||||
✓ versions with dataset "Runner/ResultCache/DefaultResultCache.php"
|
||||
✓ versions with dataset "Runner/TestSuiteLoader.php"
|
||||
@ -1316,7 +1323,7 @@
|
||||
✓ versions with dataset "TextUI/Output/Default/ProgressPrinter/Subscriber/TestSkippedSubscriber.php"
|
||||
✓ versions with dataset "TextUI/TestSuiteFilterProcessor.php"
|
||||
✓ versions with dataset "Event/Value/ThrowableBuilder.php"
|
||||
✓ versions with dataset "Logging/JUnit/JunitXmlLogger.php"
|
||||
⨯ versions with dataset "Logging/JUnit/JunitXmlLogger.php"
|
||||
|
||||
PASS Tests\PHPUnit\CustomAffixes\InvalidTestName
|
||||
✓ it runs file names like @#$%^&()-_=+.php
|
||||
@ -1542,8 +1549,8 @@
|
||||
✓ junit output
|
||||
- junit with parallel → Not working yet
|
||||
|
||||
PASS Tests\Visual\Parallel
|
||||
✓ parallel
|
||||
FAIL Tests\Visual\Parallel
|
||||
⨯ parallel
|
||||
✓ a parallel test can extend another test with same name
|
||||
|
||||
PASS Tests\Visual\SingleTestOrDirectory
|
||||
@ -1566,5 +1573,45 @@
|
||||
|
||||
WARN Tests\Visual\Version
|
||||
- visual snapshot of help command output
|
||||
────────────────────────────────────────────────────────────────────────────
|
||||
FAILED Tests\Overrides\VersionsTest > versions with dataset "Logging/JUn…
|
||||
Failed asserting that two strings are identical.
|
||||
-'676273f1fe483877cf2d95c5aedbf9ae5d6a8e2f4c12d6ce716df6591e6db023'
|
||||
+'01974a686eba69b5fbb87a904d936eae2176e39567616898c5b758db71d87a22'
|
||||
|
||||
|
||||
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 17 todos, 28 skipped, 1085 passed (2617 assertions)
|
||||
at tests/Overrides/VersionsTest.php:8
|
||||
4▕
|
||||
5▕ use Pest\Bootstrappers\BootOverrides;
|
||||
6▕
|
||||
7▕ test('versions', function (string $vendorPath, string $expectedHash) {
|
||||
➜ 8▕ expect(hash_file('sha256', $vendorPath))->toBe($expectedHash);
|
||||
9▕ })->with(function () {
|
||||
10▕ foreach (BootOverrides::FILES as $hash => $file) {
|
||||
11▕ $path = implode(DIRECTORY_SEPARATOR, [
|
||||
12▕ dirname(__DIR__, 2),
|
||||
|
||||
────────────────────────────────────────────────────────────────────────────
|
||||
FAILED Tests\Visual\Parallel > parallel
|
||||
Expected: \n
|
||||
........ss...s............sssssss.s.........................................\n
|
||||
............................................................................\n
|
||||
... (40 more lines)
|
||||
|
||||
To contain: Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 17 todos, 19 skipped, 1079 passed (2597 assertions)
|
||||
|
||||
at tests/Visual/Parallel.php:19
|
||||
15▕ };
|
||||
16▕
|
||||
17▕ test('parallel', function () use ($run) {
|
||||
18▕ expect($run('--exclude-group=integration'))
|
||||
➜ 19▕ ->toContain('Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 17 todos, 19 skipped, 1079 passed (2597 assertions)')
|
||||
20▕ ->toContain('Parallel: 3 processes');
|
||||
21▕ })->skipOnWindows();
|
||||
22▕
|
||||
23▕ test('a parallel test can extend another test with same name', function () use ($run) {
|
||||
|
||||
1 tests/Visual/Parallel.php:19
|
||||
|
||||
|
||||
Tests: 2 deprecated, 2 failed, 4 warnings, 5 incomplete, 2 notices, 17 todos, 28 skipped, 1087 passed (2620 assertions)
|
||||
@ -150,7 +150,7 @@ test('high order test with skip')
|
||||
dd('This should not run 5');
|
||||
});
|
||||
|
||||
uses(Postable::class);
|
||||
pest()->use(Postable::class);
|
||||
|
||||
/**
|
||||
* @return TestCase|TestCall|Gettable
|
||||
|
||||
@ -10,7 +10,7 @@ class InheritanceTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
uses(InheritanceTest::class);
|
||||
pest()->extend(InheritanceTest::class);
|
||||
|
||||
it('is a test', function () {
|
||||
expect(true)->toBeTrue();
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
use Pest\PendingCalls\TestCall;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
uses(Gettable::class);
|
||||
pest()->use(Gettable::class);
|
||||
|
||||
/**
|
||||
* @return TestCase|TestCall|Gettable
|
||||
|
||||
17
tests/Features/Wip.php
Normal file
17
tests/Features/Wip.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
it('may have an associated assignee', function () {
|
||||
expect(true)->toBeTrue();
|
||||
})->wip(assignee: 'nunomaduro');
|
||||
|
||||
it('may have an associated issue', function () {
|
||||
expect(true)->toBeTrue();
|
||||
})->wip(issue: 1);
|
||||
|
||||
it('may have an associated PR', function () {
|
||||
expect(true)->toBeTrue();
|
||||
})->wip(pr: 1);
|
||||
|
||||
it('may have an associated note', function () {
|
||||
expect(true)->toBeTrue();
|
||||
})->wip(note: 'a note');
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
uses()->afterEach(function () {
|
||||
pest()->afterEach(function () {
|
||||
expect($this)
|
||||
->toHaveProperty('ith')
|
||||
->and($this->ith)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
uses()->beforeEach(function () {
|
||||
pest()->beforeEach(function () {
|
||||
expect($this)
|
||||
->toHaveProperty('baz')
|
||||
->and($this->baz)
|
||||
|
||||
@ -10,7 +10,7 @@ class MyCustomClassTest extends PHPUnit\Framework\TestCase
|
||||
}
|
||||
}
|
||||
|
||||
uses(MyCustomClassTest::class);
|
||||
pest()->extend(MyCustomClassTest::class);
|
||||
|
||||
test('custom traits can be used', function () {
|
||||
$this->assertTrueIsTrue();
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
uses(Tests\CustomTestCase\CustomTestCase::class)->in(__DIR__);
|
||||
pest()->use(Tests\CustomTestCase\CustomTestCase::class)->in(__DIR__);
|
||||
|
||||
test('closure was bound to CustomTestCase', function () {
|
||||
$this->assertCustomTrue();
|
||||
|
||||
@ -16,7 +16,7 @@ abstract class MyCustomClass extends PHPUnit\Framework\TestCase
|
||||
}
|
||||
}
|
||||
|
||||
uses(MyCustomClass::class, MyCustomTrait::class);
|
||||
pest()->extend(MyCustomClass::class)->use(MyCustomTrait::class);
|
||||
|
||||
test('custom traits can be used', function () {
|
||||
$this->assertTrueIsTrue();
|
||||
|
||||
@ -7,7 +7,7 @@ error_reporting(E_ALL);
|
||||
|
||||
$GLOBALS['__PEST_INTERNAL_TEST_SUITE'] = true;
|
||||
|
||||
pest()->context()->github('pestphp/pest');
|
||||
pest()->project()->github('pestphp/pest');
|
||||
|
||||
pest()->in('PHPUnit/CustomTestCaseInSubFolders/SubFolder/SubFolder')->use(CustomTestCaseInSubFolder::class);
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ use Pest\Exceptions\ShouldNotHappen;
|
||||
use Pest\Support\Container;
|
||||
use Pest\TestSuite;
|
||||
|
||||
uses()->group('container');
|
||||
pest()->group('container');
|
||||
|
||||
beforeEach(function () {
|
||||
$this->container = new Container;
|
||||
|
||||
@ -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, 17 todos, 19 skipped, 1075 passed (2593 assertions)')
|
||||
->toContain('Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 17 todos, 19 skipped, 1079 passed (2597 assertions)')
|
||||
->toContain('Parallel: 3 processes');
|
||||
})->skipOnWindows();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user