Parcourir la source

add tests for isFile method

olinox14 il y a 1 an
Parent
commit
872187fda4
1 fichiers modifiés avec 12 ajouts et 0 suppressions
  1. 12 0
      tests/PathTest.php

+ 12 - 0
tests/PathTest.php

@@ -282,4 +282,16 @@ class PathTest extends TestCase
             $atime
         );
     }
+
+    public function testIsFileOnActualFile(): void
+    {
+        touch(self::TEMP_TEST_DIR . "/foo");
+
+        $this->assertTrue((new Path('foo'))->isFile());
+    }
+
+    public function testIsFileOnNonExistentFile(): void
+    {
+        $this->assertFalse((new Path('foo'))->isFile());
+    }
 }