-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add unitTest_MailConfigsController_index #3425
Merged
ryuring
merged 7 commits into
baserproject:dev-5.1
from
thangnnmd:unitTest_MailConfigsController_index
May 24, 2024
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
36dd036
add unitTest_MailConfigsController_index
78f7340
modified
b843796
Merge branch 'dev-5.1' into unitTest_MailConfigsController_index
1773b5a
modified
2fc8d46
modified
103ee3e
modified
f134eaf
Merge branch 'dev-5.1' into unitTest_MailConfigsController_index
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,22 +9,28 @@ | |
* @license https://basercms.net/license/index.html | ||
*/ | ||
namespace BcMail\Test\TestCase\Controller\Admin; | ||
use BaserCore\Test\Scenario\InitAppScenario; | ||
use BaserCore\TestSuite\BcTestCase; | ||
use BcMail\Controller\Admin\MailConfigsController; | ||
use CakephpFixtureFactories\Scenario\ScenarioAwareTrait; | ||
|
||
class MailConfigsControllerTest extends BcTestCase | ||
{ | ||
/** | ||
* ScenarioAwareTrait | ||
*/ | ||
use ScenarioAwareTrait; | ||
|
||
/** | ||
* set up | ||
* | ||
* @return void | ||
*/ | ||
public function setUp(): void | ||
{ | ||
// $this->MailConfigs = new MailConfigsController(new CakeRequest(null, false), new CakeResponse()); | ||
// | ||
// $this->Case = $this->getMockForAbstractClass('ControllerTestCase'); | ||
|
||
parent::setUp(); | ||
$this->loadFixtureScenario(InitAppScenario::class); | ||
$this->MailConfigsController = new MailConfigsController($this->loginAdmin($this->getRequest())); | ||
} | ||
|
||
/** | ||
|
@@ -34,8 +40,7 @@ public function setUp(): void | |
*/ | ||
public function tearDown(): void | ||
{ | ||
// unset($this->MailConfigs); | ||
// unset($this->Case); | ||
unset($this->MailConfigsController); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @thangnnmd @HungDV2022 これは不要ですね There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ryuring こちらを修正しました。確認お願いします。 |
||
parent::tearDown(); | ||
} | ||
|
||
|
@@ -74,4 +79,23 @@ public static function admin_formDataProvider() | |
], '\/admin\/mail\/mail_configs\/form'] | ||
]; | ||
} | ||
|
||
/** | ||
* test index | ||
*/ | ||
public function testIndex() | ||
{ | ||
$this->enableSecurityToken(); | ||
$this->enableCsrfToken(); | ||
|
||
//request is get | ||
$this->get('/baser/admin/bc-mail/mail_configs/index'); | ||
$this->assertResponseOk(); | ||
|
||
//request is post | ||
$this->post('/baser/admin/bc-mail/mail_configs/index', ['name_add' => 'test']); | ||
$this->assertResponseCode(302); | ||
$this->assertFlashMessage('メールプラグイン設定を保存しました。'); | ||
$this->assertRedirect('/baser/admin/bc-mail/mail_configs/index'); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thangnnmd @HungDV2022 この行は使ってないですね
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thangnnmd
làm giống thằng này xem nhé a
#3423 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ryuring
こちらを調整しました。確認お願いします。