mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-02 14:25:38 +08:00
enhance test run (#193)
This commit is contained in:
@@ -4,8 +4,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace Tests\ZM\Config;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Tests\TestCase;
|
||||
use ZM\Config\ZMConfig;
|
||||
use ZM\Exception\ConfigException;
|
||||
use ZM\Utils\ReflectionUtil;
|
||||
|
||||
/**
|
||||
@@ -64,9 +65,13 @@ class ZMConfigTest extends TestCase
|
||||
'<?php return ["patch" => "yes", "another array" => ["far", "baz"]];'
|
||||
);
|
||||
|
||||
$config = new ZMConfig([
|
||||
__DIR__ . '/config_mock',
|
||||
], 'development');
|
||||
try {
|
||||
$config = new ZMConfig([
|
||||
__DIR__ . '/config_mock',
|
||||
], 'development');
|
||||
} catch (ConfigException $e) {
|
||||
self::fail($e->getMessage());
|
||||
}
|
||||
self::$config = $config;
|
||||
}
|
||||
|
||||
@@ -83,8 +88,8 @@ class ZMConfigTest extends TestCase
|
||||
public function testGetValueWhenKeyContainsDot(): void
|
||||
{
|
||||
$this->markTestSkipped('should it be supported?');
|
||||
$this->assertEquals('c', self::$config->get('test.a.b'));
|
||||
$this->assertEquals('d', self::$config->get('test.a.b.c'));
|
||||
// $this->assertEquals('c', self::$config->get('test.a.b'));
|
||||
// $this->assertEquals('d', self::$config->get('test.a.b.c'));
|
||||
}
|
||||
|
||||
public function testGetBooleanValue(): void
|
||||
|
||||
@@ -4,8 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Tests\ZM\Middleware;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use ZM\Logger\ConsoleLogger;
|
||||
use Tests\TestCase;
|
||||
use ZM\Middleware\Pipeline;
|
||||
use ZM\Middleware\TimerMiddleware;
|
||||
|
||||
@@ -14,16 +13,6 @@ use ZM\Middleware\TimerMiddleware;
|
||||
*/
|
||||
class PipelineTest extends TestCase
|
||||
{
|
||||
public function setUp(): void
|
||||
{
|
||||
ob_logger_register(new ConsoleLogger('debug'));
|
||||
}
|
||||
|
||||
public function tearDown(): void
|
||||
{
|
||||
ob_logger_register(new ConsoleLogger('error'));
|
||||
}
|
||||
|
||||
public function testPipeline()
|
||||
{
|
||||
$pipe = new Pipeline();
|
||||
|
||||
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Tests\ZM\Utils;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Tests\TestCase;
|
||||
use ZM\Utils\ReflectionUtil;
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Tests\ZM\Utils;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Tests\TestCase;
|
||||
use ZM\Utils\ZMUtil;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user