Skip to content

Commit

Permalink
Integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
fenric committed Dec 19, 2018
1 parent aae56d5 commit f24a268
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 1 deletion.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
},
"require-dev": {
"phpunit/phpunit": "7.4.3",
"fig/http-message-util": "^1.1"
"fig/http-message-util": "^1.1",
"php-http/psr7-integration-tests": "dev-master"
},
"provide": {
"psr/http-message-implementation": "1.0"
Expand Down
7 changes: 7 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,11 @@
<directory>./tests/</directory>
</testsuite>
</testsuites>

<php>
<const name="REQUEST_FACTORY" value="Sunrise\Http\Message\RequestFactory"/>
<const name="RESPONSE_FACTORY" value="Sunrise\Http\Message\ResponseFactory"/>
<const name="STREAM_FACTORY" value="Sunrise\Stream\StreamFactory"/>
<const name="URI_FACTORY" value="Sunrise\Uri\UriFactory"/>
</php>
</phpunit>
21 changes: 21 additions & 0 deletions tests/MessageIntegrationTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Sunrise\Http\Message\Tests;

use Http\Psr7Test\BaseTest;
use Http\Psr7Test\MessageTrait;
use Sunrise\Http\Message\Message;

class MessageIntegrationTest extends BaseTest
{
use MessageTrait;

protected $skippedTests = [
'testWithoutHeader' => true,
];

protected function getMessage()
{
return new Message();
}
}
20 changes: 20 additions & 0 deletions tests/RequestIntegrationTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace Sunrise\Http\Message\Tests;

use Http\Psr7Test\RequestIntegrationTest as BaseRequestIntegrationTest;
use Sunrise\Http\Message\Request;

class RequestIntegrationTest extends BaseRequestIntegrationTest
{
protected $skippedTests = [
'testWithoutHeader' => true,
'testMethod' => true,
'testUri' => true,
];

public function createSubject()
{
return new Request();
}
}
18 changes: 18 additions & 0 deletions tests/ResponseIntegrationTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace Sunrise\Http\Message\Tests;

use Http\Psr7Test\ResponseIntegrationTest as BaseResponseIntegrationTest;
use Sunrise\Http\Message\Response;

class ResponseIntegrationTest extends BaseResponseIntegrationTest
{
protected $skippedTests = [
'testWithoutHeader' => true,
];

public function createSubject()
{
return new Response();
}
}

0 comments on commit f24a268

Please sign in to comment.