From 50cf149ed11b6ecc3ea5edfd0f3bcbd4a43776e4 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sun, 11 Nov 2018 18:44:14 +0700 Subject: [PATCH 1/3] un-ignore application/Database/Migrations from .gitignore --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index 8c2410bfcace..0d7c79ac2321 100644 --- a/.gitignore +++ b/.gitignore @@ -67,8 +67,6 @@ writable/uploads/* writable/debugbar/* -application/Database/Migrations/2* - php_errors.log #------------------------- From 1ac5aabfd1989243ee2f9ca00ac5a4e58de6fb32 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Mon, 12 Nov 2018 01:21:30 +0700 Subject: [PATCH 2/3] update migration tests to remove migration file after run migration --- tests/system/Commands/SessionsCommandsTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/system/Commands/SessionsCommandsTest.php b/tests/system/Commands/SessionsCommandsTest.php index d89cf87f41b2..529200441898 100644 --- a/tests/system/Commands/SessionsCommandsTest.php +++ b/tests/system/Commands/SessionsCommandsTest.php @@ -51,6 +51,7 @@ public function setUp() public function tearDown() { stream_filter_remove($this->stream_filter); + system('rm ' . APPPATH . '/Database/Migrations/*.php'); } public function testCreateMigrationCommand() From 9c73d4a55a966f9745c01d37b34f9fad701f2d9e Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Tue, 20 Nov 2018 13:12:24 +0700 Subject: [PATCH 3/3] update tests to only remove created migrations file in tests --- tests/system/Commands/SessionsCommandsTest.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/system/Commands/SessionsCommandsTest.php b/tests/system/Commands/SessionsCommandsTest.php index 529200441898..95c03fd5ba94 100644 --- a/tests/system/Commands/SessionsCommandsTest.php +++ b/tests/system/Commands/SessionsCommandsTest.php @@ -16,6 +16,7 @@ class SessionsCommandsTest extends \CIUnitTestCase protected $response; protected $logger; protected $runner; + private $result; public function setUp() { @@ -51,7 +52,14 @@ public function setUp() public function tearDown() { stream_filter_remove($this->stream_filter); - system('rm ' . APPPATH . '/Database/Migrations/*.php'); + + $result = remove_invisible_characters($this->result); + $result = str_replace('[0;32m', '', $result); + $result = str_replace('[0m', '', $result); + $file = trim(substr($result, 14)); + $file = str_replace('APPPATH', APPPATH, $file); + + unlink($file); } public function testCreateMigrationCommand() @@ -65,6 +73,8 @@ public function testCreateMigrationCommand() $this->assertContains('Created file:', $result); $this->assertContains('APPPATH/Database/Migrations/', $result); $this->assertContains('_create_ci_sessions_table.php', $result); + + $this->result = $result; } public function testOverriddenCreateMigrationCommand() @@ -85,6 +95,8 @@ public function testOverriddenCreateMigrationCommand() $this->assertContains('Created file:', $result); $this->assertContains('APPPATH/Database/Migrations/', $result); $this->assertContains('_create_mygoodies_table.php', $result); + + $this->result = $result; } }