aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStevan Radakovic <stevan.radakovic@linaro.org>2012-05-09 09:39:39 +0200
committerStevan Radakovic <stevan.radakovic@linaro.org>2012-05-09 09:39:39 +0200
commitddb096869361e914946d193f5645a695c1870a25 (patch)
treeaeda73d4aa0e93ea5b8ce21000845d7832a97c21
parenta4e651bb0681886b404deda03f8013ecd7129473 (diff)
Add test for broken symbolic link for checkFile method.
-rw-r--r--testing/LicenseHelperTest.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/testing/LicenseHelperTest.php b/testing/LicenseHelperTest.php
index 21e702a..15c1ceb 100644
--- a/testing/LicenseHelperTest.php
+++ b/testing/LicenseHelperTest.php
@@ -30,6 +30,21 @@ class LicenseHelperTest extends PHPUnit_Framework_TestCase
}
/**
+ * Running checkFile on a broken symbolic link returns true.
+ * This is because PHP function is_link returns true on broken soft links.
+ */
+ public function test_checkFile_brokenLink()
+ {
+ $this->temp_filename = tempnam(sys_get_temp_dir(), "unittest");
+ symlink($this->temp_filename, "test_link");
+ unlink($this->temp_filename);
+
+ $this->assertTrue(LicenseHelper::checkFile("test_link"));
+
+ unlink("test_link");
+ }
+
+ /**
* Running checkFile on a regular file returns true.
*/
public function test_checkFile_file()