function CoderTestFile::test in Coder 7.2
Same name and namespace in other branches
- 6.2 scripts/coder_format/tests/CoderTestFile.php \CoderTestFile::test()
- 6 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 117 - Set of tests for the coder_format script.
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;
}