3. Assertions

3.1. Arrays

  • array array does not have item array - Assert an array does not have key and value item.
  • array array does not have key int|string - Assert an array does not have a key.
  • array array does not have keys array -
  • array array does not have value mixed - Assert an array does not have any occurrences of the given value.
  • array array has item array - Assert an array has key and value item.
  • array array has items array - Assert an array has all key and value items.
  • array array has key int|string - Assert an array has key, returns value.
  • array array has keys array - Assert an array has several keys in any order.
  • array array has value mixed - Assert an array has at least one occurrence of the given value.
  • array array has values array - Assert an array has several values in any order.
  • array array is associative - Assert an array is associative.
  • array array is empty - Assert an array is empty (no elements).
  • array array is not associative - Assert an array is not associative.
  • array array is not empty - Assert an array is not empty (at least one element).
  • array array is not unique - Assert that an array only has at least one element that is repeated.
  • array array is unique - Assert that an array only contains unique values.

3.2. Basic

  • mixed does not equal mixed - Assert two value do not match with no regard to type.
  • mixed does not exactly equal mixed - Assert two values are of exactly the same type and value.
  • mixed equals mixed - Assert values with no regard to exact data types.
  • mixed exactly equals mixed - Assert two values match data type and value.
  • mixed is not the same as mixed - Assert two values are of exactly the same type and value.
  • mixed is the same as mixed - Assert two values match data type and value.

3.3. Booleans

  • mixed is false - Assert value is false.
  • mixed is falsy - Assert a value is a false-like value.
  • mixed is true - Assert a value is true.
  • mixed is truthy - Assert a value is a non false-like value.

3.4. Date and Time

3.5. Exceptions

  • closure callable does not throw class - Assert that a specific exception is not thrown.
  • closure callable does not throw exception - Assert that no exception is thrown.
  • closure callable throws class - Assert a specific exception was thrown.
  • closure callable throws anything except class - Assert any exception except a specific one was thrown.
  • closure callable throws exactly class - Assert a specific exception was thrown.
  • closure callable throws exception - Assert an exception was thrown.

3.6. Files

  • file string does not equal string - Compare string value with the contents of a file.
  • file string equals string - Compare string value with the contents of a file.

3.7. Numbers

  • number is between number and number - A number must be between two values (inclusive), returns value.
  • number is greater than number - A number is greater than another number.
  • number is greater than or equal to number - A number is greater than or equal to another number.
  • number is less than number - A number is less than another number.
  • number is less than or equal to number - A number is less than or equal to another number.
  • number is not between number and number - A number must not be between two values (inclusive).
  • number is not within number of number - Assert two values are not close to each other.
  • number is within number of number - Assert two values are close to each other.

3.8. Objects and Classes

  • object|class is an instance of class - Assert an objects class or subclass.
  • object|class is not an instance of class - Assert than an object is not a class or subclass.
  • object object does not have property string - Assert that an object does not have a property.
  • object object has property string - Assert that an object has a property. Returns the properties value.

3.9. Regular Expressions

  • string string does not match regex - Assert that a string does not match a regular expression.
  • string string matches regex - Assert that a string matches a regular expression.

3.10. Strings

  • string mixed does not end with mixed - Assert a string does not end with another string.
  • string mixed does not start with mixed - Assert a string does not not start (begin) with another string.
  • string string contains string - A string contains a substring. Returns original string.
  • string string contains case insensitive string - A string contains a substring (ignoring case-sensitivity). Returns original string.
  • string string does not contain string - A string does not contain a substring. Returns original string.
  • string string does not contain case insensitive string - A string does not contain a substring (ignoring case-sensitivity). Returns original string.
  • string string ends with string - Assert a string ends with another string.
  • string string is empty - Assert a string is zero length.
  • string string is not empty - Assert a string has at least one character.
  • string string starts with string - Assert a string starts (begins) with another string.

3.11. Types

  • mixed is a bool - Assert a value is true or false.
  • mixed is a boolean - Assert a value is true or false.
  • mixed is a number - Assert that a value is an integer or floating-point.
  • mixed is a string - Assert value is a string.
  • mixed is an array - Assert a value is an array.
  • mixed is an int - Assert value is an integer type.
  • mixed is an integer - Assert value is an integer type.
  • mixed is an object - Assert value is an object.
  • mixed is not a bool - Assert a value is not true or false.
  • mixed is not a boolean - Assert a value is not true or false.
  • mixed is not a number - Assert that a value is not an integer or floating-point.
  • mixed is not a string - Assert a value is not a string.
  • mixed is not an array - Assert a value is not an array.
  • mixed is not an int - Assert a value is not an integer type.
  • mixed is not an integer - Assert a value is not an integer type.
  • mixed is not an object - Assert a value is not an object.
  • mixed is not null - Assert a value is not null.
  • mixed is not numeric - Assert value is not a number or string that represents a number.
  • mixed is null - Assert a value is null.
  • mixed is numeric - Assert value is a number or string that represents a number.

3.12. URLs