mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e8f122bf47 | |||
| 9fc607a2b8 | |||
| b33af71036 | |||
| 3c6c89a6ad | |||
| 55f6b5696e | |||
| 303f4c0113 | |||
| 35a1fcd0cf | |||
| a7a3e4240e | |||
| e4af33867b | |||
| 680111fb1e | |||
| aa6ff95ea4 |
@ -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.15"
|
||||
"phpunit/phpunit": "^10.5.17"
|
||||
},
|
||||
"conflict": {
|
||||
"phpunit/phpunit": ">10.5.15",
|
||||
"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,
|
||||
|
||||
@ -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.5';
|
||||
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.5.
|
||||
Pest Testing Framework 2.34.8.
|
||||
|
||||
USAGE: pest <file> [options]
|
||||
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
|
||||
Pest Testing Framework 2.34.5.
|
||||
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