format('Y-m-d'), Directory::created($dirPath)->format('Y-m-d')); self::assertEquals($now->format('Y-m-d'), Directory::changed($dirPath)->format('Y-m-d')); self::assertTrue(Directory::delete($dirPath)); self::assertFalse(Directory::exists($dirPath)); self::assertFalse(Directory::delete('')); $dirTestPath = __DIR__ . '/dirtest'; self::assertGreaterThan(0, Directory::size($dirTestPath)); self::assertGreaterThan(Directory::size($dirTestPath, false), Directory::size($dirTestPath)); self::assertGreaterThan(0, Directory::permission($dirTestPath)); } public function testStaticMove() : void { $dirTestPath = __DIR__ . '/dirtest'; self::assertTrue(Directory::copy($dirTestPath, __DIR__ . '/newdirtest')); self::assertTrue(\file_exists(__DIR__ . '/newdirtest/sub/path/test3.txt')); self::assertTrue(Directory::delete($dirTestPath)); self::assertFalse(Directory::exists($dirTestPath)); self::assertTrue(Directory::move(__DIR__ . '/newdirtest', $dirTestPath)); self::assertTrue(\file_exists($dirTestPath . '/sub/path/test3.txt')); self::assertEquals(4, Directory::count($dirTestPath)); self::assertEquals(1, Directory::count($dirTestPath, false)); self::assertEquals(6, \count(Directory::list($dirTestPath))); self::assertEquals(3, \count(Directory::listByExtension($dirTestPath, 'txt'))); } public function testInvalidListPath() : void { self::assertEquals([], Directory::list(__DIR__ . '/invalid.txt')); } public function testInvalidCopyPath() : void { self::assertFalse(Directory::copy(__DIR__ . '/invalid', __DIR__ . '/invalid2')); } public function testInvalidMovePath() : void { self::assertFalse(Directory::move(__DIR__ . '/invalid', __DIR__ . '/invalid2')); } public function testInvalidCreatedPath() : void { self::expectException(\phpOMS\System\File\PathException::class); Directory::created(__DIR__ . '/invalid'); } public function testInvalidChangedPath() : void { self::expectException(\phpOMS\System\File\PathException::class); Directory::changed(__DIR__ . '/invalid'); } public function testInvalidSizePath() : void { self::expectException(\phpOMS\System\File\PathException::class); Directory::size(__DIR__ . '/invalid'); } public function testInvalidPermissionPath() : void { self::expectException(\phpOMS\System\File\PathException::class); Directory::permission(__DIR__ . '/invalid'); } public function testInvalidOwnerPath() : void { self::expectException(\phpOMS\System\File\PathException::class); Directory::owner(__DIR__ . '/invalid'); } }