Code Duplication    Length = 10-14 lines in 2 locations

tests/Functional/Controller/HistoryControllerTest.php 1 location

@@ 5-18 (lines=14) @@
2
3
namespace App\Tests\Functional\Controller;
4
5
class HistoryControllerTest extends AbstractController
6
{
7
    public function testGetHistories()
8
    {
9
        $this->restRequest('/api/histories');
10
    }
11
12
    public function testGetHistoriesSlug()
13
    {
14
        $slug = $this->getEm()->getRepository('App:History')->findOneBy([])->getSlug();
15
        $this->restRequest('/api/histories/'.$slug);
16
        $this->restRequest('/api/histories/nonexistent-slug', 'GET', 404);
17
    }
18
}
19

tests/Functional/Controller/TagsControllerTest.php 1 location

@@ 7-16 (lines=10) @@
4
5
use App\Entity\Tag;
6
7
class TagsControllerTest extends AbstractController
8
{
9
    public function testGetTagSlug()
10
    {
11
        $slug = $this->getEm()->getRepository(Tag::class)->findOneBy([])->getSlug();
12
13
        $this->restRequest('/api/tags/'.$slug.'/posts');
14
        $this->restRequest('/api/tags/nonexistent-tag/posts', 'GET', 404);
15
    }
16
}
17