-
Notifications
You must be signed in to change notification settings - Fork 3
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
8 changed files
with
85 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,26 @@ | ||
<?xml version="1.0"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="test/Horde/Http/Server/bootstrap.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> | ||
<coverage> | ||
<include> | ||
<directory suffix=".php">lib</directory> | ||
</include> | ||
</coverage> | ||
<testsuites> | ||
<testsuite name="horde/Http/Server"> | ||
<directory>test</directory> | ||
</testsuite> | ||
</testsuites> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd" | ||
bootstrap="test/bootstrap.php" | ||
cacheResultFile=".phpunit.cache/test-results" | ||
executionOrder="depends,defects" | ||
forceCoversAnnotation="false" | ||
beStrictAboutCoversAnnotation="true" | ||
beStrictAboutOutputDuringTests="true" | ||
beStrictAboutTodoAnnotatedTests="true" | ||
failOnRisky="true" | ||
failOnWarning="true" | ||
verbose="true"> | ||
<testsuites> | ||
<testsuite name="horde/http_server"> | ||
<directory>test</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<coverage cacheDirectory=".phpunit.cache/code-coverage" | ||
processUncoveredFiles="true"> | ||
<include> | ||
<directory suffix=".php">src</directory> | ||
</include> | ||
</coverage> | ||
</phpunit> |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,31 @@ | ||
<?php | ||
namespace Horde\Http\Server\Test; | ||
use \PHPUnit\Framework\TestCase; | ||
use Horde\Http\RequestFactory; | ||
use Horde\Http\ResponseFactory; | ||
use Horde\Http\StreamFactory; | ||
use Horde\Http\Server\RampageRequestHandler; | ||
use Psr\Http\Message\ResponseInterface; | ||
|
||
/** | ||
* @author Ralf Lang <[email protected]> | ||
* @license http://www.horde.org/licenses/bsd LGPL BSD-3-Clause | ||
* @category Horde | ||
* @package Http_Server | ||
* @subpackage UnitTests | ||
*/ | ||
class SimpleTest extends TestCase | ||
{ | ||
public function testRunnerSetup() | ||
{ | ||
// Production code would use Injector/DIC instead | ||
$responseFactory = new ResponseFactory; | ||
$streamFactory = new StreamFactory; | ||
$handler = new RampageRequestHandler($responseFactory, $streamFactory); | ||
$requestFactory = new RequestFactory(); | ||
$request = $requestFactory->createServerRequest('GET', 'https://www.horde.org'); | ||
$response = $handler->handle($request); | ||
$this->assertInstanceOf(ResponseInterface::class, $handler->handle($request)); | ||
} | ||
|
||
} |
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,12 @@ | ||
<?php | ||
$candidates = [ | ||
dirname(__FILE__, 2) . '/vendor/autoload.php', | ||
dirname(__FILE__, 4) . '/autoload.php', | ||
]; | ||
// Cover root case and library case | ||
foreach ($candidates as $candidate) { | ||
if (file_exists($candidate)) { | ||
require_once $candidate; | ||
} | ||
} | ||
\Horde_Test_Bootstrap::bootstrap(dirname(__FILE__)); |