-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
131 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ composer.lock | |
*.log | ||
*.pid | ||
*.patch | ||
*.cache | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
bootstrap="test/boot.php" | ||
colors="false" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
stopOnFailure="false" | ||
> | ||
<testsuites> | ||
<testsuite name="Php Library Test Suite"> | ||
<directory>test/</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">src</directory> | ||
</whitelist> | ||
</filter> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" bootstrap="test/bootstrap.php" colors="false" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> | ||
<coverage> | ||
<include> | ||
<directory suffix=".php">src</directory> | ||
</include> | ||
</coverage> | ||
<testsuites> | ||
<testsuite name="Php Library Test Suite"> | ||
<directory>test/</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace PhpPkg\ConfigTest; | ||
|
||
use PhpPkg\Config\ConfigBox; | ||
use PHPUnit\Framework\TestCase; | ||
use function vdump; | ||
|
||
/** | ||
* class ConfigBoxTest | ||
* | ||
* @author inhere | ||
*/ | ||
class ConfigBoxTest extends TestCase | ||
{ | ||
public function testNewFromFiles(): void | ||
{ | ||
$c = ConfigBox::newFromFiles([ | ||
__DIR__ . '/testdata/config.ini', | ||
__DIR__ . '/testdata/config.neon', | ||
__DIR__ . '/testdata/config.yml', | ||
]); | ||
|
||
vdump($c); | ||
$this->assertEquals('inher', $c->get('name')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php declare(strict_types=1); | ||
/** | ||
* phpunit --bootstrap tests/boot.php tests | ||
*/ | ||
|
||
error_reporting(E_ALL | E_STRICT); | ||
date_default_timezone_set('Asia/Shanghai'); | ||
|
||
$libDir = dirname(__DIR__); | ||
$npMap = [ | ||
'PhpPkg\\ConfigTest\\' => $libDir . '/test/', | ||
'PhpPkg\\Config\\' => $libDir . '/src/', | ||
]; | ||
|
||
spl_autoload_register(static function ($class) use ($npMap) { | ||
foreach ($npMap as $np => $dir) { | ||
$file = $dir . str_replace('\\', '/', substr($class, strlen($np))) . '.php'; | ||
|
||
if (file_exists($file)) { | ||
include $file; | ||
} | ||
} | ||
}); | ||
|
||
if (is_file(dirname(__DIR__, 3) . '/autoload.php')) { | ||
require dirname(__DIR__, 3) . '/autoload.php'; | ||
} elseif (is_file(dirname(__DIR__) . '/vendor/autoload.php')) { | ||
require dirname(__DIR__) . '/vendor/autoload.php'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name=inhere | ||
age=89 | ||
atIni=value0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: inhere | ||
age: 89 | ||
atNeon: value1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
name: inhere | ||
age: 89 | ||
atYaml: value2 | ||
|
File renamed without changes.
File renamed without changes.