1
|
|
|
<?php |
2
|
|
|
/* Copyright (C) 2018 Michael Giesler |
3
|
|
|
* |
4
|
|
|
* This file is part of Dembelo. |
5
|
|
|
* |
6
|
|
|
* Dembelo is free software: you can redistribute it and/or modify |
7
|
|
|
* it under the terms of the GNU Affero General Public License as published by |
8
|
|
|
* the Free Software Foundation, either version 3 of the License, or |
9
|
|
|
* (at your option) any later version. |
10
|
|
|
* |
11
|
|
|
* Dembelo is distributed in the hope that it will be useful, |
12
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14
|
|
|
* GNU Affero General Public License 3 for more details. |
15
|
|
|
* |
16
|
|
|
* You should have received a copy of the GNU Affero General Public License 3 |
17
|
|
|
* along with Dembelo. If not, see <http://www.gnu.org/licenses/>. |
18
|
|
|
*/ |
19
|
|
|
|
20
|
|
|
namespace DembeloMain\IntegrationTests\Controller; |
21
|
|
|
|
22
|
|
|
use DembeloMain\IntegrationTests\WebTestCase; |
23
|
|
|
use Symfony\Component\HttpFoundation\Response; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @group integration |
27
|
|
|
*/ |
28
|
|
|
class UserControllerTest extends WebTestCase |
29
|
|
|
{ |
30
|
|
|
/** |
31
|
|
|
* @return void |
32
|
|
|
*/ |
33
|
|
|
public function testLoginAction(): void |
34
|
|
|
{ |
35
|
|
|
$client = static::createClient(); |
36
|
|
|
|
37
|
|
|
$client->request('GET', '/login'); |
38
|
|
|
|
39
|
|
|
$response = $client->getResponse(); |
40
|
|
|
self::assertInstanceOf(Response::class, $response); |
41
|
|
|
self::assertEquals(200, $response->getStatusCode(), $response->getContent()); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @return void |
46
|
|
|
*/ |
47
|
|
|
public function testRegistrationAction(): void |
48
|
|
|
{ |
49
|
|
|
$client = static::createClient(); |
50
|
|
|
|
51
|
|
|
$client->request('GET', '/registration'); |
52
|
|
|
|
53
|
|
|
$response = $client->getResponse(); |
54
|
|
|
self::assertInstanceOf(Response::class, $response); |
55
|
|
|
self::assertEquals(200, $response->getStatusCode(), $response->getContent()); |
56
|
|
|
} |
57
|
|
|
} |
58
|
|
|
|