Permalink
Browse files

Fix rate limit check method not working if whois result has trailing …

…spaces
  • Loading branch information...
1 parent e705c30 commit 70272572bdec56952c10997d26ca2edc44c27e09 @lboynton committed Aug 6, 2012
Showing with 6 additions and 1 deletion.
  1. +1 −1 library/Lboy/Whois/Result/Pir.php
  2. +5 −0 tests/library/Lboy/Whois/Result/PirTest.php
@@ -41,6 +41,6 @@ public function gotWhois()
public function isRateLimitExceeded()
{
- return $this->whois == 'WHOIS LIMIT EXCEEDED';
+ return trim($this->whois) == 'WHOIS LIMIT EXCEEDED';
}
}
@@ -70,5 +70,10 @@ public function testIsRateLimitExceeded()
$whois = 'WHOIS LIMIT EXCEEDED';
$result = new Lboy_Whois_Result_Pir($whois);
$this->assertTrue($result->isRateLimitExceeded());
+
+ // check it works with spaces
+ $whois = ' WHOIS LIMIT EXCEEDED ';
+ $result = new Lboy_Whois_Result_Pir($whois);
+ $this->assertTrue($result->isRateLimitExceeded());
}
}

0 comments on commit 7027257

Please sign in to comment.