Skip to content

Commit

Permalink
ユニットテスト調整
Browse files Browse the repository at this point in the history
  • Loading branch information
dovanhung committed Dec 27, 2024
1 parent c45a87a commit 72036db
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ public function testBeforeFilter()
public function testIndex()
{
Configure::write("BcEnv.isInstalled", false);

//backup file
copy(ROOT . DS . 'config' . DS . '.env', ROOT . DS . 'config' . DS . '.env.bak');
copy(ROOT . DS . 'config' . DS . 'install.php', ROOT . DS . 'config' . DS . 'install.php.bak');
copy(ROOT . DS . 'vendor' . DS . 'autoload.php', ROOT . DS . 'vendor' . DS . 'autoload.php.bak');
$this->get('/');

//CSRFがあるか確認すること
Expand All @@ -71,6 +74,10 @@ public function testIndex()
$this->assertNotEmpty($cookies['csrfToken;;/']);

Configure::write("BcEnv.isInstalled", true);
//backup
rename(ROOT . DS . 'config' . DS . '.env.bak', ROOT . DS . 'config' . DS . '.env');
rename(ROOT . DS . 'config' . DS . 'install.php.bak', ROOT . DS . 'config' . DS . 'install.php');
rename(ROOT . DS . 'vendor' . DS . 'autoload.php.bak', ROOT . DS . 'vendor' . DS . 'autoload.php');
}

/**
Expand Down

0 comments on commit 72036db

Please sign in to comment.