1
0
mirror of https://github.com/danog/amp.git synced 2025-01-22 21:31:18 +01:00

Widen timing on Interval test

This commit is contained in:
Aaron Piotrowski 2021-10-16 09:34:39 -05:00
parent e455bed8d6
commit d937f3d7e0
No known key found for this signature in database
GPG Key ID: ADD1EF783EDE9EEB

View File

@ -22,11 +22,11 @@ class IntervalTest extends AsyncTestCase
} }
}; };
delay(0.035); delay(0.039);
unset($object); // Should destroy PeriodicFunction object and cancel loop watcher. unset($object); // Should destroy PeriodicFunction object and cancel loop watcher.
self::assertSame(3, $count); self::assertSame(3, $count);
delay(0.025); delay(0.029);
self::assertSame(3, $count); self::assertSame(3, $count);
} }
@ -40,11 +40,11 @@ class IntervalTest extends AsyncTestCase
++$count; ++$count;
}); });
delay(0.035); delay(0.039);
self::assertSame(1, $count); self::assertSame(1, $count);
self::assertFalse($interval->isEnabled()); self::assertFalse($interval->isEnabled());
delay(0.025); delay(0.029);
self::assertSame(1, $count); self::assertSame(1, $count);
} }
@ -57,17 +57,17 @@ class IntervalTest extends AsyncTestCase
++$count; ++$count;
}); });
delay(0.025); delay(0.029);
self::assertSame(2, $count); self::assertSame(2, $count);
$interval->disable(); $interval->disable();
self::assertFalse($interval->isEnabled()); self::assertFalse($interval->isEnabled());
delay(0.025); delay(0.029);
self::assertSame(2, $count); self::assertSame(2, $count);
$interval->enable(); $interval->enable();
self::assertTrue($interval->isEnabled()); self::assertTrue($interval->isEnabled());
delay(0.025); delay(0.029);
self::assertSame(4, $count); self::assertSame(4, $count);
} }
} }