mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-16 10:22:14 +01:00
Merge pull request #6226 from wallabag/fix/tags
Add prefix for tag slugs
This commit is contained in:
commit
f2226e8c68
@ -45,7 +45,7 @@ class Tag
|
||||
|
||||
/**
|
||||
* @Expose
|
||||
* @Gedmo\Slug(fields={"label"})
|
||||
* @Gedmo\Slug(fields={"label"}, prefix="t:")
|
||||
* @ORM\Column(length=128, unique=true)
|
||||
*/
|
||||
private $slug;
|
||||
|
@ -124,7 +124,7 @@ class ExportControllerTest extends WallabagCoreTestCase
|
||||
$this->assertSame('binary', $headers->get('content-transfer-encoding'));
|
||||
|
||||
ob_start();
|
||||
$crawler = $client->request('GET', '/export/tag_entries.pdf?tag=foo-bar');
|
||||
$crawler = $client->request('GET', '/export/tag_entries.pdf?tag=t:foo-bar');
|
||||
ob_end_clean();
|
||||
|
||||
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
||||
|
@ -250,29 +250,29 @@ class FeedControllerTest extends WallabagCoreTestCase
|
||||
$client = $this->getTestClient();
|
||||
|
||||
// tag foo - without sort
|
||||
$crawler = $client->request('GET', '/feed/admin/SUPERTOKEN/tags/foo');
|
||||
$crawler = $client->request('GET', '/feed/admin/SUPERTOKEN/tags/t:foo');
|
||||
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
||||
$this->assertSame('test title entry4', $crawler->filterXPath('//feed/entry[1]/title')->text());
|
||||
$this->assertSame('test title entry1', $crawler->filterXPath('//feed/entry[2]/title')->text());
|
||||
|
||||
// tag foo - with sort created
|
||||
$crawler = $client->request('GET', '/feed/admin/SUPERTOKEN/tags/foo?sort=created');
|
||||
$crawler = $client->request('GET', '/feed/admin/SUPERTOKEN/tags/t:foo?sort=created');
|
||||
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
||||
$this->assertSame('test title entry4', $crawler->filterXPath('//feed/entry[1]/title')->text());
|
||||
$this->assertSame('test title entry1', $crawler->filterXPath('//feed/entry[2]/title')->text());
|
||||
|
||||
// tag foo - with sort updated
|
||||
$crawler = $client->request('GET', '/feed/admin/SUPERTOKEN/tags/foo?sort=updated');
|
||||
$crawler = $client->request('GET', '/feed/admin/SUPERTOKEN/tags/t:foo?sort=updated');
|
||||
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
||||
$this->assertSame('test title entry1', $crawler->filterXPath('//feed/entry[1]/title')->text());
|
||||
$this->assertSame('test title entry4', $crawler->filterXPath('//feed/entry[2]/title')->text());
|
||||
|
||||
// tag foo - with invalid sort
|
||||
$client->request('GET', '/feed/admin/SUPERTOKEN/tags/foo?sort=invalid');
|
||||
$client->request('GET', '/feed/admin/SUPERTOKEN/tags/t:foo?sort=invalid');
|
||||
$this->assertSame(400, $client->getResponse()->getStatusCode());
|
||||
|
||||
// tag foo/3000
|
||||
$client->request('GET', '/feed/admin/SUPERTOKEN/tags/foo/3000');
|
||||
$client->request('GET', '/feed/admin/SUPERTOKEN/tags/t:foo/3000');
|
||||
$this->assertSame(302, $client->getResponse()->getStatusCode());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user