there4/slim-test-helpers — pull request #1 by cw-tanaka (2014-09-24 06:54:54+00:00)
Title: Support GET request

It seems that `WebTestClient` doesn't support GET request, so I changed it.

versions:

- php: PHP 5.4.30
- there4/slim-test-helpers: master
- [codeguy/Slim](https://github.com/codeguy/Slim): 2.4.3

I create this test case:

```php
false,
));

// GET /messages
$app->get('/messages', function() use ($app) {
$request = $app->request();
$user_id = $request->get('user_id');

echo 'user_id:' . $user_id;
});

// POST /messages
$app->post('/messages', function() use ($app) {
$request = $app->request();
$message = $request->post('message');

echo 'message:' . $message;
});

return $app;
}

/**
* @test
*/
public function testPost()
{
$this->client->post('/messages', [
'message' => 'hogehoge',
]);
$this->assertSame('message:hogehoge', $this->client->response->getBody());
}

/**
* @test
*/
public function testGet()
{
$this->client->get('/messages', [
'user_id' => 1234,
]);
$this->assertSame('user_id:1234', $this->client->response->getBody());
}
}
```

And execute this test with phpunit.

#### Test Result

Before:
```
.F

Time: 79 ms, Memory: 6.75Mb

There was 1 failure:

1) SampleTest::testGet
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-user_id:1234
+user_id:
```

After:
```
..

Time: 75 ms, Memory: 6.75Mb

OK (2 tests, 2 assertions)
```