From 98927283a9284ed8eee839b43beb681ec738f2cb Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 19 Jan 2022 21:19:45 +0900 Subject: [PATCH] test: change `delay` from 1000 to 100 To improve test speed. --- .../HTTP/CURLRequestDoNotShareOptionsTest.php | 22 +++++++++---------- tests/system/HTTP/CURLRequestTest.php | 22 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php b/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php index 4d35d4510271..21070736d741 100644 --- a/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php +++ b/tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php @@ -267,13 +267,13 @@ public function testHeaderContentLengthNotSharedBetweenClients() public function testOptionsDelay() { + $request = $this->getRequest(); + $this->assertSame(0.0, $request->getDelay()); + $options = [ 'delay' => 2000, 'headers' => ['fruit' => 'apple'], ]; - $request = $this->getRequest(); - $this->assertSame(0.0, $request->getDelay()); - $request = $this->getRequest($options); $this->assertSame(2.0, $request->getDelay()); } @@ -715,20 +715,20 @@ public function testSendWithDelay() { $request = $this->getRequest([ 'base_uri' => 'http://www.foo.com/api/v1/', - 'delay' => 1000, + 'delay' => 100, ]); $request->get('products'); // we still need to check the code coverage to make sure this was done - $this->assertSame(1.0, $request->getDelay()); + $this->assertSame(0.1, $request->getDelay()); } public function testSendContinued() { $request = $this->getRequest([ 'base_uri' => 'http://www.foo.com/api/v1/', - 'delay' => 1000, + 'delay' => 100, ]); $request->setOutput("HTTP/1.1 100 Continue\x0d\x0a\x0d\x0aHi there"); @@ -743,7 +743,7 @@ public function testSendContinuedWithManyHeaders() { $request = $this->getRequest([ 'base_uri' => 'http://www.foo.com/api/v1/', - 'delay' => 1000, + 'delay' => 100, ]); $output = "HTTP/1.1 100 Continue @@ -787,7 +787,7 @@ public function testSplitResponse() { $request = $this->getRequest([ 'base_uri' => 'http://www.foo.com/api/v1/', - 'delay' => 1000, + 'delay' => 100, ]); $request->setOutput("Accept: text/html\x0d\x0a\x0d\x0aHi there"); @@ -799,7 +799,7 @@ public function testApplyBody() { $request = $this->getRequest([ 'base_uri' => 'http://www.foo.com/api/v1/', - 'delay' => 1000, + 'delay' => 100, ]); $request->setBody('name=George'); @@ -814,7 +814,7 @@ public function testResponseHeaders() { $request = $this->getRequest([ 'base_uri' => 'http://www.foo.com/api/v1/', - 'delay' => 1000, + 'delay' => 100, ]); $request->setOutput("HTTP/2.0 234 Ohoh\x0d\x0aAccept: text/html\x0d\x0a\x0d\x0aHi there"); @@ -828,7 +828,7 @@ public function testResponseHeadersShortProtocol() { $request = $this->getRequest([ 'base_uri' => 'http://www.foo.com/api/v1/', - 'delay' => 1000, + 'delay' => 100, ]); $request->setOutput("HTTP/2 235 Ohoh\x0d\x0aAccept: text/html\x0d\x0a\x0d\x0aHi there shortie"); diff --git a/tests/system/HTTP/CURLRequestTest.php b/tests/system/HTTP/CURLRequestTest.php index e978944ad116..64b824cbad56 100644 --- a/tests/system/HTTP/CURLRequestTest.php +++ b/tests/system/HTTP/CURLRequestTest.php @@ -250,13 +250,13 @@ public function testHeaderContentLengthNotSharedBetweenClients() public function testOptionsDelay() { + $request = $this->getRequest(); + $this->assertSame(0.0, $request->getDelay()); + $options = [ 'delay' => 2000, 'headers' => ['fruit' => 'apple'], ]; - $request = $this->getRequest(); - $this->assertSame(0.0, $request->getDelay()); - $request = $this->getRequest($options); $this->assertSame(2.0, $request->getDelay()); } @@ -698,20 +698,20 @@ public function testSendWithDelay() { $request = $this->getRequest([ 'base_uri' => 'http://www.foo.com/api/v1/', - 'delay' => 1000, + 'delay' => 100, ]); $request->get('products'); // we still need to check the code coverage to make sure this was done - $this->assertSame(1.0, $request->getDelay()); + $this->assertSame(0.1, $request->getDelay()); } public function testSendContinued() { $request = $this->getRequest([ 'base_uri' => 'http://www.foo.com/api/v1/', - 'delay' => 1000, + 'delay' => 100, ]); $request->setOutput("HTTP/1.1 100 Continue\x0d\x0a\x0d\x0aHi there"); @@ -726,7 +726,7 @@ public function testSendContinuedWithManyHeaders() { $request = $this->getRequest([ 'base_uri' => 'http://www.foo.com/api/v1/', - 'delay' => 1000, + 'delay' => 100, ]); $output = "HTTP/1.1 100 Continue @@ -770,7 +770,7 @@ public function testSplitResponse() { $request = $this->getRequest([ 'base_uri' => 'http://www.foo.com/api/v1/', - 'delay' => 1000, + 'delay' => 100, ]); $request->setOutput("Accept: text/html\x0d\x0a\x0d\x0aHi there"); @@ -782,7 +782,7 @@ public function testApplyBody() { $request = $this->getRequest([ 'base_uri' => 'http://www.foo.com/api/v1/', - 'delay' => 1000, + 'delay' => 100, ]); $request->setBody('name=George'); @@ -797,7 +797,7 @@ public function testResponseHeaders() { $request = $this->getRequest([ 'base_uri' => 'http://www.foo.com/api/v1/', - 'delay' => 1000, + 'delay' => 100, ]); $request->setOutput("HTTP/2.0 234 Ohoh\x0d\x0aAccept: text/html\x0d\x0a\x0d\x0aHi there"); @@ -811,7 +811,7 @@ public function testResponseHeadersShortProtocol() { $request = $this->getRequest([ 'base_uri' => 'http://www.foo.com/api/v1/', - 'delay' => 1000, + 'delay' => 100, ]); $request->setOutput("HTTP/2 235 Ohoh\x0d\x0aAccept: text/html\x0d\x0a\x0d\x0aHi there shortie");