本文整理汇总了PHP中PHPUnit_Framework_Constraint::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Constraint::__construct方法的具体用法?PHP PHPUnit_Framework_Constraint::__construct怎么用?PHP PHPUnit_Framework_Constraint::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_Constraint
的用法示例。
在下文中一共展示了PHPUnit_Framework_Constraint::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(string $className, string $methodName, int $paramIndex)
{
parent::__construct();
$this->className = $className;
$this->methodName = $methodName;
$this->paramIndex = $paramIndex;
}
示例2: __construct
/**
* Creates NumArrayEqual
*
* @param \NumPHP\Core\NumArray $value expected NumArray
*
* @since 1.0.0
*/
public function __construct(NumArray $value)
{
parent::__construct();
$this->value = clone $value;
// flush the cache
$this->value->flushCache();
}
示例3: __construct
/**
* Constructor
*
* @param string $header Cache debug header; defaults to X-Cache-Debug
*/
public function __construct($header = null)
{
if ($header) {
$this->header = $header;
}
parent::__construct();
}
示例4: __construct
/**
* @param object $schema
* @param string|null $context
*/
public function __construct($schema, $context = null)
{
parent::__construct();
$this->schema = $schema;
$this->context = $context ?: 'schema';
$this->validator = new Validator($this->context);
}
示例5: __construct
/**
* @param mixed $value
* @param bool $checkForObjectIdentity
* @param bool $checkForNonObjectIdentity
*/
public function __construct($value, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false)
{
parent::__construct();
$this->checkForObjectIdentity = $checkForObjectIdentity;
$this->checkForNonObjectIdentity = $checkForNonObjectIdentity;
$this->value = $value;
}
示例6: __construct
/**
* JsonValueMatches constructor.
*
* @param string $jsonPath The JSON path that identifies the value(s)
* in the JSON document that the constraint
* should match
* @param Constraint $constraint The actual constraint that the selected
* value(s) must match
* @param bool $matchAll This flag controls how this constraint
* handles multiple values. Usually, this
* constraint will match successfully, when
* (at least) one found value matches the
* given constraint. When this flag is set,
* _all_ found values must match the
* constraint.
*/
public function __construct($jsonPath, Constraint $constraint, $matchAll = false)
{
parent::__construct();
$this->jsonPath = $jsonPath;
$this->constraint = $constraint;
$this->matchAll = $matchAll;
}
示例7: __construct
public function __construct($expected, $mainProperty, $secondaryProperty)
{
parent::__construct();
$this->expected = is_array($expected) ? $expected : [$expected];
$this->mainProperty = $mainProperty;
$this->secondaryProperty = $secondaryProperty;
}
示例8: __construct
/**
* @param int|string $permissions
*/
public function __construct($permissions)
{
parent::__construct();
if (is_string($permissions)) {
if (!ctype_digit($permissions)) {
if (1 !== preg_match(self::$permissionFormat, $permissions)) {
throw new \InvalidArgumentException(sprintf('Permission to match "%s" is not formatted correctly.', $permissions));
}
$this->permissions = $permissions;
return;
}
if ('0' === $permissions[0]) {
$permissions = intval($permissions, 8);
} else {
$permissions = (int) $permissions;
}
}
if (!is_int($permissions)) {
if (is_object($permissions)) {
$type = sprintf('%s#%s', get_class($permissions), method_exists($permissions, '__toString') ? $permissions->__toString() : '');
} elseif (null === $permissions) {
$type = 'null';
} else {
$type = gettype($permissions) . '#' . $permissions;
}
throw new \InvalidArgumentException(sprintf('Invalid value for permission to match "%s", expected int >= 0 or string.', $type));
}
if ($permissions < 0) {
throw new \InvalidArgumentException(sprintf('Invalid value for permission to match "%d", expected >= 0.', $permissions));
}
$this->permissions = $permissions;
}
示例9: __construct
/**
* @param int $type
*/
public function __construct($type)
{
parent::__construct();
switch ($type) {
case self::TYPE_BOOL:
$this->testFunction = 'is_bool';
$this->type = 'bool';
break;
case self::TYPE_INT:
$this->testFunction = 'is_int';
$this->type = 'int';
break;
case self::TYPE_STRING:
$this->testFunction = 'is_string';
$this->type = 'string';
break;
case self::TYPE_FLOAT:
$this->testFunction = 'is_float';
$this->type = 'float';
break;
case self::TYPE_ARRAY:
$this->testFunction = 'is_array';
$this->type = 'array';
break;
case self::TYPE_SCALAR:
$this->testFunction = 'is_scalar';
$this->type = 'scalar';
break;
default:
throw new \InvalidArgumentException(sprintf('Unknown ScalarConstraint type "%s" provided.', is_object($type) ? get_class($type) : (null === $type ? 'null' : gettype($type) . '#' . $type)));
}
}
示例10: __construct
public function __construct($expected, $mainProperty, $secondaryProperty)
{
parent::__construct();
$this->expected = $expected;
$this->mainProperty = $mainProperty;
$this->secondaryProperty = $secondaryProperty;
}
示例11: __construct
/**
* @param int|float $lowerBoundary
* @param int|float $upperBoundary
* @param bool $onBoundary pass if value is same as a boundary value, or false; value must be within the boundaries values
*/
public function __construct($lowerBoundary, $upperBoundary, $onBoundary)
{
parent::__construct();
$this->lowerBoundary = $lowerBoundary;
$this->upperBoundary = $upperBoundary;
$this->onBoundary = $onBoundary;
}
示例12: __construct
/**
* Construct the class.
*
* @since 0.1.0
*
* @param string $table
* @param string $column
* @param string $prefix
*/
public function __construct($table, $column, $prefix)
{
parent::__construct();
$this->table = esc_sql($table);
$this->column = esc_sql($column);
$this->prefix = $prefix;
}
示例13: __construct
public function __construct(array $constraints, $autoConfigureGroups = true, $implicitGroupName = null)
{
parent::__construct();
$this->constraintTypes = array_filter($constraints, 'is_string');
$this->constraints = array_filter($constraints, 'is_object');
$this->autoConfigureGroups = $autoConfigureGroups;
$this->implicitGroupName = $implicitGroupName;
}
示例14: __construct
/**
* @param int $value
* @throws PHPUnit_Framework_Exception
*/
public function __construct($value)
{
if (!is_int($value)) {
throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'integer');
}
parent::__construct();
$this->value = $value;
}
示例15: __construct
/**
* @param string $expectedCommand The expected, executed command substring
*/
public function __construct($expectedCommand)
{
if (!is_string($expectedCommand)) {
throw new \InvalidArgumentException('Expected command should be a string, ' . gettype($expectedCommand) . ' given');
}
$this->expectedCommand = $expectedCommand;
parent::__construct();
}