1
0
mirror of https://github.com/moparisthebest/wallabag synced 2024-08-13 16:54:00 -04:00

[add] tests for un/star entries

This commit is contained in:
Nicolas Lœuillet 2014-01-13 21:46:27 +01:00
parent 5f1b9885b4
commit f1582245fb

View File

@ -136,6 +136,65 @@ class ApiTest extends PocheWebTestCase
}
public function testStar()
{
//Load some entries
Fixtures::loadEntries($this->app['db']);
$client = $this->createClient();
$crawler = $client->request(
'GET',
'/api/star',
array(),
array(),
array('CONTENT_TYPE' => 'application/json'),
'{"id":"1"}'
);
$this->assertEquals($client->getResponse()->getStatusCode(), 201);
// Assert that the "Content-Type" header is "application/json"
$this->assertTrue(
$client->getResponse()->headers->contains(
'Content-Type',
'application/json'
)
);
$this->assertEquals('1', $client->getResponse()->getContent());
}
public function testUnstar()
{
//Load some entries
Fixtures::loadEntries($this->app['db']);
$client = $this->createClient();
$crawler = $client->request(
'GET',
'/api/unstar',
array(),
array(),
array('CONTENT_TYPE' => 'application/json'),
'{"id":"1"}'
);
$this->assertEquals($client->getResponse()->getStatusCode(), 201);
// Assert that the "Content-Type" header is "application/json"
$this->assertTrue(
$client->getResponse()->headers->contains(
'Content-Type',
'application/json'
)
);
$this->assertEquals('1', $client->getResponse()->getContent());
}
public function testPostEntries()
{