@@ -50,7 +50,20 @@ public function test_migration_generate()
5050 $ migration_path = __DIR__ . '/../Fake/migrations/ ' ;
5151 $ this ->ci ->config ->set_item ('migration_path ' , $ migration_path );
5252 $ status = $ this ->cmd ->__invoke ('migration ' , 'Test_of_generate_migration ' );
53- $ this ->assertEquals (0 , $ status );
53+ $ this ->assertEquals (Status::SUCCESS , $ status );
54+
55+ foreach (glob ($ migration_path . '*_Test_of_generate_migration.php ' ) as $ file ) {
56+ unlink ($ file );
57+ }
58+ }
59+
60+ public function test_migration_generate_class_exist ()
61+ {
62+ $ migration_path = __DIR__ . '/../Fake/migrations/ ' ;
63+ $ this ->ci ->config ->set_item ('migration_path ' , $ migration_path );
64+ $ status = $ this ->cmd ->__invoke ('migration ' , 'Test_of_generate_migration ' );
65+ $ status = $ this ->cmd ->__invoke ('migration ' , 'Test_of_generate_migration ' );
66+ $ this ->assertEquals (Status::FAILURE , $ status );
5467
5568 foreach (glob ($ migration_path . '*_Test_of_generate_migration.php ' ) as $ file ) {
5669 unlink ($ file );
@@ -63,7 +76,7 @@ public function test_migration_cannot_write_to_file()
6376 $ this ->ci ->config ->set_item ('migration_path ' , $ migration_path );
6477 $ status = $ this ->cmd ->__invoke ('migration ' , 'Test_of_generate_migration ' );
6578 $ this ->assertEquals (Status::FAILURE , $ status );
66-
79+
6780 $ this ->stderr ->rewind ();
6881 $ actual = $ this ->stderr ->fread (8192 );
6982 $ this ->assertContains ("Can't write to " , $ actual );
0 commit comments