)   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
c 1
b 0
f 1
dl 0
loc 3
rs 10
1
<?php
2
class CodeReviewElggCompatibilityTest 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...
3
4
	/**
5
	 * Checks if file is loadable for current version of PHP. Regression test after problems with 1.0.2 version.
6
	 */
7
	public function testLanguagesSyntax() {
8
9
		if (!function_exists('add_translation')) {
10
			//whatever, we just test syntax correctness
11
12
			function add_translation($country_code, $language_array) {
0 ignored issues
show
Unused Code introduced by
The parameter $country_code is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $language_array is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
13
				return true;
14
			}
15
		}
16
17
		$path = dirname(dirname(dirname(__FILE__))) . '/languages/en.php';
18
		$this->assertTrue(file_exists($path));
19
		$languages = include($path);
20
		$this->assertTrue($languages === 1 || is_array($languages));
21
	}
22
}