Procházet zdrojové kódy

add tests for isFile method

olinox14 před 1 rokem
rodič
revize
872187fda4
1 změnil soubory, kde provedl 12 přidání a 0 odebrání
  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());
+    }
 }