Skip to content

Commit

Permalink
MailformHelper::create() ユニットテスト
Browse files Browse the repository at this point in the history
  • Loading branch information
dovanhung committed Dec 5, 2024
1 parent 60acdbb commit 286ff81
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 286ff81

Please sign in to comment.