Skip to content

Commit

Permalink
feat: custom headers - rebased on master
Browse files Browse the repository at this point in the history
  • Loading branch information
bpolaszek committed Feb 19, 2021
1 parent 2bf536e commit a649939
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/EventSourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
use PHPUnit\Framework\TestCase;
use React\Promise\Promise;
use React\Promise\Deferred;
use React\Http\Browser;
use React\Http\Io\ReadableBodyStream;
use React\Stream\ThroughStream;
use ReflectionProperty;
use RingCentral\Psr7\Response;

class EventSourceTest extends TestCase
Expand Down Expand Up @@ -47,7 +47,7 @@ public function testConstructorCanBeCalledWithoutBrowser()
$this->assertInstanceOf('React\Http\Browser', $browser);
}


public function testConstructorCanBeCalledWithoutCustomHeaders()
{
$loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock();
Expand All @@ -61,7 +61,7 @@ public function testConstructorCanBeCalledWithoutCustomHeaders()
$ref = new ReflectionProperty($es, 'defaultHeaders');
$ref->setAccessible(true);
$defaultHeaders = $ref->getValue($es);

$this->assertEquals($defaultHeaders, $headers);
}

Expand All @@ -80,8 +80,8 @@ public function testConstructorCanBeCalledWithCustomHeaders()
$ref->setAccessible(true);
$headers = $ref->getValue($es);

// Could have used the defaultHeaders property on EventSource,
// but this ensures the defaults are not altered by hardcoding their values in this test
// Could have used the defaultHeaders property on EventSource,
// but this ensures the defaults are not altered by hardcoding their values in this test
$this->assertEquals(array(
'Accept' => 'text/event-stream',
'Cache-Control' => 'no-cache',
Expand Down

0 comments on commit a649939

Please sign in to comment.