@@ 30-44 (lines=15) @@ | ||
27 | $this->assertInstanceOf('Nette\Application\Responses\ForwardResponse', $response); |
|
28 | } |
|
29 | ||
30 | public function testLogin() |
|
31 | { |
|
32 | $this->presenter->getUser()->logout(); |
|
33 | ||
34 | $response = $this->makeRequest('default', 'POST', array( |
|
35 | 'action' => 'default', |
|
36 | ), array( |
|
37 | 'username' => 'test', |
|
38 | 'password' => 'test', |
|
39 | 'remember' => '1', |
|
40 | 'send' => 'Log in', |
|
41 | ), 'signInForm-submit'); |
|
42 | ||
43 | $this->assertInstanceOf('Nette\Application\Responses\ForwardResponse', $response); |
|
44 | } |
|
45 | ||
46 | public function testBadLogin() |
|
47 | { |
|
@@ 46-61 (lines=16) @@ | ||
43 | $this->assertInstanceOf('Nette\Application\Responses\ForwardResponse', $response); |
|
44 | } |
|
45 | ||
46 | public function testBadLogin() |
|
47 | { |
|
48 | $this->presenter->getUser()->logout(); |
|
49 | ||
50 | $response = $this->makeRequest('default', 'POST', array( |
|
51 | 'action' => 'default', |
|
52 | 'do' => 'signInForm-submit', |
|
53 | ), array( |
|
54 | 'username' => 'test', |
|
55 | 'password' => 'badpassword', |
|
56 | 'remember' => '1', |
|
57 | 'send' => 'Log in', |
|
58 | )); |
|
59 | ||
60 | $this->assertInstanceOf('Nette\Application\Responses\TextResponse', $response); |
|
61 | } |
|
62 | } |
|
63 |