1818use Innmind \BlackBox \Set ;
1919use Symfony \Component \Filesystem \Filesystem as FS ;
2020
21- return static function () {
21+ return static function ($ prove ) {
2222 $ path = \rtrim (\sys_get_temp_dir (), '/ ' ).'/innmind/filesystem/ ' ;
2323
24- yield properties (
24+ yield $ prove -> properties (
2525 'Filesystem properties ' ,
2626 PAdapter::properties (),
27- Set::call (static function () use ($ path ) {
27+ Set::of (static function () use ($ path ) {
2828 (new FS )->remove ($ path );
2929
3030 return Adapter::mount (
4040 );
4141
4242 foreach (PAdapter::alwaysApplicable () as $ property ) {
43- yield property (
44- $ property ,
45- Set::call (static function () use ($ path ) {
46- (new FS )->remove ($ path );
43+ yield $ prove
44+ ->property (
45+ $ property ,
46+ Set::of (static function () use ($ path ) {
47+ (new FS )->remove ($ path );
4748
48- return Adapter::mount (
49- Path::of ($ path ),
50- match (\PHP_OS ) {
51- 'Darwin ' => CaseSensitivity::insensitive,
52- default => CaseSensitivity::sensitive,
53- },
54- )
55- ->recover (Recover::mount (...))
56- ->unwrap ();
57- }),
58- )->named ('Filesystem ' );
49+ return Adapter::mount (
50+ Path::of ($ path ),
51+ match (\PHP_OS ) {
52+ 'Darwin ' => CaseSensitivity::insensitive,
53+ default => CaseSensitivity::sensitive,
54+ },
55+ )
56+ ->recover (Recover::mount (...))
57+ ->unwrap ();
58+ }),
59+ )
60+ ->named ('Filesystem ' );
5961 }
6062
61- yield test (
63+ yield $ prove -> test (
6264 'Regression adding file in directory due to case sensitivity ' ,
6365 static function ($ assert ) use ($ path ) {
6466 $ property = new PAdapter \AddRemoveAddModificationsStillAddTheFile (
@@ -86,10 +88,10 @@ static function($assert) use ($path) {
8688 );
8789
8890 foreach (CaseSensitivity::cases () as $ case ) {
89- yield properties (
91+ yield $ prove -> properties (
9092 'Filesystem properties on simulated disk ' ,
9193 PAdapter::properties (),
92- Set::call (static fn () => Adapter::mount (
94+ Set::of (static fn () => Adapter::mount (
9395 Path::of ('/ ' ),
9496 $ case ,
9597 IO ::simulation (
@@ -100,17 +102,19 @@ static function($assert) use ($path) {
100102 );
101103
102104 foreach (PAdapter::alwaysApplicable () as $ property ) {
103- yield property (
104- $ property ,
105- Set::call (static fn () => Adapter::mount (
106- Path::of ('/ ' ),
107- $ case ,
108- IO ::simulation (
109- IO ::fromAmbientAuthority (),
110- Disk::new (),
111- ),
112- )->unwrap ()),
113- )->named ('Filesystem on simulated disk ' );
105+ yield $ prove
106+ ->property (
107+ $ property ,
108+ Set::of (static fn () => Adapter::mount (
109+ Path::of ('/ ' ),
110+ $ case ,
111+ IO ::simulation (
112+ IO ::fromAmbientAuthority (),
113+ Disk::new (),
114+ ),
115+ )->unwrap ()),
116+ )
117+ ->named ('Filesystem on simulated disk ' );
114118 }
115119 }
116120};
0 commit comments