diff --git a/.travis/run-tests.sh b/.travis/run-tests.sh new file mode 100755 index 0000000..11d98cd --- /dev/null +++ b/.travis/run-tests.sh @@ -0,0 +1,14 @@ +#!/bin/bash +travisdir=$(dirname $(readlink /proc/$$/fd/255)) +testdir="$travisdir/../tests" +testedcomponents=(`cat "$travisdir/tested-components"`) +result=0 + +for tested in "${testedcomponents[@]}" + do + echo "$tested:" + phpunit -c $testdir/phpunit.xml $testdir/$tested + let "result = $result || $?" +done + +exit $result \ No newline at end of file diff --git a/.travis/skipped-components b/.travis/skipped-components new file mode 100644 index 0000000..6847359 --- /dev/null +++ b/.travis/skipped-components @@ -0,0 +1,9 @@ +Zend/Amf +Zend/Barcode +Zend/Date +Zend/Feed +Zend/Queue +Zend/Service +Zend/Test +Zend/Translator +Zend/Wildfire diff --git a/.travis/tested-components b/.travis/tested-components new file mode 100644 index 0000000..330e5f1 --- /dev/null +++ b/.travis/tested-components @@ -0,0 +1,58 @@ +Zend/Acl +Zend/Authentication +Zend/Cache +Zend/Captcha +Zend/Cloud +Zend/Code +Zend/Config +Zend/Console +Zend/Crypt +Zend/Currency +Zend/Db +Zend/Di +Zend/Docbook +Zend/Dojo +Zend/Dom +Zend/EventManager +Zend/Feed/Reader +Zend/Feed/Writer +Zend/File +Zend/Filter +Zend/Form +Zend/GData +Zend/Http +Zend/InfoCard +Zend/Json +Zend/Ldap +Zend/Loader +Zend/Locale +Zend/Log +Zend/Mail +Zend/Markup +Zend/Measure +Zend/Memory +Zend/Mime +Zend/Module +Zend/Mvc +Zend/Navigation +Zend/OAuth +Zend/OpenId +Zend/Paginator +Zend/Pdf +Zend/ProgressBar +Zend/RegistryTest.php +Zend/Rest +Zend/Search +Zend/Serializer +Zend/Server +Zend/Session +Zend/Soap +Zend/Stdlib +Zend/Tag +Zend/Text +Zend/TimeSync +Zend/Uri +Zend/Validator +Zend/VersionTest.php +Zend/View +Zend/XmlRpc diff --git a/src/Client.php b/src/Client.php index dc95e31..4985ca2 100644 --- a/src/Client.php +++ b/src/Client.php @@ -275,7 +275,7 @@ public function call($method, $params=array()) $success = true; try { $signatures = $this->getIntrospector()->getMethodSignature($method); - } catch (\Zend\XmlRpc\Exception $e) { + } catch (\Zend\XmlRpc\Exception\ExceptionInterface $e) { $success = false; } if ($success) { diff --git a/src/Client/Exception.php b/src/Client/Exception/ExceptionInterface.php similarity index 85% rename from src/Client/Exception.php rename to src/Client/Exception/ExceptionInterface.php index ea98ce2..2e87e74 100644 --- a/src/Client/Exception.php +++ b/src/Client/Exception/ExceptionInterface.php @@ -19,17 +19,17 @@ * @license http://framework.zend.com/license/new-bsd New BSD License */ -namespace Zend\XmlRpc\Client; +namespace Zend\XmlRpc\Client\Exception; /** * Base class for all Zend_XmlRpc_Client_* exceptions * - * @uses Zend\XmlRpc\Exception + * @uses Zend\XmlRpc\Exception\ExceptionInterface * @category Zend * @package Zend_XmlRpc * @subpackage Client * @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 Exception extends \Zend\XmlRpc\Exception +interface ExceptionInterface extends \Zend\XmlRpc\Exception\ExceptionInterface {} diff --git a/src/Client/Exception/FaultException.php b/src/Client/Exception/FaultException.php index e84bc9f..c69fe7e 100644 --- a/src/Client/Exception/FaultException.php +++ b/src/Client/Exception/FaultException.php @@ -33,5 +33,5 @@ */ class FaultException extends \BadMethodCallException - implements \Zend\XmlRpc\Client\Exception + implements \Zend\XmlRpc\Client\Exception\ExceptionInterface {} diff --git a/src/Client/Exception/IntrospectException.php b/src/Client/Exception/IntrospectException.php index 0383f3a..a9c922c 100644 --- a/src/Client/Exception/IntrospectException.php +++ b/src/Client/Exception/IntrospectException.php @@ -33,5 +33,5 @@ */ class IntrospectException extends \InvalidArgumentException - implements \Zend\XmlRpc\Client\Exception + implements \Zend\XmlRpc\Client\Exception\ExceptionInterface {} diff --git a/src/Client/Exception/InvalidArgumentException.php b/src/Client/Exception/InvalidArgumentException.php index 02e0c42..012a3c2 100644 --- a/src/Client/Exception/InvalidArgumentException.php +++ b/src/Client/Exception/InvalidArgumentException.php @@ -4,5 +4,5 @@ class InvalidArgumentException extends \InvalidArgumentException - implements \Zend\XmlRpc\Exception + implements \Zend\XmlRpc\Exception\ExceptionInterface {} diff --git a/src/Client/Exception/RuntimeException.php b/src/Client/Exception/RuntimeException.php index 9496b4e..e92e1f4 100644 --- a/src/Client/Exception/RuntimeException.php +++ b/src/Client/Exception/RuntimeException.php @@ -4,6 +4,6 @@ class RuntimeException extends \RuntimeException - implements \Zend\XmlRpc\Client\Exception + implements \Zend\XmlRpc\Client\Exception\ExceptionInterface {} \ No newline at end of file diff --git a/src/Exception.php b/src/Exception/ExceptionInterface.php similarity index 93% rename from src/Exception.php rename to src/Exception/ExceptionInterface.php index 166a05a..d7ace8a 100644 --- a/src/Exception.php +++ b/src/Exception/ExceptionInterface.php @@ -18,7 +18,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License */ -namespace Zend\XmlRpc; +namespace Zend\XmlRpc\Exception; /** * @category Zend @@ -26,5 +26,5 @@ * @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 Exception +interface ExceptionInterface {} diff --git a/src/Exception/InvalidArgumentException.php b/src/Exception/InvalidArgumentException.php index 4ce724f..f015aff 100644 --- a/src/Exception/InvalidArgumentException.php +++ b/src/Exception/InvalidArgumentException.php @@ -4,6 +4,6 @@ class InvalidArgumentException extends \InvalidArgumentException - implements \Zend\XmlRpc\Exception + implements \Zend\XmlRpc\Exception\ExceptionInterface {} \ No newline at end of file diff --git a/src/Exception/RuntimeException.php b/src/Exception/RuntimeException.php index 8ab9f8a..777ed0d 100644 --- a/src/Exception/RuntimeException.php +++ b/src/Exception/RuntimeException.php @@ -4,6 +4,6 @@ class RuntimeException extends \RuntimeException - implements \Zend\XmlRpc\Exception + implements \Zend\XmlRpc\Exception\ExceptionInterface {} \ No newline at end of file diff --git a/src/Exception/ValueException.php b/src/Exception/ValueException.php index 4e712b4..b6c92e8 100644 --- a/src/Exception/ValueException.php +++ b/src/Exception/ValueException.php @@ -22,7 +22,7 @@ namespace Zend\XmlRpc\Exception; /** - * @uses \Zend\XmlRpc\Exception + * @uses Zend\XmlRpc\Exception\ExceptionInterface * @category Zend * @package Zend_XmlRpc * @subpackage Value @@ -31,6 +31,6 @@ */ class ValueException extends \LogicException - implements \Zend\XmlRpc\Exception + implements \Zend\XmlRpc\Exception\ExceptionInterface {} diff --git a/src/Fault.php b/src/Fault.php index 8496103..75d8e12 100644 --- a/src/Fault.php +++ b/src/Fault.php @@ -31,7 +31,7 @@ * to instantiate a Zend_XmlRpc_Server_Fault. * * @uses SimpleXMLElement - * @uses Zend\XmlRpc\Exception + * @uses Zend\XmlRpc\Exception\ExceptionInterface * @uses Zend\XmlRpc\Value\Value * @category Zend * @package Zend_XmlRpc @@ -118,7 +118,7 @@ public function __construct($code = 404, $message = '') * Set the fault code * * @param int $code - * @return Zend\XmlRpc\Fault + * @return Fault */ public function setCode($code) { @@ -140,7 +140,7 @@ public function getCode() * Retrieve fault message * * @param string - * @return Zend\XmlRpc\Fault + * @return Fault */ public function setMessage($message) { @@ -162,7 +162,7 @@ public function getMessage() * Set encoding to use in fault response * * @param string $encoding - * @return Zend\XmlRpc\Fault + * @return Fault */ public function setEncoding($encoding) { @@ -187,7 +187,7 @@ public function getEncoding() * @param string $fault * @return boolean Returns true if successfully loaded fault response, false * if response was not a fault response - * @throws Zend\XmlRpc\Exception if no or faulty XML provided, or if fault + * @throws \Zend\XmlRpc\Exception\ExceptionInterface if no or faulty XML provided, or if fault * response does not contain either code or message */ public function loadXml($fault) @@ -258,7 +258,7 @@ public static function isFault($xml) $fault = new self(); try { $isFault = $fault->loadXml($xml); - } catch (Exception $e) { + } catch (Exception\ExceptionInterface $e) { $isFault = false; } diff --git a/src/Generator/AbstractGenerator.php b/src/Generator/AbstractGenerator.php index f3f361a..d932f79 100644 --- a/src/Generator/AbstractGenerator.php +++ b/src/Generator/AbstractGenerator.php @@ -21,14 +21,12 @@ namespace Zend\XmlRpc\Generator; -use Zend\XmlRpc\Generator as GeneratorAdapter; - /** * Abstract XML generator adapter * - * @uses Zend\XmlRpc\Generator + * @uses Zend\XmlRpc\Generator\GeneratorInterface */ -abstract class AbstractGenerator implements GeneratorAdapter +abstract class AbstractGenerator implements GeneratorInterface { /** * XML encoding string @@ -62,7 +60,7 @@ abstract protected function _init(); * * @param string $name XML tag name * @param string $value Optional value of the XML tag - * @return Zend_XmlRpc_Generator_Abstract Fluent interface + * @return AbstractGenerator Fluent interface */ public function openElement($name, $value = null) { @@ -80,7 +78,7 @@ public function openElement($name, $value = null) * Method marks the end of an XML element * * @param string $name XML tag name - * @return Zend_XmlRpc_Generator_Abstract Fluent interface + * @return AbstractGenerator Fluent interface */ public function closeElement($name) { @@ -103,7 +101,7 @@ public function getEncoding() * Set XML encoding * * @param string $encoding - * @return Zend\XmlRpc\Generator\AbstractGenerator + * @return AbstractGenerator */ public function setEncoding($encoding) { diff --git a/src/Generator.php b/src/Generator/GeneratorInterface.php similarity index 94% rename from src/Generator.php rename to src/Generator/GeneratorInterface.php index 5e3c146..67f50df 100644 --- a/src/Generator.php +++ b/src/Generator/GeneratorInterface.php @@ -18,12 +18,12 @@ * @license http://framework.zend.com/license/new-bsd New BSD License */ -namespace Zend\XmlRpc; +namespace Zend\XmlRpc\Generator; /** * XML generator adapter interface */ -interface Generator +interface GeneratorInterface { public function getEncoding(); public function setEncoding($encoding); diff --git a/src/Generator/XmlWriter.php b/src/Generator/XmlWriter.php index ec31abb..4775159 100644 --- a/src/Generator/XmlWriter.php +++ b/src/Generator/XmlWriter.php @@ -78,7 +78,7 @@ protected function _writeTextData($text) * Close an previously opened XML element * * @param string $name - * @return void + * @return XmlWriter */ protected function _closeElement($name) { diff --git a/src/Server/Exception/BadMethodCallException.php b/src/Server/Exception/BadMethodCallException.php index 7454771..44c8aed 100644 --- a/src/Server/Exception/BadMethodCallException.php +++ b/src/Server/Exception/BadMethodCallException.php @@ -4,5 +4,5 @@ class BadMethodCallException extends \BadMethodCallException - implements \Zend\XmlRpc\Server\Exception + implements \Zend\XmlRpc\Server\Exception\ExceptionInterface {} diff --git a/src/Server/Exception.php b/src/Server/Exception/ExceptionInterface.php similarity index 84% rename from src/Server/Exception.php rename to src/Server/Exception/ExceptionInterface.php index 115b015..46ec71f 100644 --- a/src/Server/Exception.php +++ b/src/Server/Exception/ExceptionInterface.php @@ -19,19 +19,19 @@ * @license http://framework.zend.com/license/new-bsd New BSD License */ -namespace Zend\XmlRpc\Server; +namespace Zend\XmlRpc\Server\Exception; /** * Zend_XmlRpc_Server_Exception * - * @uses \Zend\XmlRpc\Exception + * @uses Zend\XmlRpc\Exception\ExceptionInterface * @category Zend * @package Zend_XmlRpc * @subpackage Server * @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 Exception extends \Zend\XmlRpc\Exception +interface ExceptionInterface extends \Zend\XmlRpc\Exception\ExceptionInterface { } diff --git a/src/Server/Exception/InvalidArgumentException.php b/src/Server/Exception/InvalidArgumentException.php index 017eb6a..2d2567a 100644 --- a/src/Server/Exception/InvalidArgumentException.php +++ b/src/Server/Exception/InvalidArgumentException.php @@ -4,5 +4,5 @@ class InvalidArgumentException extends \InvalidArgumentException - implements \Zend\XmlRpc\Server\Exception + implements \Zend\XmlRpc\Server\Exception\ExceptionInterface {} diff --git a/src/Server/Exception/RuntimeException.php b/src/Server/Exception/RuntimeException.php index aad9fd7..650a098 100644 --- a/src/Server/Exception/RuntimeException.php +++ b/src/Server/Exception/RuntimeException.php @@ -4,5 +4,5 @@ class RuntimeException extends \RuntimeException - implements \Zend\XmlRpc\Server\Exception + implements \Zend\XmlRpc\Server\Exception\ExceptionInterface {} diff --git a/src/Server/Fault.php b/src/Server/Fault.php index 2e72ac5..579ba37 100644 --- a/src/Server/Fault.php +++ b/src/Server/Fault.php @@ -46,14 +46,14 @@ class Fault extends \Zend\XmlRpc\Fault { /** - * @var Exception + * @var \Exception */ protected $_exception; /** * @var array Array of exception classes that may define xmlrpc faults */ - protected static $_faultExceptionClasses = array('Zend\\XmlRpc\\Server\\Exception' => true); + protected static $_faultExceptionClasses = array('Zend\\XmlRpc\\Server\\Exception\\ExceptionInterface' => true); /** * @var array Array of fault observers @@ -63,8 +63,8 @@ class Fault extends \Zend\XmlRpc\Fault /** * Constructor * - * @param Exception $e - * @return Zend\XmlRpc\Server\Fault + * @param \Exception $e + * @return Fault */ public function __construct(\Exception $e) { @@ -94,8 +94,8 @@ public function __construct(\Exception $e) /** * Return Zend\XmlRpc\Server\Fault instance * - * @param Exception $e - * @return Zend\XmlRpc\Server\Fault + * @param \Exception $e + * @return Fault */ public static function getInstance(\Exception $e) { diff --git a/src/Value.php b/src/Value.php index 3f503f3..1981c21 100644 --- a/src/Value.php +++ b/src/Value.php @@ -114,7 +114,7 @@ public function getType() /** * Get XML generator instance * - * @return Zend\XmlRpc\Generator + * @return \Zend\XmlRpc\Generator\GeneratorInterface */ public static function getGenerator() { @@ -132,10 +132,10 @@ public static function getGenerator() /** * Sets XML generator instance * - * @param null|Generator $generator + * @param null|Generator\GeneratorInterface $generator * @return void */ - public static function setGenerator(Generator $generator = null) + public static function setGenerator(Generator\GeneratorInterface $generator = null) { self::$_generator = $generator; } diff --git a/src/Value/DateTime.php b/src/Value/DateTime.php index ad91c8d..3e756c6 100644 --- a/src/Value/DateTime.php +++ b/src/Value/DateTime.php @@ -23,7 +23,7 @@ use Zend\XmlRpc\Exception; /** - * @uses Zend\XmlRpc\Value\Exception + * @uses Zend\XmlRpc\Value\Exception\ExceptionInterface * @uses Zend\XmlRpc\Value\Scalar * @category Zend * @package Zend_XmlRpc diff --git a/src/Value/Integer.php b/src/Value/Integer.php index 09483d1..1b9fd86 100644 --- a/src/Value/Integer.php +++ b/src/Value/Integer.php @@ -23,7 +23,7 @@ use Zend\XmlRpc\Exception; /** - * @uses \Zend\XmlRpc\Value\Exception + * @uses \Zend\XmlRpc\Value\Exception\ExceptionInterface * @uses \Zend\XmlRpc\Value\Scalar * @category Zend * @package Zend_XmlRpc diff --git a/test/FaultTest.php b/test/FaultTest.php index 51be57d..43526f4 100644 --- a/test/FaultTest.php +++ b/test/FaultTest.php @@ -37,8 +37,7 @@ class FaultTest extends \PHPUnit_Framework_TestCase { /** - * Zend_XmlRpc_Fault object - * @var Zend_XmlRpc_Fault + * @var XmlRpc\Fault */ protected $_fault; diff --git a/test/GeneratorTest.php b/test/GeneratorTest.php index 28da7bf..7a66ff4 100644 --- a/test/GeneratorTest.php +++ b/test/GeneratorTest.php @@ -21,7 +21,7 @@ namespace ZendTest\XmlRpc; -use Zend\XmlRpc\Generator; +use Zend\XmlRpc\Generator\GeneratorInterface as Generator; /** * Test case for Zend_XmlRpc_Generator_* diff --git a/test/ServerTest.php b/test/ServerTest.php index e33d457..7c5825c 100644 --- a/test/ServerTest.php +++ b/test/ServerTest.php @@ -331,7 +331,7 @@ public function testMethodHelp() $help = $this->_server->methodHelp('system.methodHelp', 'system.listMethods'); $this->assertContains('Display help message for an XMLRPC method', $help); - $this->setExpectedException('Zend\\XmlRpc\\Server\\Exception', 'Method "foo" does not exist'); + $this->setExpectedException('Zend\\XmlRpc\\Server\\Exception\\ExceptionInterface', 'Method "foo" does not exist'); $this->_server->methodHelp('foo'); } @@ -351,7 +351,7 @@ public function testMethodSignature() $this->assertTrue(is_array($sig)); $this->assertEquals(1, count($sig), var_export($sig, 1)); - $this->setExpectedException('Zend\XmlRpc\Server\Exception', 'Method "foo" does not exist'); + $this->setExpectedException('Zend\XmlRpc\Server\Exception\ExceptionInterface', 'Method "foo" does not exist'); $this->_server->methodSignature('foo'); } @@ -646,7 +646,7 @@ public function testPrototypeReturnValueMustReflectDocBlock() public function testCallingUnregisteredMethod() { - $this->setExpectedException('Zend\\XmlRpc\\Server\\Exception', + $this->setExpectedException('Zend\\XmlRpc\\Server\\Exception\\ExceptionInterface', 'Unknown instance method called on server: foobarbaz'); $this->_server->foobarbaz(); } @@ -659,13 +659,13 @@ public function testSetPersistenceDoesNothing() public function testPassingInvalidRequestClassThrowsException() { - $this->setExpectedException('Zend\\XmlRpc\\Server\\Exception', 'Invalid request class'); + $this->setExpectedException('Zend\\XmlRpc\\Server\\Exception\\ExceptionInterface', 'Invalid request class'); $this->_server->setRequest('stdClass'); } public function testPassingInvalidResponseClassThrowsException() { - $this->setExpectedException('Zend\\XmlRpc\\Server\\Exception', 'Invalid response class'); + $this->setExpectedException('Zend\\XmlRpc\\Server\\Exception\\ExceptionInterface', 'Invalid response class'); $this->_server->setResponseClass('stdClass'); } diff --git a/test/ValueTest.php b/test/ValueTest.php index 613903a..f8f3dff 100644 --- a/test/ValueTest.php +++ b/test/ValueTest.php @@ -21,7 +21,7 @@ namespace ZendTest\XmlRpc; use Zend\XmlRpc\Value; -use Zend\XmlRpc\Generator; +use Zend\XmlRpc\Generator\GeneratorInterface as Generator; use Zend\Crypt\Math\BigInteger; use Zend\Date;