Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 0aab3a4

Browse files
committed
Cannot use ::class on 5.4!
- The `::class` magic class constant was introduced with PHP 5.5, so cannot be used here if we want to provide 5.4 support.
1 parent 8dd06b6 commit 0aab3a4

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

test/RelativeStreamTest.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class RelativeStreamTest extends TestCase
2020
{
2121
public function testToString()
2222
{
23-
$decorated = $this->prophesize(Stream::class);
23+
$decorated = $this->prophesize('Zend\Diactoros\Stream');
2424
$decorated->seek(100, SEEK_SET)->shouldBeCalled();
2525
$decorated->getContents()->shouldBeCalled()->willReturn('foobarbaz');
2626

@@ -31,15 +31,15 @@ public function testToString()
3131

3232
public function testClose()
3333
{
34-
$decorated = $this->prophesize(Stream::class);
34+
$decorated = $this->prophesize('Zend\Diactoros\Stream');
3535
$decorated->close()->shouldBeCalled();
3636
$stream = new RelativeStream($decorated->reveal(), 100);
3737
$stream->close();
3838
}
3939

4040
public function testDetach()
4141
{
42-
$decorated = $this->prophesize(Stream::class);
42+
$decorated = $this->prophesize('Zend\Diactoros\Stream');
4343
$decorated->detach()->shouldBeCalled()->willReturn(250);
4444
$stream = new RelativeStream($decorated->reveal(), 100);
4545
$ret = $stream->detach();
@@ -48,7 +48,7 @@ public function testDetach()
4848

4949
public function testGetSize()
5050
{
51-
$decorated = $this->prophesize(Stream::class);
51+
$decorated = $this->prophesize('Zend\Diactoros\Stream');
5252
$decorated->getSize()->shouldBeCalled()->willReturn(250);
5353
$stream = new RelativeStream($decorated->reveal(), 100);
5454
$ret = $stream->getSize();
@@ -57,7 +57,7 @@ public function testGetSize()
5757

5858
public function testTell()
5959
{
60-
$decorated = $this->prophesize(Stream::class);
60+
$decorated = $this->prophesize('Zend\Diactoros\Stream');
6161
$decorated->tell()->shouldBeCalled()->willReturn(188);
6262
$stream = new RelativeStream($decorated->reveal(), 100);
6363
$ret = $stream->tell();
@@ -66,7 +66,7 @@ public function testTell()
6666

6767
public function testIsSeekable()
6868
{
69-
$decorated = $this->prophesize(Stream::class);
69+
$decorated = $this->prophesize('Zend\Diactoros\Stream');
7070
$decorated->isSeekable()->shouldBeCalled()->willReturn(true);
7171
$stream = new RelativeStream($decorated->reveal(), 100);
7272
$ret = $stream->isSeekable();
@@ -75,7 +75,7 @@ public function testIsSeekable()
7575

7676
public function testIsWritable()
7777
{
78-
$decorated = $this->prophesize(Stream::class);
78+
$decorated = $this->prophesize('Zend\Diactoros\Stream');
7979
$decorated->isWritable()->shouldBeCalled()->willReturn(true);
8080
$stream = new RelativeStream($decorated->reveal(), 100);
8181
$ret = $stream->isWritable();
@@ -84,7 +84,7 @@ public function testIsWritable()
8484

8585
public function testIsReadable()
8686
{
87-
$decorated = $this->prophesize(Stream::class);
87+
$decorated = $this->prophesize('Zend\Diactoros\Stream');
8888
$decorated->isReadable()->shouldBeCalled()->willReturn(false);
8989
$stream = new RelativeStream($decorated->reveal(), 100);
9090
$ret = $stream->isReadable();
@@ -93,7 +93,7 @@ public function testIsReadable()
9393

9494
public function testSeek()
9595
{
96-
$decorated = $this->prophesize(Stream::class);
96+
$decorated = $this->prophesize('Zend\Diactoros\Stream');
9797
$decorated->seek(126, SEEK_SET)->shouldBeCalled()->willReturn(0);
9898
$stream = new RelativeStream($decorated->reveal(), 100);
9999
$ret = $stream->seek(26);
@@ -102,7 +102,7 @@ public function testSeek()
102102

103103
public function testRewind()
104104
{
105-
$decorated = $this->prophesize(Stream::class);
105+
$decorated = $this->prophesize('Zend\Diactoros\Stream');
106106
$decorated->seek(100, SEEK_SET)->shouldBeCalled()->willReturn(0);
107107
$stream = new RelativeStream($decorated->reveal(), 100);
108108
$ret = $stream->rewind();
@@ -111,7 +111,7 @@ public function testRewind()
111111

112112
public function testWrite()
113113
{
114-
$decorated = $this->prophesize(Stream::class);
114+
$decorated = $this->prophesize('Zend\Diactoros\Stream');
115115
$decorated->write("foobaz")->shouldBeCalled()->willReturn(6);
116116
$stream = new RelativeStream($decorated->reveal(), 100);
117117
$ret = $stream->write("foobaz");
@@ -120,7 +120,7 @@ public function testWrite()
120120

121121
public function testRead()
122122
{
123-
$decorated = $this->prophesize(Stream::class);
123+
$decorated = $this->prophesize('Zend\Diactoros\Stream');
124124
$decorated->read(3)->shouldBeCalled()->willReturn("foo");
125125
$stream = new RelativeStream($decorated->reveal(), 100);
126126
$ret = $stream->read(3);
@@ -129,7 +129,7 @@ public function testRead()
129129

130130
public function testGetContents()
131131
{
132-
$decorated = $this->prophesize(Stream::class);
132+
$decorated = $this->prophesize('Zend\Diactoros\Stream');
133133
$decorated->getContents()->shouldBeCalled()->willReturn("foo");
134134
$stream = new RelativeStream($decorated->reveal(), 100);
135135
$ret = $stream->getContents();
@@ -138,7 +138,7 @@ public function testGetContents()
138138

139139
public function testGetMetadata()
140140
{
141-
$decorated = $this->prophesize(Stream::class);
141+
$decorated = $this->prophesize('Zend\Diactoros\Stream');
142142
$decorated->getMetadata("bar")->shouldBeCalled()->willReturn("foo");
143143
$stream = new RelativeStream($decorated->reveal(), 100);
144144
$ret = $stream->getMetadata("bar");

test/Request/SerializerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,6 @@ public function testFromStreamStopsReadingAfterScanningHeader()
324324
}));
325325

326326
$stream = Serializer::fromStream($stream);
327-
$this->assertInstanceOf(RelativeStream::class, $stream->getBody());
327+
$this->assertInstanceOf('Zend\Diactoros\RelativeStream', $stream->getBody());
328328
}
329329
}

0 commit comments

Comments
 (0)