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:
Brad Jorsch 2017-09-19 16:46:51 -04:00
parent 49bd05cd2a
commit 9fefb11d56

View file

@ -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" );
}
}
}
}