diff --git a/src/Context/BaseContext.php b/src/Context/BaseContext.php index 12923f20..1eff25eb 100644 --- a/src/Context/BaseContext.php +++ b/src/Context/BaseContext.php @@ -27,7 +27,12 @@ public static function getTranslationResources() */ public function castToInt($count) { - return intval($count); + if (intval($count) < PHP_INT_MAX) { + + return intval($count); + } + + return $count; } protected function getMinkContext() diff --git a/tests/features/rest.feature b/tests/features/rest.feature index 9ba869d6..429f3242 100644 --- a/tests/features/rest.feature +++ b/tests/features/rest.feature @@ -56,9 +56,15 @@ Feature: Testing RESTContext When I send a GET request to "/rest/index.php" Then I should see "HTTP_XXX : yyy" + Scenario: Add header with large numeric value + Given I add "xxx-large-numeric" header equal to "92233720368547758070" + When I send a GET request to "/rest/index.php" + Then I should see "HTTP_XXX_LARGE_NUMERIC : 92233720368547758070" + Scenario: Header should not be cross-scenarios persistent When I send a GET request to "/rest/index.php" Then I should not see "HTTP_XXX : yyy" + Then I should not see "HTTP_XXX_LARGE_NUMERIC" Scenario: Case-insensitive header name Like describe in the rfc2614 ยง4.2