Loading _tests/tests/unit_tests/file_naming.php +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ class file_naming_test_set extends cms_test_case require_code('files2'); $ignore_stubs = array( 'test-a/', 'aps/', 'data/ckeditor/', 'data/curl-ca-bundle.crt', Loading _tests/tests/unit_tests/http.php +9 −9 Original line number Diff line number Diff line Loading @@ -21,13 +21,13 @@ class http_test_set extends cms_test_case public function testSimple() { $result = http_download_file('http://example.com/'); $this->assertTrue(strpos($result, 'Example Domain') !== false); $this->assertTrue($result !== null && strpos($result, 'Example Domain') !== false); } public function testSimpleHttps() { $result = http_download_file('https://example.com/'); $this->assertTrue(strpos($result, 'Example Domain') !== false); $this->assertTrue($result !== null && strpos($result, 'Example Domain') !== false); } public function testHead() Loading @@ -53,13 +53,13 @@ class http_test_set extends cms_test_case public function testRedirect() { $result = http_download_file('http://jigsaw.w3.org/HTTP/300/301.html', null, false); $this->assertTrue(strpos($result, 'Redirect test page') !== false); $this->assertTrue($result !== null && strpos($result, 'Redirect test page') !== false); } public function testRedirectHttps() { $result = http_download_file('https://jigsaw.w3.org/HTTP/300/301.html', null, false); $this->assertTrue(strpos($result, 'Redirect test page') !== false); $this->assertTrue($result !== null && strpos($result, 'Redirect test page') !== false); } public function testRedirectDisabled() Loading @@ -71,7 +71,7 @@ class http_test_set extends cms_test_case public function testHttpAuth() { $result = http_download_file('https://jigsaw.w3.org/HTTP/Basic/', null, false, true, 'Composr', null, null, null, null, null, null, null, array('guest', 'guest')); $this->assertTrue(strpos($result, 'Your browser made it!') !== false); $this->assertTrue($result !== null && strpos($result, 'Your browser made it!') !== false); } public function testWriteToFile() Loading @@ -79,7 +79,7 @@ class http_test_set extends cms_test_case $write_path = cms_tempnam(); $write = fopen($write_path, 'wb'); $result = http_download_file('http://example.com/', null, false, true, 'Composr', null, null, null, null, null, $write); $this->assertTrue(strpos(file_get_contents($write_path), 'Example Domain') !== false); $this->assertTrue($result !== null && strpos(file_get_contents($write_path), 'Example Domain') !== false); fclose($write); unlink($write_path); } Loading @@ -89,7 +89,7 @@ class http_test_set extends cms_test_case $write_path = cms_tempnam(); $write = fopen($write_path, 'wb'); $result = http_download_file('https://example.com/', null, false, true, 'Composr', null, null, null, null, null, $write); $this->assertTrue(strpos(file_get_contents($write_path), 'Example Domain') !== false); $this->assertTrue($result !== null && strpos(file_get_contents($write_path), 'Example Domain') !== false); fclose($write); unlink($write_path); } Loading Loading
_tests/tests/unit_tests/file_naming.php +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ class file_naming_test_set extends cms_test_case require_code('files2'); $ignore_stubs = array( 'test-a/', 'aps/', 'data/ckeditor/', 'data/curl-ca-bundle.crt', Loading
_tests/tests/unit_tests/http.php +9 −9 Original line number Diff line number Diff line Loading @@ -21,13 +21,13 @@ class http_test_set extends cms_test_case public function testSimple() { $result = http_download_file('http://example.com/'); $this->assertTrue(strpos($result, 'Example Domain') !== false); $this->assertTrue($result !== null && strpos($result, 'Example Domain') !== false); } public function testSimpleHttps() { $result = http_download_file('https://example.com/'); $this->assertTrue(strpos($result, 'Example Domain') !== false); $this->assertTrue($result !== null && strpos($result, 'Example Domain') !== false); } public function testHead() Loading @@ -53,13 +53,13 @@ class http_test_set extends cms_test_case public function testRedirect() { $result = http_download_file('http://jigsaw.w3.org/HTTP/300/301.html', null, false); $this->assertTrue(strpos($result, 'Redirect test page') !== false); $this->assertTrue($result !== null && strpos($result, 'Redirect test page') !== false); } public function testRedirectHttps() { $result = http_download_file('https://jigsaw.w3.org/HTTP/300/301.html', null, false); $this->assertTrue(strpos($result, 'Redirect test page') !== false); $this->assertTrue($result !== null && strpos($result, 'Redirect test page') !== false); } public function testRedirectDisabled() Loading @@ -71,7 +71,7 @@ class http_test_set extends cms_test_case public function testHttpAuth() { $result = http_download_file('https://jigsaw.w3.org/HTTP/Basic/', null, false, true, 'Composr', null, null, null, null, null, null, null, array('guest', 'guest')); $this->assertTrue(strpos($result, 'Your browser made it!') !== false); $this->assertTrue($result !== null && strpos($result, 'Your browser made it!') !== false); } public function testWriteToFile() Loading @@ -79,7 +79,7 @@ class http_test_set extends cms_test_case $write_path = cms_tempnam(); $write = fopen($write_path, 'wb'); $result = http_download_file('http://example.com/', null, false, true, 'Composr', null, null, null, null, null, $write); $this->assertTrue(strpos(file_get_contents($write_path), 'Example Domain') !== false); $this->assertTrue($result !== null && strpos(file_get_contents($write_path), 'Example Domain') !== false); fclose($write); unlink($write_path); } Loading @@ -89,7 +89,7 @@ class http_test_set extends cms_test_case $write_path = cms_tempnam(); $write = fopen($write_path, 'wb'); $result = http_download_file('https://example.com/', null, false, true, 'Composr', null, null, null, null, null, $write); $this->assertTrue(strpos(file_get_contents($write_path), 'Example Domain') !== false); $this->assertTrue($result !== null && strpos(file_get_contents($write_path), 'Example Domain') !== false); fclose($write); unlink($write_path); } Loading