public function test_ShouldBeUnsuableOnTooManyFailsOrIfBlocked() { $maxFails = 10; $rp = new RotatingProxy("test", null, $maxFails, -1, null); $this->assertTrue($rp->isUsable(), "Expected NOT to have enough consecutive fails"); $rp->setCurrentConsecutiveFails($maxFails); $this->assertFalse($rp->isUsable(), "Expected to have enough consecutive fails"); $rp->setCurrentConsecutiveFails(0); $rp->block(); $this->assertFalse($rp->isUsable(), "Expected to be blocked"); $rp->unblock(); $this->assertTrue($rp->isUsable(), "Expected NOT to be blocked"); }