$this->assertSame(2, $content['limit']);
}
+ public function testGetStarredEntriesWithBadSort()
+ {
+ $this->client->request('GET', '/api/entries', ['starred' => 1, 'sort' => 'updated', 'order' => 'unknown']);
+
+ $this->assertSame(400, $this->client->getResponse()->getStatusCode());
+
+ $this->assertSame('application/json', $this->client->getResponse()->headers->get('Content-Type'));
+ }
+
public function testGetStarredEntries()
{
$this->client->request('GET', '/api/entries', ['starred' => 1, 'sort' => 'updated']);
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertArrayHasKey('tags', $content);
- $this->assertSame($nbTags + 3, \count($content['tags']));
+ $this->assertCount($nbTags + 3, $content['tags']);
$entryDB = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertArrayHasKey('tags', $content);
- $this->assertSame($nbTags - 1, \count($content['tags']));
+ $this->assertCount($nbTags - 1, $content['tags']);
}
public function testSaveIsArchivedAfterPost()
$content = json_decode($this->client->getResponse()->getContent(), true);
- $this->assertSame(true, $content['exists']);
+ $this->assertTrue($content['exists']);
}
public function testGetEntriesExistsWithManyUrls()