/
call.php
35 lines (31 loc) · 928 Bytes
/
call.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
declare(strict_types = 1);
use Innmind\BlackBox\{
Set,
Random,
};
return static function() {
yield test(
'Set\Call always return a new value',
static function($assert) {
$set = Set\Call::of(static fn() => new \stdClass)->values(Random::default);
$current = $set->current()->unwrap();
$set->next();
$assert
->expected($current)
->not()
->same($set->current()->unwrap());
},
);
yield test(
'Set\Call regenerate the value when shrinking',
static function($assert) {
$set = Set\Call::of(static fn() => new \stdClass)->values(Random::default);
$current = $set->current();
$assert
->expected($current->unwrap())
->not()
->same($current->shrink()->a()->unwrap());
},
);
};