summaryrefslogtreecommitdiff
path: root/server/vendor/guzzlehttp/psr7/tests/StreamWrapperTest.php
diff options
context:
space:
mode:
authorEoleDev <EoleDev@outlook.fr>2016-04-14 16:28:25 +0200
committerEoleDev <EoleDev@outlook.fr>2016-04-14 16:28:25 +0200
commit31d2d0c158ad4daa3dde7a905f3c2e312c194f2e (patch)
tree43d761d2aec8265a22c0fdedcc365bacc10dc814 /server/vendor/guzzlehttp/psr7/tests/StreamWrapperTest.php
parent27730911d8c9253a4f5aa90450c57cdeca9d5d26 (diff)
parentb348dbc2266a3e8070a3951fb0bd8c19b852ec47 (diff)
Merge branch 'compute'
Conflicts: server/core/LibOverride/genTokenOptions.php
Diffstat (limited to 'server/vendor/guzzlehttp/psr7/tests/StreamWrapperTest.php')
-rwxr-xr-xserver/vendor/guzzlehttp/psr7/tests/StreamWrapperTest.php100
1 files changed, 0 insertions, 100 deletions
diff --git a/server/vendor/guzzlehttp/psr7/tests/StreamWrapperTest.php b/server/vendor/guzzlehttp/psr7/tests/StreamWrapperTest.php
deleted file mode 100755
index 0156e59..0000000
--- a/server/vendor/guzzlehttp/psr7/tests/StreamWrapperTest.php
+++ /dev/null
@@ -1,100 +0,0 @@
-<?php
-namespace GuzzleHttp\Tests\Psr7;
-
-use GuzzleHttp\Psr7\StreamWrapper;
-use GuzzleHttp\Psr7;
-
-/**
- * @covers GuzzleHttp\Psr7\StreamWrapper
- */
-class StreamWrapperTest extends \PHPUnit_Framework_TestCase
-{
- public function testResource()
- {
- $stream = Psr7\stream_for('foo');
- $handle = StreamWrapper::getResource($stream);
- $this->assertSame('foo', fread($handle, 3));
- $this->assertSame(3, ftell($handle));
- $this->assertSame(3, fwrite($handle, 'bar'));
- $this->assertSame(0, fseek($handle, 0));
- $this->assertSame('foobar', fread($handle, 6));
- $this->assertSame('', fread($handle, 1));
- $this->assertTrue(feof($handle));
-
- // This fails on HHVM for some reason
- if (!defined('HHVM_VERSION')) {
- $this->assertEquals([
- 'dev' => 0,
- 'ino' => 0,
- 'mode' => 33206,
- 'nlink' => 0,
- 'uid' => 0,
- 'gid' => 0,
- 'rdev' => 0,
- 'size' => 6,
- 'atime' => 0,
- 'mtime' => 0,
- 'ctime' => 0,
- 'blksize' => 0,
- 'blocks' => 0,
- 0 => 0,
- 1 => 0,
- 2 => 33206,
- 3 => 0,
- 4 => 0,
- 5 => 0,
- 6 => 0,
- 7 => 6,
- 8 => 0,
- 9 => 0,
- 10 => 0,
- 11 => 0,
- 12 => 0,
- ], fstat($handle));
- }
-
- $this->assertTrue(fclose($handle));
- $this->assertSame('foobar', (string) $stream);
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testValidatesStream()
- {
- $stream = $this->getMockBuilder('Psr\Http\Message\StreamInterface')
- ->setMethods(['isReadable', 'isWritable'])
- ->getMockForAbstractClass();
- $stream->expects($this->once())
- ->method('isReadable')
- ->will($this->returnValue(false));
- $stream->expects($this->once())
- ->method('isWritable')
- ->will($this->returnValue(false));
- StreamWrapper::getResource($stream);
- }
-
- /**
- * @expectedException \PHPUnit_Framework_Error_Warning
- */
- public function testReturnsFalseWhenStreamDoesNotExist()
- {
- fopen('guzzle://foo', 'r');
- }
-
- public function testCanOpenReadonlyStream()
- {
- $stream = $this->getMockBuilder('Psr\Http\Message\StreamInterface')
- ->setMethods(['isReadable', 'isWritable'])
- ->getMockForAbstractClass();
- $stream->expects($this->once())
- ->method('isReadable')
- ->will($this->returnValue(false));
- $stream->expects($this->once())
- ->method('isWritable')
- ->will($this->returnValue(true));
- $r = StreamWrapper::getResource($stream);
- $this->assertInternalType('resource', $r);
- fclose($r);
- }
-}