AccountTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 15
dl 0
loc 37
rs 10
c 2
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testIndexActionWatch() 0 6 1
A testIndexAction() 0 9 1
A testDownloadAction() 0 5 1
A testIndexActionFavorite() 0 6 1
1
<?php
2
3
class AccountTest extends \LocalWebTestCase
4
{
5
	public function testIndexAction()
6
	{
7
		$response = $this->call( 'GET', '/unittest/profile' );
8
9
		$this->assertEquals( 200, $response->getStatusCode() );
10
		$this->assertStringContainsString( 'account-profile', (string) $response->getBody() );
11
		$this->assertStringContainsString( 'account-history', (string) $response->getBody() );
12
		$this->assertStringContainsString( 'account-favorite', (string) $response->getBody() );
13
		$this->assertStringContainsString( 'account-watch', (string) $response->getBody() );
14
	}
15
16
17
	public function testIndexActionFavorite()
18
	{
19
		$response = $this->call( 'GET', '/unittest/profile/favorite' );
20
21
		$this->assertEquals( 200, $response->getStatusCode() );
22
		$this->assertStringContainsString( 'account-favorite', (string) $response->getBody() );
23
	}
24
25
26
	public function testIndexActionWatch()
27
	{
28
		$response = $this->call( 'GET', '/unittest/profile/watch' );
29
30
		$this->assertEquals( 200, $response->getStatusCode() );
31
		$this->assertStringContainsString( 'account-watch', (string) $response->getBody() );
32
	}
33
34
35
	public function testDownloadAction()
36
	{
37
		$response = $this->call( 'GET', '/unittest/profile/download/0' );
38
39
		$this->assertEquals( 401, $response->getStatusCode() );
40
	}
41
}
42