These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace OpenOrchestra\FunctionalTests\BackofficeBundle\Controller; |
||
4 | |||
5 | use OpenOrchestra\FunctionalTests\Utils\AbstractFormTest; |
||
6 | use OpenOrchestra\ModelInterface\Repository\ContentTypeRepositoryInterface; |
||
7 | |||
8 | /** |
||
9 | * Class ContentTypeControllerTest |
||
10 | * |
||
11 | * @group backofficeTest |
||
12 | */ |
||
13 | class ContentTypeControllerTest extends AbstractFormTest |
||
14 | { |
||
15 | /** |
||
16 | * @var ContentTypeRepositoryInterface |
||
17 | */ |
||
18 | protected $contentTypeRepository; |
||
19 | |||
20 | protected $username = 'developer'; |
||
21 | protected $password = 'developer'; |
||
22 | |||
23 | /** |
||
24 | * Set up the test |
||
25 | */ |
||
26 | public function setUp() |
||
27 | { |
||
28 | parent::setUp(); |
||
29 | $this->contentTypeRepository = static::$kernel->getContainer()->get('open_orchestra_model.repository.content_type'); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * Test content type versionnning |
||
34 | */ |
||
35 | public function testFormController() |
||
36 | { |
||
37 | // $contentTypes = $this->contentTypeRepository->findAll(); |
||
0 ignored issues
–
show
|
|||
38 | // $contentTypeCount = count($contentTypes); |
||
39 | |||
40 | // $crawler = $this->client->request('GET', '/admin/content-type/form/news'); |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
59% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them.
Loading history...
|
|||
41 | // $form = $crawler->selectButton('Save')->form(); |
||
42 | |||
43 | // $this->submitForm($form); |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
75% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them.
Loading history...
|
|||
44 | |||
45 | // $contentTypes = $this->contentTypeRepository->findAll(); |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
56% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them.
Loading history...
|
|||
46 | // $this->assertCount($contentTypeCount + 1, $contentTypes); |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * Test content edition |
||
51 | */ |
||
52 | public function testEditContent() |
||
53 | { |
||
54 | $url = '/admin/content/form/notre_vision/fr'; |
||
55 | $crawler = $this->client->request('GET', $url); |
||
56 | $this->assertNotContains('has-error', $this->client->getResponse()->getContent()); |
||
57 | $contentForm = $crawler->selectButton('Save')->form(); |
||
58 | $this->submitForm($contentForm); |
||
59 | $this->assertContains('alert alert-success', $this->client->getResponse()->getContent()); |
||
60 | |||
61 | $crawler = $this->client->request('GET', '/admin/content-type/form/news'); |
||
62 | $form = $crawler->selectButton('Save')->form(); |
||
63 | |||
64 | $this->submitForm($form); |
||
65 | |||
66 | $url = '/admin/content/form/notre_vision/fr'; |
||
67 | $this->client->request('GET', $url); |
||
68 | $this->assertNotContains('has-error', $this->client->getResponse()->getContent()); |
||
69 | } |
||
70 | |||
71 | /** |
||
72 | * Test new content |
||
73 | */ |
||
74 | public function testNewContent() |
||
75 | { |
||
76 | $url = '/admin/content/new/news/en'; |
||
77 | $this->client->request('GET', $url); |
||
78 | $this->assertNotContains('has-error', $this->client->getResponse()->getContent()); |
||
79 | } |
||
80 | } |
||
81 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.