3030use Innmind \Immutable \Sequence ;
3131use Innmind \BlackBox \Set ;
3232
33- $ proofs = static function (Url $ dsn , Driver $ driver ) {
33+ $ proofs = static function ($ prove , Url $ dsn , Driver $ driver ) {
3434 $ connection = Connection::new ($ dsn )->unwrap ();
3535 Properties::seed ($ connection );
36- $ connections = Set::call (static function () use ($ connection ) {
36+ $ connections = Set::of (static function () use ($ connection ) {
3737 Properties::seed ($ connection );
3838
3939 return $ connection ;
4040 });
4141
42- yield test (
42+ yield $ prove -> test (
4343 "PDO interface( {$ driver ->name }) " ,
4444 static fn ($ assert ) => $ assert
4545 ->object ($ connection )
4646 ->instance (Connection::class),
4747 );
4848
49- yield test (
49+ yield $ prove -> test (
5050 "PDO lazy select doesnt load everything in memory( {$ driver ->name }) " ,
5151 static function ($ assert ) use ($ connection ) {
5252 $ table = Table \Name::of ('test_lazy_load ' );
@@ -91,7 +91,7 @@ static function($assert) use ($connection) {
9191 );
9292
9393 if ($ driver === Driver::mysql) {
94- yield test (
94+ yield $ prove -> test (
9595 "PDO charset( {$ driver ->name }) " ,
9696 static function ($ assert ) use ($ connection , $ dsn ) {
9797 $ table = Table \Name::of ('test_charset ' );
@@ -144,7 +144,7 @@ static function($assert) use ($connection, $dsn) {
144144 );
145145 }
146146
147- yield test (
147+ yield $ prove -> test (
148148 "Select join( {$ driver ->name }) " ,
149149 static function ($ assert ) use ($ connection ) {
150150 $ table = Table \Name::of ('test_left_join ' );
@@ -250,7 +250,7 @@ public function value(): int
250250 },
251251 );
252252
253- yield test (
253+ yield $ prove -> test (
254254 "Delete cascade( {$ driver ->name }) " ,
255255 static function ($ assert ) use ($ connection ) {
256256 $ parent = Table \Name::of ('test_cascade_delete_parent ' );
@@ -309,7 +309,7 @@ static function($assert) use ($connection) {
309309 },
310310 );
311311
312- yield test (
312+ yield $ prove -> test (
313313 "Delete set null( {$ driver ->name }) " ,
314314 static function ($ assert ) use ($ connection ) {
315315 $ parent = Table \Name::of ('test_set_null_delete_parent ' );
@@ -375,7 +375,7 @@ static function($assert) use ($connection) {
375375 },
376376 );
377377
378- yield test (
378+ yield $ prove -> test (
379379 "Foreign key name( {$ driver ->name }) " ,
380380 static function ($ assert ) use ($ driver ) {
381381 $ parent = Table \Name::of ('parent_table ' );
@@ -392,7 +392,7 @@ static function($assert) use ($driver) {
392392 },
393393 );
394394
395- yield test (
395+ yield $ prove -> test (
396396 "Delete join( {$ driver ->name }) " ,
397397 static function ($ assert ) use ($ connection ) {
398398 $ parent = Table \Name::of ('test_join_delete_parent ' )->as ('parent ' );
@@ -465,10 +465,10 @@ static function($assert) use ($connection) {
465465 },
466466 );
467467
468- yield proof (
469- "Unique constraint( {$ driver ->name }) " ,
470- given (Set::integers ()->between (0 , 1_000_000 )),
471- static function ($ assert , $ int ) use ($ connection ) {
468+ yield $ prove
469+ -> proof ( "Unique constraint( {$ driver ->name }) " )
470+ -> given (Set::integers ()->between (0 , 1_000_000 ))
471+ -> test ( static function ($ assert , $ int ) use ($ connection ) {
472472 $ table = Table \Name::of ('test_unique ' );
473473 $ _ = $ connection (CreateTable::ifNotExists (
474474 $ table ,
@@ -506,34 +506,37 @@ static function($assert, $int) use ($connection) {
506506 )));
507507
508508 $ _ = $ connection (DropTable::named ($ table ));
509- },
510- );
509+ });
511510
512- yield properties (
511+ yield $ prove -> properties (
513512 "PDO properties( {$ driver ->name }) " ,
514513 Properties::any (),
515514 $ connections ,
516515 );
517516
518517 foreach (Properties::list () as $ property ) {
519- yield property (
520- $ property ,
521- $ connections ,
522- )->named ("PDO( {$ driver ->name }) " );
518+ yield $ prove
519+ ->property (
520+ $ property ,
521+ $ connections ,
522+ )
523+ ->named ("PDO( {$ driver ->name }) " );
523524 }
524525};
525526
526- return static function () use ($ proofs ) {
527+ return static function ($ prove ) use ($ proofs ) {
527528 $ port = \getenv ('DB_PORT ' ) ?: '3306 ' ;
528529
529530 yield from $ proofs (
531+ $ prove ,
530532 Url::of ("mysql://root:root@127.0.0.1: $ port/example " ),
531533 Driver::mysql,
532534 );
533535
534536 $ port = \getenv ('POSTGRES_DB_PORT ' ) ?: '5432 ' ;
535537
536538 yield from $ proofs (
539+ $ prove ,
537540 Url::of ("pgsql://root:root@127.0.0.1: $ port/example " ),
538541 Driver::postgres,
539542 );
0 commit comments