This repository has been archived by the owner on Jan 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
210 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?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\RequestIntegrationTest; | ||
use Zend\Diactoros\Request; | ||
|
||
class RequestTest extends RequestIntegrationTest | ||
{ | ||
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() | ||
{ | ||
return new Request('/', 'GET'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?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\ResponseIntegrationTest; | ||
use Zend\Diactoros\Response; | ||
|
||
class ResponseTest extends ResponseIntegrationTest | ||
{ | ||
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() | ||
{ | ||
return new Response(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?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\ServerRequestIntegrationTest; | ||
use Zend\Diactoros\ServerRequest; | ||
|
||
class ServerRequestTest extends ServerRequestIntegrationTest | ||
{ | ||
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() | ||
{ | ||
return new ServerRequest($_SERVER); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?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\StreamIntegrationTest; | ||
use Psr\Http\Message\StreamInterface; | ||
use Zend\Diactoros\Stream; | ||
|
||
class StreamTest extends StreamIntegrationTest | ||
{ | ||
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 createStream($data) | ||
{ | ||
if ($data instanceof StreamInterface) { | ||
return $data; | ||
} | ||
|
||
return new Stream($data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?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\UriIntegrationTest; | ||
use Zend\Diactoros\Uri; | ||
|
||
class UriTest extends UriIntegrationTest | ||
{ | ||
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 createUri($uri) | ||
{ | ||
return new Uri($uri); | ||
} | ||
} |