Skip to content

Instantly share code, notes, and snippets.

@giorrrgio
Created June 3, 2015 07:38
Show Gist options
  • Save giorrrgio/00f3c3ac8c9debb43e51 to your computer and use it in GitHub Desktop.
Save giorrrgio/00f3c3ac8c9debb43e51 to your computer and use it in GitHub Desktop.
<?php
echo 'Foo!';
<?php
namespace Acme\Controller;
class FooControllerTest extends \PHPUnit_Framework_TestCase
{
public function testHook()
{
$_SERVER['HTTP_HOST'] = 'localhost';
$_SERVER['HTTP_USER_AGENT'] = 'Foobar Agent';
$_SERVER['REQUEST_URI'] = '/app.php';
$_SERVER['REQUEST_METHOD'] = 'GET';
require_once __DIR__ . '/../../web/app.php';
$this->expectOutputString('Foo!');
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit
backupGlobals = "false"
backupStaticAttributes = "false"
colors = "true"
convertErrorsToExceptions = "true"
convertNoticesToExceptions = "true"
convertWarningsToExceptions = "true"
processIsolation = "true"
stopOnFailure = "false"
syntaxCheck = "false"
bootstrap = "vendor/autoload.php" >
<testsuites>
<testsuite name="Acme Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment