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

AdminControllerTest::testIndexAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 11
nc 1
nop 0
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