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 Sep 22, 2020
1 parent 4cbc552 commit d9ab9fb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/EventSourceTest.php
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 @@ -53,7 +53,7 @@ public function testConstructorCanBeCalledWithoutBrowser()
$this->assertInstanceOf('React\Http\Browser', $browser);
}


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

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

Expand All @@ -86,8 +86,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 d9ab9fb

Please sign in to comment.