This commit is contained in:
crazywhalecc
2024-10-02 20:31:16 +08:00
committed by Jerry Ma
parent 2d9f879994
commit ef1a9646e4
72 changed files with 107 additions and 234 deletions

View File

@@ -68,8 +68,8 @@ class ZMConfigTest extends TestCase
public function testGetValueWhenKeyContainsDot(): void
{
$this->markTestSkipped('should it be supported?');
// $this->assertEquals('c', $this->config->get('test.a.b'));
// $this->assertEquals('d', $this->config->get('test.a.b.c'));
// $this->assertEquals('c', $this->config->get('test.a.b'));
// $this->assertEquals('d', $this->config->get('test.a.b.c'));
}
public function testGetBooleanValue(): void

View File

@@ -95,7 +95,7 @@ class HttpEventListenerTest extends TestCase
return $event->reveal();
}
private function mockHandler(bool $should_be_called, callable $callback = null): self
private function mockHandler(bool $should_be_called, ?callable $callback = null): self
{
$handler = $this->prophesize(self::class);
if ($should_be_called) {

View File

@@ -68,8 +68,7 @@ class ReflectionUtilTest extends TestCase
public function provideTestGetCallReflector(): array
{
$closure = function () {
};
$closure = function () {};
return [
'callable' => [[new ReflectionUtilTestClass(), 'method'], new \ReflectionMethod(ReflectionUtilTestClass::class, 'method')],
@@ -83,18 +82,12 @@ class ReflectionUtilTest extends TestCase
class ReflectionUtilTestClass
{
public function method(string $string, ReflectionUtilTestClass $class): void
{
}
public function method(string $string, ReflectionUtilTestClass $class): void {}
public static function staticMethod(string $string, ReflectionUtilTestClass $class): void
{
}
public static function staticMethod(string $string, ReflectionUtilTestClass $class): void {}
}
class InvokableClass
{
public function __invoke(): void
{
}
public function __invoke(): void {}
}

View File

@@ -16,19 +16,19 @@ class ZMRequestTest extends TestCase
public function testPost()
{
$this->markTestIncomplete('Potential dead on Windows');
// $r = ZMRequest::post('http://httpbin.org/post', [], 'niubi=123');
// $this->assertStringContainsString('123', $r);
// $r2 = ZMRequest::post('http://httpbin.org/post', ['User-Agent' => 'test'], 'oijoij=ooo', [], false);
// $this->assertInstanceOf(ResponseInterface::class, $r2);
// $this->assertStringContainsString('ooo', $r2->getBody()->getContents());
// $r = ZMRequest::post('http://httpbin.org/post', [], 'niubi=123');
// $this->assertStringContainsString('123', $r);
// $r2 = ZMRequest::post('http://httpbin.org/post', ['User-Agent' => 'test'], 'oijoij=ooo', [], false);
// $this->assertInstanceOf(ResponseInterface::class, $r2);
// $this->assertStringContainsString('ooo', $r2->getBody()->getContents());
}
public function testGet()
{
$this->markTestIncomplete('Potential dead on Windows');
// $r = ZMRequest::get('http://httpbin.org/get', [
// 'X-Test' => '123',
// ]);
// $this->assertStringContainsString('123', $r);
// $r = ZMRequest::get('http://httpbin.org/get', [
// 'X-Test' => '123',
// ]);
// $this->assertStringContainsString('123', $r);
}
}