Conditions | 1 |
Paths | 1 |
Total Lines | 25 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | public function testIndexAction() |
||
11 | { |
||
12 | exec('./bin/console d:d:c --env=test'); |
||
13 | exec('./bin/console d:s:c --env=test'); |
||
14 | exec('./bin/console h:f:l -n --env=test'); |
||
15 | |||
16 | $client = static::createClient(); |
||
17 | $em = $client->getContainer()->get('doctrine'); |
||
18 | |||
19 | $crawler = $client->request('GET', '/login'); |
||
20 | $form = $crawler->selectButton('Login')->form(); |
||
21 | $client->submit($form, ['_username' => '[email protected]', '_password' => 'admin']); |
||
22 | |||
23 | $crawler = $client->request('GET', '/admin/'); |
||
24 | |||
25 | $form = $crawler->selectButton('Save')->form(); |
||
26 | $client->submit($form, [ |
||
27 | 'admin[userName]' => 'test1', |
||
28 | 'admin[email]' => '[email protected]', |
||
29 | ]); |
||
30 | $admin = $em->getRepository(Admin::class)->findOneBy(['userName' => 'test1']); |
||
31 | |||
32 | $this->assertInstanceOf(Admin::class, $admin); |
||
33 | exec('./bin/console d:d:d --force --env=test'); |
||
34 | } |
||
35 | } |
||
36 |