VerifyArrayTrait
Table of Contents
Methods
- contains() : mixed
- Verifies that a haystack contains a needle.
- containsEquals() : mixed
- containsOnly() : mixed
- Verifies that a haystack contains only values of a given type.
- containsOnlyInstancesOf() : mixed
- Verifies that a haystack contains only instances of a given class name.
- count() : mixed
- Verifies the number of elements of an array, Countable or Traversable.
- hasKey() : mixed
- Verifies that an array has a specified key.
- hasNotKey() : mixed
- Verifies that an array does not have a specified key.
- notContains() : mixed
- Verifies that a haystack does not contain a needle.
- notContainsEquals() : mixed
- notContainsOnly() : mixed
- Verifies that a haystack does not contain only values of a given type.
- notCount() : mixed
- Verifies the number of elements of an array, Countable or Traversable.
- notSameSize() : mixed
- Verifies that the size of two arrays (or `Countable` or `Traversable` objects) is not the same.
- sameSize() : mixed
- Verifies that the size of two arrays (or `Countable` or `Traversable` objects) is the same.
Methods
contains()
Verifies that a haystack contains a needle.
public
contains(mixed $needle) : mixed
Parameters
- $needle : mixed
containsEquals()
public
containsEquals(mixed $needle) : mixed
Parameters
- $needle : mixed
containsOnly()
Verifies that a haystack contains only values of a given type.
public
containsOnly(string $type[, bool|null $isNativeType = null ]) : mixed
Parameters
- $type : string
- $isNativeType : bool|null = null
containsOnlyInstancesOf()
Verifies that a haystack contains only instances of a given class name.
public
containsOnlyInstancesOf(string $className) : mixed
Parameters
- $className : string
count()
Verifies the number of elements of an array, Countable or Traversable.
public
count(int $expectedCount) : mixed
Parameters
- $expectedCount : int
hasKey()
Verifies that an array has a specified key.
public
hasKey(int|string $key) : mixed
Parameters
- $key : int|string
hasNotKey()
Verifies that an array does not have a specified key.
public
hasNotKey(int|string $key) : mixed
Parameters
- $key : int|string
notContains()
Verifies that a haystack does not contain a needle.
public
notContains(mixed $needle) : mixed
Parameters
- $needle : mixed
notContainsEquals()
public
notContainsEquals(mixed $needle) : mixed
Parameters
- $needle : mixed
notContainsOnly()
Verifies that a haystack does not contain only values of a given type.
public
notContainsOnly(string $type[, bool|null $isNativeType = null ]) : mixed
Parameters
- $type : string
- $isNativeType : bool|null = null
notCount()
Verifies the number of elements of an array, Countable or Traversable.
public
notCount(int $expectedCount) : mixed
Parameters
- $expectedCount : int
notSameSize()
Verifies that the size of two arrays (or `Countable` or `Traversable` objects) is not the same.
public
notSameSize(Countable|iterable<string|int, mixed> $expected) : mixed
Parameters
- $expected : Countable|iterable<string|int, mixed>
sameSize()
Verifies that the size of two arrays (or `Countable` or `Traversable` objects) is the same.
public
sameSize(Countable|iterable<string|int, mixed> $expected) : mixed
Parameters
- $expected : Countable|iterable<string|int, mixed>