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:
parent
3893aab376
commit
4d54b4caa0
1 changed files with 8 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue