public function PHPUnit_Framework_Constraint_TraversableContainsOnly::__construct in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContainsOnly.php \PHPUnit_Framework_Constraint_TraversableContainsOnly::__construct()
Parameters
string $type:
bool $isNativeType:
Overrides PHPUnit_Framework_Constraint::__construct
File
- vendor/
phpunit/ phpunit/ src/ Framework/ Constraint/ TraversableContainsOnly.php, line 33
Class
- PHPUnit_Framework_Constraint_TraversableContainsOnly
- Constraint that asserts that the Traversable it is applied to contains only values of a given type.
Code
public function __construct($type, $isNativeType = true) {
parent::__construct();
if ($isNativeType) {
$this->constraint = new PHPUnit_Framework_Constraint_IsType($type);
}
else {
$this->constraint = new PHPUnit_Framework_Constraint_IsInstanceOf($type);
}
$this->type = $type;
}