类似的内容在测试用例中没有像处理类似

I've been implementing a JsonExporter and since JSON_PRETTY_PRINT was added the testcase cannot be fixed anymore. phpunit still thinks there is a difference in the output, but it actually isn't:

// code of the testcase
$exporter->export($outFile, array(
    'key.a' => 'aaa',
    'key.b' => 'bbb',
    'key.c' => 'ccc',
));
$expectedContent = <<<EOL
{
    "key.a": "aaa",
    "key.b": "bbb",
    "key.c": "ccc"
}
EOL;
$this->assertEquals($expectedContent, file_get_contents($outFile));

Have been testing with multiple delimiters, <<<C and PHP_EOL also don't fix the testcase. The testcase always fails but there is no difference in the output:

Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
 '{
     "key.a": "aaa",
     "key.b": "bbb",
     "key.c": "ccc"
 }'

How can we make this testcase pass?

Edit: the Exporter only does a simple json_encode:

/**
 * {@inheritdoc}
 */
public function export($file, $translations)
{
    $bytes = file_put_contents($file, json_encode($translations, JSON_PRETTY_PRINT));

    return ($bytes !== false);
}

PHPUnit implements some assertions that will compare JSON data:

These will compare the data structure, not the JSON string format.