diff --git a/README.md b/README.md index 9f14a2b..3a7c033 100644 --- a/README.md +++ b/README.md @@ -12,23 +12,30 @@ You can set session or include paths used in your target product. If you call `request` method like http request, you can get a parsed response instance of `Guzzle\Http\Message\Response` ```php -use Test/FunctionalTester; - -$tester = new FunctionalTester(); - -//set session used in your target product. -$tester->setSession(['id' => 'hogehoge']); +addIncludePath(':/path/to/src'); - -//if you can get response like http request if you call get or post method -$response = $tester->get('index.php', ['username' => 'hogehoge']); - -//you can assert request results like this -$this->assertEquals(200, $response->getStatusCode()); -$this->assertEquals('OK', $response->getBody()); +use Test/FunctionalTester; +class IndexTest extends PHPUnit_Framework_TestCase +{ + public function testIndex + { + $tester = new FunctionalTester(); + + //set session used in your target product. + $tester->setSession(['id' => 'hogehoge']); + + //add includePath used in your target product. + $tester->addIncludePath(':/path/to/src'); + + //if you can get response like http request if you call get or post method + $response = $tester->get('index.php', ['username' => 'hogehoge']); + + //you can assert request results like this. + $this->assertEquals(200, $response->getStatusCode()); + $this->assertEquals('OK', $response->getBody()); + } +} ```