Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' into markup
Browse files Browse the repository at this point in the history
Conflicts:
	library/Zend/Markup/Parser/Textile.php
	library/Zend/Markup/Renderer/AbstractRenderer.php
	library/Zend/Markup/Renderer/Html.php
  • Loading branch information
kokx committed Oct 30, 2010
2 parents 25fdbe6 + 1694b28 commit ba3a8b2
Show file tree
Hide file tree
Showing 49 changed files with 198 additions and 170 deletions.
1 change: 0 additions & 1 deletion src/DbAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @subpackage PHPUnit
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
Expand Down
1 change: 0 additions & 1 deletion src/DbStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @subpackage PHPUnit
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
Expand Down
5 changes: 5 additions & 0 deletions src/Exception.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php
namespace Zend\Test;

interface Exception
{}
13 changes: 6 additions & 7 deletions src/PHPUnit/Constraint/DomQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @subpackage PHPUnit
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
Expand All @@ -30,7 +29,7 @@
*
* @uses PHPUnit_Framework_Constraint
* @uses \Zend\Dom\Query
* @uses \Zend\Test\PHPUnit\Constraint\Exception
* @uses \Zend\Test\PHPUnit\Constraint\Exception\ConstraintException
* @category Zend
* @package Zend_Test
* @subpackage PHPUnit
Expand Down Expand Up @@ -153,7 +152,7 @@ public function evaluate($other, $assertType = null)
}

if (!in_array($assertType, $this->_assertTypes)) {
throw new Exception(sprintf('Invalid assertion type "%s" provided to %s constraint', $assertType, __CLASS__));
throw new Exception\ConstraintException(sprintf('Invalid assertion type "%s" provided to %s constraint', $assertType, __CLASS__));
}

$this->_assertType = $assertType;
Expand All @@ -168,15 +167,15 @@ public function evaluate($other, $assertType = null)
switch ($assertType) {
case self::ASSERT_CONTENT_CONTAINS:
if (3 > $argc) {
throw new Exception('No content provided against which to match');
throw new Exception\ConstraintException('No content provided against which to match');
}
$this->_content = $content = $argv[2];
return ($this->_negate)
? $this->_notMatchContent($result, $content)
: $this->_matchContent($result, $content);
case self::ASSERT_CONTENT_REGEX:
if (3 > $argc) {
throw new Exception('No pattern provided against which to match');
throw new Exception\ConstraintException('No pattern provided against which to match');
}
$this->_content = $content = $argv[2];
return ($this->_negate)
Expand All @@ -186,7 +185,7 @@ public function evaluate($other, $assertType = null)
case self::ASSERT_CONTENT_COUNT_MIN:
case self::ASSERT_CONTENT_COUNT_MAX:
if (3 > $argc) {
throw new Exception('No count provided against which to compare');
throw new Exception\ConstraintException('No count provided against which to compare');
}
$this->_content = $content = $argv[2];
return $this->_countContent($result, $content, $assertType);
Expand Down Expand Up @@ -256,7 +255,7 @@ public function fail($other, $description, $not = false)
$failure = $description . "\n" . $failure;
}

throw new Exception($failure);
throw new Exception\ConstraintException($failure);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/PHPUnit/Constraint/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @subpackage PHPUnit
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
Expand All @@ -35,6 +34,6 @@
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Exception extends \PHPUnit_Framework_ExpectationFailedException
interface Exception extends \Zend\Test\PHPUnit\Exception
{
}
42 changes: 42 additions & 0 deletions src/PHPUnit/Constraint/Exception/ConstraintException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Test
* @subpackage PHPUnit
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
* @namespace
*/
namespace Zend\Test\PHPUnit\Constraint\Exception;

