Skip to content

Commit

Permalink
add unitTest_BcMailBaserHelper_methods (#3376)
Browse files Browse the repository at this point in the history
Co-authored-by: thangnn <[email protected]>
  • Loading branch information
thangnnmd and thangnn authored Apr 24, 2024
1 parent f88d52f commit 799d8f9
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/bc-mail/src/View/Helper/BcMailBaserHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class BcMailBaserHelper extends Helper implements BcPluginBaserHelperInterface
* @return array[]
* @checked
* @noTodo
* @unitTest
*/
public function methods(): array
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php

namespace BcMail\Test\TestCase\View\Helper;

use BaserCore\TestSuite\BcTestCase;
use BcMail\View\Helper\BcMailBaserHelper;
use Cake\View\View;

class BcMailBaserHelperTest extends BcTestCase
{
/**
* setUp
*
* @return void
*/
public function setUp(): void
{
parent::setUp();
$this->BcMailBaser = new BcMailBaserHelper(new View());
}

/**
* tearDown
*
*/
public function tearDown(): void
{
parent::tearDown();
}

/**
* test methods
*/
public function testMethods()
{
$methods = $this->BcMailBaser->methods();
$this->assertEquals(['Mail', 'isMail'], $methods['isMail']);
$this->assertEquals(['Mail', 'descriptionExists'], $methods['mailFormDescriptionExists']);
$this->assertEquals(['Mail', 'description'], $methods['mailFormDescription']);
$this->assertEquals(['Mailform', 'freeze'], $methods['freezeMailForm']);
$this->assertEquals(['Mailform', 'create'], $methods['createMailForm']);
$this->assertEquals(['Mailform', 'hidden'], $methods['mailFormHidden']);
$this->assertEquals(['Mailform', 'authCaptcha'], $methods['mailFormAuthCaptcha']);
$this->assertEquals(['Mailform', 'submit'], $methods['mailFormSubmit']);
$this->assertEquals(['Mailform', 'end'], $methods['endMailForm']);
$this->assertEquals(['Mailform', 'unlockField'], $methods['unlockMailFormField']);
$this->assertEquals(['Mailform', 'getSourceValue'], $methods['getMailFormSourceValue']);
$this->assertEquals(['Mailform', 'error'], $methods['mailFormError']);
$this->assertEquals(['Mailform', 'control'], $methods['mailFormControl']);
$this->assertEquals(['Mailform', 'getGroupValidErrors'], $methods['getMailFormGroupValidErrors']);
$this->assertEquals(['Mailform', 'isGroupLastField'], $methods['isMailFormGroupLastField']);
$this->assertEquals(['Mailform', 'label'], $methods['mailFormLabel']);
}
}

0 comments on commit 799d8f9

Please sign in to comment.