mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
add relation between entry and tag
This commit is contained in:
parent
6d37a7e6c1
commit
0a018fe039
6 changed files with 53 additions and 122 deletions
|
@ -150,33 +150,4 @@ class WallabagRestControllerTest extends WallabagTestCase
|
|||
|
||||
$this->assertEquals(404, $client->getResponse()->getStatusCode());
|
||||
}
|
||||
|
||||
public function testGetOneTag()
|
||||
{
|
||||
$client = $this->createClient();
|
||||
$client->request('GET', '/api/salts/admin.json');
|
||||
$salt = json_decode($client->getResponse()->getContent());
|
||||
|
||||
$headers = $this->generateHeaders('admin', 'test', $salt[0]);
|
||||
|
||||
$tag = $client->getContainer()
|
||||
->get('doctrine.orm.entity_manager')
|
||||
->getRepository('WallabagCoreBundle:Tag')
|
||||
->findOneByLabel('foo');
|
||||
|
||||
if (!$tag) {
|
||||
$this->markTestSkipped('No content found in db.');
|
||||
}
|
||||
|
||||
$client->request('GET', '/api/tags/'.$tag->getLabel().'.json', array(), array(), $headers);
|
||||
|
||||
$this->assertEquals(json_encode($tag), $client->getResponse()->getContent());
|
||||
|
||||
$this->assertTrue(
|
||||
$client->getResponse()->headers->contains(
|
||||
'Content-Type',
|
||||
'application/json'
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue