kohana/unittest — pull request #41 by arteymix (2014-11-25 18:22:03+00:00)
Title: Provide basic integration testing with Request and Response objects.

This is a proposal for a skeleton `TestCase` that would be used to do integration testing with Kohana application.

I managed to test my application by self-requesting using internal `Request` just like the following:
```php
$response = Request::factory('some/internal/endpoint')
->method(Request::POST)
->post('key', 'value')
->execute();

$this->assertEquals(200, $response->status(), $response->body());
```

But this gets a little messy and a lot of work has to be duplicated (especially for other status codes).

What I propose is a simple `TestCase_Integration` that would provide primitives for testing `Response` objects, making building and testing quality application simpler.
```php
$this->assertOk($response);
$this->assertPermanentRedirect('http://some/location', $response);
```

I would like to have your insights on the matter!