Assert
in package
Class Assert
Table of Contents
- doesNormalizedAddressHaveErrors() : void
- Assertions to check if the returned normalized address has any errors. If errors are present an exception is thrown.
- doesResponseHave500Error() : void
- Asserts that the status code is 500, and if it is a `SystemException` is thrown.
- isApiKeyValid() : void
- Asserts that the API Key provided is a valid string and is provided.
- isCityValid() : void
- Asserts that city in not an empty string and is valid characters.
- isCountryCodeValid() : void
- Check if the countryCode code is 2 capitalized letter and is not an empty string.
- isPostalCodeValid() : void
- Asserts that the postal code contains to allowed characters and is not an empty string.
- isStateValid() : void
- Asserts that state is 2 capitalized letters and that it is not an empty string.
- isStreetSet() : void
- Asserts that street array is not empty.
- isTimeoutValid() : void
- Asserts that the timeout value is valid.
- tooManyAddressLines() : void
- Checks if the street array has too many address lines, and will return false if the array **does not** have too many address lines.
Methods
doesNormalizedAddressHaveErrors()
Assertions to check if the returned normalized address has any errors. If errors are present an exception is thrown.
public
doesNormalizedAddressHaveErrors(AddressValidateResult $validationResult) : void
Parameters
- $validationResult : AddressValidateResult
Return values
void —doesResponseHave500Error()
Asserts that the status code is 500, and if it is a `SystemException` is thrown.
public
doesResponseHave500Error(array<string|int, mixed> $parsedResponse, int $statusCode) : void
Parameters
- $parsedResponse : array<string|int, mixed>
- $statusCode : int
Return values
void —isApiKeyValid()
Asserts that the API Key provided is a valid string and is provided.
public
isApiKeyValid(array<string|int, mixed> $config) : void
Parameters
- $config : array<string|int, mixed>
Return values
void —isCityValid()
Asserts that city in not an empty string and is valid characters.
public
isCityValid(string $cityLocality) : void
Parameters
- $cityLocality : string
Tags
Return values
void —isCountryCodeValid()
Check if the countryCode code is 2 capitalized letter and is not an empty string.
public
isCountryCodeValid(string $countryCode) : void
Parameters
- $countryCode : string
Tags
Return values
void —isPostalCodeValid()
Asserts that the postal code contains to allowed characters and is not an empty string.
public
isPostalCodeValid(string $postalCode) : void
Parameters
- $postalCode : string
Tags
Return values
void —isStateValid()
Asserts that state is 2 capitalized letters and that it is not an empty string.
public
isStateValid(string $stateProvince) : void
Parameters
- $stateProvince : string
Tags
Return values
void —isStreetSet()
Asserts that street array is not empty.
public
isStreetSet(array<string|int, mixed> $street) : void
Parameters
- $street : array<string|int, mixed>
Return values
void —isTimeoutValid()
Asserts that the timeout value is valid.
public
isTimeoutValid(DateInterval $timeout) : void
Parameters
- $timeout : DateInterval
Return values
void —tooManyAddressLines()
Checks if the street array has too many address lines, and will return false if the array **does not** have too many address lines.
public
tooManyAddressLines(array<string|int, mixed> $street) : void
Parameters
- $street : array<string|int, mixed>