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

CodeReview_Issues_DeprecatedTest::testIsEditable()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 32
Code Lines 23

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 23
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 32
rs 8.8571
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