Completed
Push — master ( 612575...486a28 )
by Paweł
03:08
created

CodeReview_Issues_DeprecatedTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 35
rs 10
wmc 1
lcom 1
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
B testIsEditable() 0 32 1
1
<?php
2
3
class CodeReview_Issues_DeprecatedTest extends PHPUnit_Framework_TestCase {
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
4
5
	public function testIsEditable() {
6
		$object = new CodeReview_Issues_Deprecated(array(
7
			'name' => 'function_name',
8
			'version' => '1.0',
9
			'file' => 'info.php',
10
			'line' => 321,
11
		));
12
13
		$this->assertInstanceOf('ArrayAccess', $object);
14
		$this->assertFalse(is_array($object));
15
16
		$this->assertArrayHasKey('name', $object);
17
		$this->assertArrayHasKey('version', $object);
18
		$this->assertArrayHasKey('file', $object);
19
		$this->assertArrayHasKey('line', $object);
20
		$this->assertArrayHasKey('reason', $object);
21
22
		$this->assertEquals('function_name', $object['name']);
23
		$this->assertEquals('1.0', $object['version']);
24
		$this->assertEquals('info.php', $object['file']);
25
		$this->assertEquals(321, $object['line']);
26
		$this->assertEquals('deprecated', $object['reason']);
27
28
		$object['version'] = '1.1';
29
30
		$this->assertEquals('1.1', $object['version']);
31
		$this->assertTrue(isset($object['version']));
32
33
		unset($object['version']);
34
35
		$this->assertFalse(isset($object['version']));
36
	}
37
}
38