mirror of
https://github.com/pestphp/pest.git
synced 2026-03-11 10:17:23 +01:00
Merge branch 'master' of https://github.com/pestphp/pest into patch-1
# Conflicts: # tests/.snapshots/success.txt
This commit is contained in:
@ -49,6 +49,14 @@
|
||||
✓ it creates unique test case names with ('Name 1', Pest\Plugin Object (), true) #3
|
||||
✓ it creates unique test case names - count
|
||||
|
||||
PASS Tests\Features\Depends
|
||||
✓ first
|
||||
✓ second
|
||||
✓ depends
|
||||
✓ depends with ...params
|
||||
✓ depends with defined arguments
|
||||
✓ depends run test only once
|
||||
|
||||
PASS Tests\Features\Exceptions
|
||||
✓ it gives access the the underlying expectException
|
||||
✓ it catch exceptions
|
||||
@ -155,5 +163,5 @@
|
||||
WARN Tests\Visual\Success
|
||||
s visual snapshot of test suite on success
|
||||
|
||||
Tests: 6 skipped, 88 passed
|
||||
Time: 3.53s
|
||||
Tests: 6 skipped, 94 passed
|
||||
Time: 3.73s
|
||||
|
||||
40
tests/Features/Depends.php
Normal file
40
tests/Features/Depends.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
$runCounter = 0;
|
||||
|
||||
test('first', function () use (&$runCounter) {
|
||||
assertTrue(true);
|
||||
$runCounter++;
|
||||
|
||||
return 'first';
|
||||
});
|
||||
|
||||
test('second', function () use (&$runCounter) {
|
||||
assertTrue(true);
|
||||
$runCounter++;
|
||||
|
||||
return 'second';
|
||||
});
|
||||
|
||||
test('depends', function () {
|
||||
assertEquals(
|
||||
['first', 'second'],
|
||||
func_get_args()
|
||||
);
|
||||
})->depends('first', 'second');
|
||||
|
||||
test('depends with ...params', function (string ...$params) {
|
||||
assertEquals(
|
||||
['first', 'second'],
|
||||
$params
|
||||
);
|
||||
})->depends('first', 'second');
|
||||
|
||||
test('depends with defined arguments', function (string $first, string $second) {
|
||||
assertEquals('first', $first);
|
||||
assertEquals('second', $second);
|
||||
})->depends('first', 'second');
|
||||
|
||||
test('depends run test only once', function () use (&$runCounter) {
|
||||
assertEquals(2, $runCounter);
|
||||
})->depends('first', 'second');
|
||||
Reference in New Issue
Block a user