mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e8f122bf47 | |||
| 9fc607a2b8 | |||
| b33af71036 | |||
| 3c6c89a6ad | |||
| 55f6b5696e | |||
| 303f4c0113 | |||
| 35a1fcd0cf | |||
| a7a3e4240e | |||
| e4af33867b | |||
| 680111fb1e | |||
| aa6ff95ea4 | |||
| 863a0cc837 | |||
| 126a84a63e | |||
| d519e40b95 |
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
@ -3,8 +3,6 @@ name: Tests
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
|
||||
@ -21,6 +21,8 @@ We cannot thank our sponsors enough for their incredible support in funding Pest
|
||||
|
||||
### Platinum Sponsors
|
||||
|
||||
- **[LaraJobs](https://larajobs.com)**
|
||||
- **[Brokerchooser](https://brokerchooser.com)**
|
||||
- **[Forge](https://forge.laravel.com)**
|
||||
- **[Spatie](https://spatie.be)**
|
||||
- **[Worksome](https://www.worksome.com/)**
|
||||
@ -30,9 +32,7 @@ We cannot thank our sponsors enough for their incredible support in funding Pest
|
||||
- [Akaunting](https://akaunting.com/?ref=pestphp)
|
||||
- [Codecourse](https://codecourse.com/?ref=pestphp)
|
||||
- [Laracasts](https://laracasts.com/?ref=pestphp)
|
||||
- [Laradir](https://laradir.com/?ref=pestphp)
|
||||
- [Localazy](https://localazy.com/?ref=pestphp)
|
||||
- [Stormlikes](https://www.stormlikes.net/?ref=pestphp)
|
||||
- [Zapiet](https://www.zapiet.com/?ref=pestphp)
|
||||
|
||||
Pest is an open-sourced software licensed under the **[MIT license](https://opensource.org/licenses/MIT)**.
|
||||
|
||||
@ -23,10 +23,10 @@
|
||||
"nunomaduro/termwind": "^1.15.1|^2.0.1",
|
||||
"pestphp/pest-plugin": "^2.1.1",
|
||||
"pestphp/pest-plugin-arch": "^2.7.0",
|
||||
"phpunit/phpunit": "^10.5.13"
|
||||
"phpunit/phpunit": "^10.5.17"
|
||||
},
|
||||
"conflict": {
|
||||
"phpunit/phpunit": ">10.5.13",
|
||||
"phpunit/phpunit": ">10.5.17",
|
||||
"sebastian/exporter": "<5.1.0",
|
||||
"webmozart/assert": "<1.11.0"
|
||||
},
|
||||
@ -52,8 +52,8 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"pestphp/pest-dev-tools": "^2.16.0",
|
||||
"pestphp/pest-plugin-type-coverage": "^2.8.1",
|
||||
"symfony/process": "^6.4.0|^7.0.4"
|
||||
"pestphp/pest-plugin-type-coverage": "^2.8.3",
|
||||
"symfony/process": "^6.4.0|^7.1.1"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true,
|
||||
|
||||
@ -19,7 +19,7 @@ final class BootOverrides implements Bootstrapper
|
||||
*/
|
||||
public const FILES = [
|
||||
'c7b9c8a96006dea314204a8f09a8764e51ce0b9b79aadd58da52e8c328db4870' => 'Runner/Filter/NameFilterIterator.php',
|
||||
'c5381bc34f0cb437a58ce6cf641a0e0d4a32c4190959f5419e4bd509f9caa4b8' => 'Runner/ResultCache/DefaultResultCache.php',
|
||||
'c7c09ab7c9378710b27f761a4b2948196cbbdf2a73e4389bcdca1e7c94fa9c21' => 'Runner/ResultCache/DefaultResultCache.php',
|
||||
'bc8718c89264f65800beabc23e51c6d3bcff87dfc764a12179ef5dbfde272c8b' => 'Runner/TestSuiteLoader.php',
|
||||
'f41e48d6cb546772a7de4f8e66b6b7ce894a5318d063eb52e354d206e96c701c' => 'TextUI/Command/Commands/WarmCodeCoverageCacheCommand.php',
|
||||
'cb7519f2d82893640b694492cf7ec9528da80773cc1d259634181b5d393528b5' => 'TextUI/Output/Default/ProgressPrinter/Subscriber/TestSkippedSubscriber.php',
|
||||
|
||||
@ -467,6 +467,18 @@ final class Expectation
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Asserts that the value is a list.
|
||||
*
|
||||
* @return self<TValue>
|
||||
*/
|
||||
public function toBeList(string $message = ''): self
|
||||
{
|
||||
Assert::assertIsList($this->value, $message);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Asserts that the value is of type bool.
|
||||
*
|
||||
|
||||
@ -6,7 +6,7 @@ namespace Pest;
|
||||
|
||||
function version(): string
|
||||
{
|
||||
return '2.34.4';
|
||||
return '2.34.8';
|
||||
}
|
||||
|
||||
function testDirectory(string $file = ''): string
|
||||
|
||||
@ -6,5 +6,5 @@ use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
||||
|
||||
abstract class TestCase extends BaseTestCase
|
||||
{
|
||||
use CreatesApplication;
|
||||
//
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
|
||||
Pest Testing Framework 2.34.4.
|
||||
Pest Testing Framework 2.34.8.
|
||||
|
||||
USAGE: pest <file> [options]
|
||||
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
|
||||
Pest Testing Framework 2.34.4.
|
||||
Pest Testing Framework 2.34.8.
|
||||
|
||||
|
||||
@ -511,6 +511,12 @@
|
||||
✓ passes with strings
|
||||
✓ failures
|
||||
✓ failures with custom message
|
||||
✓ not failures
|
||||
|
||||
PASS Tests\Features\Expect\toBeList
|
||||
✓ pass
|
||||
✓ failures
|
||||
✓ failures with custom message
|
||||
✓ not failures
|
||||
|
||||
PASS Tests\Features\Expect\toBeLowercase
|
||||
@ -1418,4 +1424,4 @@
|
||||
WARN Tests\Visual\Version
|
||||
- visual snapshot of help command output
|
||||
|
||||
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 20 skipped, 1009 passed (2395 assertions)
|
||||
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 20 skipped, 1013 passed (2405 assertions)
|
||||
21
tests/Features/Expect/toBeList.php
Normal file
21
tests/Features/Expect/toBeList.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
|
||||
test('pass', function () {
|
||||
expect([1, 2, 3])->toBeList();
|
||||
expect(['a' => 1, 'b' => 2, 'c' => 3])->not->toBeList();
|
||||
expect('1, 2, 3')->not->toBeList();
|
||||
});
|
||||
|
||||
test('failures', function () {
|
||||
expect(null)->toBeList();
|
||||
})->throws(ExpectationFailedException::class);
|
||||
|
||||
test('failures with custom message', function () {
|
||||
expect(null)->toBeList('oh no!');
|
||||
})->throws(ExpectationFailedException::class, 'oh no!');
|
||||
|
||||
test('not failures', function () {
|
||||
expect(['a', 'b', 'c'])->not->toBeList();
|
||||
})->throws(ExpectationFailedException::class);
|
||||
@ -16,7 +16,7 @@ $run = function () {
|
||||
|
||||
test('parallel', function () use ($run) {
|
||||
expect($run('--exclude-group=integration'))
|
||||
->toContain('Tests: 1 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 16 skipped, 994 passed (2348 assertions)')
|
||||
->toContain('Tests: 1 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 16 skipped, 998 passed (2358 assertions)')
|
||||
->toContain('Parallel: 3 processes');
|
||||
})->skipOnWindows();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user