Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit ae6e365

Browse files
committed
Simple test case
1 parent 66f15dc commit ae6e365

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

phpunit.xml.dist

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<phpunit backupGlobals="false"
4+
colors="true"
5+
bootstrap="vendor/autoload.php"
6+
>
7+
<testsuites>
8+
<testsuite name="unit">
9+
<directory>./tests/unit/</directory>
10+
</testsuite>
11+
</testsuites>
12+
13+
<testsuites>
14+
<testsuite name="integration">
15+
<directory>./tests/integration/</directory>
16+
</testsuite>
17+
</testsuites>
18+
19+
<testsuites>
20+
<testsuite name="functional">
21+
<directory>./tests/functional/</directory>
22+
</testsuite>
23+
</testsuites>
24+
25+
<filter>
26+
<whitelist>
27+
<directory>./src/</directory>
28+
</whitelist>
29+
</filter>
30+
</phpunit>

tests/functional/RunTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace functional;
4+
5+
use Stack;
6+
use Stack\CallableHttpKernel;
7+
use Symfony\Component\HttpFoundation\Request;
8+
use Symfony\Component\HttpFoundation\Response;
9+
use Symfony\Component\HttpKernel\HttpKernelInterface;
10+
11+
class RunTest extends \PHPUnit_Framework_TestCase
12+
{
13+
/** @test */
14+
public function runShouldRenderPage()
15+
{
16+
$this->expectOutputString('Hello World!');
17+
18+
$app = new CallableHttpKernel(function ($request) {
19+
return new Response('Hello World!');
20+
});
21+
22+
Stack\run($app);
23+
}
24+
}

0 commit comments

Comments
 (0)