Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php

class LoginFlowTest extends AgaviFlowTestCase
{
    
    public function testCanDoUnitTests()
    {
        $this->assertTrue(true);
    }
   
	public function __construct($name = NULL, array $data = array(), $dataName = '')
	{
        
		parent::__construct($name, $data, $dataName);
		$this->actionName = 'Login';
		$this->moduleName = 'Default';
		$this->input = '/login';
        
	}

    public function testLoginInputScreen() {
        
        $this->dispatch(array(), null, 'read');
        
        $this->assertResponseHasTag(array('tag' => 'body'));
        $this->assertResponseHasTag(array('tag' => 'div', 'content' => 'kirjautuminen'));
        $this->assertResponseHasTag(array('tag' => 'label', 'content' => 'Käyttäjätunnus:'));
        $this->assertResponseHasTag(array('tag' => 'label', 'content' => 'Salasana:'));
        $this->assertResponseHasNotTag(array('tag' => 'p', 'content' => 'Anna salasana.'));
    }
    
    
	public function testLoginWithoutPassword()
	{

		$this->dispatch(array('username' => 'Chuck'), null, 'write');
        //var_dump($this->response->getContent());
        
		$this->assertResponseHasTag(array('tag' => 'body'));
		$this->assertResponseHasTag(array('tag' => 'p', 'content' => 'Anna salasana'));
	}

    
}

?>