From a7050a399089eaa6d55332d76d00bf15f42d82b0 Mon Sep 17 00:00:00 2001 From: adlawson Date: Fri, 24 Jul 2015 17:14:26 +0100 Subject: [PATCH] Add `symlink` and `is_link` acceptance tests --- .../StreamWrapper/SymlinkAcceptanceTest.php | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 test/acceptance/Stream/StreamWrapper/SymlinkAcceptanceTest.php diff --git a/test/acceptance/Stream/StreamWrapper/SymlinkAcceptanceTest.php b/test/acceptance/Stream/StreamWrapper/SymlinkAcceptanceTest.php new file mode 100644 index 0000000..6c92f03 --- /dev/null +++ b/test/acceptance/Stream/StreamWrapper/SymlinkAcceptanceTest.php @@ -0,0 +1,41 @@ + [ + 'bar' => 'baz' + ] + ]; + + public function testIsLink() + { + $factory = $this->fs->getNodeFactory(); + + $file = $this->fs->get('/foo/bar'); + $this->fs->get('/')->add('symlink', $factory->buildFileLink($file)); + + $this->assertTrue(is_link("$this->scheme:///symlink")); + } + + public function testDirectoryLink() + { + $this->markTestSkipped('`symlink()` isn\'t supported by PHP Stream Wrappers'); + + symlink("$this->scheme:///foo/bar", "$this->scheme:///symlink"); + + $this->assertTrue(is_link("$this->scheme:///symlink")); + } + + public function testFileLink() + { + $this->markTestSkipped('`symlink()` isn\'t supported by PHP Stream Wrappers'); + + symlink("$this->scheme:///foo", "$this->scheme:///symlink"); + + $this->assertTrue(is_link("$this->scheme:///symlink")); + } +}