Commit 070e67dc authored by Chris Graham's avatar Chris Graham
Browse files

Fixed MANTIS-4810 (Minor test set fixes)

parent 36e4fed1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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',
+9 −9
Original line number Diff line number Diff line
@@ -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()
@@ -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()
@@ -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()
@@ -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);
    }
@@ -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);
    }