The Slim Framework support forum has moved to http://discourse.slimframework.com. This Tender forum is no longer maintained or monitored.

How to easily write functional tests for Slim 3.0 RC3

Jnardiello's Avatar

Jnardiello

30 Nov, 2015 02:42 PM

Hello Everyone,
we have decided to adopt Slim as our framework of choice to use for a set of internal APIs. As I'm looking into it I'm wondering how I can start writing acceptance/functional tests for my routes. Ideally, I would rather not get into implementation details about the framework and would want to do something like
```php $client = new Client(new App()); $res = $client->get($req);

$this->assertEquals(...);


I've been extensively diving in both docs and code and the closest thing I could find was here:
https://github.com/slimphp/Slim/blob/3.x/tests/AppTest.php#L761


Is there an easier way? How do you guys write your functional tests? Any suggestion will be really appreciated :) Thanks
  1. 1 Posted by Jnardiello on 30 Nov, 2015 02:44 PM

    Jnardiello's Avatar

    Apparently the formatting got completely messed up (and I can't edit it). Sorry about that :)

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac