Code Duplication    Length = 15-20 lines in 2 locations

tests/AppBundle/Controller/Api/SurveyControllerTest.php 1 location

@@ 61-80 (lines=20) @@
58
        $this->assertTrue($client->getResponse()->isSuccessful(), 'response status is 2xx');
59
    }
60
61
    public function testApiSurveyUpdate()
62
    {
63
        $client = static::createClient();
64
65
        $client->request('PUT', '/api/surveys/1');
66
67
        $this->assertEquals(401, $client->getResponse()->getStatusCode());
68
69
        $client->request(
70
            'PUT',
71
            '/api/surveys/2',
72
            array(),
73
            array(),
74
            array('CONTENT_TYPE' => 'application/json',
75
                  'HTTP_X-AUTH-TOKEN' => '2', ),
76
            $content = '{"1":"yes","2":"yes","3":"yes","4":"5","5":"7"}'
77
        );
78
79
        $this->assertEquals(200, $client->getResponse()->getStatusCode());
80
    }
81
}
82

tests/AppBundle/Controller/SurveyControllerTest.php 1 location

@@ 21-35 (lines=15) @@
18
        $this->assertEquals(200, $client->getResponse()->getStatusCode());
19
    }
20
21
    public function testSurvey()
22
    {
23
        $client = static::createClient();
24
25
        $crawler = $client->request('GET', '/surveys/1', array(), array(), array(
26
            'PHP_AUTH_USER' => '[email protected]',
27
            'PHP_AUTH_PW' => 'admin',
28
        ));
29
30
        $this->assertEquals(200, $client->getResponse()->getStatusCode());
31
32
        $this->assertEquals(1, $crawler
33
            ->filter('h3:contains("Internship survey")')
34
            ->count());
35
    }
36
37
    public function testSurveyCreate()
38
    {