Skip to content

Commit

Permalink
Merge pull request #4065 from HungDV2022/unittest_MailformHelper_create
Browse files Browse the repository at this point in the history
MailformHelper::create() ユニットテスト
  • Loading branch information
HungDV2022 authored Dec 9, 2024
2 parents 43465ff + 286ff81 commit bf0b013
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions plugins/bc-mail/src/View/Helper/MailformHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ public function control(string $fieldName, array $attributes = []): string
* @return string
* @checked
* @noTodo
* @unitTest
*/
public function create($context = null, $options = []): string
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

use BaserCore\TestSuite\BcTestCase;
use BcMail\Model\Entity\MailField;
use BcMail\Test\Factory\MailMessagesFactory;
use BcMail\View\Helper\MailformHelper;
use Cake\ORM\ResultSet;
use Cake\View\View;
Expand Down Expand Up @@ -50,7 +51,11 @@ public function testControl()
*/
public function testCreate()
{
$this->markTestIncomplete('このテストは、まだ実装されていません。');
$rs = $this->MailformHelper->create();
$this->assertTextContains('form enctype="multipart/form-data"', $rs);

$rs = $this->MailformHelper->create(MailMessagesFactory::make()->getEntity(), ['url' => '/test']);
$this->assertTextContains('action="/test"', $rs);
}

/**
Expand Down

0 comments on commit bf0b013

Please sign in to comment.