diff --git a/src/ArrayStack.php b/src/ArrayStack.php index bfa0433bd..d76cbc366 100644 --- a/src/ArrayStack.php +++ b/src/ArrayStack.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -31,7 +31,7 @@ * * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class ArrayStack extends ArrayObject diff --git a/src/CallbackHandler.php b/src/CallbackHandler.php index a42863973..19f09b937 100644 --- a/src/CallbackHandler.php +++ b/src/CallbackHandler.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -35,7 +35,7 @@ * * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class CallbackHandler diff --git a/src/ErrorHandler.php b/src/ErrorHandler.php new file mode 100644 index 000000000..ad56b6919 --- /dev/null +++ b/src/ErrorHandler.php @@ -0,0 +1,119 @@ +processArray($config); + $this->processArray($options); } /** diff --git a/src/ParameterObject.php b/src/ParameterObject.php index 55bb2d691..80399282e 100644 --- a/src/ParameterObject.php +++ b/src/ParameterObject.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface ParameterObject diff --git a/src/PriorityQueue.php b/src/PriorityQueue.php index 390a3d2d9..6f063419b 100644 --- a/src/PriorityQueue.php +++ b/src/PriorityQueue.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -41,7 +41,7 @@ * * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class PriorityQueue implements Countable, IteratorAggregate, Serializable diff --git a/src/SplPriorityQueue.php b/src/SplPriorityQueue.php index d15d81caa..5752283de 100644 --- a/src/SplPriorityQueue.php +++ b/src/SplPriorityQueue.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -33,7 +33,7 @@ * * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class SplPriorityQueue extends \SplPriorityQueue implements Serializable diff --git a/src/SplQueue.php b/src/SplQueue.php index 031ba917e..9b8d5118a 100644 --- a/src/SplQueue.php +++ b/src/SplQueue.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class SplQueue extends \SplQueue implements Serializable diff --git a/src/SplStack.php b/src/SplStack.php index a908997ba..01aa0a0c3 100644 --- a/src/SplStack.php +++ b/src/SplStack.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class SplStack extends \SplStack implements Serializable diff --git a/test/CallbackHandlerTest.php b/test/CallbackHandlerTest.php index 826c72de8..32a815eae 100644 --- a/test/CallbackHandlerTest.php +++ b/test/CallbackHandlerTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Stdlib * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id:$ */ @@ -29,7 +29,7 @@ * @package Zend_Stdlib * @subpackage UnitTests * @group Zend_Stdlib - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class CallbackHandlerTest extends \PHPUnit_Framework_TestCase diff --git a/test/ErrorHandlerTest.php b/test/ErrorHandlerTest.php new file mode 100644 index 000000000..0c53059bd --- /dev/null +++ b/test/ErrorHandlerTest.php @@ -0,0 +1,82 @@ +assertFalse(ErrorHandler::started()); + + ErrorHandler::start(); + $this->assertTrue(ErrorHandler::started()); + + ErrorHandler::stop(); + $this->assertFalse(ErrorHandler::started()); + } + + public function testStartThrowsLogicException() + { + ErrorHandler::start(); + + $this->setExpectedException('Zend\Stdlib\Exception\LogicException'); + ErrorHandler::start(); + } + + public function testStopThrowsLogicException() + { + $this->setExpectedException('Zend\Stdlib\Exception\LogicException'); + ErrorHandler::stop(); + } + + public function testReturnCatchedError() + { + ErrorHandler::start(); + strpos(); // Invalid argument list + $err = ErrorHandler::stop(); + + $this->assertInstanceOf('ErrorException', $err); + } + + public function testThrowCatchedError() + { + ErrorHandler::start(); + strpos(); // Invalid argument list + + $this->setExpectedException('ErrorException'); + ErrorHandler::stop(true); + } + + public function testAddErrors() + { + ErrorHandler::start(); + ErrorHandler::addError(1, 'test-msg1', 'test-file1', 100); + ErrorHandler::addError(2, 'test-msg2', 'test-file2', 200); + $err = ErrorHandler::stop(); + + $this->assertInstanceOf('ErrorException', $err); + $this->assertEquals('test-file2', $err->getFile()); + $this->assertEquals('test-msg2', $err->getMessage()); + $this->assertEquals(200, $err->getLine()); + $this->assertEquals(0, $err->getCode()); + $this->assertEquals(2, $err->getSeverity()); + + $previous = $err->getPrevious(); + $this->assertInstanceOf('ErrorException', $previous); + $this->assertEquals('test-file1', $previous->getFile()); + $this->assertEquals('test-msg1', $previous->getMessage()); + $this->assertEquals(100, $previous->getLine()); + $this->assertEquals(0, $previous->getCode()); + $this->assertEquals(1, $previous->getSeverity()); + } +} diff --git a/test/PriorityQueueTest.php b/test/PriorityQueueTest.php index ecb56d1ce..3986ca4ff 100644 --- a/test/PriorityQueueTest.php +++ b/test/PriorityQueueTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Stdlib * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @package Zend_Stdlib * @subpackage UnitTests * @group Zend_Stdlib - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class PriorityQueueTest extends \PHPUnit_Framework_TestCase diff --git a/test/SplPriorityQueueTest.php b/test/SplPriorityQueueTest.php index 6c8182a84..fe8a987ff 100644 --- a/test/SplPriorityQueueTest.php +++ b/test/SplPriorityQueueTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Stdlib * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id:$ */ @@ -29,7 +29,7 @@ * @package Zend_Stdlib * @subpackage UnitTests * @group Zend_Stdlib - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class SplPriorityQueueTest extends \PHPUnit_Framework_TestCase diff --git a/test/SplQueueTest.php b/test/SplQueueTest.php index f54b373e4..7412a68e0 100644 --- a/test/SplQueueTest.php +++ b/test/SplQueueTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Stdlib * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id:$ */ @@ -29,7 +29,7 @@ * @package Zend_Stdlib * @subpackage UnitTests * @group Zend_Stdlib - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class SplQueueTest extends \PHPUnit_Framework_TestCase diff --git a/test/SplStackTest.php b/test/SplStackTest.php index 423324142..3fbb6a842 100644 --- a/test/SplStackTest.php +++ b/test/SplStackTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Stdlib * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id:$ */ @@ -29,7 +29,7 @@ * @package Zend_Stdlib * @subpackage UnitTests * @group Zend_Stdlib - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class SplStackTest extends \PHPUnit_Framework_TestCase