处理 vendor 依赖错误问题

This commit is contained in:
柳清爽
2025-03-25 18:31:48 +08:00
parent f7f48a03fe
commit 4af129acf8
416 changed files with 26268 additions and 28381 deletions

View File

@@ -13,7 +13,7 @@
"php": ">5.5"
},
"require-dev": {
"phpunit/phpunit": "*",
"phpunit/phpunit": "^4.8.35|^5.4.3",
"symfony/var-dumper": "*"
},
"autoload": {

View File

@@ -8,7 +8,7 @@
<directory>tests</directory>
</testsuite>
<testsuite name="Unit">
<directory suffix="Test.php">./tests</directory>
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
</testsuites>

View File

@@ -8,14 +8,14 @@ class XML
{
$res = self::parse($xmlStr);
if ($response === null) {
return $res;
return $ref;
} else {
if (\is_string($response)) {
$response = new $response();
}
$prop = get_object_vars($response);
$target = [];
foreach ($res as $k => $v) {
if (isset($prop[$k])) {
$target[$k] = $v;
@@ -45,9 +45,7 @@ class XML
private static function parse($xml)
{
if (\PHP_VERSION_ID < 80000) {
libxml_disable_entity_loader(true);
}
libxml_disable_entity_loader(true);
return json_decode(
json_encode(

View File

@@ -23,13 +23,13 @@ class RpcUtilsTest extends TestCase
$name = $res['name'];
$value = $res['value'];
$this->assertEquals('test', $name);
$this->assertEquals(1, $value);
$this->assertEquals('1', $value);
$res = XML::parseXml($this->xmlStr, null);
$name = $res['name'];
$value = $res['value'];
$this->assertEquals('test', $name);
$this->assertEquals(1, $value);
$this->assertEquals('1', $value);
}
public function testArrayToXML()