mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-09-23 18:30:32 +00:00
Replace uses of each()
It's deprecated in PHP 7.2, may as well replace it now. Bug: T174354 Change-Id: I2c37229d69a9646edaa61e25e28b13e8190a8359
This commit is contained in:
parent
49bd05cd2a
commit
9fefb11d56
|
@ -98,15 +98,17 @@ LUA;
|
|||
|
||||
public function testGlobalEnvironment() {
|
||||
// Grab the first engine as the "standard"
|
||||
reset( $this->engines );
|
||||
list( $firstName, $firstEngine ) = each( $this->engines );
|
||||
$firstEngine = reset( $this->engines );
|
||||
$firstName = key( $this->engines );
|
||||
$firstEnv = $this->getGlobalEnvironment( $firstEngine );
|
||||
|
||||
// Test all others against it
|
||||
while ( list( $secondName, $secondEngine ) = each( $this->engines ) ) {
|
||||
$secondEnv = $this->getGlobalEnvironment( $secondEngine );
|
||||
$this->assertEquals( $firstEnv, $secondEnv,
|
||||
"Environments for $firstName and $secondName are not equivalent" );
|
||||
foreach ( $this->engines as $secondName => $secondEngine ) {
|
||||
if ( $secondName !== $firstName ) {
|
||||
$secondEnv = $this->getGlobalEnvironment( $secondEngine );
|
||||
$this->assertEquals( $firstEnv, $secondEnv,
|
||||
"Environments for $firstName and $secondName are not equivalent" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue