Skip to content

Commit 6647d04

Browse files
author
unknown
committed
modify test interface
1 parent df4b17b commit 6647d04

File tree

7 files changed

+36
-36
lines changed

7 files changed

+36
-36
lines changed

web/tests/controllers/getConfigTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function tearDown() {
2929
public function testGetConfig() {
3030
$this->CI->rawdata = dirname(__FILE__) . '/testdata_config/ok.json';
3131
ob_start();
32-
$this->CI->getOnlineConfiguration();
32+
$this->CI->pushpolicyquery();
3333
$output = ob_get_clean();
3434
$this -> assertEquals(
3535
'{"reply":{"fileSize":1,"flag":1,"msg":"ok","autoGetLocation":"1","updateOnlyWifi":"1","sessionMillis":"3000","intervalTime":5,"reportPolicy":"1","returnCode":{"domain":"","type":"S","code":"AAAAAA"}}}',
@@ -41,7 +41,7 @@ public function testGetConfig() {
4141
public function testGetConfig1() {
4242
$this->CI->rawdata = dirname(__FILE__) . '/testjson/empty.json';
4343
ob_start();
44-
$this->CI->getOnlineConfiguration();
44+
$this->CI->pushpolicyquery();
4545
$output = ob_get_clean();
4646
$this -> assertEquals(
4747
'{"reply":{"fileSize":1,"flag":-3,"msg":"Invalid content from php:\/\/input.","returnCode":{"domain":"","type":"S","code":"AAAAAA"}}}',
@@ -53,7 +53,7 @@ public function testGetConfig1() {
5353
public function testGetConfig2() {
5454
$this->CI->rawdata = dirname(__FILE__) . '/testjson/partly.json';
5555
ob_start();
56-
$this->CI->getOnlineConfiguration();
56+
$this->CI->pushpolicyquery();
5757
$output = ob_get_clean();
5858
$this -> assertEquals(
5959
'{"reply":{"fileSize":1,"flag":-5,"msg":"Appkey is not in json.","returnCode":{"domain":"","type":"S","code":"AAAAAA"}}}',
@@ -65,7 +65,7 @@ public function testGetConfig2() {
6565
public function testGetConfig3() {
6666
$this->CI->rawdata = dirname(__FILE__) . '/testdata_config/noappkey.json';
6767
ob_start();
68-
$this->CI->getOnlineConfiguration();
68+
$this->CI->pushpolicyquery();
6969
$output = ob_get_clean();
7070
$this -> assertEquals(
7171
'{"reply":{"fileSize":1,"flag":-5,"msg":"Appkey is not in json.","returnCode":{"domain":"","type":"S","code":"AAAAAA"}}}',
@@ -76,7 +76,7 @@ public function testGetConfig3() {
7676
public function testGetConfig4() {
7777
$this->CI->rawdata = dirname(__FILE__) . '/testdata_config/errorappkey.json';
7878
ob_start();
79-
$this->CI->getOnlineConfiguration();
79+
$this->CI->pushpolicyquery();
8080
$output = ob_get_clean();
8181
$this -> assertEquals(
8282
'{"reply":{"fileSize":1,"flag":-5,"msg":"Appkey is not in json.","returnCode":{"domain":"","type":"S","code":"AAAAAA"}}}',

web/tests/controllers/getUpdateTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testUpdate()
3434
{
3535
$this->CI->rawdata = dirname(__FILE__) . '/testdata_update/ok.json';
3636
ob_start();
37-
$this->CI->getApplicationUpdate();
37+
$this->CI->appupdate();
3838
$output = ob_get_clean();
3939
$this->assertEquals(
4040
'{"reply":{"flag":1,"msg":"ok","fileUrl":"http:\/\/localhost","forceupdate":"0","description":"android","time":"2016-05-01 21:45:22","versionName":"3","returnCode":{"domain":"","type":"S","code":"AAAAAA"}}}',
@@ -46,7 +46,7 @@ public function testUpdate_noupdate()
4646
{
4747
$this->CI->rawdata = dirname(__FILE__) . '/testjson/update_noupdate.json';
4848
ob_start();
49-
$this->CI->getApplicationUpdate();
49+
$this->CI->appupdate();
5050
$output = ob_get_clean();
5151
$this->assertEquals(//'{"reply":{"flag":-5,"msg":"Appkey is not in json.","returnCode":{"domain":"","type":"S","code":"AAAAAA"}}}',
5252
'{"reply":{"flag":-1,"msg":"Invalid appkey:49d0b54ea086922f0dd5459269d338ce","returnCode":{"domain":"","type":"S","code":"AAAAAA"}}}',
@@ -57,7 +57,7 @@ public function testUpdate1()
5757
{
5858
$this->CI->rawdata = dirname(__FILE__) . '/testjson/empty.json';
5959
ob_start();
60-
$this->CI->getApplicationUpdate();
60+
$this->CI->appupdate();
6161
$output = ob_get_clean();
6262
$this->assertEquals(//'{"reply":{"flag":-5,"msg":"Appkey is not in json.","returnCode":{"domain":"","type":"S","code":"AAAAAA"}}}',
6363
'{"reply":{"flag":-3,"msg":"Invalid content from php:\/\/input.","returnCode":{"domain":"","type":"S","code":"AAAAAA"}}}',
@@ -68,7 +68,7 @@ public function testUpdate2()
6868
{
6969
$this->CI->rawdata = dirname(__FILE__) . '/testjson/partly.json';
7070
ob_start();
71-
$this->CI->getApplicationUpdate();
71+
$this->CI->appupdate();
7272
$output = ob_get_clean();
7373
$this->assertEquals('{"reply":{"flag":-5,"msg":"Appkey is not in json.","returnCode":{"domain":"","type":"S","code":"AAAAAA"}}}',
7474
$output);
@@ -78,7 +78,7 @@ public function testUpdate3()
7878
{
7979
$this->CI->rawdata = dirname(__FILE__) . '/testdata_update/noappkey.json';
8080
ob_start();
81-
$this->CI->getApplicationUpdate();
81+
$this->CI->appupdate();
8282
$output = ob_get_clean();
8383
$this->assertEquals('{"reply":{"flag":-5,"msg":"Appkey is not in json.","returnCode":{"domain":"","type":"S","code":"AAAAAA"}}}',
8484
$output);
@@ -88,7 +88,7 @@ public function testUpdate4()
8888
{
8989
$this->CI->rawdata = dirname(__FILE__) . '/testjson/invalidappkey.json';
9090
ob_start();
91-
$this->CI->getApplicationUpdate();
91+
$this->CI->appupdate();
9292
$output = ob_get_clean();
9393
$this->assertEquals('{"reply":{"flag":-5,"msg":"Appkey is not in json.","returnCode":{"domain":"","type":"S","code":"AAAAAA"}}}',
9494
$output);

web/tests/controllers/postclientdataTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function tearDown() {
2626
public function testPostClientdata() {
2727
$this->CI->rawdata = dirname(__FILE__) . '/testdata_client/ok.json';
2828
ob_start();
29-
$this->CI->postClientdata();
29+
$this->CI->clientdata();
3030
$output = ob_get_clean();
3131
$this -> assertEquals(
3232
'{"flag":1,"msg":"ok"}',
@@ -37,7 +37,7 @@ public function testPostClientdata() {
3737
public function testPostClientdata1() {
3838
$this->CI->rawdata = dirname(__FILE__) . '/testjson/empty.json';
3939
ob_start();
40-
$this->CI->postClientdata();
40+
$this->CI->clientdata();
4141
$output = ob_get_clean();
4242
$this -> assertEquals(
4343
'{"flag":-3,"msg":"Invalid content from php:\/\/input."}',
@@ -48,7 +48,7 @@ public function testPostClientdata1() {
4848
public function testPostClientdata2() {
4949
$this->CI->rawdata = dirname(__FILE__) . '/testjson/partly.json';
5050
ob_start();
51-
$this->CI->postClientdata();
51+
$this->CI->clientdata();
5252
$output = ob_get_clean();
5353
$this -> assertEquals(
5454
'{"flag":-4,"msg":"Parse json data failed."}',
@@ -59,7 +59,7 @@ public function testPostClientdata2() {
5959
public function testPostClientdata3() {
6060
$this->CI->rawdata = dirname(__FILE__) . '/testdata_client/noappkey.json';
6161
ob_start();
62-
$this->CI->postClientdata();
62+
$this->CI->clientdata();
6363
$output = ob_get_clean();
6464
$this -> assertEquals(
6565
'{"flag":-5,"msg":"Appkey is not set in json."}',
@@ -70,7 +70,7 @@ public function testPostClientdata3() {
7070
public function testPostClientdata4() {
7171
$this->CI->rawdata = dirname(__FILE__) . '/testdata_client/errorappkey.json';
7272
ob_start();
73-
$this->CI->postClientdata();
73+
$this->CI->clientdata();
7474
$output = ob_get_clean();
7575
$this -> assertEquals(
7676
'{"flag":-1,"msg":"Invalid appkey:invalid_appkey_00000"}',

web/tests/controllers/posterrorTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function tearDown() {
2626
public function testPostError() {
2727
$this->CI->rawdata = dirname(__FILE__) . '/testdata_error/ok.json';
2828
ob_start();
29-
$this->CI->postErrorLog();
29+
$this->CI->errorlog();
3030
$output = ob_get_clean();
3131
$this -> assertEquals(
3232
'{"flag":1,"msg":"ok"}',
@@ -37,7 +37,7 @@ public function testPostError() {
3737
public function testPostError1() {
3838
$this->CI->rawdata = dirname(__FILE__) . '/testjson/empty.json';
3939
ob_start();
40-
$this->CI->postErrorLog();
40+
$this->CI->errorlog();
4141
$output = ob_get_clean();
4242
$this -> assertEquals(
4343
'{"flag":-3,"msg":"Invalid content from php:\/\/input."}',
@@ -48,7 +48,7 @@ public function testPostError1() {
4848
public function testPostError2() {
4949
$this->CI->rawdata = dirname(__FILE__) . '/testjson/partly.json';
5050
ob_start();
51-
$this->CI->postErrorLog();
51+
$this->CI->errorlog();
5252
$output = ob_get_clean();
5353
$this -> assertEquals(
5454
'{"flag":-4,"msg":"Parse json data failed."}',
@@ -59,7 +59,7 @@ public function testPostError2() {
5959
public function testPostError3() {
6060
$this->CI->rawdata = dirname(__FILE__) . '/testdata_error/noappkey.json';
6161
ob_start();
62-
$this->CI->postErrorLog();
62+
$this->CI->errorlog();
6363
$output = ob_get_clean();
6464
$this -> assertEquals(
6565
'{"flag":-5,"msg":"Appkey is not set in json."}',
@@ -70,7 +70,7 @@ public function testPostError3() {
7070
public function testPostError4() {
7171
$this->CI->rawdata = dirname(__FILE__) . '/testdata_error/errorappkey.json';
7272
ob_start();
73-
$this->CI->postErrorLog();
73+
$this->CI->errorlog();
7474
$output = ob_get_clean();
7575
$this -> assertEquals(
7676
'{"flag":-1,"msg":"Invalid appkey:invalid_appkey_00000"}',

web/tests/controllers/posteventTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function tearDown() {
2828
public function testPostEvent() {
2929
$this->CI->rawdata = dirname(__FILE__) . '/testdata_event/ok.json';
3030
ob_start();
31-
$this->CI->postEvent();
31+
$this->CI->eventlog();
3232
$output = ob_get_clean();
3333
$this -> assertEquals(
3434
'{"flag":1,"msg":"ok"}',
@@ -39,7 +39,7 @@ public function testPostEvent() {
3939
public function testPostEvent1() {
4040
$this->CI->rawdata = dirname(__FILE__) . '/testjson/empty.json';
4141
ob_start();
42-
$this->CI->postEvent();
42+
$this->CI->eventlog();
4343
$output = ob_get_clean();
4444
$this -> assertEquals(
4545
'{"flag":-3,"msg":"Invalid content from php:\/\/input."}',
@@ -50,7 +50,7 @@ public function testPostEvent1() {
5050
public function testPostEvent2() {
5151
$this->CI->rawdata = dirname(__FILE__) . '/testjson/partly.json';
5252
ob_start();
53-
$this->CI->postEvent();
53+
$this->CI->eventlog();
5454
$output = ob_get_clean();
5555
$this -> assertEquals(
5656
'{"flag":-4,"msg":"Parse json data failed."}',
@@ -61,7 +61,7 @@ public function testPostEvent2() {
6161
public function testPostEvent3() {
6262
$this->CI->rawdata = dirname(__FILE__) . '/testdata_event/noappkey.json';
6363
ob_start();
64-
$this->CI->postEvent();
64+
$this->CI->eventlog();
6565
$output = ob_get_clean();
6666
$this -> assertEquals(
6767
'{"flag":-5,"msg":"Appkey is not set in json."}',
@@ -72,7 +72,7 @@ public function testPostEvent3() {
7272
public function testPostEvent4() {
7373
$this->CI->rawdata = dirname(__FILE__) . '/testdata_event/errorappkey.json';
7474
ob_start();
75-
$this->CI->postEvent();
75+
$this->CI->eventlog();
7676
$output = ob_get_clean();
7777
$this -> assertEquals(
7878
'{"flag":-1,"msg":"Invalid appkey:invalid_appkey_00000"}',

web/tests/controllers/posttagTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function tearDown() {
2626
public function testPostTag() {
2727
$this->CI->rawdata = dirname(__FILE__) . '/testdata_tag/ok.json';
2828
ob_start();
29-
$this->CI->postTag();
29+
$this->CI->tag();
3030
$output = ob_get_clean();
3131
$this -> assertEquals(
3232
'{"flag":1,"msg":"ok"}',
@@ -37,7 +37,7 @@ public function testPostTag() {
3737
public function testPostTag1() {
3838
$this->CI->rawdata = dirname(__FILE__) . '/testjson/empty.json';
3939
ob_start();
40-
$this->CI->postTag();
40+
$this->CI->tag();
4141
$output = ob_get_clean();
4242
$this -> assertEquals(
4343
'{"flag":-3,"msg":"Invalid content from php:\/\/input."}',
@@ -48,7 +48,7 @@ public function testPostTag1() {
4848
public function testPostTag2() {
4949
$this->CI->rawdata = dirname(__FILE__) . '/testjson/partly.json';
5050
ob_start();
51-
$this->CI->postTag();
51+
$this->CI->tag();
5252
$output = ob_get_clean();
5353
$this -> assertEquals(
5454
'{"flag":-4,"msg":"Parse json data failed."}',
@@ -59,7 +59,7 @@ public function testPostTag2() {
5959
public function testPostTag3() {
6060
$this->CI->rawdata = dirname(__FILE__) . '/testdata_tag/noappkey.json';
6161
ob_start();
62-
$this->CI->postTag();
62+
$this->CI->tag();
6363
$output = ob_get_clean();
6464
$this -> assertEquals(
6565
'{"flag":-5,"msg":"Appkey is not set in json."}',
@@ -70,7 +70,7 @@ public function testPostTag3() {
7070
public function testPostTag4() {
7171
$this->CI->rawdata = dirname(__FILE__) . '/testdata_tag/errorappkey.json';
7272
ob_start();
73-
$this->CI->postTag();
73+
$this->CI->tag();
7474
$output = ob_get_clean();
7575
$this -> assertEquals(
7676
'{"flag":-1,"msg":"Invalid appkey:invalid_appkey_00000"}',

web/tests/controllers/postusinglogTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,39 +26,39 @@ public function tearDown() {
2626
public function testPostUsinglog() {
2727
$this->CI->rawdata = dirname(__FILE__) . '/testdata_usinglog/ok.json';
2828
ob_start();
29-
$this->CI->postActivityLog();
29+
$this->CI->usinglog();
3030
$output = ob_get_clean();
3131
$this -> assertEquals('{"flag":1,"msg":"ok"}', $output);
3232
}
3333

3434
public function testPostUsinglog1() {
3535
$this->CI->rawdata = dirname(__FILE__) . '/testjson/empty.json';
3636
ob_start();
37-
$this->CI->postActivityLog();
37+
$this->CI->usinglog();
3838
$output = ob_get_clean();
3939
$this -> assertEquals('{"flag":-3,"msg":"Invalid content from php:\/\/input."}', $output);
4040
}
4141

4242
public function testPostUsinglog2() {
4343
$this->CI->rawdata = dirname(__FILE__) . '/testjson/partly.json';
4444
ob_start();
45-
$this->CI->postActivityLog();
45+
$this->CI->usinglog();
4646
$output = ob_get_clean();
4747
$this -> assertEquals('{"flag":-4,"msg":"Parse json data failed."}', $output);
4848
}
4949

5050
public function testPostUsinglog3() {
5151
$this->CI->rawdata = dirname(__FILE__) . '/testdata_usinglog/noappkey.json';
5252
ob_start();
53-
$this->CI->postActivityLog();
53+
$this->CI->usinglog();
5454
$output = ob_get_clean();
5555
$this -> assertEquals('{"flag":-5,"msg":"Appkey is not set in json."}', $output);
5656
}
5757

5858
public function testPostUsinglog4() {
5959
$this->CI->rawdata = dirname(__FILE__) . '/testdata_usinglog/errorappkey.json';
6060
ob_start();
61-
$this->CI->postActivityLog();
61+
$this->CI->usinglog();
6262
$output = ob_get_clean();
6363
$this -> assertEquals('{"flag":-1,"msg":"Invalid appkey:invalid_appkey_00000"}', $output);
6464
}

0 commit comments

Comments
 (0)