@@ -457,10 +457,9 @@ public function testSeedStateTracking(): void
457457 $ query = $ connection ->execute ('SELECT COUNT(*) FROM numbers ' );
458458 $ this ->assertEquals (1 , $ query ->fetchColumn (0 ));
459459
460- // Second run should skip the seed (already executed)
460+ // Second run should silently skip the seed (already executed)
461461 $ this ->exec ('seeds run -c test NumbersSeed ' );
462462 $ this ->assertExitSuccess ();
463- $ this ->assertOutputContains ('Numbers seed:</info> <comment>already executed ' );
464463 $ this ->assertOutputNotContains ('seeding ' );
465464
466465 // Verify no additional data was inserted
@@ -543,9 +542,9 @@ public function testIdempotentSeed(): void
543542 $ query = $ connection ->execute ('SELECT COUNT(*) FROM numbers WHERE number = 99 ' );
544543 $ this ->assertEquals (2 , $ query ->fetchColumn (0 ));
545544
546- // Verify the seed was NOT tracked in cake_seeds table
545+ // Verify the seed WAS tracked in cake_seeds table (only one record, updated each run)
547546 $ seedLog = $ connection ->execute ('SELECT COUNT(*) FROM cake_seeds WHERE seed_name = \'IdempotentTestSeed \'' );
548- $ this ->assertEquals (0 , $ seedLog ->fetchColumn (0 ), 'Idempotent seeds should not be tracked ' );
547+ $ this ->assertEquals (1 , $ seedLog ->fetchColumn (0 ), 'Idempotent seeds should track last execution ' );
549548 }
550549
551550 public function testNonIdempotentSeedIsTracked (): void
@@ -564,10 +563,9 @@ public function testNonIdempotentSeedIsTracked(): void
564563 $ seedLog = $ connection ->execute ('SELECT COUNT(*) FROM cake_seeds WHERE seed_name = \'NumbersSeed \'' );
565564 $ this ->assertEquals (1 , $ seedLog ->fetchColumn (0 ), 'Regular seeds should be tracked ' );
566565
567- // Run again - should be skipped
566+ // Run again - should be silently skipped
568567 $ this ->exec ('seeds run -c test NumbersSeed ' );
569568 $ this ->assertExitSuccess ();
570- $ this ->assertOutputContains ('already executed ' );
571569 $ this ->assertOutputNotContains ('seeding ' );
572570 }
573571
@@ -594,10 +592,10 @@ public function testFakeSeedMarksAsExecuted(): void
594592 $ seedLog = $ connection ->execute ('SELECT COUNT(*) FROM cake_seeds WHERE seed_name = \'NumbersSeed \'' );
595593 $ this ->assertEquals (1 , $ seedLog ->fetchColumn (0 ), 'Fake seeds should be tracked ' );
596594
597- // Running again should show already executed
595+ // Running again should be silently skipped
598596 $ this ->exec ('seeds run -c test NumbersSeed ' );
599597 $ this ->assertExitSuccess ();
600- $ this ->assertOutputContains ( ' already executed ' );
598+ $ this ->assertOutputNotContains ( ' seeding ' );
601599 }
602600
603601 public function testFakeSeedWithForce (): void
@@ -692,7 +690,7 @@ public function testResetNonExistentSeed(): void
692690 $ this ->assertErrorContains ('Seed `NonExistent` does not exist ' );
693691 }
694692
695- public function testFakeIdempotentSeedIsSkipped (): void
693+ public function testFakeIdempotentSeedIsTracked (): void
696694 {
697695 $ this ->createTables ();
698696
@@ -702,12 +700,15 @@ public function testFakeIdempotentSeedIsSkipped(): void
702700 // Run idempotent seed with --fake flag
703701 $ this ->exec ('seeds run -c test -s TestSeeds IdempotentTest --fake ' );
704702 $ this ->assertExitSuccess ();
705- $ this ->assertOutputContains ('skipped (idempotent) ' );
706- $ this ->assertOutputNotContains ('faking ' );
707- $ this ->assertOutputNotContains ('faked ' );
703+ $ this ->assertOutputContains ('faking ' );
704+ $ this ->assertOutputContains ('faked ' );
705+
706+ // Verify NO data was inserted
707+ $ query = $ connection ->execute ('SELECT COUNT(*) FROM numbers WHERE number = 99 ' );
708+ $ this ->assertEquals (0 , $ query ->fetchColumn (0 ), 'Fake seed should not insert data ' );
708709
709- // Verify the seed was NOT tracked (idempotent seeds are never tracked)
710+ // Verify the seed WAS tracked
710711 $ seedLog = $ connection ->execute ('SELECT COUNT(*) FROM cake_seeds WHERE seed_name = \'IdempotentTestSeed \'' );
711- $ this ->assertEquals (0 , $ seedLog ->fetchColumn (0 ), 'Idempotent seeds should not be tracked even when faked ' );
712+ $ this ->assertEquals (1 , $ seedLog ->fetchColumn (0 ), 'Idempotent seeds should be tracked when faked ' );
712713 }
713714}
0 commit comments