Code Duplication    Length = 20-23 lines in 3 locations

tests/checks/FileWritableCheckTest.php 1 location

@@ 6-25 (lines=20) @@
3
/**
4
 * @mixin PHPUnit_Framework_TestCase
5
 */
6
class FileWritableCheckTest extends SapphireTest {
7
	public function testCheckReportsWritablePaths() {
8
		$check = new FileWriteableCheck(TEMP_FOLDER);
9
10
		$expected = array(
11
			EnvironmentCheck::OK,
12
			'',
13
		);
14
15
		$this->assertEquals($expected, $check->check());
16
	}
17
18
	public function testCheckReportsNonWritablePaths() {
19
		$check = new FileWriteableCheck('/var');
20
21
		$result = $check->check();
22
23
		$this->assertEquals(EnvironmentCheck::ERROR, $result[0]);
24
	}
25
}
26

tests/checks/HasClassCheckTest.php 1 location

@@ 6-28 (lines=23) @@
3
/**
4
 * @mixin PHPUnit_Framework_TestCase
5
 */
6
class HasClassCheckTest extends SapphireTest {
7
	public function testCheckReportsMissingClasses() {
8
		$check = new HasClassCheck('foo');
9
10
		$expected = array(
11
			EnvironmentCheck::ERROR,
12
			'Class foo doesn\'t exist',
13
		);
14
15
		$this->assertEquals($expected, $check->check());
16
	}
17
18
	public function testCheckReportsFoundClasses() {
19
		$check = new HasClassCheck('stdClass');
20
21
		$expected = array(
22
				EnvironmentCheck::OK,
23
				'Class stdClass exists',
24
		);
25
26
		$this->assertEquals($expected, $check->check());
27
	}
28
}
29

tests/checks/HasFunctionCheckTest.php 1 location

@@ 6-28 (lines=23) @@
3
/**
4
 * @mixin PHPUnit_Framework_TestCase
5
 */
6
class HasFunctionCheckTest extends SapphireTest {
7
	public function testCheckReportsMissingFunctions() {
8
		$check = new HasFunctionCheck('foo');
9
10
		$expected = array(
11
			EnvironmentCheck::ERROR,
12
			'foo() doesn\'t exist',
13
		);
14
15
		$this->assertEquals($expected, $check->check());
16
	}
17
18
	public function testCheckReportsFoundFunctions() {
19
		$check = new HasFunctionCheck('class_exists');
20
21
		$expected = array(
22
			EnvironmentCheck::OK,
23
			'class_exists() exists',
24
		);
25
26
		$this->assertEquals($expected, $check->check());
27
	}
28
}
29