Code Duplication    Length = 8-9 lines in 9 locations

src/AppBundle/Tests/Controller/BlogControllerTest.php 5 locations

@@ 39-47 (lines=9) @@
36
        $this->assertContains('1', $crawler->filter('.widget .tag-list a .badge')->eq(1)->text());
37
    }
38
39
    public function testShowArticle()
40
    {
41
        $client = static::createClient();
42
43
        $crawler = $client->request('GET', '/article/test_title');
44
45
        $this->assertEquals(200, $client->getResponse()->getStatusCode());
46
        $this->assertContains('Test title', $crawler->filter('h2 a')->text());
47
    }
48
49
    public function testSortAuthor()
50
    {
@@ 49-57 (lines=9) @@
46
        $this->assertContains('Test title', $crawler->filter('h2 a')->text());
47
    }
48
49
    public function testSortAuthor()
50
    {
51
        $client = static::createClient();
52
53
        $crawler = $client->request('GET', '/author/user_name');
54
55
        $this->assertEquals(200, $client->getResponse()->getStatusCode());
56
        $this->assertContains('Test title', $crawler->filter('h2 a')->text());
57
    }
58
59
    public function testSortCategory()
60
    {
@@ 59-67 (lines=9) @@
56
        $this->assertContains('Test title', $crawler->filter('h2 a')->text());
57
    }
58
59
    public function testSortCategory()
60
    {
61
        $client = static::createClient();
62
63
        $crawler = $client->request('GET', '/category/test_category');
64
65
        $this->assertEquals(200, $client->getResponse()->getStatusCode());
66
        $this->assertContains('Test title', $crawler->filter('h2 a')->text());
67
    }
68
69
    public function testSortTags()
70
    {
@@ 69-77 (lines=9) @@
66
        $this->assertContains('Test title', $crawler->filter('h2 a')->text());
67
    }
68
69
    public function testSortTags()
70
    {
71
        $client = static::createClient();
72
73
        $crawler = $client->request('GET', '/tag/news');
74
75
        $this->assertEquals(200, $client->getResponse()->getStatusCode());
76
        $this->assertContains('Test title', $crawler->filter('h2 a')->text());
77
    }
78
79
    public function testFormComment()
80
    {
@@ 105-113 (lines=9) @@
102
        $this->assertContains('Text comment', $crawler->filter('.media-body p')->text());
103
    }
104
105
    public function testSuccess()
106
    {
107
        $client = static::createClient();
108
109
        $crawler = $client->request('GET', '/success');
110
111
        $this->assertEquals(200, $client->getResponse()->getStatusCode());
112
        $this->assertContains('Your data successfully saved.', $crawler->filter('.alert')->text());
113
    }
114
}
115

src/AppBundle/Tests/Controller/DefaultControllerTest.php 1 location

@@ 9-17 (lines=9) @@
6
7
class DefaultControllerTest extends WebTestCase
8
{
9
    public function testIndex()
10
    {
11
        $client = static::createClient();
12
13
        $crawler = $client->request('GET', '/helloSymfony');
14
15
        $this->assertEquals(200, $client->getResponse()->getStatusCode());
16
        $this->assertContains('Welcome to Symfony', $crawler->filter('#container h1')->text());
17
    }
18
}
19

src/AppBundle/Tests/Controller/AdminControllerTest.php 3 locations

@@ 15-22 (lines=8) @@
12
13
class AdminControllerTest extends WebTestCase
14
{
15
    public function testIndex(){
16
        $client = static::createClient();
17
18
        $crawler = $client->request('GET', '/admin/');
19
20
        $this->assertEquals(200, $client->getResponse()->getStatusCode());
21
        $this->assertContains('Statistic', $crawler->filter('h2')->text());
22
    }
23
24
    public function testArticles(){
25
        $client = static::createClient();
@@ 54-62 (lines=9) @@
51
        $this->assertEquals(2, $crawler->filter('tr')->count());
52
    }
53
54
    public function testUsersDelete(){
55
        $client = static::createClient();
56
57
        $crawler = $client->request('GET', '/admin/user/delete/1');
58
59
        $this->assertEquals(200, $client->getResponse()->getStatusCode());
60
        $this->assertContains('You want to delete user "User name" (id: 1). Related records: articles (count: 1), comments (count: 1). You must to delete related records before.',
61
            $crawler->filter('.alert')->text());
62
    }
63
64
    public function testRoles(){
65
        $client = static::createClient();
@@ 74-82 (lines=9) @@
71
        $this->assertEquals(2, $crawler->filter('tr')->count());
72
    }
73
74
    public function testRolesDelete(){
75
        $client = static::createClient();
76
77
        $crawler = $client->request('GET', '/admin/role/delete/1');
78
79
        $this->assertEquals(200, $client->getResponse()->getStatusCode());
80
        $this->assertContains('You want to delete role "admin" (id: 1). Related records: users (count: 1). You must to delete related records before.',
81
            $crawler->filter('.alert')->text());
82
    }
83
}