Пример #1
0
 /**
  * Response header assertion
  *
  * @param string $headerName
  * @param string $type
  * @param PHPUnit_Framework_Constraint $constraint
  * @throws PHPUnit_Framework_Exception
  */
 public function __construct($headerName, $type, PHPUnit_Framework_Constraint $constraint = null)
 {
     if (empty($headerName) || !is_string($headerName)) {
         throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string', $headerName);
     }
     $this->_expectedValueValidation += array(self::TYPE_CONSTRAINT => array(true, null, 'PHPUnit_Framework_Constraint'));
     parent::__construct($type, $constraint);
     $this->_headerName = $headerName;
 }
Пример #2
0
 /**
  * Constraint for controller response body assertions
  *
  * @param PHPUnit_Framework_Constraint $constraint
  * @param string $type
  */
 public function __construct(PHPUnit_Framework_Constraint $constraint = null, $type = self::TYPE_CONSTRAINT)
 {
     $this->_expectedValueValidation += array(self::TYPE_CONSTRAINT => array(true, null, 'PHPUnit_Framework_Constraint'));
     parent::__construct($type, $constraint);
 }