mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-13 02:28:41 +00:00
implement todos
This commit is contained in:
parent
f44d1c7983
commit
e2f6061fa7
|
|
@ -660,11 +660,11 @@ final class ModuleManager
|
|||
*/
|
||||
public function installApplications(string $from) : void
|
||||
{
|
||||
if (!\is_dir($this->modulePath . $from . '/Application')) {
|
||||
if (!\is_dir($this->modulePath . $from . '/Admin/Install/Application')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$dirs = \scandir($this->modulePath . $from . '/Application');
|
||||
$dirs = \scandir($this->modulePath . $from . '/Admin/Install/Application');
|
||||
if ($dirs === false) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,4 +89,26 @@ class FileUtilsTest extends \PHPUnit\Framework\TestCase
|
|||
\unlink(__DIR__ . '/UTF-8.txt');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @testdox The file information can be resolved from a path
|
||||
* @covers phpOMS\System\File\FileUtils
|
||||
* @group framework
|
||||
*/
|
||||
public function testPathInfo() : void
|
||||
{
|
||||
self::assertEquals(__DIR__, FileUtils::mb_pathinfo(__DIR__ . '/FileUtilsTest.php', \PATHINFO_DIRNAME));
|
||||
self::assertEquals(\basename(__DIR__ . '/FileUtilsTest.php'), FileUtils::mb_pathinfo(__DIR__ . '/FileUtilsTest.php', \PATHINFO_BASENAME));
|
||||
self::assertEquals('php', FileUtils::mb_pathinfo(__DIR__ . '/FileUtilsTest.php', \PATHINFO_EXTENSION));
|
||||
self::assertEquals('FileUtilsTest', FileUtils::mb_pathinfo(__DIR__ . '/FileUtilsTest.php', \PATHINFO_FILENAME));
|
||||
self::assertEquals(
|
||||
[
|
||||
'dirname' => __DIR__,
|
||||
'basename' => \basename(__DIR__ . '/FileUtilsTest.php'),
|
||||
'extension' => 'php',
|
||||
'filename' => 'FileUtilsTest',
|
||||
],
|
||||
FileUtils::mb_pathinfo(__DIR__ . '/FileUtilsTest.php', \PATHINFO_FILENAME)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -871,4 +871,28 @@ class DirectoryTest extends \PHPUnit\Framework\TestCase
|
|||
|
||||
self::assertEquals(__DIR__ . '/dirtest', $dir->current()->getDirPath());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers phpOMS\System\File\Ftp\Directory<extended>
|
||||
* @group framework
|
||||
*/
|
||||
public function testNodeValid() : void
|
||||
{
|
||||
$dir = new Directory(new HttpUri(self::BASE . __DIR__ . '/dirtest'), '*', true, self::$con);
|
||||
$dir->next();
|
||||
|
||||
self::assertTrue($dir->valid());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers phpOMS\System\File\Ftp\Directory<extended>
|
||||
* @group framework
|
||||
*/
|
||||
public function testNodeInvalid() : void
|
||||
{
|
||||
$dir = new Directory(new HttpUri(self::BASE . __DIR__ . '/dirtest'), '*', true, self::$con);
|
||||
$dir->next()->next()->next()->next()->next()->next()->next();
|
||||
|
||||
self::assertFalse($dir->valid());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -224,4 +224,31 @@ class UriFactoryTest extends \PHPUnit\Framework\TestCase
|
|||
|
||||
self::assertEquals($unescaped, UriFactory::build($escaped));
|
||||
}
|
||||
|
||||
/**
|
||||
* @testdox In case of missing ? for query the builder automatically fixes it
|
||||
* @covers phpOMS\Uri\UriFactory
|
||||
* @group framework
|
||||
*/
|
||||
public function testMissingQueryIdentifier() : void
|
||||
{
|
||||
$uri = 'http://www.test-uri.com/path/here?id=123&ab=c#fragi';
|
||||
|
||||
UriFactory::setupUriBuilder(new HttpUri($uri));
|
||||
|
||||
self::assertEquals($uri, UriFactory::build('{/base}{/rootPath}{/}&id={?id}&ab={?ab}#{#}'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @testdox In case of missing ? for query the builder automatically fixes it
|
||||
* @covers phpOMS\Uri\UriFactory
|
||||
* @group framework
|
||||
*/
|
||||
public function testNormalUrlParsing() : void
|
||||
{
|
||||
$uri = 'http://www.test-uri.com/path/here?id=123&ab=c#fragi';
|
||||
$expected = 'http://www.test-uri.com/path/here?id=123&ab=c#fragi';
|
||||
|
||||
self::assertEquals($expected, UriFactory::build($uri));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user