Skip to content

Commit

Permalink
Merge branch 'unittest_InstallationsController_step3' into unittest_I…
Browse files Browse the repository at this point in the history
…nstallationsController

# Conflicts:
#	plugins/bc-installer/tests/TestCase/Controller/Admin/InstallationsControllerTest.php
  • Loading branch information
dovanhung committed Dec 26, 2024
2 parents 2453f8a + a7720a7 commit 4660ea3
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public function step2(InstallationsAdminServiceInterface $service)
* @return void|Response
* @noTodo
* @checked
* @unitTest
*/
public function step3(InstallationsAdminServiceInterface $service)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,41 @@ public function testStep2()
*/
public function testStep3()
{
$this->markTestIncomplete('このテストは、まだ実装されていません。');
$this->enableSecurityToken();
$this->enableCsrfToken();
Configure::write("BcEnv.isInstalled", false);

$this->get('/baser/admin/bc-installer/installations/step3');
$this->assertResponseCode(200);

$config = [
'mode' => 'back',
'dbType' => 'mysql',
'dbHost' => 'localhost',
'dbPrefix' => '',
'dbPort' => '3306',
'dbUsername' => 'dbUsername',
'dbPassword' => 'dbPassword',
'dbSchema' => 'dbSchema',
'dbName' => 'basercms',
'dbEncoding' => 'utf-8',
'dbDataPattern' => 'BcThemeSample.default'
];

$this->post('/baser/admin/bc-installer/installations/step3', $config);
$this->assertResponseCode(302);
$this->assertRedirect('/baser/admin/bc-installer/installations/step2');

$config['mode'] = 'checkDb';
$this->post('/baser/admin/bc-installer/installations/step3', $config);
$this->assertResponseCode(200);

$config['mode'] = 'createDb';
$this->post('/baser/admin/bc-installer/installations/step3', $config);
$this->assertResponseCode(200);


Configure::write("BcEnv.isInstalled", true);
}

/**
Expand Down

0 comments on commit 4660ea3

Please sign in to comment.