Failed Conditions
Push — master ( b9670c...4ba57f )
by Zac
16:20 queued 37s
created

TestApiControllerTest   A

Complexity

Total Complexity 19

Size/Duplication

Total Lines 259
Duplicated Lines 48.65 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 19
c 1
b 0
f 0
lcom 1
cbo 5
dl 126
loc 259
rs 10

19 Methods

Rating   Name   Duplication   Size   Complexity  
B testCreateTest() 0 34 1
A testCreateTestInsufficentPerms() 7 7 1
B testCreateTestInvalidExpectation() 0 28 1
B testCreateTestInvalidActual() 0 25 1
A testGetTestsInGroup() 0 16 1
A testGetTestsInGroupInsufficentPerms() 7 7 1
A testGetTestsInGroupInvalidGroup() 7 7 1
A testGetTest() 13 13 1
A testGetTestInsufficentPerms() 7 7 1
A testGetTestInvalidTest() 7 7 1
A testUpdateTest() 23 23 1
A testUpdateTestInsufficentPerms() 7 7 1
A testUpdateTestInvalidTest() 7 7 1
A testDeleteTest() 0 9 1
A testDeleteTestInsufficentPerms() 7 7 1
A testDeleteTestInvalidTest() 7 7 1
A testRunTest() 13 13 1
A testRunTestInsufficentPerms() 7 7 1
A testRunTestInvalidTest() 7 7 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace Overwatch\TestBundle\Tests\Controller;
4
5
use Overwatch\TestBundle\DataFixtures\ORM\TestFixtures;
6
use Overwatch\TestBundle\DataFixtures\ORM\TestGroupFixtures;
7
use Overwatch\TestBundle\Entity\Test;
8
use Overwatch\UserBundle\Tests\Base\DatabaseAwareTestCase;
9
use Symfony\Component\HttpFoundation\Response;
10
11
/**
12
 * TestApiControllerTest
13
 * Functional test of API methods provided by the APIController
14
 */
