Skip to content

Commit

Permalink
test: change delay from 1000 to 100
Browse files Browse the repository at this point in the history
To improve test speed.
  • Loading branch information
kenjis committed Jan 19, 2022
1 parent 7c32e4b commit 9892728
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
22 changes: 11 additions & 11 deletions tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down Expand Up @@ -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");
Expand All @@ -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
Expand Down Expand Up @@ -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");
Expand All @@ -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');
Expand All @@ -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");
Expand All @@ -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");
Expand Down
22 changes: 11 additions & 11 deletions tests/system/HTTP/CURLRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down Expand Up @@ -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");
Expand All @@ -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
Expand Down Expand Up @@ -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");
Expand All @@ -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');
Expand All @@ -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");
Expand All @@ -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");
Expand Down

0 comments on commit 9892728

Please sign in to comment.