Skip to content

Commit

Permalink
Merge pull request #3943 from thangnnmd/unitTest_MailFieldsController…
Browse files Browse the repository at this point in the history
…_view

MailFieldsController::view
  • Loading branch information
HungDV2022 authored Oct 24, 2024
2 parents f889863 + f7a969f commit 117c888
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public function index(MailFieldsServiceInterface $service)
*
* @checked
* @noTodo
* @unitTest
*/
public function view(MailFieldsServiceInterface $service, int $id)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,4 +271,23 @@ public function testUpdateSort()
$result = json_decode((string)$this->_response->getBody());
$this->assertEquals($result->message, 'メールフィールド「性」の並び替えを更新しました。');
}

/**
* test view
*/
public function testView()
{
//Create data
$this->loadFixtureScenario(MailFieldsScenario::class);
$this->loadFixtureScenario(MailContentsScenario::class);

$this->get("/baser/api/admin/bc-mail/mail_fields/view/1.json?token=" . $this->accessToken);
$this->assertResponseOk();

//Check the return value
$result = json_decode((string)$this->_response->getBody());
$this->assertEquals('', $result->mailField->name);
$this->assertEquals('お名前', $result->mailField->head);
$this->assertEquals('text', $result->mailField->type);
}
}

0 comments on commit 117c888

Please sign in to comment.