From: gggeek Date: Thu, 10 Dec 2020 17:22:35 +0000 (+0000) Subject: Tests X-Git-Tag: plcapi-7.1-0~3^2~151 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=58c9fd5820047b2ba80e46413fcba3578bc203a1;p=plcapi.git Tests --- diff --git a/.travis.yml b/.travis.yml index e9d8fe4..c270357 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ env: - URI=/demo/server/server.php - HTTPSSERVER=localhost - HTTPSURI=/demo/server/server.php - - PROXY=localhost:8080 + - PROXYSERVER=localhost:8080 # Travis currently compiles PHP with an oldish cURL/GnuTLS combination; # to make the tests pass when Apache has a bogus SSL cert whe need the full set of options below - HTTPSVERIFYHOST=0 diff --git a/tests/1ParsingBugsTest.php b/tests/1ParsingBugsTest.php index 4a9f23a..09d8b2f 100644 --- a/tests/1ParsingBugsTest.php +++ b/tests/1ParsingBugsTest.php @@ -161,7 +161,7 @@ class ParsingBugsTests extends PhpXmlRpc_PolyfillTestCase public function testI8() { if (PHP_INT_SIZE == 4 ) { - $this->markTestSkipped('did not find a locale which sets decimal separator to comma'); + $this->markTestSkipped('Can not test i8 as php is compiled in 32 bit mode'); return; } diff --git a/tests/3LocalhostTest.php b/tests/3LocalhostTest.php index 85934d4..9cbd1fd 100644 --- a/tests/3LocalhostTest.php +++ b/tests/3LocalhostTest.php @@ -969,7 +969,7 @@ And turned it into nylon'; new xmlrpcval('hello world', 'string'), )); $r = $this->send($m, 0, true); - $this->assertContains('hello world', $r->raw_data); + $this->assertStringContainsString('hello world', $r->raw_data); } public function testSendTwiceSameMsg() diff --git a/tests/4LocalhostMultiTest.php b/tests/4LocalhostMultiTest.php index 0516c30..317e517 100644 --- a/tests/4LocalhostMultiTest.php +++ b/tests/4LocalhostMultiTest.php @@ -103,7 +103,7 @@ class LocalhostMultiTest extends LocalhostTest { if ($this->args['PROXYSERVER'] == '') { - $this->markTestSkipped('PROXY definition missing: cannot test proxy'); + $this->markTestSkipped('PROXYSERVER definition missing: cannot test proxy'); return; } @@ -204,7 +204,7 @@ class LocalhostMultiTest extends LocalhostTest } else if ($this->args['PROXYSERVER'] == '') { - $this->markTestSkipped('PROXY definition missing: cannot test proxy w. http 1.1'); + $this->markTestSkipped('PROXYSERVER definition missing: cannot test proxy w. http 1.1'); return; } @@ -281,7 +281,7 @@ class LocalhostMultiTest extends LocalhostTest } else if ($this->args['PROXYSERVER'] == '') { - $this->markTestSkipped('PROXY definition missing: cannot test proxy w. https'); + $this->markTestSkipped('PROXYSERVER definition missing: cannot test proxy w. https'); return; } else if ($this->args['HTTPSSERVER'] == '') diff --git a/tests/5DemofilesTest.php b/tests/5DemofilesTest.php index 4ee62c8..e064add 100644 --- a/tests/5DemofilesTest.php +++ b/tests/5DemofilesTest.php @@ -63,14 +63,14 @@ class DemoFilesTest extends PhpXmlRpc_LocalFileTestCase public function testDiscussServer() { $page = $this->request('server/discuss.php'); - $this->assertContains('faultCode', $page); + $this->assertStringContainsString('faultCode', $page); $this->assertRegexp('#10(5|3)#', $page); } public function testProxyServer() { $page = $this->request('server/proxy.php'); - $this->assertContains('faultCode', $page); + $this->assertStringContainsString('faultCode', $page); $this->assertRegexp('#10(5|3)#', $page); } } diff --git a/tests/LocalFileTestCase.php b/tests/LocalFileTestCase.php index 255a87b..6ec48b3 100644 --- a/tests/LocalFileTestCase.php +++ b/tests/LocalFileTestCase.php @@ -75,8 +75,8 @@ abstract class PhpXmlRpc_LocalFileTestCase extends PhpXmlRpc_PolyfillTestCase if (!$emptyPageOk) { $this->assertNotEquals('', $page); } - $this->assertNotContains('Fatal error', $page); - $this->assertNotContains('Notice:', $page); + $this->assertStringNotContainsStringIgnoringCase('Fatal error', $page); + $this->assertStringNotContainsStringIgnoringCase('Notice:', $page); return $page; } diff --git a/tests/parse_args.php b/tests/parse_args.php index d9b3d5a..4ef568d 100644 --- a/tests/parse_args.php +++ b/tests/parse_args.php @@ -21,8 +21,6 @@ class argParser { public static function getArgs() { - global $argv; - $args = array( 'DEBUG' => 0, 'LOCALSERVER' => 'localhost', @@ -32,7 +30,7 @@ class argParser 'HTTPSVERIFYHOST' => 2, 'SSLVERSION' => 0, 'PROXYSERVER' => null, - 'NOPROXY' => false, + //'NOPROXY' => false, 'LOCALPATH' => __DIR__, ); @@ -76,8 +74,8 @@ class argParser if (isset($SSLVERSION)) { $args['SSLVERSION'] = (int)$SSLVERSION; } - if (isset($PROXY)) { - $arr = explode(':', $PROXY); + if (isset($PROXYSERVER)) { + $arr = explode(':', $PROXYSERVER); $args['PROXYSERVER'] = $arr[0]; if (count($arr) > 1) { $args['PROXYPORT'] = $arr[1]; @@ -86,9 +84,9 @@ class argParser } } // used to silence testsuite warnings about proxy code not being tested - if (isset($NOPROXY)) { - $args['NOPROXY'] = true; - } + //if (isset($NOPROXY)) { + // $args['NOPROXY'] = true; + //} if (!isset($URI)) { // GUESTIMATE the url of local demo server // play nice to php 3 and 4-5 in retrieving URL of server.php