forked from zendframework/zend-diactoros
/
UploadedFileTest.php
32 lines (27 loc) · 1.02 KB
/
UploadedFileTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/**
* @see https://github.com/zendframework/zend-diactoros for the canonical source repository
* @copyright Copyright (c) 2018 Zend Technologies USA Inc. (https://www.zend.com)
* @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License
*/
namespace ZendTest\Diactoros\Integration;
use Http\Factory\Diactoros\RequestFactory;
use Http\Psr7Test\UploadedFileIntegrationTest;
use Zend\Diactoros\Stream;
use Zend\Diactoros\UploadedFile;
class UploadedFileTest extends UploadedFileIntegrationTest
{
public static function setUpBeforeClass()
{
if (! class_exists(RequestFactory::class)) {
self::markTestSkipped('You need to install http-interop/http-factory-diactoros to run integration tests');
}
parent::setUpBeforeClass();
}
public function createSubject()
{
$stream = new Stream('php://memory', 'rw');
$stream->write('foobar');
return new UploadedFile($stream, $stream->getSize(), UPLOAD_ERR_OK);
}
}