Run ParserOutput serialization tests against latest example available

In ParserOutput serialization tests we have a large number of examples
saved for different versions of MW. When MW version is released,
but the serialization doesn't change, we stop running some serialization
tests cause we can no longer find the latest example.

Change-Id: I01e8e0e17e2371b2cd08d200d3a4611d814e74bb
This commit is contained in:
Petr Pchelko 2021-10-01 10:10:57 -07:00 committed by C. Scott Ananian
parent 3893aab376
commit 4d54b4caa0

View file

@ -207,8 +207,14 @@ class SerializationTestUtils {
string $testCaseName,
string $version = null
) {
$version = $version ?: $this->getCurrentVersion();
$path = "{$this->serializedDataPath}/{$version}-{$class}-{$testCaseName}.{$this->ext}";
if ( $version ) {
$path = "$this->serializedDataPath/$version-$class-$testCaseName.$this->ext";
} else {
// Find the latest version we have saved.
$savedFiles = glob( "$this->serializedDataPath/?.??-$class-$testCaseName.$this->ext" );
sort( $savedFiles );
$path = $savedFiles[count( $savedFiles ) - 1];
}
return (object)[
'version' => $version,
'class' => $class,