/**
* Zend_Test_PHPUnit_Constraint_Exception
*
* @uses PHPUnit_Framework_ExpectationFailedException
* @category Zend
* @package Zend_Test
* @subpackage PHPUnit
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class ConstraintException
extends \PHPUnit_Framework_ExpectationFailedException
implements \Zend\Test\PHPUnit\Constraint\Exception
{
}
13 changes: 6 additions & 7 deletions src/PHPUnit/Constraint/Redirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @subpackage PHPUnit
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
Expand All @@ -29,7 +28,7 @@
* Redirection constraints
*
* @uses PHPUnit_Framework_Constraint
* @uses \Zend\Test\PHPUnit\Constraint\Exception
* @uses \Zend\Test\PHPUnit\Constraint\Exception\ConstraintException
* @category Zend
* @package Zend_Test
* @subpackage PHPUnit
Expand Down Expand Up @@ -104,7 +103,7 @@ public function setNegate($flag = true)
public function evaluate($other, $assertType = null)
{
if (!$other instanceof \Zend\Controller\Response\AbstractResponse) {
throw new Exception('Redirect constraint assertions require a response object');
throw new Exception\ConstraintException('Redirect constraint assertions require a response object');
}

if (strstr($assertType, 'Not')) {
Expand All @@ -113,7 +112,7 @@ public function evaluate($other, $assertType = null)
}

if (!in_array($assertType, $this->_assertTypes)) {
throw new Exception(sprintf('Invalid assertion type "%s" provided to %s constraint', $assertType, __CLASS__));
throw new Exception\ConstraintException(sprintf('Invalid assertion type "%s" provided to %s constraint', $assertType, __CLASS__));
}

$this->_assertType = $assertType;
Expand All @@ -125,15 +124,15 @@ public function evaluate($other, $assertType = null)
switch ($assertType) {
case self::ASSERT_REDIRECT_TO:
if (3 > $argc) {
throw new Exception('No redirect URL provided against which to match');
throw new Exception\ConstraintException('No redirect URL provided against which to match');
}
$this->_match = $match = $argv[2];
return ($this->_negate)
? $this->_notMatch($response, $match)
: $this->_match($response, $match);
case self::ASSERT_REDIRECT_REGEX:
if (3 > $argc) {
throw new Exception('No pattern provided against which to match redirect');
throw new Exception\ConstraintException('No pattern provided against which to match redirect');
}
$this->_match = $match = $argv[2];
return ($this->_negate)
Expand Down Expand Up @@ -185,7 +184,7 @@ public function fail($other, $description, $not = false)
$failure = $description . "\n" . $failure;
}

throw new Exception($failure);
throw new Exception\ConstraintException($failure);
}

/**
Expand Down
21 changes: 10 additions & 11 deletions src/PHPUnit/Constraint/ResponseHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @subpackage PHPUnit
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
Expand All @@ -30,7 +29,7 @@
* Response header PHPUnit Constraint
*
* @uses PHPUnit_Framework_Constraint
* @uses \Zend\Test\PHPUnit\Constraint\Exception
* @uses \Zend\Test\PHPUnit\Constraint\Exception\ConstraintException
* @category Zend
* @package Zend_Test
* @subpackage PHPUnit
Expand Down Expand Up @@ -116,7 +115,7 @@ public function setNegate($flag = true)
public function evaluate($other, $assertType = null)
{
if (!$other instanceof Response\AbstractResponse) {
throw new Exception('Header constraint assertions require a response object');
throw new Exception\ConstraintException('Header constraint assertions require a response object');
}

if (strstr($assertType, 'Not')) {
Expand All @@ -125,7 +124,7 @@ public function evaluate($other, $assertType = null)
}

if (!in_array($assertType, $this->_assertTypes)) {
throw new Exception(sprintf('Invalid assertion type "%s" provided to %s constraint', $assertType, __CLASS__));
throw new Exception\ConstraintException(sprintf('Invalid assertion type "%s" provided to %s constraint', $assertType, __CLASS__));
}

$this->_assertType = $assertType;
Expand All @@ -137,23 +136,23 @@ public function evaluate($other, $assertType = null)
switch ($assertType) {
case self::ASSERT_RESPONSE_CODE:
if (3 > $argc) {
throw new Exception('No response code provided against which to match');
throw new Exception\ConstraintException('No response code provided against which to match');
}
$this->_code = $code = $argv[2];
return ($this->_negate)
? $this->_notCode($response, $code)
: $this->_code($response, $code);
case self::ASSERT_HEADER:
if (3 > $argc) {
throw new Exception('No header provided against which to match');
throw new Exception\ConstraintException('No header provided against which to match');
}
$this->_header = $header = $argv[2];
return ($this->_negate)
? $this->_notHeader($response, $header)
: $this->_header($response, $header);
case self::ASSERT_HEADER_CONTAINS:
if (4 > $argc) {
throw new Exception('Both a header name and content to match are required for ' . __FUNCTION__);
throw new Exception\ConstraintException('Both a header name and content to match are required for ' . __FUNCTION__);
}
$this->_header = $header = $argv[2];
$this->_match = $match = $argv[3];
Expand All @@ -162,15 +161,15 @@ public function evaluate($other, $assertType = null)
: $this->_headerContains($response, $header, $match);
case self::ASSERT_HEADER_REGEX:
if (4 > $argc) {
throw new Exception('Both a header name and content to match are required for ' . __FUNCTION__);
throw new Exception\ConstraintException('Both a header name and content to match are required for ' . __FUNCTION__);
}
$this->_header = $header = $argv[2];
$this->_match = $match = $argv[3];
return ($this->_negate)
? $this->_notHeaderRegex($response, $header, $match)
: $this->_headerRegex($response, $header, $match);
default:
throw new Exception('Invalid assertion type ' . __FUNCTION__);
throw new Exception\ConstraintException('Invalid assertion type ' . __FUNCTION__);
}
}

Expand Down Expand Up @@ -216,14 +215,14 @@ public function fail($other, $description, $not = false)
$failure = sprintf($failure, $this->_header, $this->_match);
break;
default:
throw new Exception('Invalid assertion type ' . __FUNCTION__);
throw new Exception\ConstraintException('Invalid assertion type ' . __FUNCTION__);
}

if (!empty($description)) {
$failure = $description . "\n" . $failure;
}

throw new Exception($failure);
throw new Exception\ConstraintException($failure);
}

/**
Expand Down
Loading

0 comments on commit ba3a8b2

Please sign in to comment.