remote file unit test
authorpaulr <me@pjr.cc>
Sat, 6 Aug 2011 12:02:18 +0000 (22:02 +1000)
committerpaulr <me@pjr.cc>
Sat, 6 Aug 2011 12:02:18 +0000 (22:02 +1000)
unittests/remoetfileexists.php [new file with mode: 0644]

diff --git a/unittests/remoetfileexists.php b/unittests/remoetfileexists.php
new file mode 100644 (file)
index 0000000..dddfe28
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+
+// begin unit test header
+$WEB_ROOT_FS = realpath(dirname(__FILE__));
+$BASE_URL = dirname($_SERVER["PHP_SELF"]);
+
+global $WEB_ROOT_FS, $URL_HANDLERS, $BASE_URL;
+
+if(file_exists("../libglcas")) {
+       $path = realpath($WEB_ROOT_FS."/../");
+       error_log("added glcas path as $path");
+       set_include_path(get_include_path().PATH_SEPARATOR.$path);
+}
+require_once("../libglcas/lib.php");
+
+
+glcas_pluginLoader();
+
+
+if(glcase_fileExists("http://ftp.iinet.net.au/pub/ubuntu/dists/hardy/Contents-amd64.gz")) {
+       echo "true - DOES EXIST: http://ftp.iinet.net.au/pub/ubuntu/dists/hardy/Contents-amd64.gz";
+} else {
+       echo "FAIL - SAID DOES NOT EXIST: http://ftp.iinet.net.au/pub/ubuntu/dists/hardy/Contents-amd64.gz";
+}
+
+if(!glcase_fileExists("http://ftp.iinet.net.au/pub/ubuntu/dists/hardy/Contents-aaaaaaaamd64.gz")) {
+       echo "true - DOES NOT EXIST: http://ftp.iinet.net.au/pub/ubuntu/dists/hardy/Contents-aaaaaaaamd64.gz";
+} else {
+       echo "FAIL - SAID DOES EXIST: http://ftp.iinet.net.au/pub/ubuntu/dists/hardy/Contents-aaaaaaaamd64.gz";
+}
+
+?>
\ No newline at end of file