init commit
This commit is contained in:
@@ -0,0 +1,173 @@
|
||||
<?php
|
||||
|
||||
$server = stream_socket_server("tcp://0.0.0.0:8000", $errno, $errstr);
|
||||
|
||||
if (!$server) {
|
||||
die("Error: $errstr ($errno)");
|
||||
}
|
||||
|
||||
function send_sse($client, $id, $event, $data, $retry = 3000) {
|
||||
$sseData = "id: $id\n";
|
||||
$sseData .= "event: $event\n";
|
||||
$sseData .= "data: " . json_encode($data) . "\n";
|
||||
$sseData .= "retry: $retry\n\n"; // The retry comment is optional and should follow client's needs
|
||||
|
||||
fwrite($client, $sseData);
|
||||
fflush($client);
|
||||
}
|
||||
|
||||
while ($client = @stream_socket_accept($server)) {
|
||||
// 读取请求
|
||||
$request = fread($client, 1024);
|
||||
list($headers, $body) = explode("\r\n\r\n", $request, 2);
|
||||
// 简单解析请求头
|
||||
$headerLines = explode("\r\n", $headers);
|
||||
$requestLine = array_shift($headerLines);
|
||||
preg_match('/\btimeout:\s*true\b/i', $headers, $timeoutMatch);
|
||||
preg_match('/\b(bodytype):[ ]*([\w\d]+)\b/i', $headers, $bodyTypeMatch);
|
||||
$bodyType = $bodyTypeMatch[2] ?? null;
|
||||
preg_match('/^(GET|POST|PUT|DELETE)\s(\/\S*)\sHTTP\/1.1/', $requestLine, $matches);
|
||||
$method = $matches[1];
|
||||
$path = $matches[2];
|
||||
|
||||
|
||||
$headerAssoc = [];
|
||||
|
||||
foreach ($headerLines as $header) {
|
||||
list($name, $value) = explode(": ", $header, 2);
|
||||
$headerAssoc[strtolower($name)] = $value;
|
||||
}
|
||||
if (substr($path, 0, 4) === '/sse') {
|
||||
$responseHeaders = "HTTP/1.1 200 OK\r\n" .
|
||||
"Content-Type: text/event-stream;charset=UTF-8\r\n" .
|
||||
"Cache-Control: no-cache\r\n" .
|
||||
"Connection: keep-alive\r\n";
|
||||
foreach ($headerAssoc as $name => $value) {
|
||||
$responseHeaders .= $name . ": " . $value . "\r\n";
|
||||
}
|
||||
$responseHeaders .= "\r\n";
|
||||
fwrite($client, $responseHeaders);
|
||||
// 刷新缓冲区,确保头部被立刻发送
|
||||
flush();
|
||||
|
||||
// 模拟发送事件流
|
||||
$count = 0;
|
||||
while ($count < 5) {
|
||||
$data = [
|
||||
"count" => $count
|
||||
];
|
||||
$sseData = "id: sse-test\n";
|
||||
$sseData .= "event: flow\n";
|
||||
$sseData .= "data: " . json_encode($data) . "\n";
|
||||
$sseData .= "retry: 3000\n\n"; // 重试时间可选
|
||||
fwrite($client, $sseData);
|
||||
|
||||
// 再次刷新缓冲区,以确保数据被发送
|
||||
flush();
|
||||
|
||||
// 等待100毫秒
|
||||
usleep(100000);
|
||||
$count++;
|
||||
}
|
||||
fclose($client);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($timeoutMatch) {
|
||||
// 模拟超时
|
||||
sleep(5);
|
||||
$responseHeaders = "HTTP/1.1 500 Internal Server Error\r\n" .
|
||||
"Content-Type: text/plain\r\n" .
|
||||
"Connection: close\r\n\r\n";
|
||||
fwrite($client, $responseHeaders . "Server Timeout");
|
||||
} else {
|
||||
$headerAssoc = [];
|
||||
foreach ($headerLines as $headerLine) {
|
||||
list($key, $value) = explode(': ', $headerLine, 2);
|
||||
$headerAssoc[strtolower($key)] = trim($value);
|
||||
}
|
||||
|
||||
// 获取路径和请求方法
|
||||
preg_match('/^(GET|POST|PUT|DELETE)\s(\/\S*)\sHTTP\/1.1/', $requestLine, $matches);
|
||||
$method = $matches[1];
|
||||
$path = $matches[2];
|
||||
|
||||
// 构建响应头
|
||||
$responseHeaders = "HTTP/1.1 200 OK\r\n" .
|
||||
"Connection: close\r\n" .
|
||||
"Content-Type: application/json\r\n" .
|
||||
"x-acs-request-id: A45EE076-334D-5012-9746-A8F828D20FD4\r\n" .
|
||||
"http-method: $method\r\n" .
|
||||
"pathname: $path\r\n" .
|
||||
"raw-body: $body\r\n";
|
||||
|
||||
// 构建响应体
|
||||
$responseBody = "";
|
||||
|
||||
echo $bodyType."\n";
|
||||
|
||||
switch ($bodyType) {
|
||||
case 'array':
|
||||
$responseBody = json_encode(["AppId", "ClassId", "UserId"]);
|
||||
break;
|
||||
case 'error':
|
||||
$responseHeaders = "HTTP/1.1 400 Bad Request\r\n" .
|
||||
"Connection: close\r\n" .
|
||||
"Content-Type: application/json\r\n" .
|
||||
"x-acs-request-id: A45EE076-334D-5012-9746-A8F828D20FD4\r\n" .
|
||||
"http-method: $method\r\n" .
|
||||
"pathname: $path\r\n";
|
||||
$responseBody = json_encode([
|
||||
"Code" => "error code",
|
||||
"Message" => "error message",
|
||||
"RequestId" => "A45EE076-334D-5012-9746-A8F828D20FD4",
|
||||
"Description" => "error description",
|
||||
"AccessDeniedDetail" => new stdClass()
|
||||
]);
|
||||
break;
|
||||
case 'error1':
|
||||
$responseHeaders = "HTTP/1.1 400 Bad Request\r\n" .
|
||||
"Connection: close\r\n" .
|
||||
"Content-Type: application/json\r\n" .
|
||||
"x-acs-request-id: A45EE076-334D-5012-9746-A8F828D20FD4\r\n" .
|
||||
"http-method: $method\r\n" .
|
||||
"pathname: $path\r\n";
|
||||
$responseBody = json_encode([
|
||||
"Code" => "error code",
|
||||
"Message" => "error message",
|
||||
"RequestId" => "A45EE076-334D-5012-9746-A8F828D20FD4",
|
||||
"Description" => "error description",
|
||||
"AccessDeniedDetail" => new stdClass(),
|
||||
"accessDeniedDetail" => ["test" => 0]
|
||||
]);
|
||||
break;
|
||||
case 'error2':
|
||||
$responseHeaders = "HTTP/1.1 400 Bad Request\r\n" .
|
||||
"Connection: close\r\n" .
|
||||
"Content-Type: application/json\r\n" .
|
||||
"x-acs-request-id: A45EE076-334D-5012-9746-A8F828D20FD4\r\n" .
|
||||
"http-method: $method\r\n" .
|
||||
"pathname: $path\r\n";
|
||||
$responseBody = json_encode([
|
||||
"Code" => "error code",
|
||||
"Message" => "error message",
|
||||
"RequestId" => "A45EE076-334D-5012-9746-A8F828D20FD4",
|
||||
"Description" => "error description",
|
||||
"accessDeniedDetail" => ["test" => 0]
|
||||
]);
|
||||
break;
|
||||
default:
|
||||
$responseBody = json_encode([
|
||||
"AppId" => "test",
|
||||
"ClassId" => "test",
|
||||
"UserId" => 123
|
||||
]);
|
||||
}
|
||||
|
||||
fwrite($client, $responseHeaders . "\r\n" . $responseBody);
|
||||
}
|
||||
fclose($client);
|
||||
continue;
|
||||
}
|
||||
|
||||
fclose($server);
|
||||
@@ -0,0 +1,419 @@
|
||||
<?php
|
||||
|
||||
namespace Darabonba\OpenApi\Tests;
|
||||
|
||||
use Darabonba\OpenApi\OpenApiClient;
|
||||
use Darabonba\OpenApi\Utils;
|
||||
|
||||
use Darabonba\OpenApi\Models\Config;
|
||||
use Darabonba\OpenApi\Models\Params;
|
||||
use Darabonba\OpenApi\Models\GlobalParameters;
|
||||
use AlibabaCloud\Dara\Models\RuntimeOptions;
|
||||
use AlibabaCloud\Dara\Models\ExtendsParameters;
|
||||
use Darabonba\OpenApi\Models\OpenApiRequest;
|
||||
use AlibabaCloud\Credentials\Credential;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @coversNothing
|
||||
*/
|
||||
class OpenApiClientTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @var resource
|
||||
*/
|
||||
private $pid = 0;
|
||||
|
||||
/**
|
||||
* @before
|
||||
*/
|
||||
protected function initialize()
|
||||
{
|
||||
// $server = dirname(__DIR__). \DIRECTORY_SEPARATOR . 'tests' . \DIRECTORY_SEPARATOR . 'Mock' . \DIRECTORY_SEPARATOR . 'MockServer.php';
|
||||
// $command = "php $server > /dev/null 2>&1 & echo $!";
|
||||
// // $command = "php -S localhost:8000 $server";
|
||||
// $output = shell_exec($command);
|
||||
// $this->pid = (int)trim($output);
|
||||
// sleep(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @after
|
||||
*/
|
||||
protected function cleanup()
|
||||
{
|
||||
// shell_exec('kill '.$this->pid);
|
||||
}
|
||||
|
||||
public function testConfig(){
|
||||
$globalParameters = new GlobalParameters([
|
||||
"headers" => [
|
||||
"global-key" => "global-value"
|
||||
],
|
||||
"queries" => [
|
||||
"global-query" => "global-value"
|
||||
]
|
||||
]);
|
||||
$config = new Config([
|
||||
"endpoint" => "config.endpoint",
|
||||
"endpointType" => "regional",
|
||||
"network" => "config.network",
|
||||
"suffix" => "config.suffix",
|
||||
"protocol" => "config.protocol",
|
||||
"method" => "config.method",
|
||||
"regionId" => "config.regionId",
|
||||
"userAgent" => "config.userAgent",
|
||||
"readTimeout" => 3000,
|
||||
"connectTimeout" => 3000,
|
||||
"httpProxy" => "config.httpProxy",
|
||||
"httpsProxy" => "config.httpsProxy",
|
||||
"noProxy" => "config.noProxy",
|
||||
"socks5Proxy" => "config.socks5Proxy",
|
||||
"socks5NetWork" => "config.socks5NetWork",
|
||||
"maxIdleConns" => 128,
|
||||
"signatureVersion" => "config.signatureVersion",
|
||||
"signatureAlgorithm" => "config.signatureAlgorithm",
|
||||
"globalParameters" => $globalParameters
|
||||
]);
|
||||
$creConfig = new \AlibabaCloud\Credentials\Credential\Config([
|
||||
"accessKeyId" => "accessKeyId",
|
||||
"accessKeySecret" => "accessKeySecret",
|
||||
"securityToken" => "securityToken",
|
||||
"type" => "sts"
|
||||
]);
|
||||
$credential = new Credential($creConfig);
|
||||
$config->credential = $credential;
|
||||
$client = new OpenApiClient($config);
|
||||
$config->accessKeyId = "ak";
|
||||
$config->accessKeySecret = "secret";
|
||||
$config->securityToken = "token";
|
||||
$config->type = "sts";
|
||||
$client = new OpenApiClient($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Config
|
||||
*/
|
||||
public static function createConfig(){
|
||||
$globalParameters = new GlobalParameters([
|
||||
"headers" => [
|
||||
"global-key" => "global-value"
|
||||
],
|
||||
"queries" => [
|
||||
"global-query" => "global-value"
|
||||
]
|
||||
]);
|
||||
$config = new Config([
|
||||
"accessKeyId" => "ak",
|
||||
"accessKeySecret" => "secret",
|
||||
"securityToken" => "token",
|
||||
"type" => "sts",
|
||||
"userAgent" => "config.userAgent",
|
||||
"readTimeout" => 3000,
|
||||
"connectTimeout" => 3000,
|
||||
"maxIdleConns" => 128,
|
||||
"signatureVersion" => "config.signatureVersion",
|
||||
"signatureAlgorithm" => "ACS3-HMAC-SHA256",
|
||||
"globalParameters" => $globalParameters
|
||||
]);
|
||||
return $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return RuntimeOptions
|
||||
*/
|
||||
public static function createRuntimeOptions(){
|
||||
$runtime = new RuntimeOptions([
|
||||
"readTimeout" => 4000,
|
||||
"connectTimeout" => 4000,
|
||||
"maxIdleConns" => 100,
|
||||
"autoretry" => true,
|
||||
"maxAttempts" => 1,
|
||||
"backoffPolicy" => "no",
|
||||
"backoffPeriod" => 1,
|
||||
"ignoreSSL" => true,
|
||||
"extendsParameters" => new ExtendsParameters([
|
||||
"headers" => [
|
||||
"extends-key" => "extends-value"
|
||||
],
|
||||
])
|
||||
]);
|
||||
return $runtime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return OpenApiRequest
|
||||
*/
|
||||
public static function createOpenApiRequest(){
|
||||
$query = [];
|
||||
$query["key1"] = "value";
|
||||
$query["key2"] = 1;
|
||||
$query["key3"] = true;
|
||||
$body = [];
|
||||
$body["key1"] = "value";
|
||||
$body["key2"] = 1;
|
||||
$body["key3"] = true;
|
||||
$headers = [
|
||||
"for-test" => "sdk"
|
||||
];
|
||||
$req = new OpenApiRequest([
|
||||
"headers" => $headers,
|
||||
"query" => Utils::query($query),
|
||||
"body" => Utils::parseToMap($body)
|
||||
]);
|
||||
return $req;
|
||||
}
|
||||
|
||||
public function testCallApiForRPCWithV2Sign_AK_Form(){
|
||||
$config = self::createConfig();
|
||||
$runtime = self::createRuntimeOptions();
|
||||
$config->protocol = "HTTP";
|
||||
$config->signatureAlgorithm = "v2";
|
||||
$config->endpoint = "test.aliyuncs.com";
|
||||
$client = new OpenApiClient($config);
|
||||
$request = self::createOpenApiRequest();
|
||||
$params = new Params([
|
||||
"action" => "TestAPI",
|
||||
"version" => "2022-06-01",
|
||||
"protocol" => "HTTPS",
|
||||
"pathname" => "/",
|
||||
"method" => "POST",
|
||||
"authType" => "AK",
|
||||
"style" => "RPC",
|
||||
"reqBodyType" => "formData",
|
||||
"bodyType" => "json"
|
||||
]);
|
||||
$client->callApi($params, $request, $runtime);
|
||||
}
|
||||
|
||||
public function testCallApiForRPCWithV2Sign_Anonymous_JSON(){
|
||||
$config = self::createConfig();
|
||||
$runtime = self::createRuntimeOptions();
|
||||
$config->protocol = "HTTP";
|
||||
$config->signatureAlgorithm = "v2";
|
||||
$config->endpoint = "test.aliyuncs.com";
|
||||
$client = new OpenApiClient($config);
|
||||
$request = self::createOpenApiRequest();
|
||||
$params = new Params([
|
||||
"action" => "TestAPI",
|
||||
"version" => "2022-06-01",
|
||||
"protocol" => "HTTPS",
|
||||
"pathname" => "/",
|
||||
"method" => "POST",
|
||||
"authType" => "Anonymous",
|
||||
"style" => "RPC",
|
||||
"reqBodyType" => "json",
|
||||
"bodyType" => "json"
|
||||
]);
|
||||
$client->callApi($params, $request, $runtime);
|
||||
}
|
||||
|
||||
public function testCallApiForROAWithV2Sign_HTTPS_AK_Form(){
|
||||
$config = self::createConfig();
|
||||
$runtime = self::createRuntimeOptions();
|
||||
$config->signatureAlgorithm = "v2";
|
||||
$config->endpoint = "test.aliyuncs.com";
|
||||
$client = new OpenApiClient($config);
|
||||
$request = self::createOpenApiRequest();
|
||||
$params = new Params([
|
||||
"action" => "TestAPI",
|
||||
"version" => "2022-06-01",
|
||||
"protocol" => "HTTPS",
|
||||
"pathname" => "/test",
|
||||
"method" => "POST",
|
||||
"authType" => "AK",
|
||||
"style" => "ROA",
|
||||
"reqBodyType" => "formData",
|
||||
"bodyType" => "json"
|
||||
]);
|
||||
$client->callApi($params, $request, $runtime);
|
||||
}
|
||||
|
||||
public function testCallApiForROAWithV2Sign_Anonymous_JSON(){
|
||||
$config = self::createConfig();
|
||||
$runtime = self::createRuntimeOptions();
|
||||
$config->protocol = "HTTP";
|
||||
$config->signatureAlgorithm = "v2";
|
||||
$config->endpoint = "test.aliyuncs.com";
|
||||
$client = new OpenApiClient($config);
|
||||
$request = self::createOpenApiRequest();
|
||||
$params = new Params([
|
||||
"action" => "TestAPI",
|
||||
"version" => "2022-06-01",
|
||||
"protocol" => "HTTPS",
|
||||
"pathname" => "/test",
|
||||
"method" => "POST",
|
||||
"authType" => "Anonymous",
|
||||
"style" => "ROA",
|
||||
"reqBodyType" => "json",
|
||||
"bodyType" => "json"
|
||||
]);
|
||||
$client->callApi($params, $request, $runtime);
|
||||
}
|
||||
|
||||
public function testCallApiForRPCWithV3Sign_AK_Form(){
|
||||
$config = self::createConfig();
|
||||
$runtime = self::createRuntimeOptions();
|
||||
$config->protocol = "HTTP";
|
||||
$config->endpoint = "test.aliyuncs.com";
|
||||
$client = new OpenApiClient($config);
|
||||
$request = self::createOpenApiRequest();
|
||||
$params = new Params([
|
||||
"action" => "TestAPI",
|
||||
"version" => "2022-06-01",
|
||||
"protocol" => "HTTPS",
|
||||
"pathname" => "/",
|
||||
"method" => "POST",
|
||||
"authType" => "AK",
|
||||
"style" => "RPC",
|
||||
"reqBodyType" => "formData",
|
||||
"bodyType" => "json"
|
||||
]);
|
||||
$client->callApi($params, $request, $runtime);
|
||||
}
|
||||
|
||||
public function testCallApiForRPCWithV3Sign_Anonymous_JSON(){
|
||||
$config = self::createConfig();
|
||||
$runtime = self::createRuntimeOptions();
|
||||
$config->protocol = "HTTP";
|
||||
$config->endpoint = "test.aliyuncs.com";
|
||||
$client = new OpenApiClient($config);
|
||||
$request = self::createOpenApiRequest();
|
||||
$params = new Params([
|
||||
"action" => "TestAPI",
|
||||
"version" => "2022-06-01",
|
||||
"protocol" => "HTTPS",
|
||||
"pathname" => "/",
|
||||
"method" => "POST",
|
||||
"authType" => "Anonymous",
|
||||
"style" => "RPC",
|
||||
"reqBodyType" => "json",
|
||||
"bodyType" => "json"
|
||||
]);
|
||||
$client->callApi($params, $request, $runtime);
|
||||
}
|
||||
|
||||
public function testCallApiForROAWithV3Sign_AK_Form(){
|
||||
$config = self::createConfig();
|
||||
$runtime = self::createRuntimeOptions();
|
||||
$config->protocol = "HTTP";
|
||||
$config->endpoint = "test.aliyuncs.com";
|
||||
$client = new OpenApiClient($config);
|
||||
$request = self::createOpenApiRequest();
|
||||
$params = new Params([
|
||||
"action" => "TestAPI",
|
||||
"version" => "2022-06-01",
|
||||
"protocol" => "HTTPS",
|
||||
"pathname" => "/test",
|
||||
"method" => "POST",
|
||||
"authType" => "AK",
|
||||
"style" => "ROA",
|
||||
"reqBodyType" => "formData",
|
||||
"bodyType" => "json"
|
||||
]);
|
||||
$client->callApi($params, $request, $runtime);
|
||||
}
|
||||
|
||||
public function testCallApiForROAWithV3Sign_Anonymous_JSON(){
|
||||
$config = self::createConfig();
|
||||
$runtime = self::createRuntimeOptions();
|
||||
$config->protocol = "HTTP";
|
||||
$config->endpoint = "test.aliyuncs.com";
|
||||
$client = new OpenApiClient($config);
|
||||
$request = self::createOpenApiRequest();
|
||||
$params = new Params([
|
||||
"action" => "TestAPI",
|
||||
"version" => "2022-06-01",
|
||||
"protocol" => "HTTPS",
|
||||
"pathname" => "/test",
|
||||
"method" => "POST",
|
||||
"authType" => "Anonymous",
|
||||
"style" => "ROA",
|
||||
"reqBodyType" => "json",
|
||||
"bodyType" => "json"
|
||||
]);
|
||||
$client->callApi($params, $request, $runtime);
|
||||
}
|
||||
|
||||
public function testResponseBodyType(){
|
||||
$config = self::createConfig();
|
||||
$runtime = self::createRuntimeOptions();
|
||||
$config->protocol = "HTTP";
|
||||
$config->endpoint = "test.aliyuncs.com";
|
||||
$client = new OpenApiClient($config);
|
||||
$request = self::createOpenApiRequest();
|
||||
$params = new Params([
|
||||
"action" => "TestAPI",
|
||||
"version" => "2022-06-01",
|
||||
"protocol" => "HTTPS",
|
||||
"pathname" => "/test",
|
||||
"method" => "POST",
|
||||
"authType" => "AK",
|
||||
"style" => "ROA",
|
||||
"reqBodyType" => "formData",
|
||||
"bodyType" => "json"
|
||||
]);
|
||||
$client->callApi($params, $request, $runtime);
|
||||
$params->bodyType = "array";
|
||||
$client->callApi($params, $request, $runtime);
|
||||
$params->bodyType = "string";
|
||||
$client->callApi($params, $request, $runtime);
|
||||
$params->bodyType = "byte";
|
||||
$client->callApi($params, $request, $runtime);
|
||||
}
|
||||
|
||||
public function testCallSSEApiWithSignV3()
|
||||
{
|
||||
$config = self::createConfig();
|
||||
$runtime = self::createRuntimeOptions();
|
||||
$config->protocol = "HTTP";
|
||||
$config->endpoint = "127.0.0.1:8000";
|
||||
$client = new OpenApiClient($config);
|
||||
$request = self::createOpenApiRequest();
|
||||
$params = new Params([
|
||||
"action" => "TestAPI",
|
||||
"version" => "2022-06-01",
|
||||
"protocol" => "HTTPS",
|
||||
"pathname" => "/sse",
|
||||
"method" => "POST",
|
||||
"authType" => "AK",
|
||||
"style" => "ROA",
|
||||
"reqBodyType" => "json",
|
||||
"bodyType" => "sse"
|
||||
]);
|
||||
$response = $client->callSSEApi($params, $request, $runtime);
|
||||
|
||||
|
||||
// Add more assertions as needed
|
||||
$events = [];
|
||||
|
||||
// SSE events are typically separated by double newline
|
||||
foreach ($response as $event) {
|
||||
$this->assertEquals(200, $event->statusCode);
|
||||
$headers = $event->headers;
|
||||
$this->assertEquals('text/event-stream;charset=UTF-8', $headers['Content-Type'][0]);
|
||||
$this->assertEquals('sdk', $headers['for-test'][0]);
|
||||
$userAgentArray = explode(' ', $headers['user-agent'][0]);
|
||||
$this->assertEquals('config.userAgent', end($userAgentArray));
|
||||
$this->assertEquals('global-value', $headers['global-key'][0]);
|
||||
$this->assertEquals('extends-value', $headers['extends-key'][0]);
|
||||
$this->assertNotEmpty($headers['x-acs-signature-nonce'][0]);
|
||||
$this->assertNotEmpty($headers['x-acs-date'][0]);
|
||||
$this->assertEquals('application/json', $headers['accept'][0]);
|
||||
$event = $event->event->toArray();
|
||||
// var_dump($event);
|
||||
$events[] = json_decode($event['data'], true);
|
||||
}
|
||||
$expectedEvents = [
|
||||
['count' => 0],
|
||||
['count' => 1],
|
||||
['count' => 2],
|
||||
['count' => 3],
|
||||
['count' => 4],
|
||||
];
|
||||
$this->assertCount(5, $events);
|
||||
$this->assertEquals($expectedEvents, $events);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
require dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
|
||||
Reference in New Issue
Block a user