Browse Source

add tests for isFile method

olinox14 1 year ago
parent
commit
872187fda4
1 changed files with 12 additions and 0 deletions
  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());
+    }
 }