Browse Source

added test cases for Path

Fabian Peter Hammerle 7 years ago
parent
commit
c03b8cdaed
1 changed files with 10 additions and 1 deletions
  1. 10 1
      tests/PathTest.php

+ 10 - 1
tests/PathTest.php

@@ -83,6 +83,11 @@ class PathTest extends \PHPUnit_Framework_TestCase
     public function dirPathProvider()
     {
         return [
+            ['/', '/'],
+            ['/dir', '/dir'],
+            ['/dir/subdir', '/dir/subdir'],
+            ['dir', 'dir'],
+            ['dir/subdir', 'dir/subdir'],
             [null, null],
             ];
     }
@@ -94,7 +99,11 @@ class PathTest extends \PHPUnit_Framework_TestCase
     {
         $p = new Path;
         $p->dirPath = $input_dir_path;
-        $this->assertSame($expected_dir_path, $p->dirPath);
+        if(isset($input_dir_path)) {
+            $this->assertSame($expected_dir_path, $p->dirPath->path);
+        } else {
+            $this->assertNull($p->dirPath);
+        }
     }
 
     public function extensionProvider()