Sfoglia il codice sorgente

add tests for isFile method

olinox14 1 anno fa
parent
commit
872187fda4
1 ha cambiato i file con 12 aggiunte e 0 eliminazioni
  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());
+    }
 }