function CoderTestFile::test in Coder 6
Same name and namespace in other branches
- 6.2 scripts/coder_format/tests/CoderTestFile.php \CoderTestFile::test()
- 7.2 scripts/coder_format/tests/CoderTestFile.php \CoderTestFile::test()
- 7 scripts/coder_format/tests/CoderTestFile.php \CoderTestFile::test()
Implements SimpleExpectation::test().
Parameters
$filename Filename of test file to test.:
File
- scripts/
coder_format/ tests/ CoderTestFile.php, line 113
Class
- CoderTestFile
- Represents coder test file for full coder_format_string_all() tests.
Code
function test($filename = false) {
if ($filename) {
$this
->load($filename);
}
// Perform test.
// Test passes until proven invalid.
$valid = TRUE;
foreach ($this->input as $unit => $content) {
// Parse input and store results.
$this->actual[$unit] = coder_format_string_all($this->input[$unit]);
// Let this test fail, if a unit fails.
if ($this->expect[$unit] !== $this->actual[$unit]) {
$valid = FALSE;
}
}
return $valid;
}