Skip to content

Commit 3d3b818

Browse files
committed
added example functional tests.
1 parent 8b7504f commit 3d3b818

4 files changed

Lines changed: 55 additions & 0 deletions

File tree

app/tests/ExampleTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
class ExampleTest extends TestCase {
4+
5+
/**
6+
* A basic functional test example.
7+
*
8+
* @return void
9+
*/
10+
public function testBasicExample()
11+
{
12+
$client = $this->createClient();
13+
14+
$crawler = $client->request('GET', '/');
15+
16+
$this->assertCount(1, $crawler->filter('h1:contains("Hello World!")'));
17+
}
18+
19+
}

app/tests/TestCase.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
class TestCase extends Silex\WebTestCase {
4+
5+
/**
6+
* Creates the application.
7+
*
8+
* @return Symfony\Component\HttpKernel\HttpKernel
9+
*/
10+
public function createApplication()
11+
{
12+
return require __DIR__.'/../../shine.php';
13+
}
14+
15+
}

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"require": {
33
"illuminate/foundation": ">=1.0.0"
4+
},
5+
"autoload": {
6+
"classmap": ["app/tests/TestCase.php"]
47
}
58
}

phpunit.xml.dist

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit backupGlobals="false"
3+
backupStaticAttributes="false"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
convertErrorsToExceptions="true"
7+
convertNoticesToExceptions="true"
8+
convertWarningsToExceptions="true"
9+
processIsolation="false"
10+
stopOnFailure="false"
11+
syntaxCheck="false"
12+
>
13+
<testsuites>
14+
<testsuite name="Application Test Suite">
15+
<directory>./app/tests/</directory>
16+
</testsuite>
17+
</testsuites>
18+
</phpunit>

0 commit comments

Comments
 (0)