Skip to content

Instantly share code, notes, and snippets.

@igorw
Created August 16, 2012 12:41
Show Gist options
  • Save igorw/3369858 to your computer and use it in GitHub Desktop.
Save igorw/3369858 to your computer and use it in GitHub Desktop.
<?php
use Silex\WebTestCase;
class RestApiTest extends WebTestCase
{
public function createApplication()
{
...
}
public function testRestApiLikeABoss()
{
$client = $this->createClient();
$client->request('GET', '/');
$response = $client->getResponse();
$this->assertTrue($response->isOk());
$data = json_decode($response->getContent(), true);
$expectedUsers = [['id' => 1, 'name' => 'igorw']];
$this->assertSame($expectedUsers, $data['users']);
}
}
@cordoval
Copy link

what is the larger context of this ? :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment