Commit 03c6d241 authored by Ylan Fleurant's avatar Ylan Fleurant
Browse files

compat php 7.3

parent cc6814d7
......@@ -127,8 +127,8 @@ class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit\Framework\Constraint
}
if (!in_array($assertType, $this->_assertTypes)) {
require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new Zend_Test_PHPUnit_Constraint_Exception(sprintf('Invalid assertion type "%s" provided to %s constraint', $assertType, __CLASS__));
// require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new PHPUnit\Framework\ExpectationFailedException(sprintf('Invalid assertion type "%s" provided to %s constraint', $assertType, __CLASS__));
}
$this->_assertType = $assertType;
......@@ -142,8 +142,8 @@ class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit\Framework\Constraint
switch ($assertType) {
case self::ASSERT_CONTENT_CONTAINS:
if (3 > $argc) {
require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new Zend_Test_PHPUnit_Constraint_Exception('No content provided against which to match');
// require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new PHPUnit\Framework\ExpectationFailedException('No content provided against which to match');
}
$this->_content = $content = $argv[2];
return ($this->_negate)
......@@ -151,8 +151,8 @@ class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit\Framework\Constraint
: $this->_matchContent($result, $content);
case self::ASSERT_CONTENT_REGEX:
if (3 > $argc) {
require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new Zend_Test_PHPUnit_Constraint_Exception('No pattern provided against which to match');
// require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new PHPUnit\Framework\ExpectationFailedException('No pattern provided against which to match');
}
$this->_content = $content = $argv[2];
return ($this->_negate)
......@@ -162,8 +162,8 @@ class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit\Framework\Constraint
case self::ASSERT_CONTENT_COUNT_MIN:
case self::ASSERT_CONTENT_COUNT_MAX:
if (3 > $argc) {
require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new Zend_Test_PHPUnit_Constraint_Exception('No count provided against which to compare');
// require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new PHPUnit\Framework\ExpectationFailedException('No count provided against which to compare');
}
$this->_content = $content = $argv[2];
return $this->_countContent($result, $content, $assertType);
......@@ -192,7 +192,7 @@ class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit\Framework\Constraint
$not = $comparisonFailure;
//public function fail($other, $description, $not = false)
require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
// require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
switch ($this->_assertType) {
case self::ASSERT_CONTENT_CONTAINS:
$failure = 'Failed asserting node denoted by %s CONTAINS content "%s"';
......@@ -237,7 +237,7 @@ class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit\Framework\Constraint
$failure = $description . "\n" . $failure;
}
throw new Zend_Test_PHPUnit_Constraint_Exception($failure);
throw new PHPUnit\Framework\ExpectationFailedException($failure);
}
/**
......
......@@ -82,8 +82,8 @@ class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit\Framework\Constraint
$assertType = $description;
if (!$other instanceof Zend_Controller_Response_Abstract) {
require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new Zend_Test_PHPUnit_Constraint_Exception('Redirect constraint assertions require a response object');
// require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new PHPUnit\Framework\ExpectationFailedException('Redirect constraint assertions require a response object');
}
if (strstr($assertType, 'Not')) {
......@@ -92,8 +92,8 @@ class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit\Framework\Constraint
}
if (!in_array($assertType, $this->_assertTypes)) {
require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new Zend_Test_PHPUnit_Constraint_Exception(sprintf('Invalid assertion type "%s" provided to %s constraint', $assertType, __CLASS__));
// require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new PHPUnit\Framework\ExpectationFailedException(sprintf('Invalid assertion type "%s" provided to %s constraint', $assertType, __CLASS__));
}
$this->_assertType = $assertType;
......@@ -105,8 +105,8 @@ class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit\Framework\Constraint
switch ($assertType) {
case self::ASSERT_REDIRECT_TO:
if (3 > $argc) {
require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new Zend_Test_PHPUnit_Constraint_Exception('No redirect URL provided against which to match');
// require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new PHPUnit\Framework\ExpectationFailedException('No redirect URL provided against which to match');
}
$this->_match = $match = $argv[2];
return ($this->_negate)
......@@ -114,8 +114,8 @@ class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit\Framework\Constraint
: $this->_match($response, $match);
case self::ASSERT_REDIRECT_REGEX:
if (3 > $argc) {
require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new Zend_Test_PHPUnit_Constraint_Exception('No pattern provided against which to match redirect');
// require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new PHPUnit\Framework\ExpectationFailedException('No pattern provided against which to match redirect');
}
$this->_match = $match = $argv[2];
return ($this->_negate)
......@@ -142,7 +142,7 @@ class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit\Framework\Constraint
//public function fail($other, $description, $not = false)
$not = $comparisonFailure;
require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
// require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
switch ($this->_assertType) {
case self::ASSERT_REDIRECT_TO:
$failure = 'Failed asserting response redirects to "%s"';
......@@ -171,7 +171,7 @@ class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit\Framework\Constraint
$failure = $description . "\n" . $failure;
}
throw new Zend_Test_PHPUnit_Constraint_Exception($failure);
throw new PHPUnit\Framework\ExpectationFailedException($failure);
}
/**
......
......@@ -92,8 +92,8 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit\Framework\Cons
$assertType = $description;
//public function evaluate($other, $assertType = null)
if (!$other instanceof Zend_Controller_Response_Abstract) {
require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new Zend_Test_PHPUnit_Constraint_Exception('Header constraint assertions require a response object');
// require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new PHPUnit\Framework\ExpectationFailedException('Header constraint assertions require a response object');
}
if (strstr($assertType, 'Not')) {
......@@ -102,8 +102,8 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit\Framework\Cons
}
if (!in_array($assertType, $this->_assertTypes)) {
require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new Zend_Test_PHPUnit_Constraint_Exception(sprintf('Invalid assertion type "%s" provided to %s constraint', $assertType, __CLASS__));
// require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new PHPUnit\Framework\ExpectationFailedException(sprintf('Invalid assertion type "%s" provided to %s constraint', $assertType, __CLASS__));
}
$this->_assertType = $assertType;
......@@ -115,8 +115,8 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit\Framework\Cons
switch ($assertType) {
case self::ASSERT_RESPONSE_CODE:
if (3 > $argc) {
require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new Zend_Test_PHPUnit_Constraint_Exception('No response code provided against which to match');
// require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new PHPUnit\Framework\ExpectationFailedException('No response code provided against which to match');
}
$this->_code = $code = $argv[2];
return ($this->_negate)
......@@ -124,8 +124,8 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit\Framework\Cons
: $this->_code($response, $code);
case self::ASSERT_HEADER:
if (3 > $argc) {
require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new Zend_Test_PHPUnit_Constraint_Exception('No header provided against which to match');
// require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new PHPUnit\Framework\ExpectationFailedException('No header provided against which to match');
}
$this->_header = $header = $argv[2];
return ($this->_negate)
......@@ -133,8 +133,8 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit\Framework\Cons
: $this->_header($response, $header);
case self::ASSERT_HEADER_CONTAINS:
if (4 > $argc) {
require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new Zend_Test_PHPUnit_Constraint_Exception('Both a header name and content to match are required for ' . __FUNCTION__);
// require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new PHPUnit\Framework\ExpectationFailedException('Both a header name and content to match are required for ' . __FUNCTION__);
}
$this->_header = $header = $argv[2];
$this->_match = $match = $argv[3];
......@@ -143,8 +143,8 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit\Framework\Cons
: $this->_headerContains($response, $header, $match);
case self::ASSERT_HEADER_REGEX:
if (4 > $argc) {
require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new Zend_Test_PHPUnit_Constraint_Exception('Both a header name and content to match are required for ' . __FUNCTION__);
// require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new PHPUnit\Framework\ExpectationFailedException('Both a header name and content to match are required for ' . __FUNCTION__);
}
$this->_header = $header = $argv[2];
$this->_match = $match = $argv[3];
......@@ -152,8 +152,8 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit\Framework\Cons
? $this->_notHeaderRegex($response, $header, $match)
: $this->_headerRegex($response, $header, $match);
default:
require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new Zend_Test_PHPUnit_Constraint_Exception('Invalid assertion type ' . __FUNCTION__);
// require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
throw new PHPUnit\Framework\ExpectationFailedException('Invalid assertion type ' . __FUNCTION__);
}
}
......@@ -171,7 +171,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit\Framework\Cons
{
$not = $comparisonFailure;
//public function fail($other, $description, $not = false)
require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
// require_once 'Zend/Test/PHPUnit/Constraint/Exception.php';
switch ($this->_assertType) {
case self::ASSERT_RESPONSE_CODE:
$failure = 'Failed asserting response code "%s"';
......@@ -202,14 +202,14 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit\Framework\Cons
$failure = sprintf($failure, $this->_header, $this->_match);
break;
default:
throw new Zend_Test_PHPUnit_Constraint_Exception('Invalid assertion type ' . __FUNCTION__);
throw new PHPUnit\Framework\ExpectationFailedException('Invalid assertion type ' . __FUNCTION__);
}
if (!empty($description)) {
$failure = $description . "\n" . $failure;
}
throw new Zend_Test_PHPUnit_Constraint_Exception($failure);
throw new PHPUnit\Framework\ExpectationFailedException($failure);
}
/**
......
......@@ -104,7 +104,7 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends TestCase
*
* @return void
*/
protected function setUp()
protected function setUp():void
{
$this->bootstrap();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment