Completed
Pull Request — dev (#27)
by
unknown
03:07
created

AdminControllerTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 4
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testIndexAction() 0 16 1
1
<?php
2
3
namespace Tests\AppBundle\Controller;
4
5
use AppBundle\Entity\Admin;
6
7
class AdminControllerTest extends AbstractController
8
{
9
    public function testIndexAction()
10
    {
11
        $this->request('/admin/', 'GET', 302);
12
        $this->request('/login');
13
        $client = $this->logIn();
14
        $crawler = $this->request('/admin/');
15
16
        $form = $crawler->selectButton('Save')->form();
17
        $client->submit($form, [
18
            'admin[userName]' => 'test1',
19
            'admin[email]' => '[email protected]',
20
        ]);
21
        $admin = $this->em->getRepository(Admin::class)->findOneBy(['userName' => 'test1']);
22
23
        $this->assertInstanceOf(Admin::class, $admin);
24
    }
25
}
26