15
class TestApiControllerTest extends DatabaseAwareTestCase
16
{
17
    public function testCreateTest()
18
    {
19
        $newTest = new Test;
20
        $newTest
21
            ->setName('Ping 1234')
22
            ->setActual('1.2.3.4')
23
            ->setExpectation('toPing')
24
        ;
25
        
26
        $this->logIn('ROLE_SUPER_ADMIN');
27
        $this->makeJsonRequest(
28
            'POST',
29
            '/api/tests/group/' . TestGroupFixtures::$groups['group-2']->getId(),
30
            [
31
                'name'        => $newTest->getName(),
32
                'actual'      => $newTest->getActual(),
33
                'expectation' => $newTest->getExpectation()
34
            ]
35
        );
36
        
37
        $test = $this->em->getRepository("Overwatch\TestBundle\Entity\Test")->findOneBy([
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Overwatch\TestBundle\Entity\Test does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
38
            'name' => $newTest->getName()
39
        ]);
40
       
41
        $this->assertNotNull($test);
42
        $this->assertEquals($newTest->getActual(), $test->getActual());
43
        $this->assertEquals($newTest->getExpectation(), $test->getExpectation());
44
        
45
        $this->assertJsonResponse($this->client->getResponse());
46
        $this->assertJsonStringEqualsJsonString(
47
            json_encode($test),
48
            $this->getResponseContent(true)
49
        );
50
    }
51
    
52 View Code Duplication
    public function testCreateTestInsufficentPerms()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
53
    {
54
        $this->logIn('ROLE_USER');
55
        $this->client->request('POST', '/api/tests/group/' . TestGroupFixtures::$groups['group-1']->getId());
56
        
57
        $this->assertForbidden($this->client->getResponse());
58
    }
59
    
60
    public function testCreateTestInvalidExpectation()
61
    {
62
        $newTest = new Test;
63
        $newTest
64
            ->setName('Ping 1234')
65
            ->setActual('1.2.3.4')
66
            ->setExpectation('IfThisExpectationExistsIBrokeIt')
67
        ;
68
        
69
        $this->logIn('ROLE_SUPER_ADMIN');
70
        $this->makeJsonRequest(
71
            'POST',
72
            '/api/tests/group/' . TestGroupFixtures::$groups['group-2']->getId(),
73
            [
74
                'name'        => $newTest->getName(),
75
                'actual'      => $newTest->getActual(),
76
                'expectation' => $newTest->getExpectation()
77
            ]
78
        );
79
        
80
        $this->assertEquals(Response::HTTP_UNPROCESSABLE_ENTITY, $this->client->getResponse()->getStatusCode());
81
        $this->assertContains($newTest->getExpectation(), $this->getResponseContent(true));
82
        $this->assertContains('could not be found', $this->getResponseContent(true));
83
        
84
        $this->assertNull($this->em->getRepository("Overwatch\TestBundle\Entity\Test")->findOneBy([
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Overwatch\TestBundle\Entity\Test does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
85
            'name' => $newTest->getName()
86
        ]));
87
    }
88
    
89
    public function testCreateTestInvalidActual()
90
    {
91
        $newTest = new Test;
92
        $newTest
93
            ->setName('Ping 1234')
94
            ->setExpectation('toPing')
95
        ;
96
        
97
        $this->logIn('ROLE_SUPER_ADMIN');
98
        $this->makeJsonRequest(
99
            'POST',
100
            '/api/tests/group/' . TestGroupFixtures::$groups['group-2']->getId(),
101
            [
102
                'name'        => $newTest->getName(),
103
                'expectation' => $newTest->getExpectation()
104
            ]
105
        );
106
        
107
        $this->assertEquals(Response::HTTP_UNPROCESSABLE_ENTITY, $this->client->getResponse()->getStatusCode());
108
        $this->assertContains('An actual value to test against must be provided.', $this->getResponseContent(true));
109
        
110
        $this->assertNull($this->em->getRepository("Overwatch\TestBundle\Entity\Test")->findOneBy([
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Overwatch\TestBundle\Entity\Test does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
111
            'name' => $newTest->getName()
112
        ]));
113
    }
114
    
115
    public function testGetTestsInGroup()
116
    {
117
        $this->logIn('ROLE_SUPER_ADMIN');
118
        $this->client->request('GET', '/api/tests/group/' . TestGroupFixtures::$groups['group-1']->getId());
119
        
120
        $this->assertJsonResponse($this->client->getResponse());
121
        $this->assertCount(2, $this->getResponseContent());
122
        $this->assertCollectionContainsObject(
123
            $this->em->find("Overwatch\TestBundle\Entity\Test", TestFixtures::$tests['test-1']->getId()),
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Overwatch\TestBundle\Entity\Test does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
124
            $this->getResponseContent()
125
        );
126
        $this->assertCollectionContainsObject(
127
            $this->em->find("Overwatch\TestBundle\Entity\Test", TestFixtures::$tests['test-2']->getId()),
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Overwatch\TestBundle\Entity\Test does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
128
            $this->getResponseContent()
129
        );
130
    }
131
    
132 View Code Duplication
    public function testGetTestsInGroupInsufficentPerms()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
133
    {
134
        $this->logIn('ROLE_ADMIN');
135
        $this->client->request('GET', '/api/tests/group/' . TestGroupFixtures::$groups['group-1']->getId());
136
        
137
        $this->assertForbidden($this->client->getResponse());
138
    }
139
    
140 View Code Duplication
    public function testGetTestsInGroupInvalidGroup()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
141
    {
142
        $this->logIn('ROLE_SUPER_ADMIN');
143
        $this->client->request('GET', '/api/tests/group/1000');
144
        
145
        $this->assertEquals(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode());
146
    }
147
    
148 View Code Duplication
    public function testGetTest()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
149
    {
150
        $this->logIn('ROLE_SUPER_ADMIN');
151
        $this->client->request('GET', '/api/tests/' . TestFixtures::$tests['test-1']->getId());
152
        
153
        $this->assertJsonResponse($this->client->getResponse());
154
        $this->assertJsonStringEqualsJsonString(
155
            json_encode(
156
                $this->em->find("Overwatch\TestBundle\Entity\Test", TestFixtures::$tests['test-1']->getId())
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Overwatch\TestBundle\Entity\Test does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
157
            ),
158
            $this->getResponseContent(true)
159
        );
160
    }
161
    
162 View Code Duplication
    public function testGetTestInsufficentPerms()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
163
    {
164
        $this->logIn('ROLE_ADMIN');
165
        $this->client->request('GET', '/api/tests/' . TestFixtures::$tests['test-1']->getId());
166
        
167
        $this->assertForbidden($this->client->getResponse());
168
    }
169
    
170 View Code Duplication
    public function testGetTestInvalidTest()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
171
    {
172
        $this->logIn('ROLE_SUPER_ADMIN');
173
        $this->client->request('GET', '/api/tests/1000');
174
        
175
        $this->assertEquals(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode());
176
    }
177
    
178 View Code Duplication
    public function testUpdateTest()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
179
    {
180
        $newName = 'Renamed Test';
181
        
182
        $this->logIn('ROLE_SUPER_ADMIN');
183
        $this->makeJsonRequest(
184
            'PUT',
185
            '/api/tests/' . TestFixtures::$tests['test-1']->getId(),
186
            [
187
                'name' => $newName
188
            ]
189
        );
190
        
191
        $test = $this->em->find("Overwatch\TestBundle\Entity\Test", TestFixtures::$tests['test-1']->getId());
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Overwatch\TestBundle\Entity\Test does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
192
        
193
        $this->assertEquals($newName, $test->getName());
194
        
195
        $this->assertJsonResponse($this->client->getResponse());
196
        $this->assertJsonStringEqualsJsonString(
197
            json_encode($test),
198
            $this->getResponseContent(true)
199
        );
200
    }
201
    
202 View Code Duplication
    public function testUpdateTestInsufficentPerms()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
203
    {
204
        $this->logIn('ROLE_USER');
205
        $this->client->request('PUT', '/api/tests/' . TestFixtures::$tests['test-1']->getId());
206
        
207
        $this->assertForbidden($this->client->getResponse());
208
    }
209
    
210 View Code Duplication
    public function testUpdateTestInvalidTest()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
211
    {
212
        $this->logIn('ROLE_SUPER_ADMIN');
213
        $this->client->request('PUT', '/api/tests/1000');
214
        
215
        $this->assertEquals(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode());
216
    }
217
    
218
    public function testDeleteTest()
219
    {
220
        $this->logIn('ROLE_SUPER_ADMIN');
221
        $this->client->request('DELETE', '/api/tests/' . TestFixtures::$tests['test-1']->getId());
222
        
223
        $this->assertTrue($this->client->getResponse()->isSuccessful());
224
        $this->assertEquals(Response::HTTP_NO_CONTENT, $this->client->getResponse()->getStatusCode());
225
        $this->assertNull($this->em->find("Overwatch\TestBundle\Entity\Test", TestFixtures::$tests['test-1']->getId()));
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Overwatch\TestBundle\Entity\Test does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
226
    }
227
    
228 View Code Duplication
    public function testDeleteTestInsufficentPerms()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
229
    {
230
        $this->logIn('ROLE_USER');
231
        $this->client->request('DELETE', '/api/tests/' . TestFixtures::$tests['test-1']->getId());
232
        
233
        $this->assertForbidden($this->client->getResponse());
234
    }
235
    
236 View Code Duplication
    public function testDeleteTestInvalidTest()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
237
    {
238
        $this->logIn('ROLE_SUPER_ADMIN');
239
        $this->client->request('DELETE', '/api/tests/1000');
240
        
241
        $this->assertEquals(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode());
242
    }
243
    
244 View Code Duplication
    public function testRunTest()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
245
    {
246
        $this->logIn('ROLE_SUPER_ADMIN');
247
        $this->client->request('POST', '/api/tests/' . TestFixtures::$tests['test-1']->getId());
248
        
249
        $test = $this->em->find("Overwatch\TestBundle\Entity\Test", TestFixtures::$tests['test-1']->getId());
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Overwatch\TestBundle\Entity\Test does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
250
        
251
        $this->assertJsonResponse($this->client->getResponse());
252
        $this->assertJsonStringEqualsJsonString(
253
            json_encode($test->getResults()->last()),
254
            $this->getResponseContent(true)
255
        );
256
    }
257
    
258 View Code Duplication
    public function testRunTestInsufficentPerms()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
259
    {
260
        $this->logIn('ROLE_USER');
261
        $this->client->request('POST', '/api/tests/' . TestFixtures::$tests['test-1']->getId());
262
        
263
        $this->assertForbidden($this->client->getResponse());
264
    }
265
    
266 View Code Duplication
    public function testRunTestInvalidTest()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
267
    {
268
        $this->logIn('ROLE_SUPER_ADMIN');
269
        $this->client->request('POST', '/api/tests/1000');
270
        
271
        $this->assertEquals(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode());
272
    }
273
}
274