Skip to content

Commit

Permalink
Merge pull request #3948 from thangnnmd/unitTest_MailMessagesContrlle…
Browse files Browse the repository at this point in the history
…r_beforeFilter

MailMessagesContrller::beforeFilter
  • Loading branch information
HungDV2022 authored Oct 28, 2024
2 parents d827feb + cd035c2 commit 7d9ff78
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class MailMessagesController extends BcApiController
* @return \Cake\Http\Response|void
* @checked
* @noTodo
* @unitTest
*/
public function beforeFilter(EventInterface $event)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
use BaserCore\Test\Factory\ContentFactory;
use BaserCore\Test\Scenario\InitAppScenario;
use BaserCore\TestSuite\BcTestCase;
use BcMail\Controller\Api\MailMessagesController;
use BcMail\Service\MailMessagesServiceInterface;
use BcMail\Test\Factory\MailContentFactory;
use BcMail\Test\Scenario\MailContentsScenario;
use Cake\Event\Event;
use Cake\ORM\Entity;
use Cake\ORM\TableRegistry;
use Cake\TestSuite\IntegrationTestTrait;
Expand Down Expand Up @@ -56,6 +58,19 @@ public function tearDown(): void
parent::tearDown();
}


/**
* test beforeFilter
*/
public function testBeforeFilter()
{
$this->MailMessagesController = new MailMessagesController($this->getRequest());
$event = new Event('Controller.beforeFilter', $this->MailMessagesController);
$this->MailMessagesController->beforeFilter($event);
$config = $this->MailMessagesController->FormProtection->getConfig('validate');
$this->assertFalse($config);
}

/**
* [API] 受信メール一覧
*/
Expand Down

0 comments on commit 7d9ff78

Please sign in to comment.