Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Kazushige Tominaga committed Dec 19, 2015
1 parent 524b2e0 commit 33a7be3
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
<?php

//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());
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());
}
}
```


Expand Down

0 comments on commit 33a7be3

Please sign in to comment.