private function execTest(\Phpcf\Formatter $Formatter, $file) { $source_file = $file; if (strpos($file, ':') !== false) { list($file, ) = explode(':', $file); } $expected_content = null; $expected = __DIR__ . self::EXPECTED . $file; if (!file_exists($expected)) { $this->fail("File {$expected} does not exists"); } else { if (false === ($expected_content = file_get_contents($expected))) { $this->fail("Failed to get content of {$expected}"); } } $original = __DIR__ . self::ORIGINAL . $source_file; $FormatResult = $Formatter->formatFile($original); $this->assertNull($FormatResult->getError()); // we expect no error $this->assertEquals($expected_content, $FormatResult->getContent()); }