Skip to content

Commit 62d4215

Browse files
committed
fix testPrefersReducedMotionDisabled should restore PANTHER_NO_REDUCED_MOTION state
1 parent 772a8be commit 62d4215

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/ClientTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,11 +615,18 @@ public function testPrefersReducedMotionDisabled(string $browser): void
615615
{
616616
$this->expectException(ElementClickInterceptedException::class);
617617

618+
$previous = $_SERVER['PANTHER_NO_REDUCED_MOTION'] ?? null;
618619
$_SERVER['PANTHER_NO_REDUCED_MOTION'] = true;
619620
$client = self::createPantherClient(['browser' => $browser]);
620621
$client->request('GET', '/prefers-reduced-motion.html');
621622

622623
$client->clickLink('Click me!');
624+
625+
if (null === $previous) {
626+
unset($_SERVER['PANTHER_NO_REDUCED_MOTION']);
627+
} else {
628+
$_SERVER['PANTHER_NO_REDUCED_MOTION'] = $previous;
629+
}
623630
}
624631

625632
public static function providePrefersReducedMotion(): iterable

0 commit comments

Comments
 (0)