Skip to content

Commit 03af379

Browse files
committed
add UTF-8 characters in the template and a new campaign
1 parent 9adf991 commit 03af379

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

tests/phpunit/restapi.php

+32-2
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,37 @@ function testCreateCampaign($templateId) {
702702
$campaignID = $result->data->id;
703703
return $campaignID;
704704
}
705-
705+
706+
/**
707+
*
708+
* test creating a campaign with UTF-8 characters
709+
*/
710+
711+
function testCreateCampaignUTF8() {
712+
$post_params = array(
713+
'subject' => 'Test Campaign created by API '.time(),
714+
'fromfield' => 'From Name [email protected]',
715+
'replyto' => '',
716+
'message' => '快速的棕色狐狸跳过懒狗',
717+
'textmessage' => '快速的棕色狐狸跳过懒狗',
718+
'footer' => 'Footer',
719+
'status' => 'submitted',
720+
'sendformat' => 'both',
721+
'template' => 0,
722+
'embargo' => date('Y-m-d'),
723+
'rsstemplate' => '',
724+
'owner' => 0,
725+
'htmlformatted' => 1,
726+
);
727+
728+
$result = $this->callAPI('campaignAdd', $post_params);
729+
$this->assertEquals('success', $result->status);
730+
$campaignID = $result->data->id;
731+
$this->assertEquals($result->data->message,'快速的棕色狐狸跳过懒狗');
732+
return $campaignID;
733+
}
734+
735+
706736
/**
707737
* update a campaign
708738
* @depends testCreateCampaign
@@ -755,7 +785,7 @@ public function testCountCampaignsAgain($campaignCount)
755785

756786
$result = $this->callAPI('campaignsCount', $post_params);
757787
$this->assertEquals('success', $result->status);
758-
$this->assertEquals($campaignCount+1, $result->data->total);
788+
$this->assertEquals($campaignCount+2, $result->data->total);
759789
$campaignCount = $result->data->total;
760790

761791
return $campaignCount;

tests/phpunit/test-template1.html

+5
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,10 @@ <h3 style="margin:10px;text-align:right;font-weight:normal; color:#FFF !importan
2020
</tr>
2121
</tbody>
2222
</table>
23+
24+
<p>Some texts in UTF-8</p>
25+
<p>快速的棕色狐狸跳过懒狗</p>
26+
<p>速い茶色のキツネは、のろまなイヌに飛びかかりました</p>
27+
2328
</div>
2429
</div>

0 commit comments

Comments
 (0)