public function testThrottleDoesntAllowMoreThanOnceCallPerSecond()
 {
     $this->throttle->throttle(['amz_product_api_service_call']);
     $time_a = microtime(true);
     $this->throttle->throttle(['amz_product_api_service_call']);
     $time_b = microtime(true);
     assertThat($time_b - $time_a, greaterThanOrEqualTo(1));
 }
 public function testThrottleDoesntAllowMoreThanOnceCallPerSecond()
 {
     throttle();
     $time_a = microtime(true);
     throttle();
     $time_b = microtime(true);
     assertThat($time_b - $time_a, greaterThanOrEqualTo(1));
 }
 public function testShouldMonitorExecutionOfFunction()
 {
     $result = monitorExecution(function () {
     });
     assertThat($result->dateStart, anInstanceOf('Datetime'));
     assertThat($result->dateFinish, anInstanceOf('Datetime'));
     assertThat($result->elapsedSeconds, greaterThanOrEqualTo(0));
     assertThat($result->convertSecondsToReadableString(), is('0s'));
     assertThat($result->hasFailed(), is(false));
 }
 public function testAllowsForInclusiveComparisons()
 {
     assertThat(1, lessThanOrEqualTo(1));
     assertThat(1, greaterThanOrEqualTo(1));
 }