This repository was archived by the owner on Jan 29, 2020. It is now read-only.
File tree 9 files changed +194
-2
lines changed
9 files changed +194
-2
lines changed Original file line number Diff line number Diff line change 9
9
env :
10
10
global :
11
11
- COMPOSER_ARGS="--no-interaction"
12
- - COVERAGE_DEPS="php-coveralls/php-coveralls "
12
+ - DEPENDENCIES=" "
13
13
- LEGACY_DEPS="phpunit/phpunit"
14
14
15
15
matrix :
@@ -31,6 +31,7 @@ matrix:
31
31
- DEPS=locked
32
32
- CHECK_CS=true
33
33
- TEST_COVERAGE=true
34
+ - DEPENDENCIES="php-coveralls/php-coveralls"
34
35
- php : 7
35
36
env :
36
37
- DEPS=latest
@@ -52,6 +53,11 @@ matrix:
52
53
- php : 7.2
53
54
env :
54
55
- DEPS=latest
56
+ - php : 7.2
57
+ name : Integration tests
58
+ env :
59
+ - DEPENDENCIES="http-interop/http-factory-diactoros"
60
+
55
61
56
62
before_install :
57
63
- if [[ $TEST_COVERAGE != 'true' && "$(php --version | grep xdebug -ci)" -ge 1 ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
@@ -62,7 +68,7 @@ install:
62
68
- if [[ $TRAVIS_PHP_VERSION =~ ^5.6 ]]; then travis_retry composer update $COMPOSER_ARGS --with-dependencies $LEGACY_DEPS ; fi
63
69
- if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi
64
70
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
65
- - if [[ $TEST_COVERAGE == 'true' ]] ; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi
71
+ - if ! [ -v "$DEPENDENCIES" ] ; then travis_retry composer require --dev $COMPOSER_ARGS $DEPENDENCIES ; fi
66
72
- stty cols 120 && composer show
67
73
68
74
script :
Original file line number Diff line number Diff line change 30
30
"require-dev" : {
31
31
"ext-dom" : " *" ,
32
32
"ext-libxml" : " *" ,
33
+ "php-http/psr7-integration-tests" : " dev-master" ,
33
34
"phpunit/phpunit" : " ^5.7.16 || ^6.0.8 || ^7.2.7" ,
34
35
"zendframework/zend-coding-standard" : " ~1.0"
35
36
},
Original file line number Diff line number Diff line change 10
10
<directory suffix =" .php" >src</directory >
11
11
</whitelist >
12
12
</filter >
13
+
14
+ <php >
15
+ <const name =" REQUEST_FACTORY" value =" Http\Factory\Diactoros\RequestFactory" />
16
+ <const name =" RESPONSE_FACTORY" value =" Http\Factory\Diactoros\ResponseFactory" />
17
+ <const name =" SERVER_REQUEST_FACTORY" value =" Http\Factory\Diactoros\ServerRequestFactory" />
18
+ <const name =" STREAM_FACTORY" value =" Http\Factory\Diactoros\StreamFactory" />
19
+ <const name =" UPLOADED_FILE_FACTORY" value =" Http\Factory\Diactoros\UploadedFileFactory" />
20
+ <const name =" URI_FACTORY" value =" Http\Factory\Diactoros\UriFactory" />
21
+ </php >
13
22
</phpunit >
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * @see https://github.com/zendframework/zend-diactoros for the canonical source repository
4
+ * @copyright Copyright (c) 2015-2017 Zend Technologies USA Inc. (http://www.zend.com)
5
+ * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License
6
+ */
7
+
8
+ namespace ZendTest \Diactoros \Integration ;
9
+
10
+ use Http \Factory \Diactoros \RequestFactory ;
11
+ use Http \Psr7Test \RequestIntegrationTest ;
12
+ use Zend \Diactoros \Request ;
13
+
14
+ class RequestTest extends RequestIntegrationTest
15
+ {
16
+ public static function setUpBeforeClass ()
17
+ {
18
+ if (!class_exists (RequestFactory::class)) {
19
+ self ::markTestSkipped ('You need to install http-interop/http-factory-diactoros to run integration tests ' );
20
+ }
21
+ parent ::setUpBeforeClass ();
22
+ }
23
+
24
+ public function createSubject ()
25
+ {
26
+ return new Request ('/ ' , 'GET ' );
27
+ }
28
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * @see https://github.com/zendframework/zend-diactoros for the canonical source repository
4
+ * @copyright Copyright (c) 2015-2017 Zend Technologies USA Inc. (http://www.zend.com)
5
+ * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License
6
+ */
7
+
8
+ namespace ZendTest \Diactoros \Integration ;
9
+
10
+ use Http \Factory \Diactoros \RequestFactory ;
11
+ use Http \Psr7Test \ResponseIntegrationTest ;
12
+ use Zend \Diactoros \Response ;
13
+
14
+ class ResponseTest extends ResponseIntegrationTest
15
+ {
16
+ public static function setUpBeforeClass ()
17
+ {
18
+ if (!class_exists (RequestFactory::class)) {
19
+ self ::markTestSkipped ('You need to install http-interop/http-factory-diactoros to run integration tests ' );
20
+ }
21
+ parent ::setUpBeforeClass ();
22
+ }
23
+
24
+ public function createSubject ()
25
+ {
26
+ return new Response ();
27
+ }
28
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * @see https://github.com/zendframework/zend-diactoros for the canonical source repository
4
+ * @copyright Copyright (c) 2015-2017 Zend Technologies USA Inc. (http://www.zend.com)
5
+ * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License
6
+ */
7
+
8
+ namespace ZendTest \Diactoros \Integration ;
9
+
10
+ use Http \Factory \Diactoros \RequestFactory ;
11
+ use Http \Psr7Test \ServerRequestIntegrationTest ;
12
+ use Zend \Diactoros \ServerRequest ;
13
+
14
+ class ServerRequestTest extends ServerRequestIntegrationTest
15
+ {
16
+ public static function setUpBeforeClass ()
17
+ {
18
+ if (!class_exists (RequestFactory::class)) {
19
+ self ::markTestSkipped ('You need to install http-interop/http-factory-diactoros to run integration tests ' );
20
+ }
21
+ parent ::setUpBeforeClass ();
22
+ }
23
+
24
+ public function createSubject ()
25
+ {
26
+ return new ServerRequest ($ _SERVER );
27
+ }
28
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * @see https://github.com/zendframework/zend-diactoros for the canonical source repository
4
+ * @copyright Copyright (c) 2015-2017 Zend Technologies USA Inc. (http://www.zend.com)
5
+ * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License
6
+ */
7
+
8
+ namespace ZendTest \Diactoros \Integration ;
9
+
10
+ use Http \Factory \Diactoros \RequestFactory ;
11
+ use Http \Psr7Test \StreamIntegrationTest ;
12
+ use Zend \Diactoros \Stream ;
13
+
14
+ class StreamTest extends StreamIntegrationTest
15
+ {
16
+ public static function setUpBeforeClass ()
17
+ {
18
+ if (!class_exists (RequestFactory::class)) {
19
+ self ::markTestSkipped ('You need to install http-interop/http-factory-diactoros to run integration tests ' );
20
+ }
21
+ parent ::setUpBeforeClass ();
22
+ }
23
+
24
+ public function createStream ($ data )
25
+ {
26
+ if ($ data instanceof StreamInterface) {
27
+ return $ data ;
28
+ }
29
+
30
+ return new Stream ($ data );
31
+ }
32
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * @see https://github.com/zendframework/zend-diactoros for the canonical source repository
4
+ * @copyright Copyright (c) 2015-2017 Zend Technologies USA Inc. (http://www.zend.com)
5
+ * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License
6
+ */
7
+
8
+ namespace ZendTest \Diactoros \Integration ;
9
+
10
+ use Http \Factory \Diactoros \RequestFactory ;
11
+ use Http \Psr7Test \UploadedFileIntegrationTest ;
12
+ use Zend \Diactoros \Stream ;
13
+ use Zend \Diactoros \UploadedFile ;
14
+
15
+ class UploadedFileTest extends UploadedFileIntegrationTest
16
+ {
17
+ public static function setUpBeforeClass ()
18
+ {
19
+ if (!class_exists (RequestFactory::class)) {
20
+ self ::markTestSkipped ('You need to install http-interop/http-factory-diactoros to run integration tests ' );
21
+ }
22
+ parent ::setUpBeforeClass ();
23
+ }
24
+
25
+ public function createSubject ()
26
+ {
27
+ $ stream = new Stream ('php://memory ' , 'rw ' );
28
+ $ stream ->write ('foobar ' );
29
+
30
+ return new UploadedFile ($ stream , $ stream ->getSize (), UPLOAD_ERR_OK );
31
+ }
32
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * @see https://github.com/zendframework/zend-diactoros for the canonical source repository
4
+ * @copyright Copyright (c) 2015-2017 Zend Technologies USA Inc. (http://www.zend.com)
5
+ * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License
6
+ */
7
+
8
+ namespace ZendTest \Diactoros \Integration ;
9
+
10
+ use Http \Factory \Diactoros \RequestFactory ;
11
+ use Http \Psr7Test \UriIntegrationTest ;
12
+ use Zend \Diactoros \Uri ;
13
+
14
+ class UriTest extends UriIntegrationTest
15
+ {
16
+ public static function setUpBeforeClass ()
17
+ {
18
+ if (!class_exists (RequestFactory::class)) {
19
+ self ::markTestSkipped ('You need to install http-interop/http-factory-diactoros to run integration tests ' );
20
+ }
21
+ parent ::setUpBeforeClass ();
22
+ }
23
+
24
+ public function createUri ($ uri )
25
+ {
26
+ return new Uri ($ uri );
27
+ }
28
+ }
You can’t perform that action at this time.
0 commit comments