Skip to content

Commit

Permalink
Merge pull request #3975 from thangnnmd/unitTest_BcFrontAppController…
Browse files Browse the repository at this point in the history
…_beforeRender

BcFrontAppController::beforeRender() ユニットテストユニットテスト
  • Loading branch information
HungDV2022 authored Nov 7, 2024
2 parents 4b7370b + 539d0f6 commit 23f95b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions plugins/baser-core/src/Controller/BcFrontAppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public function beforeFilter(EventInterface $event)
* @param EventInterface $event
* @checked
* @noTodo
* @unitTest
*/
public function beforeRender(EventInterface $event): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use BaserCore\TestSuite\BcTestCase;
use BaserCore\Utility\BcContainer;
use Cake\Core\Configure;
use Cake\Event\Event;
use CakephpFixtureFactories\Scenario\ScenarioAwareTrait;

/**
Expand Down Expand Up @@ -95,14 +96,11 @@ public function testBeforeFilter()
*/
public function testBeforeRender()
{
$this->markTestIncomplete('このテストはまだ実装されていません。');
// TODO ucmitz 本体側の実装要
/* >>>
$this->BcFrontAppController->setRequest($this->getRequest('/en/サイトID3の固定ページ'));
$this->BcFrontAppController->setRequest($this->getRequest());
$this->BcFrontAppController->beforeRender(new Event('beforeRender'));
$this->assertEquals('en', $this->BcFrontAppController->viewBuilder()->getLayoutPath());
$this->assertEquals('en', $this->BcFrontAppController->viewBuilder()->getTemplatePath());
<<< */
$viewBuilder = $this->BcFrontAppController->viewBuilder();
$this->assertEquals('BaserCore.BcFrontApp', $viewBuilder->getClassName());
$this->assertEquals('BcFront', $viewBuilder->getTheme());
}

}

0 comments on commit 23f95b5

Please sign in to comment.