From f069fbd54e93cbdecd9558ebdbe8c016c65fcebd Mon Sep 17 00:00:00 2001 From: Ari Pringle Date: Wed, 31 Jan 2018 15:01:16 -0700 Subject: [PATCH] upgrade to phpunit 6 (#15) * upgrade to phpunit 6 * change setExpectedException to expectedException* * fix expectedException calls to expectException * minimum php version is now 7.0 * update phpcov dependency --- .travis.yml | 1 - composer.json | 13 +- .../Zend_Test-PHPUnit-Bootstrapping.xml | 2 +- .../Zend_Test-PHPUnit-Db-Quickstart.xml | 8 +- .../Zend_Test-PHPUnit-Db-Testing.xml | 6 +- .../Zend_Test-PHPUnit-Bootstrapping.xml | 2 +- .../Zend_Test-PHPUnit-Db-Quickstart.xml | 8 +- .../Zend_Test-PHPUnit-Db-Testing.xml | 6 +- .../Zend_Test-PHPUnit-Bootstrapping.xml | 2 +- .../Zend_Test-PHPUnit-Db-Quickstart.xml | 8 +- .../Zend_Test-PHPUnit-Db-Testing.xml | 6 +- .../Zend_Test-PHPUnit-Bootstrapping.xml | 2 +- .../Zend/Test/PHPUnit/Constraint/DomQuery.php | 18 +- .../Test/PHPUnit/Constraint/DomQuery34.php | 422 ----------------- .../Test/PHPUnit/Constraint/DomQuery37.php | 434 ------------------ .../Test/PHPUnit/Constraint/DomQuery41.php | 10 +- .../Test/PHPUnit/Constraint/Exception.php | 4 +- .../Zend/Test/PHPUnit/Constraint/Redirect.php | 18 +- .../Test/PHPUnit/Constraint/Redirect34.php | 303 ------------ .../Test/PHPUnit/Constraint/Redirect37.php | 315 ------------- .../Test/PHPUnit/Constraint/Redirect41.php | 10 +- .../PHPUnit/Constraint/ResponseHeader.php | 18 +- .../PHPUnit/Constraint/ResponseHeader34.php | 406 ---------------- .../PHPUnit/Constraint/ResponseHeader37.php | 419 ----------------- .../PHPUnit/Constraint/ResponseHeader41.php | 10 +- .../Zend/Test/PHPUnit/ControllerTestCase.php | 14 +- .../Zend/Test/PHPUnit/DatabaseTestCase.php | 12 +- library/Zend/Test/PHPUnit/Db/Connection.php | 10 +- .../Zend/Test/PHPUnit/Db/DataSet/DbRowset.php | 6 +- .../Zend/Test/PHPUnit/Db/DataSet/DbTable.php | 6 +- .../PHPUnit/Db/DataSet/DbTableDataSet.php | 8 +- .../Test/PHPUnit/Db/DataSet/QueryDataSet.php | 8 +- .../Test/PHPUnit/Db/DataSet/QueryTable.php | 10 +- .../Zend/Test/PHPUnit/Db/Metadata/Generic.php | 4 +- .../Test/PHPUnit/Db/Operation/DeleteAll.php | 12 +- .../Zend/Test/PHPUnit/Db/Operation/Insert.php | 16 +- .../Test/PHPUnit/Db/Operation/Truncate.php | 12 +- library/Zend/Test/PHPUnit/Db/SimpleTester.php | 16 +- .../Project/Context/Zf/TestLibraryFile.php | 2 +- library/Zend/Tool/Project/Provider/Test.php | 2 +- tests/TestHelper.php | 4 +- tests/Zend/Acl/AclTest.php | 11 +- tests/Zend/Amf/Adobe/IntrospectorTest.php | 2 +- tests/Zend/Amf/AuthTest.php | 2 +- tests/Zend/Amf/RequestTest.php | 34 +- tests/Zend/Amf/ResourceTest.php | 2 +- tests/Zend/Amf/Response/HttpTest.php | 2 +- tests/Zend/Amf/ResponseTest.php | 2 +- tests/Zend/Amf/ServerTest.php | 57 ++- tests/Zend/Amf/TypeLoaderTest.php | 2 +- tests/Zend/Amf/Util/BinaryStreamTest.php | 8 +- tests/Zend/Amf/Value/ArrayCollectionTest.php | 4 +- tests/Zend/Amf/Value/MessageBodyTest.php | 2 +- tests/Zend/Amf/Value/MessageHeaderTest.php | 2 +- tests/Zend/Application/ApplicationTest.php | 20 +- .../Bootstrap/BootstrapAbstractTest.php | 30 +- .../Application/Bootstrap/BootstrapTest.php | 5 +- .../Application/Module/AutoloaderTest.php | 2 +- .../Zend/Application/Module/BootstrapTest.php | 4 +- .../Application/Resource/CacheManagerTest.php | 6 +- tests/Zend/Application/Resource/DbTest.php | 4 +- tests/Zend/Application/Resource/DojoTest.php | 2 +- .../Resource/FrontcontrollerTest.php | 2 +- .../Zend/Application/Resource/LayoutTest.php | 2 +- .../Zend/Application/Resource/LocaleTest.php | 2 +- tests/Zend/Application/Resource/LogTest.php | 2 +- tests/Zend/Application/Resource/MailTest.php | 4 +- .../Zend/Application/Resource/ModulesTest.php | 2 +- .../Zend/Application/Resource/MultidbTest.php | 2 +- .../Application/Resource/NavigationTest.php | 2 +- .../Resource/ResourceAbstractTest.php | 2 +- .../Zend/Application/Resource/RouterTest.php | 2 +- .../Zend/Application/Resource/SessionTest.php | 2 +- .../Application/Resource/TranslateTest.php | 9 +- .../Application/Resource/UseragentTest.php | 2 +- tests/Zend/Application/Resource/ViewTest.php | 2 +- .../Auth/Adapter/DbTable/BasicSqliteTest.php | 23 +- tests/Zend/Auth/Adapter/DigestTest.php | 6 +- tests/Zend/Auth/Adapter/Http/AuthTest.php | 6 +- tests/Zend/Auth/Adapter/Http/ObjectTest.php | 12 +- tests/Zend/Auth/Adapter/Http/ProxyTest.php | 4 +- .../Auth/Adapter/Http/Resolver/FileTest.php | 6 +- tests/Zend/Auth/Adapter/Ldap/OfflineTest.php | 2 +- tests/Zend/Auth/Adapter/Ldap/OnlineTest.php | 2 +- tests/Zend/Auth/Adapter/OpenId/OpenIdTest.php | 58 +-- tests/Zend/AuthTest.php | 2 +- tests/Zend/Barcode/FactoryTest.php | 36 +- tests/Zend/Barcode/Object/Code25Test.php | 9 +- .../Barcode/Object/Code25interleavedTest.php | 9 +- tests/Zend/Barcode/Object/Code39Test.php | 9 +- tests/Zend/Barcode/Object/Ean13Test.php | 3 +- tests/Zend/Barcode/Object/Ean8Test.php | 3 +- tests/Zend/Barcode/Object/IdentcodeTest.php | 3 +- tests/Zend/Barcode/Object/Itf14Test.php | 9 +- tests/Zend/Barcode/Object/LeitcodeTest.php | 3 +- tests/Zend/Barcode/Object/PlanetTest.php | 6 +- tests/Zend/Barcode/Object/PostnetTest.php | 6 +- tests/Zend/Barcode/Object/RoyalmailTest.php | 3 +- tests/Zend/Barcode/Object/TestCommon.php | 43 +- tests/Zend/Barcode/Object/UpcaTest.php | 3 +- tests/Zend/Barcode/Object/UpceTest.php | 3 +- tests/Zend/Barcode/Renderer/ImageTest.php | 30 +- tests/Zend/Barcode/Renderer/PdfTest.php | 3 +- tests/Zend/Barcode/Renderer/SvgTest.php | 9 +- tests/Zend/Barcode/Renderer/TestCommon.php | 29 +- tests/Zend/Cache/ClassFrontendTest.php | 4 +- tests/Zend/Cache/CommonBackendTest.php | 6 +- .../Zend/Cache/CommonExtendedBackendTest.php | 4 +- tests/Zend/Cache/CoreTest.php | 4 +- tests/Zend/Cache/FactoryException.php | 4 +- tests/Zend/Cache/FactoryTest.php | 2 +- tests/Zend/Cache/FileBackendTest.php | 8 +- tests/Zend/Cache/FileFrontendTest.php | 2 +- tests/Zend/Cache/FunctionFrontendTest.php | 4 +- tests/Zend/Cache/ManagerTest.php | 4 +- tests/Zend/Cache/OutputFrontendTest.php | 2 +- tests/Zend/Cache/PageFrontendTest.php | 2 +- tests/Zend/Cache/StaticBackendTest.php | 4 +- tests/Zend/Captcha/DumbTest.php | 2 +- tests/Zend/Captcha/FigletTest.php | 20 +- tests/Zend/Captcha/ImageTest.php | 30 +- tests/Zend/Captcha/ReCaptchaTest.php | 4 +- .../Cloud/DocumentService/FactoryTest.php | 4 +- tests/Zend/Cloud/DocumentService/TestCase.php | 2 +- .../Cloud/Infrastructure/Adapter/Ec2Test.php | 8 +- .../Infrastructure/Adapter/RackspaceTest.php | 8 +- .../Zend/Cloud/Infrastructure/FactoryTest.php | 4 +- tests/Zend/Cloud/Infrastructure/TestCase.php | 14 +- tests/Zend/Cloud/QueueService/FactoryTest.php | 4 +- tests/Zend/Cloud/QueueService/TestCase.php | 4 +- .../StorageService/Adapter/FileSystemTest.php | 2 +- .../Zend/Cloud/StorageService/FactoryTest.php | 4 +- tests/Zend/Cloud/StorageService/TestCase.php | 6 +- tests/Zend/CodeGenerator/Php/ClassTest.php | 13 +- .../Php/Docblock/Tag/ParamTest.php | 2 +- .../Php/Docblock/Tag/ReturnTest.php | 2 +- .../CodeGenerator/Php/Docblock/TagTest.php | 2 +- tests/Zend/CodeGenerator/Php/DocblockTest.php | 2 +- tests/Zend/CodeGenerator/Php/FileTest.php | 2 +- tests/Zend/CodeGenerator/Php/MethodTest.php | 2 +- .../Zend/CodeGenerator/Php/ParameterTest.php | 2 +- .../Php/Property/DefaultValueTest.php | 2 +- tests/Zend/CodeGenerator/Php/PropertyTest.php | 4 +- tests/Zend/Config/IniTest.php | 12 +- tests/Zend/Config/JsonTest.php | 22 +- tests/Zend/Config/Writer/ArrayTest.php | 2 +- tests/Zend/Config/Writer/IniTest.php | 2 +- tests/Zend/Config/Writer/JsonTest.php | 2 +- tests/Zend/Config/Writer/XmlTest.php | 2 +- tests/Zend/Config/Writer/YamlTest.php | 2 +- tests/Zend/Config/XmlTest.php | 2 +- tests/Zend/Config/YamlTest.php | 31 +- tests/Zend/ConfigTest.php | 2 +- tests/Zend/Console/GetoptTest.php | 2 +- .../Action/Helper/ActionStackTest.php | 2 +- .../Action/Helper/AjaxContextTest.php | 6 +- .../Action/Helper/AutoCompleteTest.php | 2 +- .../Controller/Action/Helper/CacheTest.php | 2 +- .../Action/Helper/ContextSwitchTest.php | 14 +- .../Action/Helper/FlashMessengerTest.php | 6 +- .../Controller/Action/Helper/JsonTest.php | 6 +- .../Action/Helper/NamespaceTest.php | 2 +- .../Action/Helper/RedirectorTest.php | 2 +- .../Zend/Controller/Action/Helper/UrlTest.php | 2 +- .../Action/Helper/ViewRendererTest.php | 12 +- .../Action/HelperBroker/PriorityStackTest.php | 2 +- .../Controller/Action/HelperBrokerTest.php | 8 +- tests/Zend/Controller/ActionTest.php | 4 +- .../Controller/Dispatcher/StandardTest.php | 4 +- tests/Zend/Controller/FrontTest.php | 12 +- .../Controller/Plugin/ActionStackTest.php | 10 +- tests/Zend/Controller/Plugin/BrokerTest.php | 4 +- .../Controller/Plugin/ErrorHandlerTest.php | 2 +- .../Zend/Controller/Plugin/PutHandlerTest.php | 2 +- .../Zend/Controller/Request/Apache404Test.php | 2 +- tests/Zend/Controller/Request/HttpTest.php | 2 +- .../Controller/Request/HttpTestCaseTest.php | 40 +- tests/Zend/Controller/Request/SimpleTest.php | 2 +- tests/Zend/Controller/Response/HttpTest.php | 38 +- .../Controller/Response/HttpTestCaseTest.php | 10 +- tests/Zend/Controller/Router/RewriteTest.php | 5 +- .../Controller/Router/Route/ChainTest.php | 24 +- .../Controller/Router/Route/HostnameTest.php | 2 +- .../Controller/Router/Route/ModuleTest.php | 30 +- .../Controller/Router/Route/RegexTest.php | 2 +- .../Controller/Router/Route/StaticTest.php | 10 +- tests/Zend/Controller/Router/RouteTest.php | 16 +- tests/Zend/Crypt/DiffieHellmanTest.php | 2 +- tests/Zend/Crypt/HmacTest.php | 2 +- .../Zend/Crypt/Math/BigInteger/BcmathTest.php | 2 +- tests/Zend/Crypt/Math/BigInteger/GmpTest.php | 2 +- tests/Zend/Crypt/MathTest.php | 2 +- tests/Zend/Crypt/Rsa/RsaTest.php | 2 +- tests/Zend/CurrencyTest.php | 2 +- tests/Zend/Date/DateObjectTest.php | 6 +- tests/Zend/DateTest.php | 22 +- tests/Zend/Db/Adapter/OracleTest.php | 18 +- tests/Zend/Db/Adapter/Pdo/MssqlTest.php | 2 +- tests/Zend/Db/Adapter/Pdo/OciTest.php | 6 +- tests/Zend/Db/Adapter/SkipTests.php | 2 +- tests/Zend/Db/Adapter/SqlsrvTest.php | 2 +- tests/Zend/Db/Adapter/StaticTest.php | 4 +- tests/Zend/Db/Adapter/TestCommon.php | 114 ++--- tests/Zend/Db/Profiler/FirebugTest.php | 6 +- tests/Zend/Db/Profiler/OracleTest.php | 26 +- tests/Zend/Db/Profiler/Pdo/OciTest.php | 2 +- tests/Zend/Db/Profiler/TestCommon.php | 34 +- tests/Zend/Db/Select/MysqliTest.php | 3 +- tests/Zend/Db/Select/TestCommon.php | 4 +- tests/Zend/Db/Statement/Db2Test.php | 2 +- tests/Zend/Db/Statement/MysqliTest.php | 8 +- tests/Zend/Db/Statement/OracleTest.php | 4 +- tests/Zend/Db/Statement/Pdo/IbmTest.php | 2 +- tests/Zend/Db/Statement/Pdo/TestCommon.php | 2 +- tests/Zend/Db/Statement/SqlsrvTest.php | 2 +- tests/Zend/Db/Statement/StaticTest.php | 2 +- tests/Zend/Db/Statement/TestCommon.php | 18 +- .../Db/Table/Relationships/StaticTest.php | 4 +- tests/Zend/Db/Table/Row/StaticTest.php | 2 +- tests/Zend/Db/Table/Row/TestCommon.php | 4 +- tests/Zend/Db/Table/Rowset/StaticTest.php | 2 +- tests/Zend/Db/Table/Rowset/TestCommon.php | 10 +- tests/Zend/Db/Table/Select/MysqliTest.php | 3 +- tests/Zend/Db/Table/StaticTest.php | 2 +- tests/Zend/Db/Table/TestCommon.php | 14 +- tests/Zend/Db/TestSetup.php | 2 +- tests/Zend/DebugTest.php | 2 +- tests/Zend/Dojo/BuildLayerTest.php | 16 +- tests/Zend/Dojo/DataTest.php | 39 +- tests/Zend/Dojo/DojoTest.php | 18 +- .../Form/Decorator/AccordionContainerTest.php | 2 +- .../Dojo/Form/Decorator/AccordionPaneTest.php | 2 +- .../Form/Decorator/BorderContainerTest.php | 2 +- .../Form/Decorator/DijitContainerTest.php | 17 +- .../Dojo/Form/Decorator/DijitElementTest.php | 25 +- .../Dojo/Form/Decorator/DijitFormTest.php | 2 +- .../Form/Decorator/SplitContainerTest.php | 2 +- .../Form/Decorator/StackContainerTest.php | 2 +- .../Dojo/Form/Decorator/TabContainerTest.php | 2 +- tests/Zend/Dojo/Form/Element/ButtonTest.php | 2 +- tests/Zend/Dojo/Form/Element/CheckBoxTest.php | 2 +- tests/Zend/Dojo/Form/Element/ComboBoxTest.php | 12 +- .../Dojo/Form/Element/CurrencyTextBoxTest.php | 7 +- .../Dojo/Form/Element/DateTextBoxTest.php | 22 +- tests/Zend/Dojo/Form/Element/DijitTest.php | 8 +- tests/Zend/Dojo/Form/Element/EditorTest.php | 12 +- .../Dojo/Form/Element/FilteringSelectTest.php | 2 +- .../Form/Element/HorizontalSliderTest.php | 36 +- .../Dojo/Form/Element/NumberSpinnerTest.php | 18 +- .../Dojo/Form/Element/NumberTextBoxTest.php | 5 +- .../Dojo/Form/Element/PasswordTextBoxTest.php | 2 +- .../Dojo/Form/Element/RadioButtonTest.php | 4 +- .../Dojo/Form/Element/SimpleTextareaTest.php | 2 +- .../Dojo/Form/Element/SubmitButtonTest.php | 2 +- tests/Zend/Dojo/Form/Element/TextBoxTest.php | 12 +- tests/Zend/Dojo/Form/Element/TextareaTest.php | 2 +- .../Dojo/Form/Element/TimeTextBoxTest.php | 11 +- .../Form/Element/ValidationTextBoxTest.php | 16 +- .../Dojo/Form/Element/VerticalSliderTest.php | 22 +- tests/Zend/Dojo/Form/FormTest.php | 14 +- tests/Zend/Dojo/Form/SubFormTest.php | 12 +- .../View/Helper/AccordionContainerTest.php | 8 +- .../Dojo/View/Helper/AccordionPaneTest.php | 2 +- .../Dojo/View/Helper/BorderContainerTest.php | 2 +- tests/Zend/Dojo/View/Helper/ButtonTest.php | 2 +- tests/Zend/Dojo/View/Helper/CheckBoxTest.php | 2 +- tests/Zend/Dojo/View/Helper/ComboBoxTest.php | 2 +- .../Zend/Dojo/View/Helper/ContentPaneTest.php | 2 +- .../Dojo/View/Helper/CurrencyTextBoxTest.php | 2 +- .../Zend/Dojo/View/Helper/CustomDijitTest.php | 5 +- .../Zend/Dojo/View/Helper/DateTextBoxTest.php | 2 +- tests/Zend/Dojo/View/Helper/DojoTest.php | 80 ++-- tests/Zend/Dojo/View/Helper/EditorTest.php | 2 +- .../Dojo/View/Helper/FilteringSelectTest.php | 2 +- tests/Zend/Dojo/View/Helper/FormTest.php | 2 +- .../Dojo/View/Helper/HorizontalSliderTest.php | 5 +- .../Dojo/View/Helper/NumberSpinnerTest.php | 10 +- .../Dojo/View/Helper/NumberTextBoxTest.php | 2 +- .../Dojo/View/Helper/PasswordTextBoxTest.php | 2 +- .../Zend/Dojo/View/Helper/RadioButtonTest.php | 2 +- .../Dojo/View/Helper/SimpleTextareaTest.php | 2 +- .../Dojo/View/Helper/SplitContainerTest.php | 2 +- .../Dojo/View/Helper/StackContainerTest.php | 2 +- .../Dojo/View/Helper/SubmitButtonTest.php | 2 +- .../Dojo/View/Helper/TabContainerTest.php | 2 +- tests/Zend/Dojo/View/Helper/TextBoxTest.php | 2 +- tests/Zend/Dojo/View/Helper/TextareaTest.php | 2 +- .../Zend/Dojo/View/Helper/TimeTextBoxTest.php | 2 +- .../View/Helper/ValidationTextBoxTest.php | 2 +- .../Dojo/View/Helper/VerticalSliderTest.php | 2 +- tests/Zend/Dom/Query/Css2XpathTest.php | 8 +- tests/Zend/Dom/Query/ResultTest.php | 2 +- tests/Zend/Dom/QueryTest.php | 6 +- tests/Zend/EventManager/EventManagerTest.php | 11 +- tests/Zend/EventManager/FilterChainTest.php | 2 +- .../EventManager/GlobalEventManagerTest.php | 2 +- .../EventManager/StaticEventManagerTest.php | 2 +- .../EventManager/StaticIntegrationTest.php | 2 +- tests/Zend/ExceptionTest.php | 2 +- tests/Zend/Feed/AbstractFeedTest.php | 2 +- tests/Zend/Feed/ArrayAccessTest.php | 2 +- tests/Zend/Feed/AtomEntryOnlyTest.php | 2 +- tests/Zend/Feed/AtomPublishingTest.php | 2 +- tests/Zend/Feed/AtomTest.php | 3 +- tests/Zend/Feed/CountTest.php | 2 +- tests/Zend/Feed/ElementTest.php | 6 +- tests/Zend/Feed/Entry/RssTest.php | 2 +- tests/Zend/Feed/ImportTest.php | 2 +- tests/Zend/Feed/IteratorTest.php | 2 +- .../Pubsubhubbub/Model/SubscriptionTest.php | 4 +- .../Zend/Feed/Pubsubhubbub/PublisherTest.php | 2 +- .../Feed/Pubsubhubbub/PubsubhubbubTest.php | 2 +- .../Pubsubhubbub/Subscriber/CallbackTest.php | 2 +- .../Feed/Pubsubhubbub/SubscriberHttpTest.php | 2 +- .../Zend/Feed/Pubsubhubbub/SubscriberTest.php | 5 +- .../Reader/Entry/AtomStandaloneEntryTest.php | 2 +- tests/Zend/Feed/Reader/Entry/AtomTest.php | 2 +- tests/Zend/Feed/Reader/Entry/CommonTest.php | 2 +- tests/Zend/Feed/Reader/Entry/RssTest.php | 2 +- .../Zend/Feed/Reader/Feed/AtomSourceTest.php | 2 +- tests/Zend/Feed/Reader/Feed/AtomTest.php | 2 +- tests/Zend/Feed/Reader/Feed/CommonTest.php | 2 +- tests/Zend/Feed/Reader/Feed/RssTest.php | 2 +- .../Integration/H-OnlineComAtom10Test.php | 2 +- .../Feed/Reader/Integration/LautDeRdfTest.php | 2 +- .../Reader/Integration/PodcastRss2Test.php | 2 +- .../Integration/WordpressAtom10Test.php | 2 +- .../Integration/WordpressRss2DcAtomTest.php | 2 +- tests/Zend/Feed/ReaderTest.php | 10 +- tests/Zend/Feed/RssTest.php | 3 +- tests/Zend/Feed/Writer/DeletedTest.php | 6 +- tests/Zend/Feed/Writer/EntryTest.php | 30 +- .../Writer/Extension/ITunes/EntryTest.php | 35 +- .../Feed/Writer/Extension/ITunes/FeedTest.php | 47 +- tests/Zend/Feed/Writer/FeedTest.php | 48 +- .../Feed/Writer/Renderer/Entry/AtomTest.php | 17 +- .../Feed/Writer/Renderer/Entry/RssTest.php | 20 +- .../Feed/Writer/Renderer/Feed/AtomTest.php | 14 +- .../Feed/Writer/Renderer/Feed/RssTest.php | 44 +- tests/Zend/File/ClassFileLocatorTest.php | 6 +- .../File/Transfer/Adapter/AbstractTest.php | 93 ++-- tests/Zend/File/Transfer/Adapter/HttpTest.php | 32 +- tests/Zend/Filter/AlnumTest.php | 2 +- tests/Zend/Filter/AlphaTest.php | 2 +- tests/Zend/Filter/BaseNameTest.php | 2 +- tests/Zend/Filter/BooleanTest.php | 2 +- tests/Zend/Filter/CallbackTest.php | 2 +- tests/Zend/Filter/Compress/Bz2Test.php | 2 +- tests/Zend/Filter/Compress/GzTest.php | 2 +- tests/Zend/Filter/Compress/LzfTest.php | 2 +- tests/Zend/Filter/Compress/RarTest.php | 12 +- tests/Zend/Filter/Compress/TarTest.php | 2 +- tests/Zend/Filter/Compress/ZipTest.php | 18 +- tests/Zend/Filter/CompressTest.php | 2 +- tests/Zend/Filter/DecompressTest.php | 2 +- tests/Zend/Filter/DecryptTest.php | 2 +- tests/Zend/Filter/DigitsTest.php | 2 +- tests/Zend/Filter/DirTest.php | 2 +- tests/Zend/Filter/Encrypt/McryptTest.php | 2 +- tests/Zend/Filter/Encrypt/OpensslTest.php | 4 +- tests/Zend/Filter/EncryptTest.php | 2 +- tests/Zend/Filter/File/DecryptTest.php | 2 +- tests/Zend/Filter/File/EncryptTest.php | 2 +- tests/Zend/Filter/File/LowerCaseTest.php | 13 +- tests/Zend/Filter/File/RenameTest.php | 13 +- tests/Zend/Filter/File/UpperCaseTest.php | 13 +- tests/Zend/Filter/HtmlEntitiesTest.php | 2 +- tests/Zend/Filter/InflectorTest.php | 6 +- tests/Zend/Filter/InputTest.php | 94 ++-- tests/Zend/Filter/IntTest.php | 2 +- .../Zend/Filter/LocalizedToNormalizedTest.php | 2 +- .../Zend/Filter/NormalizedToLocalizedTest.php | 2 +- tests/Zend/Filter/NullTest.php | 2 +- tests/Zend/Filter/PregReplaceTest.php | 4 +- tests/Zend/Filter/RealPathTest.php | 13 +- tests/Zend/Filter/StringToLowerTest.php | 2 +- tests/Zend/Filter/StringToUpperTest.php | 2 +- tests/Zend/Filter/StringTrimTest.php | 2 +- tests/Zend/Filter/StripNewlinesTest.php | 2 +- tests/Zend/Filter/StripTagsTest.php | 6 +- .../Zend/Filter/Word/CamelCaseToDashTest.php | 2 +- .../Filter/Word/CamelCaseToSeparatorTest.php | 2 +- .../Filter/Word/CamelCaseToUnderscoreTest.php | 2 +- .../Zend/Filter/Word/DashToCamelCaseTest.php | 2 +- .../Zend/Filter/Word/DashToSeparatorTest.php | 2 +- .../Zend/Filter/Word/DashToUnderscoreTest.php | 2 +- .../Filter/Word/SeparatorToCamelCaseTest.php | 2 +- .../Zend/Filter/Word/SeparatorToDashTest.php | 2 +- .../Filter/Word/SeparatorToSeparatorTest.php | 2 +- .../Filter/Word/UnderscoreToCamelCaseTest.php | 2 +- .../Zend/Filter/Word/UnderscoreToDashTest.php | 2 +- .../Filter/Word/UnderscoreToSeparatorTest.php | 2 +- tests/Zend/FilterTest.php | 5 +- tests/Zend/Form/Decorator/AbstractTest.php | 2 +- tests/Zend/Form/Decorator/CallbackTest.php | 2 +- tests/Zend/Form/Decorator/DescriptionTest.php | 2 +- tests/Zend/Form/Decorator/ErrorsTest.php | 2 +- tests/Zend/Form/Decorator/FieldsetTest.php | 2 +- tests/Zend/Form/Decorator/FileTest.php | 2 +- tests/Zend/Form/Decorator/FormErrorsTest.php | 2 +- tests/Zend/Form/Decorator/FormTest.php | 2 +- tests/Zend/Form/Decorator/HtmlTagTest.php | 2 +- tests/Zend/Form/Decorator/ImageTest.php | 2 +- tests/Zend/Form/Decorator/LabelTest.php | 4 +- .../Form/Decorator/PrepareElementsTest.php | 2 +- tests/Zend/Form/Decorator/ReCaptchaTest.php | 2 +- tests/Zend/Form/Decorator/ViewHelperTest.php | 2 +- tests/Zend/Form/Decorator/ViewScriptTest.php | 2 +- tests/Zend/Form/DisplayGroupTest.php | 21 +- tests/Zend/Form/Element/ButtonTest.php | 2 +- tests/Zend/Form/Element/CaptchaTest.php | 29 +- tests/Zend/Form/Element/CheckboxTest.php | 2 +- tests/Zend/Form/Element/FileTest.php | 19 +- tests/Zend/Form/Element/HashTest.php | 12 +- tests/Zend/Form/Element/HiddenTest.php | 2 +- tests/Zend/Form/Element/ImageTest.php | 2 +- tests/Zend/Form/Element/MultiCheckboxTest.php | 6 +- tests/Zend/Form/Element/MultiselectTest.php | 6 +- tests/Zend/Form/Element/NoteTest.php | 2 +- tests/Zend/Form/Element/PasswordTest.php | 4 +- tests/Zend/Form/Element/RadioTest.php | 2 +- tests/Zend/Form/Element/ResetTest.php | 2 +- tests/Zend/Form/Element/SelectTest.php | 2 +- tests/Zend/Form/Element/SubmitTest.php | 2 +- tests/Zend/Form/Element/TextTest.php | 2 +- tests/Zend/Form/Element/TextareaTest.php | 2 +- tests/Zend/Form/ElementTest.php | 99 ++-- tests/Zend/Form/FormTest.php | 156 +++---- tests/Zend/Form/SubFormTest.php | 12 +- .../Zend/Gdata/Analytics/AccountFeedTest.php | 2 +- .../Zend/Gdata/Analytics/AccountQueryTest.php | 2 +- tests/Zend/Gdata/Analytics/DataFeedTest.php | 2 +- tests/Zend/Gdata/Analytics/DataQueryTest.php | 2 +- tests/Zend/Gdata/App/AuthorTest.php | 4 +- tests/Zend/Gdata/App/BaseTest.php | 2 +- .../App/CaptchaRequiredExceptionTest.php | 2 +- tests/Zend/Gdata/App/CategoryTest.php | 4 +- tests/Zend/Gdata/App/ContentTest.php | 4 +- tests/Zend/Gdata/App/ControlTest.php | 4 +- tests/Zend/Gdata/App/EntryTest.php | 10 +- tests/Zend/Gdata/App/FeedTest.php | 8 +- tests/Zend/Gdata/App/GeneratorTest.php | 4 +- tests/Zend/Gdata/App/HttpExceptionTest.php | 2 +- tests/Zend/Gdata/App/UtilTest.php | 2 +- tests/Zend/Gdata/AppTest.php | 2 +- tests/Zend/Gdata/AttendeeStatusTest.php | 10 +- tests/Zend/Gdata/AttendeeTypeTest.php | 10 +- tests/Zend/Gdata/AuthSubTest.php | 23 +- .../Zend/Gdata/Books/CollectionEntryTest.php | 2 +- tests/Zend/Gdata/Books/CollectionFeedTest.php | 2 +- tests/Zend/Gdata/Books/VolumeEntryTest.php | 10 +- tests/Zend/Gdata/Books/VolumeFeedTest.php | 10 +- tests/Zend/Gdata/BooksOnlineTest.php | 2 +- tests/Zend/Gdata/BooksTest.php | 2 +- tests/Zend/Gdata/Calendar/AccessLevelTest.php | 10 +- tests/Zend/Gdata/Calendar/ColorTest.php | 10 +- tests/Zend/Gdata/Calendar/EventEntryTest.php | 10 +- .../Calendar/EventQueryExceptionTest.php | 8 +- tests/Zend/Gdata/Calendar/EventQueryTest.php | 2 +- tests/Zend/Gdata/Calendar/HiddenTest.php | 10 +- tests/Zend/Gdata/Calendar/LinkTest.php | 10 +- tests/Zend/Gdata/Calendar/QuickAddTest.php | 10 +- tests/Zend/Gdata/Calendar/SelectedTest.php | 10 +- .../Calendar/SendEventNotificationsTest.php | 10 +- tests/Zend/Gdata/Calendar/TimezoneTest.php | 10 +- tests/Zend/Gdata/Calendar/WebContentTest.php | 10 +- tests/Zend/Gdata/CalendarEventTest.php | 2 +- .../Zend/Gdata/CalendarFeedCompositeTest.php | 2 +- tests/Zend/Gdata/CalendarFeedTest.php | 2 +- tests/Zend/Gdata/CalendarOnlineTest.php | 2 +- tests/Zend/Gdata/CalendarTest.php | 10 +- tests/Zend/Gdata/CommentsTest.php | 10 +- .../Zend/Gdata/Docs/DocumentListEntryTest.php | 2 +- .../Zend/Gdata/Docs/DocumentListFeedTest.php | 2 +- tests/Zend/Gdata/Docs/QueryTest.php | 2 +- tests/Zend/Gdata/DocsOnlineTest.php | 2 +- tests/Zend/Gdata/DocsTest.php | 2 +- tests/Zend/Gdata/EntryLinkTest.php | 10 +- tests/Zend/Gdata/EntryTest.php | 2 +- tests/Zend/Gdata/EventStatusTest.php | 10 +- tests/Zend/Gdata/ExtendedPropertyTest.php | 10 +- tests/Zend/Gdata/FeedLinkTest.php | 10 +- tests/Zend/Gdata/FeedTest.php | 2 +- tests/Zend/Gdata/Gapps/EmailListEntryTest.php | 10 +- tests/Zend/Gdata/Gapps/EmailListFeedTest.php | 10 +- tests/Zend/Gdata/Gapps/EmailListQueryTest.php | 2 +- .../Gapps/EmailListRecipientEntryTest.php | 10 +- .../Gapps/EmailListRecipientFeedTest.php | 10 +- .../Gapps/EmailListRecipientQueryTest.php | 2 +- tests/Zend/Gdata/Gapps/EmailListTest.php | 10 +- tests/Zend/Gdata/Gapps/ErrorTest.php | 2 +- tests/Zend/Gdata/Gapps/GroupEntryTest.php | 10 +- tests/Zend/Gdata/Gapps/GroupFeedTest.php | 10 +- tests/Zend/Gdata/Gapps/GroupQueryTest.php | 2 +- tests/Zend/Gdata/Gapps/LoginTest.php | 10 +- tests/Zend/Gdata/Gapps/MemberEntryTest.php | 10 +- tests/Zend/Gdata/Gapps/MemberFeedTest.php | 10 +- tests/Zend/Gdata/Gapps/MemberQueryTest.php | 2 +- tests/Zend/Gdata/Gapps/NameTest.php | 10 +- tests/Zend/Gdata/Gapps/NicknameEntryTest.php | 10 +- tests/Zend/Gdata/Gapps/NicknameFeedTest.php | 10 +- tests/Zend/Gdata/Gapps/NicknameQueryTest.php | 2 +- tests/Zend/Gdata/Gapps/NicknameTest.php | 10 +- tests/Zend/Gdata/Gapps/OwnerEntryTest.php | 10 +- tests/Zend/Gdata/Gapps/OwnerFeedTest.php | 10 +- tests/Zend/Gdata/Gapps/OwnerQueryTest.php | 2 +- tests/Zend/Gdata/Gapps/PropertyTest.php | 10 +- tests/Zend/Gdata/Gapps/QuotaTest.php | 10 +- .../Zend/Gdata/Gapps/ServiceExceptionTest.php | 11 +- tests/Zend/Gdata/Gapps/UserEntryTest.php | 10 +- tests/Zend/Gdata/Gapps/UserFeedTest.php | 10 +- tests/Zend/Gdata/Gapps/UserQueryTest.php | 2 +- tests/Zend/Gdata/GappsOnlineTest.php | 2 +- tests/Zend/Gdata/GappsTest.php | 2 +- tests/Zend/Gdata/GdataOnlineTest.php | 2 +- tests/Zend/Gdata/GdataTest.php | 2 +- tests/Zend/Gdata/MediaMimeStreamTest.php | 2 +- .../Zend/Gdata/OpenSearchItemsPerPageTest.php | 10 +- tests/Zend/Gdata/OpenSearchStartIndexTest.php | 10 +- .../Zend/Gdata/OpenSearchTotalResultsTest.php | 10 +- tests/Zend/Gdata/OriginalEventTest.php | 10 +- .../Gdata/Photos/PhotosAlbumEntryTest.php | 2 +- .../Zend/Gdata/Photos/PhotosAlbumFeedTest.php | 2 +- .../Gdata/Photos/PhotosAlbumQueryTest.php | 2 +- .../Gdata/Photos/PhotosCommentEntryTest.php | 2 +- .../Gdata/Photos/PhotosPhotoEntryTest.php | 2 +- .../Zend/Gdata/Photos/PhotosPhotoFeedTest.php | 2 +- .../Gdata/Photos/PhotosPhotoQueryTest.php | 2 +- .../Zend/Gdata/Photos/PhotosTagEntryTest.php | 2 +- .../Zend/Gdata/Photos/PhotosUserEntryTest.php | 2 +- .../Zend/Gdata/Photos/PhotosUserFeedTest.php | 2 +- .../Zend/Gdata/Photos/PhotosUserQueryTest.php | 2 +- tests/Zend/Gdata/PhotosOnlineTest.php | 2 +- tests/Zend/Gdata/QueryTest.php | 2 +- tests/Zend/Gdata/RecurrenceExceptionTest.php | 10 +- tests/Zend/Gdata/RecurrenceTest.php | 10 +- tests/Zend/Gdata/ReminderTest.php | 10 +- .../Zend/Gdata/Spreadsheets/CellEntryTest.php | 2 +- .../Zend/Gdata/Spreadsheets/CellFeedTest.php | 2 +- .../Zend/Gdata/Spreadsheets/CellQueryTest.php | 2 +- tests/Zend/Gdata/Spreadsheets/CellTest.php | 2 +- .../Zend/Gdata/Spreadsheets/ColCountTest.php | 2 +- tests/Zend/Gdata/Spreadsheets/CustomTest.php | 2 +- .../Gdata/Spreadsheets/DocumentQueryTest.php | 2 +- .../Zend/Gdata/Spreadsheets/ListEntryTest.php | 2 +- .../Zend/Gdata/Spreadsheets/ListFeedTest.php | 2 +- .../Zend/Gdata/Spreadsheets/ListQueryTest.php | 2 +- .../Zend/Gdata/Spreadsheets/RowCountTest.php | 2 +- .../Spreadsheets/SpreadsheetFeedTest.php | 2 +- .../Gdata/Spreadsheets/WorksheetEntryTest.php | 2 +- .../Gdata/Spreadsheets/WorksheetFeedTest.php | 2 +- tests/Zend/Gdata/SpreadsheetsOnlineTest.php | 2 +- tests/Zend/Gdata/SpreadsheetsTest.php | 2 +- tests/Zend/Gdata/TransparencyTest.php | 10 +- tests/Zend/Gdata/VisibilityTest.php | 10 +- tests/Zend/Gdata/WhenTest.php | 10 +- tests/Zend/Gdata/WhereTest.php | 10 +- tests/Zend/Gdata/WhoTest.php | 10 +- tests/Zend/Http/Client/ClientTest.php | 4 +- tests/Zend/Http/Client/CommonHttpTests.php | 8 +- tests/Zend/Http/Client/CurlTest.php | 16 +- tests/Zend/Http/Client/SocketTest.php | 6 +- tests/Zend/Http/Client/StaticTest.php | 31 +- tests/Zend/Http/Client/TestAdapterTest.php | 5 +- tests/Zend/Http/CookieJarTest.php | 15 +- tests/Zend/Http/CookieTest.php | 5 +- tests/Zend/Http/Header/HeaderValueTest.php | 4 +- tests/Zend/Http/Header/SetCookieTest.php | 6 +- tests/Zend/Http/ResponseTest.php | 7 +- .../Http/UserAgent/AbstractDeviceTest.php | 2 +- .../Features/Adapter/BrowscapTest.php | 2 +- .../Features/Adapter/DeviceAtlasTest.php | 2 +- .../Features/Adapter/TeraWurflTest.php | 2 +- tests/Zend/Http/UserAgentTest.php | 38 +- tests/Zend/Json/JsonXMLTest.php | 7 +- tests/Zend/Json/Server/CacheTest.php | 2 +- tests/Zend/Json/Server/ErrorTest.php | 16 +- tests/Zend/Json/Server/RequestTest.php | 24 +- tests/Zend/Json/Server/ResponseTest.php | 30 +- tests/Zend/Json/Server/Smd/ServiceTest.php | 20 +- tests/Zend/Json/Server/SmdTest.php | 50 +- tests/Zend/Json/ServerTest.php | 24 +- tests/Zend/JsonTest.php | 7 +- tests/Zend/Layout/HelperTest.php | 2 +- tests/Zend/Layout/LayoutTest.php | 2 +- tests/Zend/Layout/PluginTest.php | 2 +- tests/Zend/Ldap/AttributeTest.php | 30 +- tests/Zend/Ldap/BindTest.php | 7 +- tests/Zend/Ldap/CanonTest.php | 2 +- tests/Zend/Ldap/ConnectTest.php | 2 +- tests/Zend/Ldap/ConverterTest.php | 9 +- tests/Zend/Ldap/CopyRenameTest.php | 18 +- tests/Zend/Ldap/CrudTest.php | 12 +- tests/Zend/Ldap/Dn/CreationTest.php | 2 +- tests/Zend/Ldap/Dn/EscapingTest.php | 2 +- tests/Zend/Ldap/Dn/ExplodingTest.php | 5 +- tests/Zend/Ldap/Dn/ImplodingTest.php | 8 +- tests/Zend/Ldap/Dn/MiscTest.php | 2 +- tests/Zend/Ldap/Dn/ModificationTest.php | 2 +- tests/Zend/Ldap/FilterTest.php | 5 +- tests/Zend/Ldap/Node/OfflineTest.php | 19 +- tests/Zend/Ldap/Node/OnlineTest.php | 12 +- tests/Zend/Ldap/Node/RootDseTest.php | 120 ++--- tests/Zend/Ldap/Node/SchemaTest.php | 22 +- tests/Zend/Ldap/OfflineTest.php | 2 +- tests/Zend/Ldap/SearchTest.php | 16 +- tests/Zend/Ldap/TestCase.php | 2 +- tests/Zend/Loader/Autoloader/ResourceTest.php | 48 +- .../AutoloaderFactoryClassMapLoaderTest.php | 4 +- tests/Zend/Loader/AutoloaderFactoryTest.php | 22 +- .../Loader/AutoloaderMultiVersionTest.php | 11 +- tests/Zend/Loader/AutoloaderTest.php | 19 +- tests/Zend/Loader/ClassMapAutoloaderTest.php | 14 +- tests/Zend/Loader/PluginLoaderTest.php | 17 +- tests/Zend/Loader/StandardAutoloaderTest.php | 2 +- tests/Zend/LoaderTest.php | 2 +- tests/Zend/Locale/DataTest.php | 14 +- tests/Zend/Locale/FormatTest.php | 36 +- tests/Zend/Locale/MathTest.php | 2 +- tests/Zend/LocaleTest.php | 60 +-- tests/Zend/Log/Filter/ChainingTest.php | 2 +- tests/Zend/Log/Filter/MessageTest.php | 2 +- tests/Zend/Log/Filter/PriorityTest.php | 2 +- tests/Zend/Log/Filter/SuppressTest.php | 2 +- tests/Zend/Log/Formatter/FirebugTest.php | 2 +- tests/Zend/Log/Formatter/SimpleTest.php | 2 +- tests/Zend/Log/Formatter/XmlTest.php | 2 +- tests/Zend/Log/LogTest.php | 13 +- tests/Zend/Log/Writer/AbstractTest.php | 6 +- tests/Zend/Log/Writer/DbTest.php | 4 +- tests/Zend/Log/Writer/FirebugTest.php | 2 +- tests/Zend/Log/Writer/MailTest.php | 12 +- tests/Zend/Log/Writer/MockTest.php | 2 +- tests/Zend/Log/Writer/NullTest.php | 2 +- tests/Zend/Log/Writer/StreamTest.php | 2 +- tests/Zend/Log/Writer/SyslogTest.php | 2 +- tests/Zend/Log/Writer/ZendMonitorTest.php | 4 +- tests/Zend/Mail/FileTransportTest.php | 4 +- tests/Zend/Mail/Header/HeaderNameTest.php | 5 +- tests/Zend/Mail/Header/HeaderValueTest.php | 5 +- tests/Zend/Mail/ImapTest.php | 12 +- tests/Zend/Mail/InterfaceTest.php | 2 +- tests/Zend/Mail/MailTest.php | 5 +- tests/Zend/Mail/MaildirFolderTest.php | 2 +- tests/Zend/Mail/MaildirMessageOldTest.php | 2 +- tests/Zend/Mail/MaildirTest.php | 2 +- tests/Zend/Mail/MaildirWritableTest.php | 2 +- tests/Zend/Mail/MboxFolderTest.php | 2 +- tests/Zend/Mail/MboxMessageOldTest.php | 2 +- tests/Zend/Mail/MboxTest.php | 2 +- tests/Zend/Mail/MessageTest.php | 5 +- tests/Zend/Mail/Pop3Test.php | 4 +- tests/Zend/Mail/SmtpOfflineTest.php | 2 +- tests/Zend/Mail/SmtpProtocolTest.php | 11 +- tests/Zend/Mail/SmtpTest.php | 2 +- tests/Zend/Markup/BbcodeAndHtmlTest.php | 6 +- tests/Zend/Markup/FactoryTest.php | 2 +- tests/Zend/Markup/ParserIntegrityTest.php | 2 +- tests/Zend/Measure/AccelerationTest.php | 4 +- tests/Zend/Measure/AngleTest.php | 4 +- tests/Zend/Measure/AreaTest.php | 4 +- tests/Zend/Measure/BinaryTest.php | 6 +- tests/Zend/Measure/CapacitanceTest.php | 4 +- tests/Zend/Measure/Cooking/VolumeTest.php | 4 +- tests/Zend/Measure/Cooking/WeightTest.php | 4 +- tests/Zend/Measure/CurrentTest.php | 4 +- tests/Zend/Measure/DensityTest.php | 4 +- tests/Zend/Measure/EnergyTest.php | 4 +- tests/Zend/Measure/Flow/MassTest.php | 4 +- tests/Zend/Measure/Flow/MoleTest.php | 4 +- tests/Zend/Measure/Flow/VolumeTest.php | 4 +- tests/Zend/Measure/ForceTest.php | 4 +- tests/Zend/Measure/FrequencyTest.php | 4 +- tests/Zend/Measure/IlluminationTest.php | 4 +- tests/Zend/Measure/LengthTest.php | 4 +- tests/Zend/Measure/LightnessTest.php | 4 +- tests/Zend/Measure/NumberTest.php | 4 +- tests/Zend/Measure/PowerTest.php | 4 +- tests/Zend/Measure/PressureTest.php | 4 +- tests/Zend/Measure/SpeedTest.php | 4 +- tests/Zend/Measure/TemperatureTest.php | 4 +- tests/Zend/Measure/TimeTest.php | 4 +- tests/Zend/Measure/TorqueTest.php | 4 +- tests/Zend/Measure/Viscosity/DynamicTest.php | 4 +- .../Zend/Measure/Viscosity/KinematicTest.php | 4 +- tests/Zend/Measure/VolumeTest.php | 4 +- tests/Zend/Measure/WeightTest.php | 4 +- tests/Zend/Memory/AccessControllerTest.php | 2 +- tests/Zend/Memory/LockedTest.php | 2 +- tests/Zend/Memory/MemoryManagerTest.php | 2 +- tests/Zend/Memory/MemoryTest.php | 2 +- tests/Zend/Memory/MovableTest.php | 2 +- tests/Zend/Memory/ValueTest.php | 2 +- tests/Zend/Mime/MessageTest.php | 6 +- tests/Zend/Mime/PartTest.php | 10 +- tests/Zend/MimeTest.php | 2 +- tests/Zend/Mobile/Push/AbstractTest.php | 2 +- tests/Zend/Mobile/Push/ApnsTest.php | 47 +- tests/Zend/Mobile/Push/GcmTest.php | 20 +- .../Zend/Mobile/Push/Message/AbstractTest.php | 11 +- tests/Zend/Mobile/Push/Message/ApnsTest.php | 37 +- tests/Zend/Mobile/Push/Message/GcmTest.php | 14 +- .../Zend/Mobile/Push/Message/Mpns/RawTest.php | 17 +- .../Mobile/Push/Message/Mpns/TileTest.php | 29 +- .../Mobile/Push/Message/Mpns/ToastTest.php | 17 +- tests/Zend/Mobile/Push/MpnsTest.php | 29 +- tests/Zend/Mobile/Push/Response/GcmTest.php | 5 +- tests/Zend/Navigation/ContainerTest.php | 2 +- tests/Zend/Navigation/Page/MvcTest.php | 2 +- tests/Zend/Navigation/Page/UriTest.php | 2 +- tests/Zend/Navigation/PageFactoryTest.php | 2 +- tests/Zend/Navigation/PageTest.php | 2 +- tests/Zend/NavigationTest.php | 2 +- tests/Zend/Oauth/ClientTest.php | 2 +- tests/Zend/Oauth/ConfigTest.php | 2 +- tests/Zend/Oauth/Oauth/ConsumerTest.php | 2 +- .../Zend/Oauth/Oauth/Http/AccessTokenTest.php | 2 +- .../Oauth/Oauth/Http/RequestTokenTest.php | 2 +- .../Oauth/Http/UserAuthorizationTest.php | 2 +- tests/Zend/Oauth/Oauth/Http/UtilityTest.php | 2 +- .../Oauth/Oauth/Signature/AbstractTest.php | 2 +- tests/Zend/Oauth/Oauth/Signature/HmacTest.php | 2 +- .../Oauth/Oauth/Signature/PlaintextTest.php | 2 +- tests/Zend/Oauth/Oauth/Signature/RsaTest.php | 2 +- tests/Zend/Oauth/Oauth/Token/AccessTest.php | 2 +- .../Oauth/Token/AuthorizedRequestTest.php | 2 +- tests/Zend/Oauth/Oauth/Token/RequestTest.php | 2 +- tests/Zend/Oauth/OauthTest.php | 2 +- .../Zend/OpenId/Consumer/Storage/FileTest.php | 10 +- tests/Zend/OpenId/ConsumerTest.php | 22 +- tests/Zend/OpenId/Extension/SregTest.php | 2 +- tests/Zend/OpenId/ExtensionTest.php | 2 +- .../Zend/OpenId/Provider/Storage/FileTest.php | 18 +- .../Zend/OpenId/Provider/User/SessionTest.php | 4 +- tests/Zend/OpenId/ProviderTest.php | 12 +- tests/Zend/OpenIdTest.php | 20 +- tests/Zend/Paginator/Adapter/ArrayTest.php | 4 +- tests/Zend/Paginator/Adapter/DbSelectTest.php | 4 +- tests/Zend/Paginator/Adapter/IteratorTest.php | 4 +- tests/Zend/Paginator/Adapter/NullTest.php | 4 +- .../Zend/Paginator/ScrollingStyle/AllTest.php | 4 +- .../Paginator/ScrollingStyle/ElasticTest.php | 4 +- .../Paginator/ScrollingStyle/JumpingTest.php | 4 +- .../Paginator/ScrollingStyle/SlidingTest.php | 4 +- tests/Zend/Paginator/_files/test.sqlite | Bin 10240 -> 10240 bytes tests/Zend/PaginatorTest.php | 6 +- tests/Zend/Pdf/ActionTest.php | 2 +- tests/Zend/Pdf/DestinationTest.php | 2 +- tests/Zend/Pdf/DrawingTest.php | 2 +- tests/Zend/Pdf/Element/ArrayTest.php | 2 +- tests/Zend/Pdf/Element/BooleanTest.php | 2 +- tests/Zend/Pdf/Element/DictionaryTest.php | 2 +- tests/Zend/Pdf/Element/NameTest.php | 2 +- tests/Zend/Pdf/Element/NullTest.php | 2 +- tests/Zend/Pdf/Element/NumericTest.php | 2 +- tests/Zend/Pdf/Element/Object/StreamTest.php | 2 +- tests/Zend/Pdf/Element/ObjectTest.php | 2 +- tests/Zend/Pdf/Element/StreamTest.php | 2 +- tests/Zend/Pdf/Element/String/BinaryTest.php | 2 +- tests/Zend/Pdf/Element/StringTest.php | 2 +- tests/Zend/Pdf/FactoryTest.php | 2 +- tests/Zend/Pdf/Filter/Ascii85Test.php | 2 +- tests/Zend/Pdf/Filter/RunLengthTest.php | 2 +- tests/Zend/Pdf/NamedDestinationsTest.php | 2 +- tests/Zend/Pdf/ProcessingTest.php | 2 +- tests/Zend/PdfTest.php | 34 +- .../Zend/ProgressBar/Adapter/ConsoleTest.php | 10 +- tests/Zend/ProgressBar/Adapter/JsPullTest.php | 2 +- tests/Zend/ProgressBar/Adapter/JsPushTest.php | 2 +- tests/Zend/ProgressBar/ProgressBarTest.php | 2 +- .../Queue/Adapter/ActivemqOfflineTest.php | 2 +- tests/Zend/Queue/Adapter/ActivemqTest.php | 6 +- tests/Zend/Queue/Adapter/AdapterTest.php | 12 +- tests/Zend/Queue/Adapter/ArrayTest.php | 2 +- tests/Zend/Queue/Adapter/MemcacheqTest.php | 6 +- tests/Zend/Queue/CustomTest.php | 2 +- tests/Zend/Queue/FactoryTest.php | 2 +- tests/Zend/Queue/Message/IteratorTest.php | 8 +- tests/Zend/Queue/MessageTest.php | 6 +- tests/Zend/Queue/QueueBaseTest.php | 20 +- tests/Zend/Queue/QueueTest.php | 18 +- tests/Zend/Queue/Stomp/ClientTest.php | 2 +- tests/Zend/Queue/Stomp/FrameTest.php | 8 +- tests/Zend/Reflection/ClassTest.php | 2 +- .../Reflection/Docblock/Tag/ParamTest.php | 2 +- .../Reflection/Docblock/Tag/ReturnTest.php | 2 +- tests/Zend/Reflection/Docblock/TagTest.php | 2 +- tests/Zend/Reflection/DocblockTest.php | 2 +- tests/Zend/Reflection/ExtensionTest.php | 2 +- tests/Zend/Reflection/FileTest.php | 8 +- tests/Zend/Reflection/FunctionTest.php | 2 +- tests/Zend/Reflection/MethodTest.php | 2 +- tests/Zend/Reflection/ParameterTest.php | 2 +- tests/Zend/Reflection/PropertyTest.php | 2 +- tests/Zend/RegistryTest.php | 2 +- tests/Zend/Rest/ClientTest.php | 2 +- tests/Zend/Rest/ControllerTest.php | 2 +- tests/Zend/Rest/ResultTest.php | 6 +- tests/Zend/Rest/RouteTest.php | 84 ++-- tests/Zend/Rest/ServerTest.php | 10 +- tests/Zend/Search/Lucene/AnalysisTest.php | 2 +- tests/Zend/Search/Lucene/DocumentTest.php | 4 +- tests/Zend/Search/Lucene/FSMTest.php | 2 +- tests/Zend/Search/Lucene/FieldTest.php | 2 +- .../Lucene/Index/DictionaryLoaderTest.php | 2 +- .../Search/Lucene/Index/FieldInfoTest.php | 2 +- .../Search/Lucene/Index/SegmentInfoTest.php | 2 +- .../Search/Lucene/Index/SegmentMergerTest.php | 2 +- .../Zend/Search/Lucene/Index/TermInfoTest.php | 2 +- tests/Zend/Search/Lucene/Index/TermTest.php | 2 +- .../Lucene/Index/TermsPriorityQueueTest.php | 2 +- tests/Zend/Search/Lucene/LuceneTest.php | 2 +- .../Zend/Search/Lucene/PriorityQueueTest.php | 2 +- tests/Zend/Search/Lucene/Search23Test.php | 2 +- .../Search/Lucene/SearchHighlightTest.php | 2 +- tests/Zend/Search/Lucene/SearchTest.php | 2 +- .../Search/Lucene/Storage/DirectoryTest.php | 2 +- tests/Zend/Search/Lucene/Storage/FileTest.php | 2 +- tests/Zend/Serializer/Adapter/Amf0Test.php | 2 +- tests/Zend/Serializer/Adapter/Amf3Test.php | 2 +- .../Zend/Serializer/Adapter/IgbinaryTest.php | 4 +- tests/Zend/Serializer/Adapter/JsonTest.php | 4 +- tests/Zend/Serializer/Adapter/PhpCodeTest.php | 4 +- .../Serializer/Adapter/PhpSerializeTest.php | 4 +- .../PythonPickleSerializeProtocol0Test.php | 2 +- .../PythonPickleSerializeProtocol1Test.php | 2 +- .../Adapter/PythonPickleUnserializeTest.php | 4 +- tests/Zend/Serializer/Adapter/WddxTest.php | 12 +- tests/Zend/Serializer/SerializerTest.php | 8 +- tests/Zend/Server/DefinitionTest.php | 8 +- tests/Zend/Server/Method/CallbackTest.php | 7 +- tests/Zend/Server/Method/DefinitionTest.php | 13 +- tests/Zend/Server/Method/ParameterTest.php | 2 +- tests/Zend/Server/Method/PrototypeTest.php | 8 +- tests/Zend/Server/Reflection/ClassTest.php | 8 +- tests/Zend/Server/Reflection/FunctionTest.php | 18 +- tests/Zend/Server/Reflection/MethodTest.php | 2 +- tests/Zend/Server/Reflection/NodeTest.php | 8 +- .../Zend/Server/Reflection/ParameterTest.php | 6 +- .../Zend/Server/Reflection/PrototypeTest.php | 4 +- .../Server/Reflection/ReturnValueTest.php | 2 +- tests/Zend/Server/ReflectionTest.php | 2 +- tests/Zend/Service/AkismetTest.php | 2 +- tests/Zend/Service/Amazon/AbstractTest.php | 2 +- .../Service/Amazon/Authentication/S3Test.php | 2 +- .../Service/Amazon/Authentication/V1Test.php | 2 +- .../Service/Amazon/Authentication/V2Test.php | 2 +- .../Zend/Service/Amazon/Ec2/AbstractTest.php | 2 +- .../Amazon/Ec2/AvailabilityzonesTest.php | 6 +- .../Service/Amazon/Ec2/CloudWatchTest.php | 2 +- tests/Zend/Service/Amazon/Ec2/EbsTest.php | 2 +- tests/Zend/Service/Amazon/Ec2/Ec2Test.php | 2 +- .../Zend/Service/Amazon/Ec2/ElasticipTest.php | 2 +- tests/Zend/Service/Amazon/Ec2/ImageTest.php | 2 +- .../Amazon/Ec2/InstanceReservedTest.php | 2 +- .../Zend/Service/Amazon/Ec2/InstanceTest.php | 2 +- .../Amazon/Ec2/InstanceWindowsTest.php | 2 +- tests/Zend/Service/Amazon/Ec2/KeypairTest.php | 8 +- tests/Zend/Service/Amazon/Ec2/RegionTest.php | 2 +- .../Service/Amazon/Ec2/SecuritygroupsTest.php | 2 +- tests/Zend/Service/Amazon/OfflineTest.php | 2 +- tests/Zend/Service/Amazon/OnlineTest.php | 2 +- tests/Zend/Service/Amazon/S3/OnlineTest.php | 6 +- tests/Zend/Service/Amazon/S3/StreamTest.php | 8 +- .../Service/Amazon/SimpleDb/OnlineTest.php | 50 +- .../Zend/Service/Amazon/SimpleDb/PageTest.php | 2 +- tests/Zend/Service/Amazon/Sqs/OfflineTest.php | 10 +- tests/Zend/Service/Amazon/Sqs/OnlineTest.php | 4 +- .../Audioscrobbler/AudioscrobblerTest.php | 4 +- .../Audioscrobbler/AudioscrobblerTestCase.php | 2 +- tests/Zend/Service/Delicious/PostTest.php | 2 +- .../Service/Delicious/PrivateDataTest.php | 12 +- .../Zend/Service/Delicious/PublicDataTest.php | 18 +- .../Zend/Service/Delicious/SimplePostTest.php | 2 +- tests/Zend/Service/Ebay/AbstractTest.php | 6 +- .../Zend/Service/Ebay/Finding/OfflineTest.php | 18 +- .../Zend/Service/Ebay/Finding/OnlineTest.php | 2 +- tests/Zend/Service/Flickr/OfflineTest.php | 2 +- tests/Zend/Service/Flickr/OnlineTest.php | 2 +- tests/Zend/Service/LiveDocx/LiveDocxTest.php | 2 +- tests/Zend/Service/LiveDocx/MailMergeTest.php | 10 +- .../Service/Rackspace/Files/OfflineTest.php | 10 +- .../Service/Rackspace/Files/OnlineTest.php | 8 +- tests/Zend/Service/Rackspace/OfflineTest.php | 20 +- .../Service/Rackspace/Servers/OfflineTest.php | 2 +- .../Service/Rackspace/Servers/OnlineTest.php | 2 +- tests/Zend/Service/ReCaptcha/MailHideTest.php | 8 +- .../Zend/Service/ReCaptcha/ReCaptchaTest.php | 12 +- tests/Zend/Service/ReCaptcha/ResponseTest.php | 2 +- tests/Zend/Service/ShortUrl/BitLyTest.php | 8 +- tests/Zend/Service/ShortUrl/IsGdTest.php | 12 +- tests/Zend/Service/ShortUrl/JdemCzTest.php | 12 +- .../Zend/Service/ShortUrl/MetamarkNetTest.php | 12 +- .../Zend/Service/ShortUrl/TinyUrlComTest.php | 12 +- tests/Zend/Service/SlideShareTest.php | 8 +- .../Management/ManagementClientTest.php | 8 +- tests/Zend/Service/StrikeIron/BaseTest.php | 8 +- .../Zend/Service/StrikeIron/DecoratorTest.php | 2 +- .../Zend/Service/StrikeIron/ExceptionTest.php | 2 +- tests/Zend/Service/StrikeIron/NoSoapTest.php | 2 +- .../StrikeIron/SalesUseTaxBasicTest.php | 2 +- .../Service/StrikeIron/StrikeIronTest.php | 2 +- .../StrikeIron/USAddressVerificationTest.php | 2 +- .../Service/StrikeIron/ZipCodeInfoTest.php | 2 +- tests/Zend/Service/Twitter/TwitterTest.php | 18 +- .../BlobStorageSharedAccessTest.php | 7 +- .../Service/WindowsAzure/BlobStorageTest.php | 14 +- .../Service/WindowsAzure/BlobStreamTest.php | 8 +- .../Credentials/SharedAccessSignatureTest.php | 2 +- .../Credentials/SharedKeyLiteTest.php | 14 +- .../Credentials/SharedKeyTest.php | 14 +- .../WindowsAzure/Diagnostics/ManagerTest.php | 2 +- .../WindowsAzure/DynamicTableEntityTest.php | 2 +- .../Management/ManagementClientTest.php | 8 +- .../Service/WindowsAzure/QueueStorageTest.php | 2 +- .../Service/WindowsAzure/RetryPolicyTest.php | 2 +- .../WindowsAzure/SessionHandlerTest.php | 8 +- .../Zend/Service/WindowsAzure/StorageTest.php | 2 +- .../WindowsAzure/TableEntityQueryTest.php | 2 +- .../Service/WindowsAzure/TableEntityTest.php | 2 +- .../WindowsAzure/TableSessionHandlerTest.php | 6 +- .../Service/WindowsAzure/TableStorageTest.php | 6 +- tests/Zend/Service/Yahoo/OfflineTest.php | 2 +- tests/Zend/Service/Yahoo/OnlineTest.php | 2 +- .../Zend/Session/SaveHandler/DbTableTest.php | 10 +- tests/Zend/Session/SessionTest.php | 20 +- tests/Zend/Soap/AutoDiscover/OnlineTest.php | 6 +- tests/Zend/Soap/AutoDiscoverTest.php | 2 +- tests/Zend/Soap/ClientTest.php | 2 +- tests/Zend/Soap/ServerTest.php | 4 +- .../Wsdl/ArrayOfTypeComplexStrategyTest.php | 2 +- .../Wsdl/ArrayOfTypeSequenceStrategyTest.php | 4 +- .../Zend/Soap/Wsdl/CompositeStrategyTest.php | 2 +- .../Zend/Soap/Wsdl/DefaultComplexTypeTest.php | 2 +- tests/Zend/Soap/WsdlTest.php | 2 +- tests/Zend/Stdlib/CallbackHandlerTest.php | 14 +- tests/Zend/Stdlib/PriorityQueueTest.php | 2 +- tests/Zend/Stdlib/SplPriorityQueueTest.php | 2 +- tests/Zend/Tag/Cloud/CloudTest.php | 2 +- .../Tag/Cloud/Decorator/HtmlCloudTest.php | 2 +- .../Zend/Tag/Cloud/Decorator/HtmlTagTest.php | 2 +- tests/Zend/Tag/ItemListTest.php | 2 +- tests/Zend/Tag/ItemTest.php | 4 +- tests/Zend/Test/DbAdapterTest.php | 2 +- tests/Zend/Test/DbStatementTest.php | 6 +- .../Test/PHPUnit/Constraint/DomQueryTest.php | 2 +- .../Test/PHPUnit/ControllerTestCaseTest.php | 19 +- tests/Zend/Test/PHPUnit/Db/ConnectionTest.php | 2 +- .../PHPUnit/Db/DataSet/DataSetTestCase.php | 4 +- .../Test/PHPUnit/Db/DataSet/DbRowsetTest.php | 4 +- .../PHPUnit/Db/DataSet/DbTableDataSetTest.php | 4 +- .../Test/PHPUnit/Db/DataSet/DbTableTest.php | 2 +- .../PHPUnit/Db/DataSet/QueryDataSetTest.php | 4 +- .../PHPUnit/Db/DataSet/QueryTableTest.php | 6 +- .../Db/Integration/AbstractTestCase.php | 6 +- .../Test/PHPUnit/Db/Metadata/GenericTest.php | 2 +- .../PHPUnit/Db/Operation/DeleteAllTest.php | 14 +- .../Test/PHPUnit/Db/Operation/InsertTest.php | 14 +- .../PHPUnit/Db/Operation/TruncateTest.php | 16 +- .../Zend/Test/PHPUnit/Db/SimpleTesterTest.php | 8 +- tests/Zend/Test/PHPUnit/Db/TestCaseTest.php | 12 +- tests/Zend/Text/FigletTest.php | 5 +- tests/Zend/Text/MultiByteTest.php | 2 +- tests/Zend/Text/TableTest.php | 2 +- tests/Zend/TimeSyncTest.php | 2 +- tests/Zend/Tool/Framework/Action/BaseTest.php | 2 +- .../Tool/Framework/Action/RepositoryTest.php | 8 +- .../Tool/Framework/Client/RequestTest.php | 2 +- .../Tool/Framework/Client/ResponseTest.php | 5 +- .../Loader/IncludePathLoaderTest.php | 2 +- .../Manifest/ProviderMetadataTest.php | 2 +- .../Framework/Manifest/RepositoryTest.php | 8 +- .../Framework/Metadata/ActionMetadataTest.php | 2 +- .../Tool/Framework/Metadata/MetadataTest.php | 2 +- .../Tool/Framework/Provider/AbstractTest.php | 2 +- .../Framework/Provider/RepositoryTest.php | 5 +- .../Tool/Framework/Provider/SignatureTest.php | 8 +- tests/Zend/Tool/Framework/RegistryTest.php | 14 +- .../Tool/Project/Context/RegistryTest.php | 8 +- tests/Zend/Tool/Project/ProfileTest.php | 24 +- .../Tool/Project/Provider/ControllerTest.php | 2 +- .../Tool/Project/_files/project1/.gitignore | 2 - tests/Zend/Translate/Adapter/ArrayTest.php | 4 +- tests/Zend/Translate/Adapter/CsvTest.php | 4 +- tests/Zend/Translate/Adapter/GettextTest.php | 8 +- tests/Zend/Translate/Adapter/IniTest.php | 4 +- tests/Zend/Translate/Adapter/QtTest.php | 4 +- tests/Zend/Translate/Adapter/TbxTest.php | 4 +- tests/Zend/Translate/Adapter/TmxTest.php | 4 +- tests/Zend/Translate/Adapter/XliffTest.php | 4 +- tests/Zend/Translate/Adapter/XmlTmTest.php | 4 +- tests/Zend/TranslateTest.php | 38 +- tests/Zend/Uri/HttpTest.php | 15 +- tests/Zend/UriTest.php | 13 +- tests/Zend/Validate/AbstractTest.php | 14 +- tests/Zend/Validate/AlnumTest.php | 2 +- tests/Zend/Validate/AlphaTest.php | 2 +- tests/Zend/Validate/BarcodeTest.php | 6 +- tests/Zend/Validate/BetweenTest.php | 2 +- tests/Zend/Validate/CallbackTest.php | 2 +- tests/Zend/Validate/CcnumTest.php | 2 +- tests/Zend/Validate/CreditCardTest.php | 2 +- tests/Zend/Validate/DateTest.php | 2 +- tests/Zend/Validate/Db/NoRecordExistsTest.php | 4 +- tests/Zend/Validate/Db/RecordExistsTest.php | 4 +- tests/Zend/Validate/DigitsTest.php | 2 +- tests/Zend/Validate/EmailAddressTest.php | 4 +- tests/Zend/Validate/File/CountTest.php | 2 +- tests/Zend/Validate/File/Crc32Test.php | 8 +- .../Validate/File/ExcludeExtensionTest.php | 8 +- .../Validate/File/ExcludeMimeTypeTest.php | 2 +- tests/Zend/Validate/File/ExistsTest.php | 2 +- tests/Zend/Validate/File/ExtensionTest.php | 8 +- tests/Zend/Validate/File/FilesSizeTest.php | 4 +- tests/Zend/Validate/File/HashTest.php | 8 +- tests/Zend/Validate/File/ImageSizeTest.php | 2 +- tests/Zend/Validate/File/IsCompressedTest.php | 4 +- tests/Zend/Validate/File/IsImageTest.php | 4 +- tests/Zend/Validate/File/Md5Test.php | 8 +- tests/Zend/Validate/File/MimeTypeTest.php | 2 +- tests/Zend/Validate/File/NotExistsTest.php | 2 +- tests/Zend/Validate/File/Sha1Test.php | 8 +- tests/Zend/Validate/File/SizeTest.php | 2 +- tests/Zend/Validate/File/UploadTest.php | 26 +- tests/Zend/Validate/File/WordCountTest.php | 2 +- tests/Zend/Validate/FloatTest.php | 2 +- tests/Zend/Validate/GreaterThanTest.php | 2 +- tests/Zend/Validate/HexTest.php | 2 +- tests/Zend/Validate/HostnameTest.php | 2 +- tests/Zend/Validate/IbanTest.php | 2 +- tests/Zend/Validate/IdenticalTest.php | 6 +- tests/Zend/Validate/InArrayTest.php | 2 +- tests/Zend/Validate/IntTest.php | 2 +- tests/Zend/Validate/IpTest.php | 2 +- tests/Zend/Validate/IsbnTest.php | 2 +- tests/Zend/Validate/LessThanTest.php | 2 +- tests/Zend/Validate/MessageTest.php | 4 +- tests/Zend/Validate/NotEmptyTest.php | 4 +- tests/Zend/Validate/PostCodeTest.php | 2 +- tests/Zend/Validate/RegexTest.php | 2 +- .../Zend/Validate/Sitemap/ChangefreqTest.php | 2 +- tests/Zend/Validate/Sitemap/LastmodTest.php | 2 +- tests/Zend/Validate/Sitemap/LocTest.php | 2 +- tests/Zend/Validate/Sitemap/PriorityTest.php | 2 +- tests/Zend/Validate/StringLengthTest.php | 5 +- tests/Zend/ValidateTest.php | 5 +- tests/Zend/VersionTest.php | 2 +- tests/Zend/View/Helper/ActionTest.php | 8 +- .../View/Helper/AttributeJsEscapingTest.php | 2 +- tests/Zend/View/Helper/BaseUrlTest.php | 2 +- tests/Zend/View/Helper/CurrencyTest.php | 2 +- tests/Zend/View/Helper/CycleTest.php | 2 +- tests/Zend/View/Helper/DeclareVarsTest.php | 2 +- tests/Zend/View/Helper/DoctypeTest.php | 4 +- tests/Zend/View/Helper/FieldsetTest.php | 2 +- tests/Zend/View/Helper/FormButtonTest.php | 2 +- tests/Zend/View/Helper/FormCheckboxTest.php | 2 +- tests/Zend/View/Helper/FormErrorsTest.php | 2 +- tests/Zend/View/Helper/FormFileTest.php | 2 +- tests/Zend/View/Helper/FormImageTest.php | 2 +- tests/Zend/View/Helper/FormLabelTest.php | 2 +- .../View/Helper/FormMultiCheckboxTest.php | 2 +- tests/Zend/View/Helper/FormPasswordTest.php | 2 +- tests/Zend/View/Helper/FormRadioTest.php | 2 +- tests/Zend/View/Helper/FormResetTest.php | 2 +- tests/Zend/View/Helper/FormSelectTest.php | 2 +- tests/Zend/View/Helper/FormSubmitTest.php | 2 +- tests/Zend/View/Helper/FormTest.php | 2 +- tests/Zend/View/Helper/FormTextTest.php | 2 +- tests/Zend/View/Helper/FormTextareaTest.php | 4 +- tests/Zend/View/Helper/GravatarTest.php | 8 +- tests/Zend/View/Helper/HeadLinkTest.php | 2 +- tests/Zend/View/Helper/HeadMetaTest.php | 10 +- tests/Zend/View/Helper/HeadScriptTest.php | 2 +- tests/Zend/View/Helper/HeadStyleTest.php | 2 +- tests/Zend/View/Helper/HeadTitleTest.php | 2 +- tests/Zend/View/Helper/HtmlFlashTest.php | 2 +- tests/Zend/View/Helper/HtmlListTest.php | 2 +- tests/Zend/View/Helper/HtmlObjectTest.php | 2 +- tests/Zend/View/Helper/HtmlPageTest.php | 2 +- tests/Zend/View/Helper/HtmlQuicktimeTest.php | 2 +- tests/Zend/View/Helper/InlineScriptTest.php | 2 +- tests/Zend/View/Helper/JsonTest.php | 4 +- tests/Zend/View/Helper/LayoutTest.php | 2 +- .../View/Helper/Navigation/TestAbstract.php | 2 +- .../View/Helper/PaginationControlTest.php | 2 +- tests/Zend/View/Helper/PartialLoopTest.php | 2 +- tests/Zend/View/Helper/PartialTest.php | 4 +- .../View/Helper/Placeholder/ContainerTest.php | 2 +- .../View/Helper/Placeholder/RegistryTest.php | 2 +- .../Placeholder/StandaloneContainerTest.php | 2 +- tests/Zend/View/Helper/PlaceholderTest.php | 2 +- .../View/Helper/RenderToPlaceholderTest.php | 2 +- tests/Zend/View/Helper/ServerUrlTest.php | 2 +- tests/Zend/View/Helper/TranslateTest.php | 2 +- tests/Zend/View/Helper/UrlTest.php | 2 +- tests/Zend/View/Helper/UserAgentTest.php | 2 +- tests/Zend/ViewTest.php | 54 +-- tests/Zend/Wildfire/WildfireTest.php | 2 +- tests/Zend/Xml/MultibyteTest.php | 11 +- tests/Zend/Xml/SecurityTest.php | 4 +- tests/Zend/XmlRpc/BigIntegerValueTest.php | 2 +- tests/Zend/XmlRpc/ClientTest.php | 2 +- tests/Zend/XmlRpc/FaultTest.php | 2 +- tests/Zend/XmlRpc/GeneratorTest.php | 4 +- tests/Zend/XmlRpc/Request/HttpTest.php | 2 +- tests/Zend/XmlRpc/RequestTest.php | 4 +- tests/Zend/XmlRpc/ResponseTest.php | 4 +- tests/Zend/XmlRpc/Server/CacheTest.php | 2 +- tests/Zend/XmlRpc/Server/FaultTest.php | 4 +- tests/Zend/XmlRpc/ServerTest.php | 46 +- tests/Zend/XmlRpc/ValueTest.php | 19 +- tests/phpunit.xml | 9 +- .../resources/languages/Zend_ValidateTest.php | 2 +- tests/runalltests.php | 2 +- 1115 files changed, 4052 insertions(+), 5990 deletions(-) delete mode 100644 library/Zend/Test/PHPUnit/Constraint/DomQuery34.php delete mode 100644 library/Zend/Test/PHPUnit/Constraint/DomQuery37.php delete mode 100644 library/Zend/Test/PHPUnit/Constraint/Redirect34.php delete mode 100644 library/Zend/Test/PHPUnit/Constraint/Redirect37.php delete mode 100644 library/Zend/Test/PHPUnit/Constraint/ResponseHeader34.php delete mode 100644 library/Zend/Test/PHPUnit/Constraint/ResponseHeader37.php delete mode 100644 tests/Zend/Tool/Project/_files/project1/.gitignore diff --git a/.travis.yml b/.travis.yml index eeb024e701..bdad3162f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ language: php sudo: false php: - - 5.6 - 7 - 7.1 - 7.2 diff --git a/composer.json b/composer.json index 161e019911..30afdff56f 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "homepage": "http://framework.zend.com/", "license": "BSD-3-Clause", "require": { - "php": ">=5.6.0" + "php": ">=7.0.0" }, "autoload": { "psr-0": { @@ -22,15 +22,10 @@ "config": { "bin-dir": "bin" }, - "extra": { - "branch-alias": { - "dev-master": "1.12.x-dev" - } - }, "require-dev": { - "phpunit/phpunit": "5.*", - "phpunit/dbunit": "1.3.*", - "phpunit/phpcov": "^3.0" + "phpunit/phpunit": "^6.0", + "phpunit/dbunit": "^3.0.2", + "phpunit/phpcov": "^4.0" }, "archive": { "exclude": ["/demos", "/documentation", "/tests"] diff --git a/documentation/manual/de/module_specs/Zend_Test-PHPUnit-Bootstrapping.xml b/documentation/manual/de/module_specs/Zend_Test-PHPUnit-Bootstrapping.xml index 4354193b78..d5aa8f3360 100644 --- a/documentation/manual/de/module_specs/Zend_Test-PHPUnit-Bootstrapping.xml +++ b/documentation/manual/de/module_specs/Zend_Test-PHPUnit-Bootstrapping.xml @@ -8,7 +8,7 @@ Wie im Login-Beispiel gezeigt, sollten alle MVC-Testfälle Zend_Test_PHPUnit_ControllerTestCase erweitern. Diese Klasse - ihrerseits erweitert PHPUnit_Framework_TestCase und gibt einem alle + ihrerseits erweitert PHPUnit\Framework\TestCase und gibt einem alle Strukturen und Zusicherungen, die man von PHPUnit erwartet -- sowie einiges an Scaffolding und Zusicherungen, die genau auf die Zend Framework MVC-Implementation zugeschnitten sind. diff --git a/documentation/manual/de/module_specs/Zend_Test-PHPUnit-Db-Quickstart.xml b/documentation/manual/de/module_specs/Zend_Test-PHPUnit-Db-Quickstart.xml index 6ca72fdc56..6c72976d9c 100644 --- a/documentation/manual/de/module_specs/Zend_Test-PHPUnit-Db-Quickstart.xml +++ b/documentation/manual/de/module_specs/Zend_Test-PHPUnit-Db-Quickstart.xml @@ -14,7 +14,7 @@ abgespeichert wird. Zuerst müssen wir eine Test-Klasse erstellen die Zend_Test_PHPUnit_DatabaseTestCase erweitert. Diese Klasse erweitert die Datenbank Erweiterung von PHPUnit, welche Ihrerseits den standardmäßigen - Basis PHPUnit_Framework_TestCase erweitert. Ein Datenbank + Basis PHPUnit\Framework\TestCase erweitert. Ein Datenbank Testcase enthält zwei abstrakte Methoden die implementiert werden müssen, eine für die Datenbank Verbindung und eine für das initiale Datenset das als Seed oder Fixum verwendet werden soll. @@ -37,7 +37,7 @@ class BugsTest extends Zend_Test_PHPUnit_DatabaseTestCase /** * Returns the test database connection. * - * @return PHPUnit_Extensions_Database_DB_IDatabaseConnection + * @return PHPUnit\DbUnit\Database\Connection */ protected function getConnection() { @@ -52,7 +52,7 @@ class BugsTest extends Zend_Test_PHPUnit_DatabaseTestCase } /** - * @return PHPUnit_Extensions_Database_DataSet_IDataSet + * @return PHPUnit\DbUnit\DataSet\IDataSet */ protected function getDataSet() { @@ -98,7 +98,7 @@ class BugsTest extends Zend_Test_PHPUnit_DatabaseTestCase DataSets müssen das Interface - PHPUnit_Extensions_Database_DataSet_IDataSet + PHPUnit\DbUnit\DataSet\IDataSet implementieren. Es gibt eine Vielzahl an Typen von XML und YAML Konfigurationsdateien die in PHPUnit enthalten sind, welche es erlauben zu spezifizieren wie Tabellen und Datensätze auszusehen haben und man sollte in die diff --git a/documentation/manual/de/module_specs/Zend_Test-PHPUnit-Db-Testing.xml b/documentation/manual/de/module_specs/Zend_Test-PHPUnit-Db-Testing.xml index b37462aa4d..f7306d20d1 100644 --- a/documentation/manual/de/module_specs/Zend_Test-PHPUnit-Db-Testing.xml +++ b/documentation/manual/de/module_specs/Zend_Test-PHPUnit-Db-Testing.xml @@ -37,7 +37,7 @@ Die Klasse Zend_Test_PHPUnit_DatabaseTestCase ist von - PHPUnit_Extensions_Database_TestCase abgeleitet welche es + PHPUnit\DbUnit\TestCase abgeleitet welche es erlaubt Tests mit einer frischen und fixen Datenbank einfach für jeden Lauf zu erstellen. Die Implementation von Zend bietet einige bequeme zusätzliche Features über die Database Erweiterung von PHPUnit wenn es zur Verwendung von @@ -110,7 +110,7 @@ Die nächste Tabelle listet nur die neuen Methoden verglichen mit - PHPUnit_Extensions_Database_TestCase auf, dessen PHPUnit\DbUnit\TestCase auf, dessen API in der Dokumentation von PHPUnit dokumentiert ist. @@ -239,7 +239,7 @@ class UserControllerTest extends Zend_Test_PHPUnit_ControllerTestCase $databaseTester = new Zend_Test_PHPUnit_Db_SimpleTester($connection); $databaseFixture = - new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet( + new PHPUnit\DbUnit\DataSet\FlatXmlDataSet( dirname(__FILE__) . '/_files/initialUserFixture.xml' ); diff --git a/documentation/manual/en/module_specs/Zend_Test-PHPUnit-Bootstrapping.xml b/documentation/manual/en/module_specs/Zend_Test-PHPUnit-Bootstrapping.xml index 47ee765cd5..d3f89b34b5 100644 --- a/documentation/manual/en/module_specs/Zend_Test-PHPUnit-Bootstrapping.xml +++ b/documentation/manual/en/module_specs/Zend_Test-PHPUnit-Bootstrapping.xml @@ -7,7 +7,7 @@ As noted in the Login example, all MVC test cases should extend Zend_Test_PHPUnit_ControllerTestCase. This class in turn - extends PHPUnit_Framework_TestCase, and gives you all the + extends PHPUnit\Framework\TestCase, and gives you all the structure and assertions you'd expect from PHPUnit -- as well as some scaffolding and assertions specific to Zend Framework's MVC implementation. diff --git a/documentation/manual/en/module_specs/Zend_Test-PHPUnit-Db-Quickstart.xml b/documentation/manual/en/module_specs/Zend_Test-PHPUnit-Db-Quickstart.xml index a5256446d6..bc8b3aba9c 100644 --- a/documentation/manual/en/module_specs/Zend_Test-PHPUnit-Db-Quickstart.xml +++ b/documentation/manual/en/module_specs/Zend_Test-PHPUnit-Db-Quickstart.xml @@ -13,7 +13,7 @@ setup a test-class that extends Zend_Test_PHPUnit_DatabaseTestCase. This class extends the PHPUnit Database Extension, which in turn extends the basic - PHPUnit_Framework_TestCase. A database testcase contains two + PHPUnit\Framework\TestCase. A database testcase contains two abstract methods that have to be implemented, one for the database connection and one for the initial dataset that should be used as seed or fixture. @@ -34,7 +34,7 @@ class BugsTest extends Zend_Test_PHPUnit_DatabaseTestCase /** * Returns the test database connection. * - * @return PHPUnit_Extensions_Database_DB_IDatabaseConnection + * @return PHPUnit\DbUnit\Database\Connection */ protected function getConnection() { @@ -49,7 +49,7 @@ class BugsTest extends Zend_Test_PHPUnit_DatabaseTestCase } /** - * @return PHPUnit_Extensions_Database_DataSet_IDataSet + * @return PHPUnit\DbUnit\DataSet\IDataSet */ protected function getDataSet() { @@ -94,7 +94,7 @@ class BugsTest extends Zend_Test_PHPUnit_DatabaseTestCase DataSets have to implement the interface - PHPUnit_Extensions_Database_DataSet_IDataSet. + PHPUnit\DbUnit\DataSet\IDataSet. There is a wide range of XML and YAML configuration file types included in PHPUnit which allows to specifiy how the tables and datasets should look like and you should look into the PHPUnit documentation to get the diff --git a/documentation/manual/en/module_specs/Zend_Test-PHPUnit-Db-Testing.xml b/documentation/manual/en/module_specs/Zend_Test-PHPUnit-Db-Testing.xml index 23db609ce2..1386e47a80 100644 --- a/documentation/manual/en/module_specs/Zend_Test-PHPUnit-Db-Testing.xml +++ b/documentation/manual/en/module_specs/Zend_Test-PHPUnit-Db-Testing.xml @@ -33,7 +33,7 @@ The Zend_Test_PHPUnit_DatabaseTestCase class derives from the - PHPUnit_Extensions_Database_TestCase which allows to setup tests + PHPUnit\DbUnit\TestCase which allows to setup tests with a fresh database fixture on each run easily. The Zend implementation offers some additional convenience features over the PHPUnit Database extension when it comes to using Zend_Db resources inside your tests. The workflow of a @@ -103,7 +103,7 @@ The next table lists only the new methods compared to the - PHPUnit_Extensions_Database_TestCase, whose PHPUnit\DbUnit\TestCase, whose API is documented in the PHPUnit Documentation. @@ -228,7 +228,7 @@ class UserControllerTest extends Zend_Test_PHPUnit_ControllerTestCase $databaseTester = new Zend_Test_PHPUnit_Db_SimpleTester($connection); $databaseFixture = - new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet( + new PHPUnit\DbUnit\DataSet\FlatXmlDataSet( dirname(__FILE__) . '/_files/initialUserFixture.xml' ); diff --git a/documentation/manual/fr/module_specs/Zend_Test-PHPUnit-Bootstrapping.xml b/documentation/manual/fr/module_specs/Zend_Test-PHPUnit-Bootstrapping.xml index 5d4c11c09c..f8113469c7 100644 --- a/documentation/manual/fr/module_specs/Zend_Test-PHPUnit-Bootstrapping.xml +++ b/documentation/manual/fr/module_specs/Zend_Test-PHPUnit-Bootstrapping.xml @@ -8,7 +8,7 @@ Comme noté dans l'exemple de login, tous les tests MVC doivent étendre Zend_Test_PHPUnit_ControllerTestCase. Cette classe étend elle-même - PHPUnit_Framework_TestCase, et vous fournit donc toute la structure et les + PHPUnit\Framework\TestCase, et vous fournit donc toute la structure et les assertions que vous attendez de PHPUnit - ainsi que quelques échafaudages et assertions spécifiques à l'implémentation MVC de Zend Framework. diff --git a/documentation/manual/fr/module_specs/Zend_Test-PHPUnit-Db-Quickstart.xml b/documentation/manual/fr/module_specs/Zend_Test-PHPUnit-Db-Quickstart.xml index 5a4732e243..a213c6118c 100755 --- a/documentation/manual/fr/module_specs/Zend_Test-PHPUnit-Db-Quickstart.xml +++ b/documentation/manual/fr/module_specs/Zend_Test-PHPUnit-Db-Quickstart.xml @@ -14,7 +14,7 @@ de tests sous forme de classe étendant Zend_Test_PHPUnit_DatabaseTestCase. Cette classe étend elle- même PHPUnit Database Extension, qui étend alors - PHPUnit_Framework_TestCase. Un cas de test pour base de données + PHPUnit\Framework\TestCase. Un cas de test pour base de données contient deux méthodes abstraites à définir, une concernant la connexion à la base et l'autre concernant les données à utiliser comme source pour les tests. @@ -36,7 +36,7 @@ class BugsTest extends Zend_Test_PHPUnit_DatabaseTestCase /** * Retourne la connexion de test * - * @return PHPUnit_Extensions_Database_DB_IDatabaseConnection + * @return PHPUnit\DbUnit\Database\Connection */ protected function getConnection() { @@ -51,7 +51,7 @@ class BugsTest extends Zend_Test_PHPUnit_DatabaseTestCase } /** - * @return PHPUnit_Extensions_Database_DataSet_IDataSet + * @return PHPUnit\DbUnit\DataSet\IDataSet */ protected function getDataSet() { @@ -94,7 +94,7 @@ class BugsTest extends Zend_Test_PHPUnit_DatabaseTestCase Les jeux de données (DataSets) doivent implémenter - PHPUnit_Extensions_Database_DataSet_IDataSet. + PHPUnit\DbUnit\DataSet\IDataSet. Il en existe quelques uns, basés sur XML ou YAML et ils sont inclus dans PHPUnit et permettent de décrire les données fictives pour les tests. Vous devriez vous reporter à la documentation de PHPUnit pour diff --git a/documentation/manual/fr/module_specs/Zend_Test-PHPUnit-Db-Testing.xml b/documentation/manual/fr/module_specs/Zend_Test-PHPUnit-Db-Testing.xml index c7d3ae107a..69042c8e74 100644 --- a/documentation/manual/fr/module_specs/Zend_Test-PHPUnit-Db-Testing.xml +++ b/documentation/manual/fr/module_specs/Zend_Test-PHPUnit-Db-Testing.xml @@ -33,7 +33,7 @@ La classe Zend_Test_PHPUnit_DatabaseTestCase étend - PHPUnit_Extensions_Database_TestCase, celle-ci permet de configurer + PHPUnit\DbUnit\TestCase, celle-ci permet de configurer un jeu de données concernant la base, pour chaque test. L'implementation du Zend Framework offre quelques fonctionalités supplémentaires par rapport à l'extension PHPUnit concernant les bases de données, ceci dans le but d'utiliser des ressources provenant de @@ -101,7 +101,7 @@ Le tableau suivant liste uniquement les nouvelles méthodes par rapport à la classe - PHPUnit_Extensions_Database_TestCase, dont l'PHPUnit\DbUnit\TestCase, dont l'API est documentée dans la documentation de PHPUnit. @@ -223,7 +223,7 @@ class UserControllerTest extends Zend_Test_PHPUnit_ControllerTestCase $databaseTester = new Zend_Test_PHPUnit_Db_SimpleTester($connection); $databaseFixture = - new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet( + new PHPUnit\DbUnit\DataSet\FlatXmlDataSet( dirname(__FILE__) . '/_files/initialUserFixture.xml' ); diff --git a/documentation/manual/ja/module_specs/Zend_Test-PHPUnit-Bootstrapping.xml b/documentation/manual/ja/module_specs/Zend_Test-PHPUnit-Bootstrapping.xml index 53c44e1ba6..6ac1c99a0d 100644 --- a/documentation/manual/ja/module_specs/Zend_Test-PHPUnit-Bootstrapping.xml +++ b/documentation/manual/ja/module_specs/Zend_Test-PHPUnit-Bootstrapping.xml @@ -10,7 +10,7 @@ テストケースは Zend_Test_PHPUnit_ControllerTestCase を継承しなければなりません。このクラスは - PHPUnit_Framework_TestCase を継承しており、 + PHPUnit\Framework\TestCase を継承しており、 PHPUnit が提供する仕組みやアサーションをすべて使用できます。 またそれに加えて、Zend Framework の MVC 実装に特化した scaffold 機能やアサーションもあります。 diff --git a/library/Zend/Test/PHPUnit/Constraint/DomQuery.php b/library/Zend/Test/PHPUnit/Constraint/DomQuery.php index 2aa52794b5..65dae4d995 100644 --- a/library/Zend/Test/PHPUnit/Constraint/DomQuery.php +++ b/library/Zend/Test/PHPUnit/Constraint/DomQuery.php @@ -20,19 +20,7 @@ * @version $Id$ */ -if (version_compare(PHPUnit_Runner_Version::id(), '4.1', '>=')) { - include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'DomQuery41.php'); +include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'DomQuery41.php'); - class Zend_Test_PHPUnit_Constraint_DomQuery extends Zend_Test_PHPUnit_Constraint_DomQuery41 - {} -} elseif (version_compare(PHPUnit_Runner_Version::id(), '3.5', '>=')) { - include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'DomQuery37.php'); - - class Zend_Test_PHPUnit_Constraint_DomQuery extends Zend_Test_PHPUnit_Constraint_DomQuery37 - {} -} else { - include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'DomQuery34.php'); - - class Zend_Test_PHPUnit_Constraint_DomQuery extends Zend_Test_PHPUnit_Constraint_DomQuery34 - {} -} +class Zend_Test_PHPUnit_Constraint_DomQuery extends Zend_Test_PHPUnit_Constraint_DomQuery41 +{} diff --git a/library/Zend/Test/PHPUnit/Constraint/DomQuery34.php b/library/Zend/Test/PHPUnit/Constraint/DomQuery34.php deleted file mode 100644 index 740f51cbb2..0000000000 --- a/library/Zend/Test/PHPUnit/Constraint/DomQuery34.php +++ /dev/null @@ -1,422 +0,0 @@ -_path = $path; - } - - /** - * Indicate negative match - * - * @param bool $flag - * @return void - */ - public function setNegate($flag = true) - { - $this->_negate = $flag; - } - - /** - * Whether or not path is a straight XPath expression - * - * @param bool $flag - * @return Zend_Test_PHPUnit_Constraint_DomQuery - */ - public function setUseXpath($flag = true) - { - $this->_useXpath = (bool) $flag; - return $this; - } - - /** - * Evaluate an object to see if it fits the constraints - * - * @param string $other String to examine - * @param null|string Assertion type - * @return bool - */ - public function evaluate($other, $assertType = null) - { - if (strstr($assertType, 'Not')) { - $this->setNegate(true); - $assertType = str_replace('Not', '', $assertType); - } - - if (strstr($assertType, 'Xpath')) { - $this->setUseXpath(true); - $assertType = str_replace('Xpath', 'Query', $assertType); - } - - 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__)); - } - - $this->_assertType = $assertType; - - $method = $this->_useXpath ? 'queryXpath' : 'query'; - $domQuery = new Zend_Dom_Query($other); - $domQuery->registerXpathNamespaces($this->_xpathNamespaces); - $result = $domQuery->$method($this->_path); - $argv = func_get_args(); - $argc = func_num_args(); - - 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'); - } - $this->_content = $content = $argv[2]; - return ($this->_negate) - ? $this->_notMatchContent($result, $content) - : $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'); - } - $this->_content = $content = $argv[2]; - return ($this->_negate) - ? $this->_notRegexContent($result, $content) - : $this->_regexContent($result, $content); - case self::ASSERT_CONTENT_COUNT: - 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'); - } - $this->_content = $content = $argv[2]; - return $this->_countContent($result, $content, $assertType); - case self::ASSERT_QUERY: - default: - if ($this->_negate) { - return (0 == count($result)); - } else { - return (0 != count($result)); - } - } - } - - /** - * Report Failure - * - * @see PHPUnit_Framework_Constraint for implementation details - * @param mixed $other CSS selector path - * @param string $description - * @param bool $not - * @return void - * @throws PHPUnit_Framework_ExpectationFailedException - */ - public function fail($other, $description, $not = false) - { - 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"'; - if ($this->_negate) { - $failure = 'Failed asserting node DENOTED BY %s DOES NOT CONTAIN content "%s"'; - } - $failure = sprintf($failure, $other, $this->_content); - break; - case self::ASSERT_CONTENT_REGEX: - $failure = 'Failed asserting node denoted by %s CONTAINS content MATCHING "%s"'; - if ($this->_negate) { - $failure = 'Failed asserting node DENOTED BY %s DOES NOT CONTAIN content MATCHING "%s"'; - } - $failure = sprintf($failure, $other, $this->_content); - break; - case self::ASSERT_CONTENT_COUNT: - $failure = 'Failed asserting node DENOTED BY %s OCCURS EXACTLY %d times'; - if ($this->_negate) { - $failure = 'Failed asserting node DENOTED BY %s DOES NOT OCCUR EXACTLY %d times'; - } - $failure = sprintf($failure, $other, $this->_content); - break; - case self::ASSERT_CONTENT_COUNT_MIN: - $failure = 'Failed asserting node DENOTED BY %s OCCURS AT LEAST %d times'; - $failure = sprintf($failure, $other, $this->_content); - break; - case self::ASSERT_CONTENT_COUNT_MAX: - $failure = 'Failed asserting node DENOTED BY %s OCCURS AT MOST %d times'; - $failure = sprintf($failure, $other, $this->_content); - break; - case self::ASSERT_QUERY: - default: - $failure = 'Failed asserting node DENOTED BY %s EXISTS'; - if ($this->_negate) { - $failure = 'Failed asserting node DENOTED BY %s DOES NOT EXIST'; - } - $failure = sprintf($failure, $other); - break; - } - - if (!empty($description)) { - $failure = $description . "\n" . $failure; - } - - throw new Zend_Test_PHPUnit_Constraint_Exception($failure); - } - - /** - * Complete implementation - * - * @return string - */ - public function toString() - { - return ''; - } - - /** - * Register XPath namespaces - * - * @param array $xpathNamespaces - * @return void - */ - public function registerXpathNamespaces($xpathNamespaces) - { - $this->_xpathNamespaces = $xpathNamespaces; - } - - /** - * Check to see if content is matched in selected nodes - * - * @param Zend_Dom_Query_Result $result - * @param string $match Content to match - * @return bool - */ - protected function _matchContent($result, $match) - { - $match = (string) $match; - - if (0 == count($result)) { - return false; - } - - foreach ($result as $node) { - $content = $this->_getNodeContent($node); - if (strstr($content, $match)) { - return true; - } - } - - return false; - } - - /** - * Check to see if content is NOT matched in selected nodes - * - * @param Zend_Dom_Query_Result $result - * @param string $match - * @return bool - */ - protected function _notMatchContent($result, $match) - { - if (0 == count($result)) { - return true; - } - - foreach ($result as $node) { - $content = $this->_getNodeContent($node); - if (strstr($content, $match)) { - return false; - } - } - - return true; - } - - /** - * Check to see if content is matched by regex in selected nodes - * - * @param Zend_Dom_Query_Result $result - * @param string $pattern - * @return bool - */ - protected function _regexContent($result, $pattern) - { - if (0 == count($result)) { - return false; - } - - foreach ($result as $node) { - $content = $this->_getNodeContent($node); - if (preg_match($pattern, $content)) { - return true; - } - } - - return false; - } - - /** - * Check to see if content is NOT matched by regex in selected nodes - * - * @param Zend_Dom_Query_Result $result - * @param string $pattern - * @return bool - */ - protected function _notRegexContent($result, $pattern) - { - if (0 == count($result)) { - return true; - } - - foreach ($result as $node) { - $content = $this->_getNodeContent($node); - if (preg_match($pattern, $content)) { - return false; - } - } - - return true; - } - - /** - * Determine if content count matches criteria - * - * @param Zend_Dom_Query_Result $result - * @param int $test Value against which to test - * @param string $type assertion type - * @return boolean - */ - protected function _countContent($result, $test, $type) - { - $count = count($result); - - switch ($type) { - case self::ASSERT_CONTENT_COUNT: - return ($this->_negate) - ? ($test != $count) - : ($test == $count); - case self::ASSERT_CONTENT_COUNT_MIN: - return ($count >= $test); - case self::ASSERT_CONTENT_COUNT_MAX: - return ($count <= $test); - default: - return false; - } - } - - /** - * Get node content, minus node markup tags - * - * @param DOMNode $node - * @return string - */ - protected function _getNodeContent(DOMNode $node) - { - if ($node instanceof DOMAttr) { - return $node->value; - } else { - $doc = $node->ownerDocument; - $content = $doc->saveXML($node); - $tag = $node->nodeName; - $regex = '|]*>|'; - return preg_replace($regex, '', $content); - } - } -} diff --git a/library/Zend/Test/PHPUnit/Constraint/DomQuery37.php b/library/Zend/Test/PHPUnit/Constraint/DomQuery37.php deleted file mode 100644 index b5c230ab72..0000000000 --- a/library/Zend/Test/PHPUnit/Constraint/DomQuery37.php +++ /dev/null @@ -1,434 +0,0 @@ -_path = $path; - } - - /** - * Indicate negative match - * - * @param bool $flag - * @return void - */ - public function setNegate($flag = true) - { - $this->_negate = $flag; - } - - /** - * Whether or not path is a straight XPath expression - * - * @param bool $flag - * @return Zend_Test_PHPUnit_Constraint_DomQuery - */ - public function setUseXpath($flag = true) - { - $this->_useXpath = (bool) $flag; - return $this; - } - - /** - * Evaluate an object to see if it fits the constraints - * - * @param string Response content to be matched against (haystack) - * @param null|string Assertion type - * @param string (optional) String to match (needle), may be required depending on assertion type - * @return bool - * - * NOTE: - * Drastic changes up to PHPUnit 3.5.15 this was: - * public function evaluate($other, $assertType = null) - * In PHPUnit 3.6.0 they changed the interface into this: - * public function evaluate($other, $description = '', $returnResult = FALSE) - * We use the new interface for PHP-strict checking, but emulate the old one - */ - public function evaluate($content, $assertType = '', $match = FALSE) - { - if (strstr($assertType, 'Not')) { - $this->setNegate(true); - $assertType = str_replace('Not', '', $assertType); - } - - if (strstr($assertType, 'Xpath')) { - $this->setUseXpath(true); - $assertType = str_replace('Xpath', 'Query', $assertType); - } - - 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__)); - } - - $this->_assertType = $assertType; - - $method = $this->_useXpath ? 'queryXpath' : 'query'; - $domQuery = new Zend_Dom_Query($content); - $domQuery->registerXpathNamespaces($this->_xpathNamespaces); - $result = $domQuery->$method($this->_path); - - switch ($assertType) { - case self::ASSERT_CONTENT_CONTAINS: - if (!$match) { - require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; - throw new Zend_Test_PHPUnit_Constraint_Exception('No content provided against which to match'); - } - $this->_content = $match; - return ($this->_negate) - ? $this->_notMatchContent($result, $match) - : $this->_matchContent($result, $match); - case self::ASSERT_CONTENT_REGEX: - if (!$match) { - require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; - throw new Zend_Test_PHPUnit_Constraint_Exception('No pattern provided against which to match'); - } - $this->_content = $match; - return ($this->_negate) - ? $this->_notRegexContent($result, $match) - : $this->_regexContent($result, $match); - case self::ASSERT_CONTENT_COUNT: - case self::ASSERT_CONTENT_COUNT_MIN: - case self::ASSERT_CONTENT_COUNT_MAX: - if ($match === false) { - require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; - throw new Zend_Test_PHPUnit_Constraint_Exception('No count provided against which to compare'); - } - $this->_content = $match; - return $this->_countContent($result, $match, $assertType); - case self::ASSERT_QUERY: - default: - if ($this->_negate) { - return (0 == count($result)); - } else { - return (0 != count($result)); - } - } - } - - /** - * Report Failure - * - * @see PHPUnit_Framework_Constraint for implementation details - * @param mixed CSS selector path - * @param string Failure description - * @param object Cannot be used, null - * @return void - * @throws PHPUnit_Framework_ExpectationFailedException - * NOTE: - * Drastic changes up to PHPUnit 3.5.15 this was: - * public function fail($other, $description, $not = false) - * In PHPUnit 3.6.0 they changed the interface into this: - * protected function fail($other, $description, PHPUnit_Framework_ComparisonFailure $comparisonFailure = NULL) - * We use the new interface for PHP-strict checking - */ - public function fail($other, $description, PHPUnit_Framework_ComparisonFailure $cannot_be_used = NULL) - { - 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"'; - if ($this->_negate) { - $failure = 'Failed asserting node DENOTED BY %s DOES NOT CONTAIN content "%s"'; - } - $failure = sprintf($failure, $other, $this->_content); - break; - case self::ASSERT_CONTENT_REGEX: - $failure = 'Failed asserting node denoted by %s CONTAINS content MATCHING "%s"'; - if ($this->_negate) { - $failure = 'Failed asserting node DENOTED BY %s DOES NOT CONTAIN content MATCHING "%s"'; - } - $failure = sprintf($failure, $other, $this->_content); - break; - case self::ASSERT_CONTENT_COUNT: - $failure = 'Failed asserting node DENOTED BY %s OCCURS EXACTLY %d times'; - if ($this->_negate) { - $failure = 'Failed asserting node DENOTED BY %s DOES NOT OCCUR EXACTLY %d times'; - } - $failure = sprintf($failure, $other, $this->_content); - break; - case self::ASSERT_CONTENT_COUNT_MIN: - $failure = 'Failed asserting node DENOTED BY %s OCCURS AT LEAST %d times'; - $failure = sprintf($failure, $other, $this->_content); - break; - case self::ASSERT_CONTENT_COUNT_MAX: - $failure = 'Failed asserting node DENOTED BY %s OCCURS AT MOST %d times'; - $failure = sprintf($failure, $other, $this->_content); - break; - case self::ASSERT_QUERY: - default: - $failure = 'Failed asserting node DENOTED BY %s EXISTS'; - if ($this->_negate) { - $failure = 'Failed asserting node DENOTED BY %s DOES NOT EXIST'; - } - $failure = sprintf($failure, $other); - break; - } - - if (!empty($description)) { - $failure = $description . "\n" . $failure; - } - - throw new Zend_Test_PHPUnit_Constraint_Exception($failure); - } - - /** - * Complete implementation - * - * @return string - */ - public function toString() - { - return ''; - } - - /** - * Register XPath namespaces - * - * @param array $xpathNamespaces - * @return void - */ - public function registerXpathNamespaces($xpathNamespaces) - { - $this->_xpathNamespaces = $xpathNamespaces; - } - - /** - * Check to see if content is matched in selected nodes - * - * @param Zend_Dom_Query_Result $result - * @param string $match Content to match - * @return bool - */ - protected function _matchContent($result, $match) - { - $match = (string) $match; - - if (0 == count($result)) { - return false; - } - - foreach ($result as $node) { - $content = $this->_getNodeContent($node); - if (strstr($content, $match)) { - return true; - } - } - - return false; - } - - /** - * Check to see if content is NOT matched in selected nodes - * - * @param Zend_Dom_Query_Result $result - * @param string $match - * @return bool - */ - protected function _notMatchContent($result, $match) - { - if (0 == count($result)) { - return true; - } - - foreach ($result as $node) { - $content = $this->_getNodeContent($node); - if (strstr($content, $match)) { - return false; - } - } - - return true; - } - - /** - * Check to see if content is matched by regex in selected nodes - * - * @param Zend_Dom_Query_Result $result - * @param string $pattern - * @return bool - */ - protected function _regexContent($result, $pattern) - { - if (0 == count($result)) { - return false; - } - - foreach ($result as $node) { - $content = $this->_getNodeContent($node); - if (preg_match($pattern, $content)) { - return true; - } - } - - return false; - } - - /** - * Check to see if content is NOT matched by regex in selected nodes - * - * @param Zend_Dom_Query_Result $result - * @param string $pattern - * @return bool - */ - protected function _notRegexContent($result, $pattern) - { - if (0 == count($result)) { - return true; - } - - foreach ($result as $node) { - $content = $this->_getNodeContent($node); - if (preg_match($pattern, $content)) { - return false; - } - } - - return true; - } - - /** - * Determine if content count matches criteria - * - * @param Zend_Dom_Query_Result $result - * @param int $test Value against which to test - * @param string $type assertion type - * @return boolean - */ - protected function _countContent($result, $test, $type) - { - $count = count($result); - - switch ($type) { - case self::ASSERT_CONTENT_COUNT: - return ($this->_negate) - ? ($test != $count) - : ($test == $count); - case self::ASSERT_CONTENT_COUNT_MIN: - return ($count >= $test); - case self::ASSERT_CONTENT_COUNT_MAX: - return ($count <= $test); - default: - return false; - } - } - - /** - * Get node content, minus node markup tags - * - * @param DOMNode $node - * @return string - */ - protected function _getNodeContent(DOMNode $node) - { - if ($node instanceof DOMAttr) { - return $node->value; - } else { - $doc = $node->ownerDocument; - $content = $doc->saveXML($node); - $tag = $node->nodeName; - $regex = '|]*>|'; - return preg_replace($regex, '', $content); - } - } -} diff --git a/library/Zend/Test/PHPUnit/Constraint/DomQuery41.php b/library/Zend/Test/PHPUnit/Constraint/DomQuery41.php index 28cc484b3a..98f8e15ab6 100644 --- a/library/Zend/Test/PHPUnit/Constraint/DomQuery41.php +++ b/library/Zend/Test/PHPUnit/Constraint/DomQuery41.php @@ -26,14 +26,14 @@ /** * Zend_Dom_Query-based PHPUnit Constraint * - * @uses PHPUnit_Framework_Constraint + * @uses PHPUnit\Framework\Constraint\Constraint * @category Zend * @package Zend_Test * @subpackage PHPUnit * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Constraint_DomQuery41 extends PHPUnit_Framework_Constraint +class Zend_Test_PHPUnit_Constraint_DomQuery41 extends PHPUnit\Framework\Constraint\Constraint { /**#@+ * Assertion type constants @@ -209,17 +209,17 @@ public function evaluate($content, $assertType = '', $match = FALSE) /** * Report Failure * - * @see PHPUnit_Framework_Constraint for implementation details + * @see PHPUnit\Framework\Constraint\Constraint for implementation details * @param mixed CSS selector path * @param string Failure description * @param object Cannot be used, null * @return void - * @throws PHPUnit_Framework_ExpectationFailedException + * @throws PHPUnit\Framework\ExpectationFailedException * NOTE: * Drastic changes up to PHPUnit 3.5.15 this was: * public function fail($other, $description, $not = false) * In PHPUnit 3.6.0 they changed the interface into this: - * protected function fail($other, $description, PHPUnit_Framework_ComparisonFailure $comparisonFailure = NULL) + * protected function fail($other, $description, SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure = NULL) * We use the new interface for PHP-strict checking * NOTE 2: * Interface changed again in PHPUnit 4.1.0 because of refactoring to SebastianBergmann\Comparator diff --git a/library/Zend/Test/PHPUnit/Constraint/Exception.php b/library/Zend/Test/PHPUnit/Constraint/Exception.php index 2286fef076..e4fe6470e1 100644 --- a/library/Zend/Test/PHPUnit/Constraint/Exception.php +++ b/library/Zend/Test/PHPUnit/Constraint/Exception.php @@ -23,13 +23,13 @@ /** * Zend_Test_PHPUnit_Constraint_Exception * - * @uses PHPUnit_Framework_ExpectationFailedException + * @uses PHPUnit\Framework\ExpectationFailedException * @category Zend * @package Zend_Test * @subpackage PHPUnit * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Constraint_Exception extends PHPUnit_Framework_ExpectationFailedException +class Zend_Test_PHPUnit_Constraint_Exception extends PHPUnit\Framework\ExpectationFailedException { } diff --git a/library/Zend/Test/PHPUnit/Constraint/Redirect.php b/library/Zend/Test/PHPUnit/Constraint/Redirect.php index 819d8b2b96..ef3088d5aa 100644 --- a/library/Zend/Test/PHPUnit/Constraint/Redirect.php +++ b/library/Zend/Test/PHPUnit/Constraint/Redirect.php @@ -20,19 +20,7 @@ * @version $Id$ */ -if (version_compare(PHPUnit_Runner_Version::id(), '4.1', '>=')) { - include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Redirect41.php'); +include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Redirect41.php'); - class Zend_Test_PHPUnit_Constraint_Redirect extends Zend_Test_PHPUnit_Constraint_Redirect41 - {} -} elseif (version_compare(PHPUnit_Runner_Version::id(), '3.5', '>=')) { - include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Redirect37.php'); - - class Zend_Test_PHPUnit_Constraint_Redirect extends Zend_Test_PHPUnit_Constraint_Redirect37 - {} -} else { - include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Redirect34.php'); - - class Zend_Test_PHPUnit_Constraint_Redirect extends Zend_Test_PHPUnit_Constraint_Redirect34 - {} -} +class Zend_Test_PHPUnit_Constraint_Redirect extends Zend_Test_PHPUnit_Constraint_Redirect41 +{} diff --git a/library/Zend/Test/PHPUnit/Constraint/Redirect34.php b/library/Zend/Test/PHPUnit/Constraint/Redirect34.php deleted file mode 100644 index e8d9f8ed9e..0000000000 --- a/library/Zend/Test/PHPUnit/Constraint/Redirect34.php +++ /dev/null @@ -1,303 +0,0 @@ -_negate = $flag; - } - - /** - * Evaluate an object to see if it fits the constraints - * - * @param string $other String to examine - * @param null|string Assertion type - * @return bool - */ - 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('Redirect constraint assertions require a response object'); - } - - if (strstr($assertType, 'Not')) { - $this->setNegate(true); - $assertType = str_replace('Not', '', $assertType); - } - - 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__)); - } - - $this->_assertType = $assertType; - - $response = $other; - $argv = func_get_args(); - $argc = func_num_args(); - - 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'); - } - $this->_match = $match = $argv[2]; - return ($this->_negate) - ? $this->_notMatch($response, $match) - : $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'); - } - $this->_match = $match = $argv[2]; - return ($this->_negate) - ? $this->_notRegex($response, $match) - : $this->_regex($response, $match); - case self::ASSERT_REDIRECT: - default: - $headers = $response->sendHeaders(); - if (isset($headers['location'])) { - $redirect = $headers['location']; - $redirect = str_replace('Location: ', '', $redirect); - $this->_actual = $redirect; - } - return ($this->_negate) ? !$response->isRedirect() : $response->isRedirect(); - } - } - - /** - * Report Failure - * - * @see PHPUnit_Framework_Constraint for implementation details - * @param mixed $other - * @param string $description Additional message to display - * @param bool $not - * @return void - * @throws PHPUnit_Framework_ExpectationFailedException - */ - public function fail($other, $description, $not = false) - { - require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; - switch ($this->_assertType) { - case self::ASSERT_REDIRECT_TO: - $failure = 'Failed asserting response redirects to "%s"'; - if ($this->_negate) { - $failure = 'Failed asserting response DOES NOT redirect to "%s"'; - } - $failure = sprintf($failure, $this->_match); - if (!$this->_negate && $this->_actual) { - $failure .= sprintf(PHP_EOL . 'It redirects to "%s".', $this->_actual); - } - break; - case self::ASSERT_REDIRECT_REGEX: - $failure = 'Failed asserting response redirects to URL MATCHING "%s"'; - if ($this->_negate) { - $failure = 'Failed asserting response DOES NOT redirect to URL MATCHING "%s"'; - } - $failure = sprintf($failure, $this->_match); - if ($this->_actual) { - $failure .= sprintf(PHP_EOL . 'It redirects to "%s".', $this->_actual); - } - break; - case self::ASSERT_REDIRECT: - default: - $failure = 'Failed asserting response is a redirect'; - if ($this->_negate) { - $failure = 'Failed asserting response is NOT a redirect'; - if ($this->_actual) { - $failure .= sprintf(PHP_EOL . 'It redirects to "%s"', $this->_actual); - } - } - break; - } - - if (!empty($description)) { - $failure = $description . "\n" . $failure; - } - - throw new Zend_Test_PHPUnit_Constraint_Exception($failure); - } - - /** - * Complete implementation - * - * @return string - */ - public function toString() - { - return ''; - } - - /** - * Check to see if content is matched in selected nodes - * - * @param Zend_Controller_Response_HttpTestCase $response - * @param string $match Content to match - * @return bool - */ - protected function _match($response, $match) - { - if (!$response->isRedirect()) { - return false; - } - - $headers = $response->sendHeaders(); - $redirect = $headers['location']; - $redirect = str_replace('Location: ', '', $redirect); - $this->_actual = $redirect; - - return ($redirect == $match); - } - - /** - * Check to see if content is NOT matched in selected nodes - * - * @param Zend_Controller_Response_HttpTestCase $response - * @param string $match - * @return bool - */ - protected function _notMatch($response, $match) - { - if (!$response->isRedirect()) { - return true; - } - - $headers = $response->sendHeaders(); - $redirect = $headers['location']; - $redirect = str_replace('Location: ', '', $redirect); - $this->_actual = $redirect; - - return ($redirect != $match); - } - - /** - * Check to see if content is matched by regex in selected nodes - * - * @param Zend_Controller_Response_HttpTestCase $response - * @param string $pattern - * @return bool - */ - protected function _regex($response, $pattern) - { - if (!$response->isRedirect()) { - return false; - } - - $headers = $response->sendHeaders(); - $redirect = $headers['location']; - $redirect = str_replace('Location: ', '', $redirect); - $this->_actual = $redirect; - - return preg_match($pattern, $redirect); - } - - /** - * Check to see if content is NOT matched by regex in selected nodes - * - * @param Zend_Controller_Response_HttpTestCase $response - * @param string $pattern - * @return bool - */ - protected function _notRegex($response, $pattern) - { - if (!$response->isRedirect()) { - return true; - } - - $headers = $response->sendHeaders(); - $redirect = $headers['location']; - $redirect = str_replace('Location: ', '', $redirect); - $this->_actual = $redirect; - - return !preg_match($pattern, $redirect); - } -} diff --git a/library/Zend/Test/PHPUnit/Constraint/Redirect37.php b/library/Zend/Test/PHPUnit/Constraint/Redirect37.php deleted file mode 100644 index 0494c976f9..0000000000 --- a/library/Zend/Test/PHPUnit/Constraint/Redirect37.php +++ /dev/null @@ -1,315 +0,0 @@ -_negate = $flag; - } - - /** - * Evaluate an object to see if it fits the constraints - * - * @param string $other String to examine - * @param null|string Assertion type - * @return bool - * NOTE: - * Drastic changes up to PHPUnit 3.5.15 this was: - * public function evaluate($other, $assertType = null) - * In PHPUnit 3.6.0 they changed the interface into this: - * public function evaluate($other, $description = '', $returnResult = FALSE) - * We use the new interface for PHP-strict checking, but emulate the old one - */ - public function evaluate($other, $assertType = null, $variable = FALSE) - { - 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'); - } - - if (strstr($assertType, 'Not')) { - $this->setNegate(true); - $assertType = str_replace('Not', '', $assertType); - } - - 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__)); - } - - $this->_assertType = $assertType; - - $response = $other; - $argv = func_get_args(); - $argc = func_num_args(); - - 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'); - } - $this->_match = $match = $argv[2]; - return ($this->_negate) - ? $this->_notMatch($response, $match) - : $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'); - } - $this->_match = $match = $argv[2]; - return ($this->_negate) - ? $this->_notRegex($response, $match) - : $this->_regex($response, $match); - case self::ASSERT_REDIRECT: - default: - $headers = $response->sendHeaders(); - if (isset($headers['location'])) { - $redirect = $headers['location']; - $redirect = str_replace('Location: ', '', $redirect); - $this->_actual = $redirect; - } - return ($this->_negate) ? !$response->isRedirect() : $response->isRedirect(); - } - } - - /** - * Report Failure - * - * @see PHPUnit_Framework_Constraint for implementation details - * @param mixed $other - * @param string $description Additional message to display - * @param bool $not - * @return void - * @throws PHPUnit_Framework_ExpectationFailedException - * NOTE: - * Drastic changes up to PHPUnit 3.5.15 this was: - * public function fail($other, $description, $not = false) - * In PHPUnit 3.6.0 they changed the interface into this: - * protected function fail($other, $description, PHPUnit_Framework_ComparisonFailure $comparisonFailure = NULL) - * We use the new interface for PHP-strict checking - */ - public function fail($other, $description, PHPUnit_Framework_ComparisonFailure $cannot_be_used = NULL) - { - require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; - switch ($this->_assertType) { - case self::ASSERT_REDIRECT_TO: - $failure = 'Failed asserting response redirects to "%s"'; - if ($this->_negate) { - $failure = 'Failed asserting response DOES NOT redirect to "%s"'; - } - $failure = sprintf($failure, $this->_match); - if (!$this->_negate && $this->_actual) { - $failure .= sprintf(PHP_EOL . 'It redirects to "%s".', $this->_actual); - } - break; - case self::ASSERT_REDIRECT_REGEX: - $failure = 'Failed asserting response redirects to URL MATCHING "%s"'; - if ($this->_negate) { - $failure = 'Failed asserting response DOES NOT redirect to URL MATCHING "%s"'; - } - $failure = sprintf($failure, $this->_match); - if ($this->_actual) { - $failure .= sprintf(PHP_EOL . 'It redirects to "%s".', $this->_actual); - } - break; - case self::ASSERT_REDIRECT: - default: - $failure = 'Failed asserting response is a redirect'; - if ($this->_negate) { - $failure = 'Failed asserting response is NOT a redirect'; - if ($this->_actual) { - $failure .= sprintf(PHP_EOL . 'It redirects to "%s"', $this->_actual); - } - } - break; - } - - if (!empty($description)) { - $failure = $description . "\n" . $failure; - } - - throw new Zend_Test_PHPUnit_Constraint_Exception($failure); - } - - /** - * Complete implementation - * - * @return string - */ - public function toString() - { - return ''; - } - - /** - * Check to see if content is matched in selected nodes - * - * @param Zend_Controller_Response_HttpTestCase $response - * @param string $match Content to match - * @return bool - */ - protected function _match($response, $match) - { - if (!$response->isRedirect()) { - return false; - } - - $headers = $response->sendHeaders(); - $redirect = $headers['location']; - $redirect = str_replace('Location: ', '', $redirect); - $this->_actual = $redirect; - - return ($redirect == $match); - } - - /** - * Check to see if content is NOT matched in selected nodes - * - * @param Zend_Controller_Response_HttpTestCase $response - * @param string $match - * @return bool - */ - protected function _notMatch($response, $match) - { - if (!$response->isRedirect()) { - return true; - } - - $headers = $response->sendHeaders(); - $redirect = $headers['location']; - $redirect = str_replace('Location: ', '', $redirect); - $this->_actual = $redirect; - - return ($redirect != $match); - } - - /** - * Check to see if content is matched by regex in selected nodes - * - * @param Zend_Controller_Response_HttpTestCase $response - * @param string $pattern - * @return bool - */ - protected function _regex($response, $pattern) - { - if (!$response->isRedirect()) { - return false; - } - - $headers = $response->sendHeaders(); - $redirect = $headers['location']; - $redirect = str_replace('Location: ', '', $redirect); - $this->_actual = $redirect; - - return preg_match($pattern, $redirect); - } - - /** - * Check to see if content is NOT matched by regex in selected nodes - * - * @param Zend_Controller_Response_HttpTestCase $response - * @param string $pattern - * @return bool - */ - protected function _notRegex($response, $pattern) - { - if (!$response->isRedirect()) { - return true; - } - - $headers = $response->sendHeaders(); - $redirect = $headers['location']; - $redirect = str_replace('Location: ', '', $redirect); - $this->_actual = $redirect; - - return !preg_match($pattern, $redirect); - } -} diff --git a/library/Zend/Test/PHPUnit/Constraint/Redirect41.php b/library/Zend/Test/PHPUnit/Constraint/Redirect41.php index 6f6e915648..1588296d2f 100644 --- a/library/Zend/Test/PHPUnit/Constraint/Redirect41.php +++ b/library/Zend/Test/PHPUnit/Constraint/Redirect41.php @@ -23,14 +23,14 @@ /** * Redirection constraints * - * @uses PHPUnit_Framework_Constraint + * @uses PHPUnit\Framework\Constraint\Constraint * @category Zend * @package Zend_Test * @subpackage PHPUnit * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Constraint_Redirect41 extends PHPUnit_Framework_Constraint +class Zend_Test_PHPUnit_Constraint_Redirect41 extends PHPUnit\Framework\Constraint\Constraint { /**#@+ * Assertion type constants @@ -163,17 +163,17 @@ public function evaluate($other, $assertType = null, $variable = FALSE) /** * Report Failure * - * @see PHPUnit_Framework_Constraint for implementation details + * @see PHPUnit\Framework\Constraint\Constraint for implementation details * @param mixed $other * @param string $description Additional message to display * @param bool $not * @return void - * @throws PHPUnit_Framework_ExpectationFailedException + * @throws PHPUnit\Framework\ExpectationFailedException * NOTE: * Drastic changes up to PHPUnit 3.5.15 this was: * public function fail($other, $description, $not = false) * In PHPUnit 3.6.0 they changed the interface into this: - * protected function fail($other, $description, PHPUnit_Framework_ComparisonFailure $comparisonFailure = NULL) + * protected function fail($other, $description, SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure = NULL) * We use the new interface for PHP-strict checking * NOTE 2: * Interface changed again in PHPUnit 4.1.0 because of refactoring to SebastianBergmann\Comparator diff --git a/library/Zend/Test/PHPUnit/Constraint/ResponseHeader.php b/library/Zend/Test/PHPUnit/Constraint/ResponseHeader.php index 178de05051..7b0a026103 100644 --- a/library/Zend/Test/PHPUnit/Constraint/ResponseHeader.php +++ b/library/Zend/Test/PHPUnit/Constraint/ResponseHeader.php @@ -20,19 +20,7 @@ * @version $Id$ */ -if (version_compare(PHPUnit_Runner_Version::id(), '4.1', '>=')) { - include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'ResponseHeader41.php'); +include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'ResponseHeader41.php'); - class Zend_Test_PHPUnit_Constraint_ResponseHeader extends Zend_Test_PHPUnit_Constraint_ResponseHeader41 - {} -} elseif (version_compare(PHPUnit_Runner_Version::id(), '3.5', '>=')) { - include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'ResponseHeader37.php'); - - class Zend_Test_PHPUnit_Constraint_ResponseHeader extends Zend_Test_PHPUnit_Constraint_ResponseHeader37 - {} -} else { - include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'ResponseHeader34.php'); - - class Zend_Test_PHPUnit_Constraint_ResponseHeader extends Zend_Test_PHPUnit_Constraint_ResponseHeader34 - {} -} +class Zend_Test_PHPUnit_Constraint_ResponseHeader extends Zend_Test_PHPUnit_Constraint_ResponseHeader41 +{} diff --git a/library/Zend/Test/PHPUnit/Constraint/ResponseHeader34.php b/library/Zend/Test/PHPUnit/Constraint/ResponseHeader34.php deleted file mode 100644 index 3d37756d23..0000000000 --- a/library/Zend/Test/PHPUnit/Constraint/ResponseHeader34.php +++ /dev/null @@ -1,406 +0,0 @@ -_negate = $flag; - } - - /** - * Evaluate an object to see if it fits the constraints - * - * @param Zend_Controller_Response_Abstract $other String to examine - * @param null|string Assertion type - * @return bool - */ - 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'); - } - - if (strstr($assertType, 'Not')) { - $this->setNegate(true); - $assertType = str_replace('Not', '', $assertType); - } - - 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__)); - } - - $this->_assertType = $assertType; - - $response = $other; - $argv = func_get_args(); - $argc = func_num_args(); - - 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'); - } - $this->_code = $code = $argv[2]; - return ($this->_negate) - ? $this->_notCode($response, $code) - : $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'); - } - $this->_header = $header = $argv[2]; - return ($this->_negate) - ? $this->_notHeader($response, $header) - : $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__); - } - $this->_header = $header = $argv[2]; - $this->_match = $match = $argv[3]; - return ($this->_negate) - ? $this->_notHeaderContains($response, $header, $match) - : $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__); - } - $this->_header = $header = $argv[2]; - $this->_match = $match = $argv[3]; - return ($this->_negate) - ? $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__); - } - } - - /** - * Report Failure - * - * @see PHPUnit_Framework_Constraint for implementation details - * @param mixed $other - * @param string $description Additional message to display - * @param bool $not - * @return void - * @throws PHPUnit_Framework_ExpectationFailedException - */ - public function fail($other, $description, $not = false) - { - require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; - switch ($this->_assertType) { - case self::ASSERT_RESPONSE_CODE: - $failure = 'Failed asserting response code "%s"'; - if ($this->_negate) { - $failure = 'Failed asserting response code IS NOT "%s"'; - } - $failure = sprintf($failure, $this->_code); - if (!$this->_negate && $this->_actualCode) { - $failure .= sprintf(PHP_EOL . 'Was "%s"', $this->_actualCode); - } - break; - case self::ASSERT_HEADER: - $failure = 'Failed asserting response header "%s" found'; - if ($this->_negate) { - $failure = 'Failed asserting response response header "%s" WAS NOT found'; - } - $failure = sprintf($failure, $this->_header); - break; - case self::ASSERT_HEADER_CONTAINS: - $failure = 'Failed asserting response header "%s" exists and contains "%s"'; - if ($this->_negate) { - $failure = 'Failed asserting response header "%s" DOES NOT CONTAIN "%s"'; - } - $failure = sprintf($failure, $this->_header, $this->_match); - break; - case self::ASSERT_HEADER_REGEX: - $failure = 'Failed asserting response header "%s" exists and matches regex "%s"'; - if ($this->_negate) { - $failure = 'Failed asserting response header "%s" DOES NOT MATCH regex "%s"'; - } - $failure = sprintf($failure, $this->_header, $this->_match); - break; - default: - throw new Zend_Test_PHPUnit_Constraint_Exception('Invalid assertion type ' . __FUNCTION__); - } - - if (!empty($description)) { - $failure = $description . "\n" . $failure; - } - - throw new Zend_Test_PHPUnit_Constraint_Exception($failure); - } - - /** - * Complete implementation - * - * @return string - */ - public function toString() - { - return ''; - } - - /** - * Compare response code for positive match - * - * @param Zend_Controller_Response_Abstract $response - * @param int $code - * @return bool - */ - protected function _code(Zend_Controller_Response_Abstract $response, $code) - { - $test = $this->_getCode($response); - $this->_actualCode = $test; - return ($test == $code); - } - - /** - * Compare response code for negative match - * - * @param Zend_Controller_Response_Abstract $response - * @param int $code - * @return bool - */ - protected function _notCode(Zend_Controller_Response_Abstract $response, $code) - { - $test = $this->_getCode($response); - return ($test != $code); - } - - /** - * Retrieve response code - * - * @param Zend_Controller_Response_Abstract $response - * @return int - */ - protected function _getCode(Zend_Controller_Response_Abstract $response) - { - $test = $response->getHttpResponseCode(); - if (null === $test) { - $test = 200; - } - return $test; - } - - /** - * Positive check for response header presence - * - * @param Zend_Controller_Response_Abstract $response - * @param string $header - * @return bool - */ - protected function _header(Zend_Controller_Response_Abstract $response, $header) - { - return (null !== $this->_getHeader($response, $header)); - } - - /** - * Negative check for response header presence - * - * @param Zend_Controller_Response_Abstract $response - * @param string $header - * @return bool - */ - protected function _notHeader(Zend_Controller_Response_Abstract $response, $header) - { - return (null === $this->_getHeader($response, $header)); - } - - /** - * Retrieve response header - * - * @param Zend_Controller_Response_Abstract $response - * @param string $header - * @return string|null - */ - protected function _getHeader(Zend_Controller_Response_Abstract $response, $header) - { - $headers = $response->sendHeaders(); - $header = strtolower($header); - if (array_key_exists($header, $headers)) { - return $headers[$header]; - } - return null; - } - - /** - * Positive check for header contents matching pattern - * - * @param Zend_Controller_Response_Abstract $response - * @param string $header - * @param string $match - * @return bool - */ - protected function _headerContains(Zend_Controller_Response_Abstract $response, $header, $match) - { - if (null === ($fullHeader = $this->_getHeader($response, $header))) { - return false; - } - - $contents = str_replace($header . ': ', '', $fullHeader); - - return (strstr($contents, $match) !== false); - } - - /** - * Negative check for header contents matching pattern - * - * @param Zend_Controller_Response_Abstract $response - * @param string $header - * @param string $match - * @return bool - */ - protected function _notHeaderContains(Zend_Controller_Response_Abstract $response, $header, $match) - { - if (null === ($fullHeader = $this->_getHeader($response, $header))) { - return true; - } - - $contents = str_replace($header . ': ', '', $fullHeader); - - return (strstr($contents, $match) === false); - } - - /** - * Positive check for header contents matching regex - * - * @param Zend_Controller_Response_Abstract $response - * @param string $header - * @param string $pattern - * @return bool - */ - protected function _headerRegex(Zend_Controller_Response_Abstract $response, $header, $pattern) - { - if (null === ($fullHeader = $this->_getHeader($response, $header))) { - return false; - } - - $contents = str_replace($header . ': ', '', $fullHeader); - - return preg_match($pattern, $contents); - } - - /** - * Negative check for header contents matching regex - * - * @param Zend_Controller_Response_Abstract $response - * @param string $header - * @param string $pattern - * @return bool - */ - protected function _notHeaderRegex(Zend_Controller_Response_Abstract $response, $header, $pattern) - { - if (null === ($fullHeader = $this->_getHeader($response, $header))) { - return true; - } - - $contents = str_replace($header . ': ', '', $fullHeader); - - return !preg_match($pattern, $contents); - } -} diff --git a/library/Zend/Test/PHPUnit/Constraint/ResponseHeader37.php b/library/Zend/Test/PHPUnit/Constraint/ResponseHeader37.php deleted file mode 100644 index ad26f0eb69..0000000000 --- a/library/Zend/Test/PHPUnit/Constraint/ResponseHeader37.php +++ /dev/null @@ -1,419 +0,0 @@ -_negate = $flag; - } - - /** - * Evaluate an object to see if it fits the constraints - * - * @param object of Zend_Controller_Response_Abstract to be evaluated - * @param null|string Assertion type - * @param int|string HTTP response code to evaluate against | header string (haystack) - * @param string (optional) match (needle), may be required depending on assertion type - * @return bool - * NOTE: - * Drastic changes up to PHPUnit 3.5.15 this was: - * public function evaluate($other, $assertType = null) - * In PHPUnit 3.6.0 they changed the interface into this: - * public function evaluate($other, $description = '', $returnResult = FALSE) - * We use the new interface for PHP-strict checking, but emulate the old one - */ - public function evaluate($response, $assertType = '', $variable = FALSE) - { - if (!$response 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'); - } - - if (strstr($assertType, 'Not')) { - $this->setNegate(true); - $assertType = str_replace('Not', '', $assertType); - } - - 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__)); - } - - $this->_assertType = $assertType; - - $argv = func_get_args(); - $argc = func_num_args(); - - 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'); - } - $this->_code = $code = $argv[2]; - return ($this->_negate) - ? $this->_notCode($response, $code) - : $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'); - } - $this->_header = $header = $argv[2]; - return ($this->_negate) - ? $this->_notHeader($response, $header) - : $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 ' . $assertType); - } - $this->_header = $header = $argv[2]; - $this->_match = $match = $argv[3]; - return ($this->_negate) - ? $this->_notHeaderContains($response, $header, $match) - : $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 ' . $assertType); - } - $this->_header = $header = $argv[2]; - $this->_match = $match = $argv[3]; - return ($this->_negate) - ? $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 ' . $assertType); - } - } - - /** - * Report Failure - * - * @see PHPUnit_Framework_Constraint for implementation details - * @param mixed CSS selector path - * @param string Failure description - * @param object Cannot be used, null - * @return void - * @throws PHPUnit_Framework_ExpectationFailedException - * NOTE: - * Drastic changes up to PHPUnit 3.5.15 this was: - * public function fail($other, $description, $not = false) - * In PHPUnit 3.6.0 they changed the interface into this: - * protected function fail($other, $description, PHPUnit_Framework_ComparisonFailure $comparisonFailure = NULL) - * We use the new interface for PHP-strict checking - */ - public function fail($other, $description, PHPUnit_Framework_ComparisonFailure $cannot_be_used = NULL) - { - require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; - switch ($this->_assertType) { - case self::ASSERT_RESPONSE_CODE: - $failure = 'Failed asserting response code "%s"'; - if ($this->_negate) { - $failure = 'Failed asserting response code IS NOT "%s"'; - } - $failure = sprintf($failure, $this->_code); - if (!$this->_negate && $this->_actualCode) { - $failure .= sprintf(PHP_EOL . 'Was "%s"', $this->_actualCode); - } - break; - case self::ASSERT_HEADER: - $failure = 'Failed asserting response header "%s" found'; - if ($this->_negate) { - $failure = 'Failed asserting response response header "%s" WAS NOT found'; - } - $failure = sprintf($failure, $this->_header); - break; - case self::ASSERT_HEADER_CONTAINS: - $failure = 'Failed asserting response header "%s" exists and contains "%s"'; - if ($this->_negate) { - $failure = 'Failed asserting response header "%s" DOES NOT CONTAIN "%s"'; - } - $failure = sprintf($failure, $this->_header, $this->_match); - break; - case self::ASSERT_HEADER_REGEX: - $failure = 'Failed asserting response header "%s" exists and matches regex "%s"'; - if ($this->_negate) { - $failure = 'Failed asserting response header "%s" DOES NOT MATCH regex "%s"'; - } - $failure = sprintf($failure, $this->_header, $this->_match); - break; - default: - throw new Zend_Test_PHPUnit_Constraint_Exception('Invalid assertion type ' . __FUNCTION__); - } - - if (!empty($description)) { - $failure = $description . "\n" . $failure; - } - - throw new Zend_Test_PHPUnit_Constraint_Exception($failure); - } - - /** - * Complete implementation - * - * @return string - */ - public function toString() - { - return ''; - } - - /** - * Compare response code for positive match - * - * @param Zend_Controller_Response_Abstract $response - * @param int $code - * @return bool - */ - protected function _code(Zend_Controller_Response_Abstract $response, $code) - { - $test = $this->_getCode($response); - $this->_actualCode = $test; - return ($test == $code); - } - - /** - * Compare response code for negative match - * - * @param Zend_Controller_Response_Abstract $response - * @param int $code - * @return bool - */ - protected function _notCode(Zend_Controller_Response_Abstract $response, $code) - { - $test = $this->_getCode($response); - return ($test != $code); - } - - /** - * Retrieve response code - * - * @param Zend_Controller_Response_Abstract $response - * @return int - */ - protected function _getCode(Zend_Controller_Response_Abstract $response) - { - $test = $response->getHttpResponseCode(); - if (null === $test) { - $test = 200; - } - return $test; - } - - /** - * Positive check for response header presence - * - * @param Zend_Controller_Response_Abstract $response - * @param string $header - * @return bool - */ - protected function _header(Zend_Controller_Response_Abstract $response, $header) - { - return (null !== $this->_getHeader($response, $header)); - } - - /** - * Negative check for response header presence - * - * @param Zend_Controller_Response_Abstract $response - * @param string $header - * @return bool - */ - protected function _notHeader(Zend_Controller_Response_Abstract $response, $header) - { - return (null === $this->_getHeader($response, $header)); - } - - /** - * Retrieve response header - * - * @param Zend_Controller_Response_Abstract $response - * @param string $header - * @return string|null - */ - protected function _getHeader(Zend_Controller_Response_Abstract $response, $header) - { - $headers = $response->sendHeaders(); - $header = strtolower($header); - if (array_key_exists($header, $headers)) { - return $headers[$header]; - } - return null; - } - - /** - * Positive check for header contents matching pattern - * - * @param Zend_Controller_Response_Abstract $response - * @param string $header - * @param string $match - * @return bool - */ - protected function _headerContains(Zend_Controller_Response_Abstract $response, $header, $match) - { - if (null === ($fullHeader = $this->_getHeader($response, $header))) { - return false; - } - - $contents = str_replace($header . ': ', '', $fullHeader); - - return (strstr($contents, $match) !== false); - } - - /** - * Negative check for header contents matching pattern - * - * @param Zend_Controller_Response_Abstract $response - * @param string $header - * @param string $match - * @return bool - */ - protected function _notHeaderContains(Zend_Controller_Response_Abstract $response, $header, $match) - { - if (null === ($fullHeader = $this->_getHeader($response, $header))) { - return true; - } - - $contents = str_replace($header . ': ', '', $fullHeader); - - return (strstr($contents, $match) === false); - } - - /** - * Positive check for header contents matching regex - * - * @param Zend_Controller_Response_Abstract $response - * @param string $header - * @param string $pattern - * @return bool - */ - protected function _headerRegex(Zend_Controller_Response_Abstract $response, $header, $pattern) - { - if (null === ($fullHeader = $this->_getHeader($response, $header))) { - return false; - } - - $contents = str_replace($header . ': ', '', $fullHeader); - - return preg_match($pattern, $contents); - } - - /** - * Negative check for header contents matching regex - * - * @param Zend_Controller_Response_Abstract $response - * @param string $header - * @param string $pattern - * @return bool - */ - protected function _notHeaderRegex(Zend_Controller_Response_Abstract $response, $header, $pattern) - { - if (null === ($fullHeader = $this->_getHeader($response, $header))) { - return true; - } - - $contents = str_replace($header . ': ', '', $fullHeader); - - return !preg_match($pattern, $contents); - } -} diff --git a/library/Zend/Test/PHPUnit/Constraint/ResponseHeader41.php b/library/Zend/Test/PHPUnit/Constraint/ResponseHeader41.php index 7f244d43bf..0a322e6cbd 100644 --- a/library/Zend/Test/PHPUnit/Constraint/ResponseHeader41.php +++ b/library/Zend/Test/PHPUnit/Constraint/ResponseHeader41.php @@ -23,14 +23,14 @@ /** * Response header PHPUnit Constraint * - * @uses PHPUnit_Framework_Constraint + * @uses PHPUnit\Framework\Constraint\Constraint * @category Zend * @package Zend_Test * @subpackage PHPUnit * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Constraint_ResponseHeader41 extends PHPUnit_Framework_Constraint +class Zend_Test_PHPUnit_Constraint_ResponseHeader41 extends PHPUnit\Framework\Constraint\Constraint { /**#@+ * Assertion type constants @@ -189,17 +189,17 @@ public function evaluate($response, $assertType = '', $variable = FALSE) /** * Report Failure * - * @see PHPUnit_Framework_Constraint for implementation details + * @see PHPUnit\Framework\Constraint\Constraint for implementation details * @param mixed CSS selector path * @param string Failure description * @param object Cannot be used, null * @return void - * @throws PHPUnit_Framework_ExpectationFailedException + * @throws PHPUnit\Framework\ExpectationFailedException * NOTE: * Drastic changes up to PHPUnit 3.5.15 this was: * public function fail($other, $description, $not = false) * In PHPUnit 3.6.0 they changed the interface into this: - * protected function fail($other, $description, PHPUnit_Framework_ComparisonFailure $comparisonFailure = NULL) + * protected function fail($other, $description, SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure = NULL) * We use the new interface for PHP-strict checking * NOTE 2: * Interface changed again in PHPUnit 4.1.0 because of refactoring to SebastianBergmann\Comparator diff --git a/library/Zend/Test/PHPUnit/ControllerTestCase.php b/library/Zend/Test/PHPUnit/ControllerTestCase.php index 69976f0d93..3d5521eb20 100644 --- a/library/Zend/Test/PHPUnit/ControllerTestCase.php +++ b/library/Zend/Test/PHPUnit/ControllerTestCase.php @@ -37,14 +37,14 @@ /** * Functional testing scaffold for MVC applications * - * @uses PHPUnit_Framework_TestCase + * @uses PHPUnit\Framework\TestCase * @category Zend * @package Zend_Test * @subpackage PHPUnit * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_TestCase +abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit\Framework\TestCase { /** * @var mixed Bootstrap file path or callback @@ -1149,15 +1149,9 @@ protected function _incrementAssertionCount() $stack = debug_backtrace(); foreach ($stack as $step) { if (isset($step['object']) - && $step['object'] instanceof PHPUnit_Framework_TestCase + && $step['object'] instanceof PHPUnit\Framework\TestCase ) { - if (version_compare(PHPUnit_Runner_Version::id(), '3.3.0', 'lt')) { - break; - } elseif (version_compare(PHPUnit_Runner_Version::id(), '3.3.3', 'lt')) { - $step['object']->incrementAssertionCounter(); - } else { - $step['object']->addToAssertionCount(1); - } + $step['object']->addToAssertionCount(1); break; } } diff --git a/library/Zend/Test/PHPUnit/DatabaseTestCase.php b/library/Zend/Test/PHPUnit/DatabaseTestCase.php index 1280309749..4d4f9db387 100644 --- a/library/Zend/Test/PHPUnit/DatabaseTestCase.php +++ b/library/Zend/Test/PHPUnit/DatabaseTestCase.php @@ -48,14 +48,14 @@ /** * Generic Testcase for Zend Framework related DbUnit Testing with PHPUnit * - * @uses PHPUnit_Extensions_Database_TestCase + * @uses PHPUnit\DbUnit\TestCase * @category Zend * @package Zend_Test * @subpackage PHPUnit * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -abstract class Zend_Test_PHPUnit_DatabaseTestCase extends PHPUnit_Extensions_Database_TestCase +abstract class Zend_Test_PHPUnit_DatabaseTestCase extends PHPUnit\DbUnit\TestCase { /** * Creates a new Zend Database Connection using the given Adapter and database schema name. @@ -82,11 +82,11 @@ protected function getAdapter() /** * Returns the database operation executed in test setup. * - * @return PHPUnit_Extensions_Database_Operation_DatabaseOperation + * @return PHPUnit\DbUnit\Operation\Operation */ protected function getSetUpOperation() { - return new PHPUnit_Extensions_Database_Operation_Composite(array( + return new PHPUnit\DbUnit\Operation\Composite(array( new Zend_Test_PHPUnit_Db_Operation_Truncate(), new Zend_Test_PHPUnit_Db_Operation_Insert(), )); @@ -95,11 +95,11 @@ protected function getSetUpOperation() /** * Returns the database operation executed in test cleanup. * - * @return PHPUnit_Extensions_Database_Operation_DatabaseOperation + * @return PHPUnit\DbUnit\Operation\Operation */ protected function getTearDownOperation() { - return PHPUnit_Extensions_Database_Operation_Factory::NONE(); + return PHPUnit\DbUnit\Operation\Factory::NONE(); } /** diff --git a/library/Zend/Test/PHPUnit/Db/Connection.php b/library/Zend/Test/PHPUnit/Db/Connection.php index 2b0e5c3c1e..5a6a01eb38 100644 --- a/library/Zend/Test/PHPUnit/Db/Connection.php +++ b/library/Zend/Test/PHPUnit/Db/Connection.php @@ -34,14 +34,14 @@ * Generic Abstraction of Zend_Db Connections in the PHPUnit Database Extension context. * * @uses Zend_Db_Adapter_Abstract - * @uses PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection + * @uses PHPUnit\DbUnit\Database\DefaultConnection * @category Zend * @package Zend_Test * @subpackage PHPUnit * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Db_Connection extends PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection +class Zend_Test_PHPUnit_Db_Connection extends PHPUnit\DbUnit\Database\DefaultConnection { /** * Zend_Db_Adapter_Abstract @@ -60,7 +60,7 @@ class Zend_Test_PHPUnit_Db_Connection extends PHPUnit_Extensions_Database_DB_Def /** * Metadata * - * @param PHPUnit_Extensions_Database_DB_IMetaData $db + * @param PHPUnit\DbUnit\Database\Metadata\Metadata $db */ protected $_metaData; @@ -91,7 +91,7 @@ public function close() * * @param string $resultName * @param string $sql - * @return PHPUnit_Extensions_Database_DataSet_ITable + * @return PHPUnit\DbUnit\DataSet\ITable */ public function createQueryTable($resultName, $sql) { @@ -112,7 +112,7 @@ public function getConnection() * Returns a database metadata object that can be used to retrieve table * meta data from the database. * - * @return PHPUnit_Extensions_Database_DB_IMetaData + * @return PHPUnit\DbUnit\Database\Metadata\Metadata */ public function getMetaData() { diff --git a/library/Zend/Test/PHPUnit/Db/DataSet/DbRowset.php b/library/Zend/Test/PHPUnit/Db/DataSet/DbRowset.php index d8437528d5..78a2a5aa11 100644 --- a/library/Zend/Test/PHPUnit/Db/DataSet/DbRowset.php +++ b/library/Zend/Test/PHPUnit/Db/DataSet/DbRowset.php @@ -28,14 +28,14 @@ /** * Use a Zend_Db Rowset as a datatable for assertions with other PHPUnit Database extension tables. * - * @uses PHPUnit_Extensions_Database_DataSet_AbstractTable + * @uses PHPUnit\DbUnit\DataSet\AbstractTable * @category Zend * @package Zend_Test * @subpackage PHPUnit * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Db_DataSet_DbRowset extends PHPUnit_Extensions_Database_DataSet_AbstractTable +class Zend_Test_PHPUnit_Db_DataSet_DbRowset extends PHPUnit\DbUnit\DataSet\AbstractTable { /** * Construct Table object from a Zend_Db_Table_Rowset @@ -68,6 +68,6 @@ public function __construct(Zend_Db_Table_Rowset_Abstract $rowset, $tableName = } $this->tableName = $tableName; - $this->tableMetaData = new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData($this->tableName, $columns); + $this->tableMetaData = new PHPUnit\DbUnit\DataSet\DefaultTableMetadata($this->tableName, $columns); } } diff --git a/library/Zend/Test/PHPUnit/Db/DataSet/DbTable.php b/library/Zend/Test/PHPUnit/Db/DataSet/DbTable.php index 37eaf430ca..b727448ae2 100644 --- a/library/Zend/Test/PHPUnit/Db/DataSet/DbTable.php +++ b/library/Zend/Test/PHPUnit/Db/DataSet/DbTable.php @@ -28,14 +28,14 @@ /** * Use a Zend_Db_Table for assertions with other PHPUnit Database Extension table types. * - * @uses PHPUnit_Extensions_Database_DataSet_QueryTable + * @uses PHPUnit\DbUnit\DataSet\QueryTable * @category Zend * @package Zend_Test * @subpackage PHPUnit * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Db_DataSet_DbTable extends PHPUnit_Extensions_Database_DataSet_QueryTable +class Zend_Test_PHPUnit_Db_DataSet_DbTable extends PHPUnit\DbUnit\DataSet\QueryTable { /** * Zend_Db_Table object @@ -114,7 +114,7 @@ protected function createTableMetaData() { if ($this->tableMetaData === NULL) { $this->loadData(); - $this->tableMetaData = new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData($this->tableName, $this->_columns); + $this->tableMetaData = new PHPUnit\DbUnit\DataSet\DefaultTableMetadata($this->tableName, $this->_columns); } } } diff --git a/library/Zend/Test/PHPUnit/Db/DataSet/DbTableDataSet.php b/library/Zend/Test/PHPUnit/Db/DataSet/DbTableDataSet.php index ed7530564c..a9a4a1c5c2 100644 --- a/library/Zend/Test/PHPUnit/Db/DataSet/DbTableDataSet.php +++ b/library/Zend/Test/PHPUnit/Db/DataSet/DbTableDataSet.php @@ -35,7 +35,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Db_DataSet_DbTableDataSet extends PHPUnit_Extensions_Database_DataSet_AbstractDataSet +class Zend_Test_PHPUnit_Db_DataSet_DbTableDataSet extends PHPUnit\DbUnit\DataSet\AbstractDataSet { /** * @var array @@ -64,18 +64,18 @@ public function addTable(Zend_Db_Table_Abstract $table, $where = null, $order = * true a reverse iterator will be returned. * * @param bool $reverse - * @return PHPUnit_Extensions_Database_DB_TableIterator + * @return PHPUnit\DbUnit\Database\TableIterator */ protected function createIterator($reverse = FALSE) { - return new PHPUnit_Extensions_Database_DataSet_DefaultTableIterator($this->tables, $reverse); + return new PHPUnit\DbUnit\DataSet\DefaultTableIterator($this->tables, $reverse); } /** * Returns a table object for the given table. * * @param string $tableName - * @return PHPUnit_Extensions_Database_DB_Table + * @return PHPUnit\DbUnit\Database\Table */ public function getTable($tableName) { diff --git a/library/Zend/Test/PHPUnit/Db/DataSet/QueryDataSet.php b/library/Zend/Test/PHPUnit/Db/DataSet/QueryDataSet.php index bd3f67daf2..43ccc0214e 100644 --- a/library/Zend/Test/PHPUnit/Db/DataSet/QueryDataSet.php +++ b/library/Zend/Test/PHPUnit/Db/DataSet/QueryDataSet.php @@ -33,21 +33,21 @@ /** * Uses several query strings or Zend_Db_Select objects to form a dataset of tables for assertion with other datasets. * - * @uses PHPUnit_Extensions_Database_DataSet_QueryDataSet + * @uses PHPUnit\DbUnit\DataSet\QueryDataSet * @category Zend * @package Zend_Test * @subpackage PHPUnit * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Db_DataSet_QueryDataSet extends PHPUnit_Extensions_Database_DataSet_QueryDataSet +class Zend_Test_PHPUnit_Db_DataSet_QueryDataSet extends PHPUnit\DbUnit\DataSet\QueryDataSet { /** * Creates a new dataset using the given database connection. * - * @param PHPUnit_Extensions_Database_DB_IDatabaseConnection $databaseConnection + * @param PHPUnit\DbUnit\Database\Connection $databaseConnection */ - public function __construct(PHPUnit_Extensions_Database_DB_IDatabaseConnection $databaseConnection) + public function __construct(PHPUnit\DbUnit\Database\Connection $databaseConnection) { if( !($databaseConnection instanceof Zend_Test_PHPUnit_Db_Connection) ) { require_once "Zend/Test/PHPUnit/Db/Exception.php"; diff --git a/library/Zend/Test/PHPUnit/Db/DataSet/QueryTable.php b/library/Zend/Test/PHPUnit/Db/DataSet/QueryTable.php index 6100e80577..1e99c6ed5e 100644 --- a/library/Zend/Test/PHPUnit/Db/DataSet/QueryTable.php +++ b/library/Zend/Test/PHPUnit/Db/DataSet/QueryTable.php @@ -23,24 +23,24 @@ /** * Represent a PHPUnit Database Extension table with Queries using a Zend_Db adapter for assertion against other tables. * - * @uses PHPUnit_Extensions_Database_DataSet_QueryTable + * @uses PHPUnit\DbUnit\DataSet\QueryTable * @category Zend * @package Zend_Test * @subpackage PHPUnit * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Db_DataSet_QueryTable extends PHPUnit_Extensions_Database_DataSet_QueryTable +class Zend_Test_PHPUnit_Db_DataSet_QueryTable extends PHPUnit\DbUnit\DataSet\QueryTable { /** * Creates a new database query table object. * * @param string $tableName * @param string $query - * @param PHPUnit_Extensions_Database_DB_IDatabaseConnection $databaseConnection + * @param PHPUnit\DbUnit\Database\Connection $databaseConnection * @throws Zend_Test_PHPUnit_Db_Exception */ - public function __construct($tableName, $query, PHPUnit_Extensions_Database_DB_IDatabaseConnection $databaseConnection) + public function __construct($tableName, $query, PHPUnit\DbUnit\Database\Connection $databaseConnection) { if( !($databaseConnection instanceof Zend_Test_PHPUnit_Db_Connection) ) { require_once "Zend/Test/PHPUnit/Db/Exception.php"; @@ -74,7 +74,7 @@ protected function createTableMetaData() if(count($this->data) > 0) { $keys = array_keys($this->data[0]); } - $this->tableMetaData = new PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData( + $this->tableMetaData = new PHPUnit\DbUnit\DataSet\DefaultTableMetadata( $this->tableName, $keys ); } diff --git a/library/Zend/Test/PHPUnit/Db/Metadata/Generic.php b/library/Zend/Test/PHPUnit/Db/Metadata/Generic.php index d4b414494a..0808374f4e 100644 --- a/library/Zend/Test/PHPUnit/Db/Metadata/Generic.php +++ b/library/Zend/Test/PHPUnit/Db/Metadata/Generic.php @@ -28,14 +28,14 @@ /** * Generic Metadata accessor for the Zend_Db adapters * - * @uses PHPUnit_Extensions_Database_DB_IMetaData + * @uses PHPUnit\DbUnit\Database\Metadata\Metadata * @category Zend * @package Zend_Test * @subpackage PHPUnit * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Db_Metadata_Generic implements PHPUnit_Extensions_Database_DB_IMetaData +class Zend_Test_PHPUnit_Db_Metadata_Generic implements PHPUnit\DbUnit\Database\Metadata\Metadata { /** * Zend_Db Connection diff --git a/library/Zend/Test/PHPUnit/Db/Operation/DeleteAll.php b/library/Zend/Test/PHPUnit/Db/Operation/DeleteAll.php index 7e4fa5e2e2..2753d88e6a 100644 --- a/library/Zend/Test/PHPUnit/Db/Operation/DeleteAll.php +++ b/library/Zend/Test/PHPUnit/Db/Operation/DeleteAll.php @@ -28,20 +28,20 @@ /** * Delete All Operation that can be executed on set up or tear down of a database tester. * - * @uses PHPUnit_Extensions_Database_Operation_IDatabaseOperation + * @uses PHPUnit\DbUnit\Operation\Operation * @category Zend * @package Zend_Test * @subpackage PHPUnit * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Db_Operation_DeleteAll implements PHPUnit_Extensions_Database_Operation_IDatabaseOperation +class Zend_Test_PHPUnit_Db_Operation_DeleteAll implements PHPUnit\DbUnit\Operation\Operation { /** - * @param PHPUnit_Extensions_Database_DB_IDatabaseConnection $connection - * @param PHPUnit_Extensions_Database_DataSet_IDataSet $dataSet + * @param PHPUnit\DbUnit\Database\Connection $connection + * @param PHPUnit\DbUnit\DataSet\IDataSet $dataSet */ - public function execute(PHPUnit_Extensions_Database_DB_IDatabaseConnection $connection, PHPUnit_Extensions_Database_DataSet_IDataSet $dataSet) + public function execute(PHPUnit\DbUnit\Database\Connection $connection, PHPUnit\DbUnit\DataSet\IDataSet $dataSet) { if(!($connection instanceof Zend_Test_PHPUnit_Db_Connection)) { require_once "Zend/Test/PHPUnit/Db/Exception.php"; @@ -53,7 +53,7 @@ public function execute(PHPUnit_Extensions_Database_DB_IDatabaseConnection $conn $tableName = $table->getTableMetaData()->getTableName(); $connection->getConnection()->delete($tableName); } catch (Exception $e) { - throw new PHPUnit_Extensions_Database_Operation_Exception('DELETEALL', 'DELETE FROM '.$tableName.'', array(), $table, $e->getMessage()); + throw new PHPUnit\DbUnit\Operation\Exception('DELETEALL', 'DELETE FROM '.$tableName.'', array(), $table, $e->getMessage()); } } } diff --git a/library/Zend/Test/PHPUnit/Db/Operation/Insert.php b/library/Zend/Test/PHPUnit/Db/Operation/Insert.php index 7668d6c501..b4f9721b36 100644 --- a/library/Zend/Test/PHPUnit/Db/Operation/Insert.php +++ b/library/Zend/Test/PHPUnit/Db/Operation/Insert.php @@ -28,20 +28,20 @@ /** * Operation for Inserting on setup or teardown of a database tester. * - * @uses PHPUnit_Extensions_Database_Operation_IDatabaseOperation + * @uses PHPUnit\DbUnit\Operation\Operation * @category Zend * @package Zend_Test * @subpackage PHPUnit * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Db_Operation_Insert implements PHPUnit_Extensions_Database_Operation_IDatabaseOperation +class Zend_Test_PHPUnit_Db_Operation_Insert implements PHPUnit\DbUnit\Operation\Operation { /** - * @param PHPUnit_Extensions_Database_DB_IDatabaseConnection $connection - * @param PHPUnit_Extensions_Database_DataSet_IDataSet $dataSet + * @param PHPUnit\DbUnit\Database\Connection $connection + * @param PHPUnit\DbUnit\DataSet\IDataSet $dataSet */ - public function execute(PHPUnit_Extensions_Database_DB_IDatabaseConnection $connection, PHPUnit_Extensions_Database_DataSet_IDataSet $dataSet) + public function execute(PHPUnit\DbUnit\Database\Connection $connection, PHPUnit\DbUnit\DataSet\IDataSet $dataSet) { if(!($connection instanceof Zend_Test_PHPUnit_Db_Connection)) { require_once "Zend/Test/PHPUnit/Db/Exception.php"; @@ -61,7 +61,7 @@ public function execute(PHPUnit_Extensions_Database_DB_IDatabaseConnection $conn try { $db->insert($tableName, $values); } catch (Exception $e) { - throw new PHPUnit_Extensions_Database_Operation_Exception("INSERT", "INSERT INTO ".$tableName." [..]", $values, $table, $e->getMessage()); + throw new PHPUnit\DbUnit\Operation\Exception("INSERT", "INSERT INTO ".$tableName." [..]", $values, $table, $e->getMessage()); } } } @@ -69,11 +69,11 @@ public function execute(PHPUnit_Extensions_Database_DB_IDatabaseConnection $conn /** * - * @param PHPUnit_Extensions_Database_DataSet_ITable $table + * @param PHPUnit\DbUnit\DataSet\ITable $table * @param int $rowNum * @return array */ - protected function buildInsertValues(PHPUnit_Extensions_Database_DataSet_ITable $table, $rowNum) + protected function buildInsertValues(PHPUnit\DbUnit\DataSet\ITable $table, $rowNum) { $values = array(); foreach($table->getTableMetaData()->getColumns() as $columnName) { diff --git a/library/Zend/Test/PHPUnit/Db/Operation/Truncate.php b/library/Zend/Test/PHPUnit/Db/Operation/Truncate.php index da7c643b76..8ca9ead155 100644 --- a/library/Zend/Test/PHPUnit/Db/Operation/Truncate.php +++ b/library/Zend/Test/PHPUnit/Db/Operation/Truncate.php @@ -28,22 +28,22 @@ /** * Operation for Truncating on setup or teardown of a database tester. * - * @uses PHPUnit_Extensions_Database_Operation_IDatabaseOperation + * @uses PHPUnit\DbUnit\Operation\Operation * @category Zend * @package Zend_Test * @subpackage PHPUnit * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Db_Operation_Truncate implements PHPUnit_Extensions_Database_Operation_IDatabaseOperation +class Zend_Test_PHPUnit_Db_Operation_Truncate implements PHPUnit\DbUnit\Operation\Operation { /** * - * @param PHPUnit_Extensions_Database_DB_IDatabaseConnection $connection - * @param PHPUnit_Extensions_Database_DataSet_IDataSet $dataSet + * @param PHPUnit\DbUnit\Database\Connection $connection + * @param PHPUnit\DbUnit\DataSet\IDataSet $dataSet * @return void */ - public function execute(PHPUnit_Extensions_Database_DB_IDatabaseConnection $connection, PHPUnit_Extensions_Database_DataSet_IDataSet $dataSet) + public function execute(PHPUnit\DbUnit\Database\Connection $connection, PHPUnit\DbUnit\DataSet\IDataSet $dataSet) { if(!($connection instanceof Zend_Test_PHPUnit_Db_Connection)) { require_once "Zend/Test/PHPUnit/Db/Exception.php"; @@ -55,7 +55,7 @@ public function execute(PHPUnit_Extensions_Database_DB_IDatabaseConnection $conn $tableName = $table->getTableMetaData()->getTableName(); $this->_truncate($connection->getConnection(), $tableName); } catch (Exception $e) { - throw new PHPUnit_Extensions_Database_Operation_Exception('TRUNCATE', 'TRUNCATE '.$tableName.'', array(), $table, $e->getMessage()); + throw new PHPUnit\DbUnit\Operation\Exception('TRUNCATE', 'TRUNCATE '.$tableName.'', array(), $table, $e->getMessage()); } } } diff --git a/library/Zend/Test/PHPUnit/Db/SimpleTester.php b/library/Zend/Test/PHPUnit/Db/SimpleTester.php index 901b4e7139..03be0a6579 100644 --- a/library/Zend/Test/PHPUnit/Db/SimpleTester.php +++ b/library/Zend/Test/PHPUnit/Db/SimpleTester.php @@ -33,21 +33,21 @@ /** * Simple Tester for Database Tests when the Abstract Test Case cannot be used. * - * @uses PHPUnit_Extensions_Database_DefaultTester + * @uses PHPUnit\DbUnit\DefaultTester * @category Zend * @package Zend_Test * @subpackage PHPUnit * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Db_SimpleTester extends PHPUnit_Extensions_Database_DefaultTester +class Zend_Test_PHPUnit_Db_SimpleTester extends PHPUnit\DbUnit\DefaultTester { /** * Creates a new default database tester using the given connection. * - * @param PHPUnit_Extensions_Database_DB_IDatabaseConnection $connection + * @param PHPUnit\DbUnit\Database\Connection $connection */ - public function __construct(PHPUnit_Extensions_Database_DB_IDatabaseConnection $connection) + public function __construct(PHPUnit\DbUnit\Database\Connection $connection) { if(!($connection instanceof Zend_Test_PHPUnit_Db_Connection)) { require_once "Zend/Test/PHPUnit/Db/Exception.php"; @@ -55,19 +55,19 @@ public function __construct(PHPUnit_Extensions_Database_DB_IDatabaseConnection $ } $this->connection = $connection; - $this->setUpOperation = new PHPUnit_Extensions_Database_Operation_Composite(array( + $this->setUpOperation = new PHPUnit\DbUnit\Operation\Composite(array( new Zend_Test_PHPUnit_Db_Operation_Truncate(), new Zend_Test_PHPUnit_Db_Operation_Insert(), )); - $this->tearDownOperation = PHPUnit_Extensions_Database_Operation_Factory::NONE(); + $this->tearDownOperation = PHPUnit\DbUnit\Operation\Factory::NONE(); } /** * Set Up the database using the given Dataset and the SetUp strategy "Truncate, then Insert" * - * @param PHPUnit_Extensions_Database_DataSet_IDataSet $dataSet + * @param PHPUnit\DbUnit\DataSet\IDataSet $dataSet */ - public function setUpDatabase(PHPUnit_Extensions_Database_DataSet_IDataSet $dataSet) + public function setUpDatabase(PHPUnit\DbUnit\DataSet\IDataSet $dataSet) { $this->setDataSet($dataSet); $this->onSetUp(); diff --git a/library/Zend/Tool/Project/Context/Zf/TestLibraryFile.php b/library/Zend/Tool/Project/Context/Zf/TestLibraryFile.php index 1e9923e829..e74b188876 100644 --- a/library/Zend/Tool/Project/Context/Zf/TestLibraryFile.php +++ b/library/Zend/Tool/Project/Context/Zf/TestLibraryFile.php @@ -86,7 +86,7 @@ public function getContents() 'classes' => array( new Zend_CodeGenerator_Php_Class(array( 'name' => $className, - 'extendedClass' => 'PHPUnit_Framework_TestCase', + 'extendedClass' => 'PHPUnit\Framework\TestCase', 'methods' => array( new Zend_CodeGenerator_Php_Method(array( 'name' => 'setUp', diff --git a/library/Zend/Tool/Project/Provider/Test.php b/library/Zend/Tool/Project/Provider/Test.php index 31316027b7..8ca1152ae9 100644 --- a/library/Zend/Tool/Project/Provider/Test.php +++ b/library/Zend/Tool/Project/Provider/Test.php @@ -57,7 +57,7 @@ public static function isTestingEnabled(Zend_Tool_Project_Profile $profile) public static function isPHPUnitAvailable() { - if (class_exists('PHPUnit_Runner_Version', false)) { + if (class_exists('PHPUnit\Runner\Version', false) || class_exists('PHPUnit_Runner_Version', false)) { return true; } diff --git a/tests/TestHelper.php b/tests/TestHelper.php index 845f07bdc6..a47bafcefa 100644 --- a/tests/TestHelper.php +++ b/tests/TestHelper.php @@ -23,10 +23,10 @@ /** * Include PHPUnit dependencies */ -if (version_compare(PHPUnit_Runner_Version::id(), '4.0.0', '<')) { +if (version_compare(PHPUnit\Runner\Version::id(), '4.0.0', '<')) { require_once 'PHPUnit/Runner/Version.php'; - $phpunitVersion = PHPUnit_Runner_Version::id(); + $phpunitVersion = PHPUnit\Runner\Version::id(); if ($phpunitVersion == '@package_version@' || version_compare($phpunitVersion, '3.5.5', '>=')) { require_once 'PHPUnit/Autoload.php'; // >= PHPUnit 3.5.5 } else { diff --git a/tests/Zend/Acl/AclTest.php b/tests/Zend/Acl/AclTest.php index 7511ef7890..9ce15c8494 100644 --- a/tests/Zend/Acl/AclTest.php +++ b/tests/Zend/Acl/AclTest.php @@ -33,7 +33,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Acl_AclTest extends PHPUnit_Framework_TestCase +class Zend_Acl_AclTest extends PHPUnit\Framework\TestCase { /** * ACL object for each test method @@ -1180,17 +1180,18 @@ protected function _loadUseCase1() /** * Returns an array of registered roles - * @expectedException PHPUnit_Framework_Error * @group ZF-5638 */ public function testGetRegisteredRoles() { + $this->expectException(\PHPUnit\Framework\Error\Error::class); + $acl = $this->_acl; $acl->addRole('developer'); $roles = $acl->getRegisteredRoles(); - $this->assertTrue(is_array($roles)); - $this->assertFalse(empty($roles)); + $this->assertInternalType('array', $roles); + $this->assertNotEmpty($roles); } /** @@ -1263,7 +1264,7 @@ public function testGetRegisteredRolesIsDeprecated() { try { $this->_acl->getRegisteredRoles(); $this->fail('getRegisteredRoles() did not throw an exception'); - } catch(PHPUnit_Framework_Error $e) { + } catch(PHPUnit\Framework\Error\Error $e) { return; } diff --git a/tests/Zend/Amf/Adobe/IntrospectorTest.php b/tests/Zend/Amf/Adobe/IntrospectorTest.php index e612a82d7b..0c973c19af 100644 --- a/tests/Zend/Amf/Adobe/IntrospectorTest.php +++ b/tests/Zend/Amf/Adobe/IntrospectorTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Amf */ -class Zend_Amf_Adobe_IntrospectorTest extends PHPUnit_Framework_TestCase +class Zend_Amf_Adobe_IntrospectorTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Amf/AuthTest.php b/tests/Zend/Amf/AuthTest.php index 9ca71f99d9..6ba101ad4b 100755 --- a/tests/Zend/Amf/AuthTest.php +++ b/tests/Zend/Amf/AuthTest.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Amf */ -class Zend_Amf_AuthTest extends PHPUnit_Framework_TestCase +class Zend_Amf_AuthTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Amf/RequestTest.php b/tests/Zend/Amf/RequestTest.php index db7f67a3ac..05062c88ce 100644 --- a/tests/Zend/Amf/RequestTest.php +++ b/tests/Zend/Amf/RequestTest.php @@ -36,7 +36,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Amf */ -class Zend_Amf_RequestTest extends PHPUnit_Framework_TestCase +class Zend_Amf_RequestTest extends PHPUnit\Framework\TestCase { /** * Zend_Amf_Request object @@ -87,7 +87,7 @@ public function testAmf3RemoteObjectUndefParameterDeserializedToNativePhpNull() $this->assertEquals('RoundTrip', $message->source); $data = $message->body; // Make sure that we are dealing with a PHP null - $this->assertTrue(is_null($data[0])); + $this->assertNull($data[0]); } /** @@ -114,7 +114,7 @@ public function testAmf3RemoteObjectStringParameterDeserializedToNativePhpString $this->assertEquals('RoundTrip', $message->source); $data = $message->body; // Make sure that we are dealing with a PHP string - $this->assertTrue(is_string($data[0])); + $this->assertInternalType('string', $data[0]); // Make sure that the string was deserialized properly and check its value $this->assertEquals('abcdefghijklmpqrstuvwxyz', $data[0]); } @@ -143,7 +143,7 @@ public function testAmf3RemoteObjectArrayParameterDeserializedToNativePhpArray() $this->assertEquals('RoundTrip', $message->source); $data = $message->body; // Make sure that we are dealing with a PHP array - $this->assertTrue(is_array($data[0])); + $this->assertInternalType('array', $data[0]); // Make sure that the array was deserialized properly and check its value $this->assertEquals('a', $data[0][0]); $this->assertEquals('g', $data[0][6]); @@ -173,7 +173,7 @@ public function testAmf3NumberParameterDeserializedToNativePhpFloat() $this->assertEquals('RoundTrip', $message->source); $data = $message->body; // Make sure that we are dealing with a PHP float - $this->assertTrue(is_float($data[0])); + $this->assertInternalType('float', $data[0]); // Make sure that the float was deserialized properly and check its value $this->assertEquals(31.57, $data[0]); } @@ -230,7 +230,7 @@ public function testAmf3LargeIntParameterDeserializedToNativePhpInt() $this->assertEquals('RoundTrip', $message->source); $data = $message->body; // Make sure that we are dealing with a PHP array - $this->assertTrue(is_int($data[0])); + $this->assertInternalType('int', $data[0]); // Make sure that the array was deserialized properly and check its value $this->assertEquals(268435455, $data[0]); } @@ -257,7 +257,7 @@ public function testAmf3BoolTrueParameterDeserializedToNativePhpBool() $this->assertEquals('RoundTrip', $message->source); $data = $message->body; // Make sure that we are dealing with a PHP array - $this->assertTrue(is_bool($data[0])); + $this->assertInternalType('bool', $data[0]); // Make sure that the Bool was deserialized properly and check its value $this->assertEquals(true, $data[0]); } @@ -284,7 +284,7 @@ public function testAmf3BoolFalseParameterDeserializedToNativePhpBool() $this->assertEquals('RoundTrip', $message->source); $data = $message->body; // Make sure that we are dealing with a PHP array - $this->assertTrue(is_bool($data[0])); + $this->assertInternalType('bool', $data[0]); // Make sure that the Bool was deserialized properly and check its value $this->assertEquals(false, $data[0]); } @@ -327,7 +327,7 @@ public function testAmf3ByteArrayDeserializedToNativePhpString() $this->assertTrue($requestBody[0] instanceof Zend_Amf_Value_MessageBody); $data = $requestBody[0]->getData(); // Make sure that we are dealing with a PHP string - $this->assertTrue(is_string($data[0])); + $this->assertInternalType('string', $data[0]); // Make sure that the string was deserialized properly and check its value $byteArray = file_get_contents(dirname(__FILE__) .'/Request/bytearray.bin'); $this->assertEquals($byteArray, $data[0]); @@ -351,7 +351,7 @@ public function testAmf0StringParameterDeserializedToNativePhpString() $this->assertEquals('RoundTrip.returnString', $requestBody[0]->getTargetURI()); $data = $requestBody[0]->getData(); // Make sure that we are dealing with a PHP string - $this->assertTrue(is_string($data[0])); + $this->assertInternalType('string', $data[0]); // Make sure that the string was deserialized properly and check its value $this->assertEquals('abcdefghijklmpqrstuvwxyz', $data[0]); } @@ -422,9 +422,9 @@ public function testAmf0MixedArrayParameterDeserializedToNativePhpObject() // keys. In PHP 7.2+ array_key_exists on this particular object returns false // https://3v4l.org/ui8Fm if (version_compare(PHP_VERSION, '7.0.0', '>=')) { - $this->assertTrue(array_key_exists(1, get_object_vars($data[0]))); + $this->assertArrayHasKey(1, get_object_vars($data[0])); } else { - $this->assertTrue(array_key_exists(1, $data[0])); + $this->assertArrayHasKey(1, $data[0]); } $this->assertEquals('two', $data[0]->two); } @@ -446,7 +446,7 @@ public function testAmf0NumberParameterDeserializedToNativePhpFloat() $this->assertTrue($bodies[0] instanceof Zend_Amf_Value_MessageBody); $data = $bodies[0]->getData(); // Make sure that the string was deserialized properly and check its value - $this->assertTrue(is_float($data[0])); + $this->assertInternalType('float', $data[0]); $this->assertEquals(31.57, $data[0]); } @@ -508,7 +508,7 @@ public function testAmf0BoolTrueParameterDeserializedToNativePhpBool() $this->assertTrue($bodies[0] instanceof Zend_Amf_Value_MessageBody); $data = $bodies[0]->getData(); // Make sure that the string was deserialized properly and check its value - $this->assertTrue(is_bool($data[0])); + $this->assertInternalType('bool', $data[0]); $this->assertEquals(true, $data[0]); } @@ -529,7 +529,7 @@ public function testAmf0BoolFalseParameterDeserializedToNativePhpBool() $this->assertTrue($bodies[0] instanceof Zend_Amf_Value_MessageBody); $data = $bodies[0]->getData(); // Make sure that the string was deserialized properly and check its value - $this->assertTrue(is_bool($data[0])); + $this->assertInternalType('bool', $data[0]); $this->assertEquals(false, $data[0]); } @@ -546,7 +546,7 @@ public function testAmf0NullDeserializedToNativePhpNull() $this->assertTrue($bodies[0] instanceof Zend_Amf_Value_MessageBody); $data = $bodies[0]->getData(); // Make sure that the string was deserialized properly and check its value - $this->assertTrue(is_null($data[0])); + $this->assertNull($data[0]); } public function testAmf0UndefinedDeserializedToNativePhpNull() @@ -562,7 +562,7 @@ public function testAmf0UndefinedDeserializedToNativePhpNull() $this->assertTrue($bodies[0] instanceof Zend_Amf_Value_MessageBody); $data = $bodies[0]->getData(); // Make sure that the string was deserialized properly and check its value - $this->assertTrue(is_null($data[0])); + $this->assertNull($data[0]); } public function testAmf0XmlParameterDeserializedToNativePhpSimpleXml() diff --git a/tests/Zend/Amf/ResourceTest.php b/tests/Zend/Amf/ResourceTest.php index a25db9426c..297f940d8d 100755 --- a/tests/Zend/Amf/ResourceTest.php +++ b/tests/Zend/Amf/ResourceTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Amf */ -class Zend_Amf_ResourceTest extends PHPUnit_Framework_TestCase +class Zend_Amf_ResourceTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Amf/Response/HttpTest.php b/tests/Zend/Amf/Response/HttpTest.php index 870058abb1..2dc606a585 100644 --- a/tests/Zend/Amf/Response/HttpTest.php +++ b/tests/Zend/Amf/Response/HttpTest.php @@ -36,7 +36,7 @@ * @group Zend_Amf * @group Zend_Amf_Response */ -class Zend_Amf_Response_HttpTest extends PHPUnit_Framework_TestCase +class Zend_Amf_Response_HttpTest extends PHPUnit\Framework\TestCase { /** * Ensure isIeOverSsl() does not emit a notice when $_SERVER['HTTPS'] not set diff --git a/tests/Zend/Amf/ResponseTest.php b/tests/Zend/Amf/ResponseTest.php index a267e6009a..77c3a1ad5a 100644 --- a/tests/Zend/Amf/ResponseTest.php +++ b/tests/Zend/Amf/ResponseTest.php @@ -40,7 +40,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Amf */ -class Zend_Amf_ResponseTest extends PHPUnit_Framework_TestCase +class Zend_Amf_ResponseTest extends PHPUnit\Framework\TestCase { // The message response status code. public $responseURI = "/2/onResult"; diff --git a/tests/Zend/Amf/ServerTest.php b/tests/Zend/Amf/ServerTest.php index 42c199d82b..c91f3633c8 100644 --- a/tests/Zend/Amf/ServerTest.php +++ b/tests/Zend/Amf/ServerTest.php @@ -40,7 +40,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Amf */ -class Zend_Amf_ServerTest extends PHPUnit_Framework_TestCase +class Zend_Amf_ServerTest extends PHPUnit\Framework\TestCase { protected $_server; @@ -93,26 +93,29 @@ public function testSetClass() } /** - * @expectedException Zend_Amf_Server_Exception */ public function testSetClassShouldRaiseExceptionOnInvalidClassname() { + $this->expectException(\Zend_Amf_Server_Exception::class); + $this->_server->setClass('foobar'); } /** - * @expectedException Zend_Amf_Server_Exception */ public function testSetClassShouldRaiseExceptionOnInvalidClasstype() { + $this->expectException(\Zend_Amf_Server_Exception::class); + $this->_server->setClass(array('foobar')); } /** - * @expectedException Zend_Amf_Server_Exception */ public function testSetClassShouldRaiseExceptionOnDuplicateMethodName() { + $this->expectException(\Zend_Amf_Server_Exception::class); + $this->_server->setClass('Zend_Amf_testclass', 'tc'); $this->_server->setClass('Zend_Amf_testclassPrivate', 'tc'); } @@ -174,18 +177,20 @@ public function testAddFunction() } /** - * @expectedException Zend_Amf_Server_Exception */ public function testAddFunctionShouldRaiseExceptionForInvalidFunctionName() { + $this->expectException(\Zend_Amf_Server_Exception::class); + $this->_server->addFunction(true); } /** - * @expectedException Zend_Amf_Server_Exception */ public function testAddFunctionShouldRaiseExceptionOnDuplicateMethodName() { + $this->expectException(\Zend_Amf_Server_Exception::class); + $this->_server->addFunction('Zend_Amf_Server_testFunction', 'tc'); $this->_server->addFunction('Zend_Amf_Server_testFunction', 'tc'); } @@ -209,7 +214,7 @@ public function testHandleLoadedClassAmf0() $responseBody = $response->getAmfBodies(); // Now check if the return data was properly set. $this->assertTrue(0 < count($responseBody), var_export($responseBody, 1)); - $this->assertTrue(array_key_exists(0, $responseBody), var_export($responseBody, 1)); + $this->assertArrayHasKey(0, $responseBody, var_export($responseBody, 1)); $this->assertEquals("String: 12345", $responseBody[0]->getData(), var_export($responseBody, 1)); } @@ -227,7 +232,7 @@ public function testShouldAllowHandlingFunctionCallsViaAmf0() $responseBody = $response->getAmfBodies(); // Now check if the return data was properly set. $this->assertTrue(0 < count($responseBody), var_export($responseBody, 1)); - $this->assertTrue(array_key_exists(0, $responseBody), var_export($responseBody, 1)); + $this->assertArrayHasKey(0, $responseBody, var_export($responseBody, 1)); $this->assertEquals("bar: foo", $responseBody[0]->getData(), var_export($responseBody, 1)); } @@ -252,7 +257,7 @@ public function testHandleLoadedClassAmf3NetConnection() $responseBody = $response->getAmfBodies(); // Now check if the return data was properly set. $this->assertTrue(0 < count($responseBody), var_export($responseBody, 1)); - $this->assertTrue(array_key_exists(0, $responseBody), var_export($responseBody, 1)); + $this->assertArrayHasKey(0, $responseBody, var_export($responseBody, 1)); $this->assertEquals("String: 12345", $responseBody[0]->getData(), var_export($responseBody, 1)); } @@ -277,7 +282,7 @@ public function testShouldAllowHandlingFunctionCallsViaAmf3NetConnection() $responseBody = $response->getAmfBodies(); // Now check if the return data was properly set. $this->assertTrue(0 < count($responseBody), var_export($responseBody, 1)); - $this->assertTrue(array_key_exists(0, $responseBody), var_export($responseBody, 1)); + $this->assertArrayHasKey(0, $responseBody, var_export($responseBody, 1)); $this->assertEquals("bar: foo", $responseBody[0]->getData(), var_export($responseBody, 1)); } @@ -307,7 +312,7 @@ public function testHandleLoadedClassAmf3() $response = $this->_server->getResponse(); $responseBody = $response->getAmfBodies(); $this->assertTrue(0 < count($responseBody), var_export($responseBody, 1)); - $this->assertTrue(array_key_exists(0, $responseBody), var_export($responseBody, 1)); + $this->assertArrayHasKey(0, $responseBody, var_export($responseBody, 1)); // Now check if the return data was properly set. $acknowledgeMessage = $responseBody[0]->getData(); // check that we have a message beening returned @@ -342,7 +347,7 @@ public function testSameMethodNameInTwoServices() $response = $this->_server->getResponse(); $responseBody = $response->getAmfBodies(); $this->assertTrue(0 < count($responseBody), var_export($responseBody, 1)); - $this->assertTrue(array_key_exists(0, $responseBody), var_export($responseBody, 1)); + $this->assertArrayHasKey(0, $responseBody, var_export($responseBody, 1)); // Now check if the return data was properly set. $acknowledgeMessage = $responseBody[0]->getData(); // check that we have a message beening returned @@ -371,7 +376,7 @@ public function testCommandMessagePingOperation() $response = $this->_server->getResponse(); $responseBody = $response->getAmfBodies(); $this->assertTrue(0 < count($responseBody), var_export($responseBody, 1)); - $this->assertTrue(array_key_exists(0, $responseBody), var_export($responseBody, 1)); + $this->assertArrayHasKey(0, $responseBody, var_export($responseBody, 1)); // Now check if the return data was properly set. $acknowledgeMessage = $responseBody[0]->getData(); // check that we have a message beening returned @@ -427,7 +432,7 @@ public function testInvalidCommandMessageShouldResultInErrorMessage() $response = $this->_server->getResponse(); $responseBody = $response->getAmfBodies(); $this->assertTrue(0 < count($responseBody), var_export($responseBody, 1)); - $this->assertTrue(array_key_exists(0, $responseBody), var_export($responseBody, 1)); + $this->assertArrayHasKey(0, $responseBody, var_export($responseBody, 1)); // Now check if the return data was properly set. $message = $responseBody[0]->getData(); @@ -722,10 +727,11 @@ public function testSetRequestShouldAllowValidStringClassNames() } /** - * @expectedException Zend_Amf_Server_Exception */ public function testSetRequestShouldRaiseExceptionOnInvalidStringClassName() { + $this->expectException(\Zend_Amf_Server_Exception::class); + $this->_server->setRequest('Zend_Amf_ServerTest_BogusRequest'); } @@ -737,10 +743,11 @@ public function testSetRequestShouldAllowValidRequestObjects() } /** - * @expectedException Zend_Amf_Server_Exception */ public function testSetRequestShouldRaiseExceptionOnInvalidRequestObjects() { + $this->expectException(\Zend_Amf_Server_Exception::class); + require_once 'Zend/XmlRpc/Request.php'; $request = new Zend_XmlRpc_Request; $this->_server->setRequest($request); @@ -755,10 +762,11 @@ public function testSetResponseShouldAllowValidStringClassNames() } /** - * @expectedException Zend_Amf_Server_Exception */ public function testSetResponseShouldRaiseExceptionOnInvalidStringClassName() { + $this->expectException(\Zend_Amf_Server_Exception::class); + $this->_server->setResponse('Zend_Amf_ServerTest_BogusResponse'); } @@ -770,10 +778,11 @@ public function testSetResponseShouldAllowValidResponseObjects() } /** - * @expectedException Zend_Amf_Server_Exception */ public function testSetResponseShouldRaiseExceptionOnInvalidResponseObjects() { + $this->expectException(\Zend_Amf_Server_Exception::class); + require_once 'Zend/XmlRpc/Response.php'; $response = new Zend_XmlRpc_Response; $this->_server->setResponse($response); @@ -785,7 +794,7 @@ public function testGetFunctionsShouldReturnArrayOfDispatchables() ->setClass('Zend_Amf_testclass', 'tc') ->setClass('Zend_Amf_testclassPrivate', 'tcp'); $functions = $this->_server->getFunctions(); - $this->assertTrue(is_array($functions)); + $this->assertInternalType('array', $functions); $this->assertTrue(0 < count($functions)); $namespaces = array('tf', 'tc', 'tcp'); foreach ($functions as $key => $value) { @@ -836,7 +845,7 @@ public function testSingleArrayParamaterAMF3() $response = $this->_server->getResponse(); $responseBody = $response->getAmfBodies(); $this->assertTrue(0 < count($responseBody), var_export($responseBody, 1)); - $this->assertTrue(array_key_exists(0, $responseBody), var_export($responseBody, 1)); + $this->assertArrayHasKey(0, $responseBody, var_export($responseBody, 1)); // Now check if the return data was properly set. $acknowledgeMessage = $responseBody[0]->getData(); // check that we have a message beening returned @@ -862,7 +871,7 @@ public function testSingleArrayParamaterAMF0() $responseBody = $response->getAmfBodies(); // Now check if the return data was properly set. $this->assertTrue(0 < count($responseBody), var_export($responseBody, 1)); - $this->assertTrue(array_key_exists(0, $responseBody), var_export($responseBody, 1)); + $this->assertArrayHasKey(0, $responseBody, var_export($responseBody, 1)); $this->assertTrue($responseBody[0]->getData(), var_export($responseBody, 1)); } @@ -892,7 +901,7 @@ public function testMutiArrayParamaterAMF3() $response = $this->_server->getResponse(); $responseBody = $response->getAmfBodies(); $this->assertTrue(0 < count($responseBody), var_export($responseBody, 1)); - $this->assertTrue(array_key_exists(0, $responseBody), var_export($responseBody, 1)); + $this->assertArrayHasKey(0, $responseBody, var_export($responseBody, 1)); // Now check if the return data was properly set. $acknowledgeMessage = $responseBody[0]->getData(); // check that we have a message beening returned @@ -919,7 +928,7 @@ public function testMutiArrayParamaterAMF0() $responseBody = $response->getAmfBodies(); // Now check if the return data was properly set. $this->assertTrue(0 < count($responseBody), var_export($responseBody, 1)); - $this->assertTrue(array_key_exists(0, $responseBody), var_export($responseBody, 1)); + $this->assertArrayHasKey(0, $responseBody, var_export($responseBody, 1)); $this->assertEquals(4, count($responseBody[0]->getData()), var_export($responseBody, 1)); } @@ -948,7 +957,7 @@ public function testSingleObjectParamaterAMF3() $response = $this->_server->getResponse(); $responseBody = $response->getAmfBodies(); $this->assertTrue(0 < count($responseBody), var_export($responseBody, 1)); - $this->assertTrue(array_key_exists(0, $responseBody), var_export($responseBody, 1)); + $this->assertArrayHasKey(0, $responseBody, var_export($responseBody, 1)); // Now check if the return data was properly set. $acknowledgeMessage = $responseBody[0]->getData(); // check that we have a message beening returned diff --git a/tests/Zend/Amf/TypeLoaderTest.php b/tests/Zend/Amf/TypeLoaderTest.php index 2c6907bf8b..adf699d52d 100644 --- a/tests/Zend/Amf/TypeLoaderTest.php +++ b/tests/Zend/Amf/TypeLoaderTest.php @@ -30,7 +30,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Amf */ -class Zend_Amf_TypeloaderTest extends PHPUnit_Framework_TestCase +class Zend_Amf_TypeloaderTest extends PHPUnit\Framework\TestCase { /** * test that we can get the server name from the client name for deserialization. diff --git a/tests/Zend/Amf/Util/BinaryStreamTest.php b/tests/Zend/Amf/Util/BinaryStreamTest.php index 5d5896c1e3..e23c25f968 100644 --- a/tests/Zend/Amf/Util/BinaryStreamTest.php +++ b/tests/Zend/Amf/Util/BinaryStreamTest.php @@ -32,21 +32,23 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Amf */ -class Zend_Amf_Util_BinaryStreamTest extends PHPUnit_Framework_TestCase +class Zend_Amf_Util_BinaryStreamTest extends PHPUnit\Framework\TestCase { /** - * @expectedException Zend_Amf_Exception */ public function testConstructorShouldThrowExceptionForInvalidStream() { + $this->expectException(\Zend_Amf_Exception::class); + $test = new Zend_Amf_Util_BinaryStream(array('foo', 'bar')); } /** - * @expectedException Zend_Amf_Exception */ public function testReadBytesShouldRaiseExceptionForBufferUnderrun() { + $this->expectException(\Zend_Amf_Exception::class); + $string = 'this is a short stream'; $stream = new Zend_Amf_Util_BinaryStream($string); $length = strlen($string); diff --git a/tests/Zend/Amf/Value/ArrayCollectionTest.php b/tests/Zend/Amf/Value/ArrayCollectionTest.php index 0f059abbb0..7797cda5cb 100644 --- a/tests/Zend/Amf/Value/ArrayCollectionTest.php +++ b/tests/Zend/Amf/Value/ArrayCollectionTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Amf */ -class Zend_Amf_Value_ArrayCollectionTest extends PHPUnit_Framework_TestCase +class Zend_Amf_Value_ArrayCollectionTest extends PHPUnit\Framework\TestCase { @@ -140,7 +140,7 @@ public function testIteratorToArray() { $this->_arrayCollection = new Zend_Amf_Value_Messaging_ArrayCollection($this->_data); $standardArray = iterator_to_array($this->_arrayCollection); - $this->assertTrue(is_array($standardArray)); + $this->assertInternalType('array', $standardArray); } /** diff --git a/tests/Zend/Amf/Value/MessageBodyTest.php b/tests/Zend/Amf/Value/MessageBodyTest.php index c4c76a5855..679e3893e6 100644 --- a/tests/Zend/Amf/Value/MessageBodyTest.php +++ b/tests/Zend/Amf/Value/MessageBodyTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Amf */ -class Zend_Amf_Value_MessageBodyTest extends PHPUnit_Framework_TestCase +class Zend_Amf_Value_MessageBodyTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Amf/Value/MessageHeaderTest.php b/tests/Zend/Amf/Value/MessageHeaderTest.php index bd12e0aaa9..ef67e31232 100644 --- a/tests/Zend/Amf/Value/MessageHeaderTest.php +++ b/tests/Zend/Amf/Value/MessageHeaderTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Amf */ -class Zend_Amf_Value_MessageHeaderTest extends PHPUnit_Framework_TestCase +class Zend_Amf_Value_MessageHeaderTest extends PHPUnit\Framework\TestCase { public function testConstructorShouldSetMessageHeaderName() { diff --git a/tests/Zend/Application/ApplicationTest.php b/tests/Zend/Application/ApplicationTest.php index 3d04be448d..397c420ba5 100644 --- a/tests/Zend/Application/ApplicationTest.php +++ b/tests/Zend/Application/ApplicationTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Application */ -class Zend_Application_ApplicationTest extends PHPUnit_Framework_TestCase +class Zend_Application_ApplicationTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -246,10 +246,11 @@ public function testPassingArrayBootstrapOptionShouldRegisterBootstrapBasedOnPat } /** - * @expectedException Zend_Application_Exception */ public function testPassingArrayBootstrapWithoutPathOptionShouldRaiseException() { + $this->expectException(\Zend_Application_Exception::class); + $this->application->setOptions(array( 'bootstrap' => array( 'class' => 'ZfAppBootstrap', @@ -259,10 +260,11 @@ public function testPassingArrayBootstrapWithoutPathOptionShouldRaiseException() } /** - * @expectedException Zend_Application_Exception */ public function testPassingInvalidBootstrapOptionShouldRaiseException() { + $this->expectException(\Zend_Application_Exception::class); + $this->application->setOptions(array( 'bootstrap' => new stdClass(), )); @@ -270,10 +272,11 @@ public function testPassingInvalidBootstrapOptionShouldRaiseException() } /** - * @expectedException Zend_Application_Exception */ public function testPassingInvalidOptionsArgumentToConstructorShouldRaiseException() { + $this->expectException(\Zend_Application_Exception::class); + $application = new Zend_Application('testing', new stdClass()); } @@ -365,10 +368,11 @@ public function testPassingArrayOptionsWithConfigKeyShouldLoadOptionsAndNotOverr } /** - * @expectedException Zend_Application_Exception */ public function testPassingInvalidStringOptionToConstructorShouldRaiseException() { + $this->expectException(\Zend_Application_Exception::class); + $application = new Zend_Application('testing', dirname(__FILE__) . '/_files/appconfig'); } @@ -393,10 +397,11 @@ public function testBootstrapImplementsFluentInterface() } /** - * @expectedException Zend_Application_Exception */ public function testApplicationShouldRaiseExceptionIfBootstrapFileDoesNotContainBootstrapClass() { + $this->expectException(\Zend_Application_Exception::class); + $this->application->setOptions(array( 'bootstrap' => array( 'path' => dirname(__FILE__) . '/_files/ZfAppNoBootstrap.php', @@ -407,10 +412,11 @@ public function testApplicationShouldRaiseExceptionIfBootstrapFileDoesNotContain } /** - * @expectedException Zend_Application_Exception */ public function testApplicationShouldRaiseExceptionWhenBootstrapClassNotOfCorrectType() { + $this->expectException(\Zend_Application_Exception::class); + $this->application->setOptions(array( 'bootstrap' => array( 'path' => dirname(__FILE__) . '/_files/ZfAppBadBootstrap.php', diff --git a/tests/Zend/Application/Bootstrap/BootstrapAbstractTest.php b/tests/Zend/Application/Bootstrap/BootstrapAbstractTest.php index 89fdcf0dc7..30178331ef 100644 --- a/tests/Zend/Application/Bootstrap/BootstrapAbstractTest.php +++ b/tests/Zend/Application/Bootstrap/BootstrapAbstractTest.php @@ -58,7 +58,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Application */ -class Zend_Application_Bootstrap_BootstrapAbstractTest extends PHPUnit_Framework_TestCase +class Zend_Application_Bootstrap_BootstrapAbstractTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -127,10 +127,11 @@ public function testConstructorShouldAllowPassingAnotherBootstrapObject() } /** - * @expectedException Zend_Application_Bootstrap_Exception */ public function testConstructorShouldRaiseExceptionForInvalidApplicationArgument() { + $this->expectException(\Zend_Application_Bootstrap_Exception::class); + require_once dirname(__FILE__) . '/../_files/ZfAppBootstrap.php'; $bootstrap = new ZfAppBootstrap(new stdClass); } @@ -183,7 +184,7 @@ public function testPluginPathsOptionKeyShouldAddPrefixPathsToPluginLoader() )); $loader = $bootstrap->getPluginLoader(); $paths = $loader->getPaths('Foo'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } public function testResourcesOptionKeyShouldRegisterBootstrapPluginResources() @@ -249,10 +250,11 @@ public function testInternalInitializersShouldRegisterResourceNames() } /** - * @expectedException Zend_Application_Bootstrap_Exception */ public function testRegisterPluginResourceShouldThrowExceptionForInvalidResourceType() { + $this->expectException(\Zend_Application_Bootstrap_Exception::class); + require_once dirname(__FILE__) . '/../_files/ZfAppBootstrap.php'; $bootstrap = new ZfAppBootstrap($this->application); $bootstrap->registerPluginResource(array()); @@ -300,10 +302,11 @@ public function testShouldAllowUnregisteringPluginResourcesUsingConcreteInstance } /** - * @expectedException Zend_Application_Bootstrap_Exception */ public function testAttemptingToUnregisterPluginResourcesUsingInvalidResourceTypeShouldThrowException() { + $this->expectException(\Zend_Application_Bootstrap_Exception::class); + require_once dirname(__FILE__) . '/../_files/ZfAppBootstrap.php'; $bootstrap = new ZfAppBootstrap($this->application); $bootstrap->registerPluginResource('view'); @@ -361,7 +364,7 @@ public function testDefaultPluginLoaderShouldRegisterPrefixPathForResources() $bootstrap = new ZfAppBootstrap($this->application); $loader = $bootstrap->getPluginLoader(); $paths = $loader->getPaths('Zend_Application_Resource'); - $this->assertFalse(empty($paths)); + $this->assertNotEmpty($paths); } public function testEnvironmentShouldMatchApplicationEnvironment() @@ -425,20 +428,22 @@ public function testPassingNoValuesToBootstrapExecutesAllResources() } /** - * @expectedException Zend_Application_Bootstrap_Exception */ public function testPassingInvalidResourceArgumentToBootstrapShouldThrowException() { + $this->expectException(\Zend_Application_Bootstrap_Exception::class); + require_once dirname(__FILE__) . '/../_files/ZfAppBootstrap.php'; $bootstrap = new ZfAppBootstrap($this->application); $bootstrap->bootstrap(new stdClass); } /** - * @expectedException Zend_Application_Bootstrap_Exception */ public function testPassingUnknownResourceToBootstrapShouldThrowException() { + $this->expectException(\Zend_Application_Bootstrap_Exception::class); + require_once dirname(__FILE__) . '/../_files/ZfAppBootstrap.php'; $bootstrap = new ZfAppBootstrap($this->application); $bootstrap->bootstrap('bazbat'); @@ -453,20 +458,22 @@ public function testCallShouldOverloadToBootstrap() } /** - * @expectedException Zend_Application_Bootstrap_Exception */ public function testCallShouldThrowExceptionForInvalidMethodCall() { + $this->expectException(\Zend_Application_Bootstrap_Exception::class); + require_once dirname(__FILE__) . '/../_files/ZfAppBootstrap.php'; $bootstrap = new ZfAppBootstrap($this->application); $bootstrap->initFoo(); } /** - * @expectedException Zend_Application_Bootstrap_Exception */ public function testDependencyTrackingShouldDetectCircularDependencies() { + $this->expectException(\Zend_Application_Bootstrap_Exception::class); + require_once dirname(__FILE__) . '/../_files/BootstrapBaseCircularDependency.php'; $bootstrap = new BootstrapBaseCircularDependency($this->application); $bootstrap->bootstrap(); @@ -707,10 +714,11 @@ public function testCallingSetOptionsMultipleTimesShouldUpdateOptionKeys() /** * @group ZF-9110 - * @expectedException Zend_Application_Bootstrap_Exception */ public function testPassingSameBootstrapAsApplicationShouldNotCauseRecursion() { + $this->expectException(\Zend_Application_Bootstrap_Exception::class); + $bootstrap = new Zend_Application_Bootstrap_Bootstrap($this->application); $bootstrap->setApplication($bootstrap); } diff --git a/tests/Zend/Application/Bootstrap/BootstrapTest.php b/tests/Zend/Application/Bootstrap/BootstrapTest.php index 877f53f019..623b2e75ce 100644 --- a/tests/Zend/Application/Bootstrap/BootstrapTest.php +++ b/tests/Zend/Application/Bootstrap/BootstrapTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Application */ -class Zend_Application_Bootstrap_BootstrapTest extends PHPUnit_Framework_TestCase +class Zend_Application_Bootstrap_BootstrapTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -86,10 +86,11 @@ public function testFrontControllerResourcePluginShouldBeRegisteredByDefault() } /** - * @expectedException Zend_Application_Bootstrap_Exception */ public function testRunShouldRaiseExceptionIfNoControllerDirectoryRegisteredWithFrontController() { + $this->expectException(\Zend_Application_Bootstrap_Exception::class); + $this->bootstrap->bootstrap(); $this->bootstrap->run(); } diff --git a/tests/Zend/Application/Module/AutoloaderTest.php b/tests/Zend/Application/Module/AutoloaderTest.php index 1975feaab0..d5f1908a5b 100644 --- a/tests/Zend/Application/Module/AutoloaderTest.php +++ b/tests/Zend/Application/Module/AutoloaderTest.php @@ -46,7 +46,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Application */ -class Zend_Application_Module_AutoloaderTest extends PHPUnit_Framework_TestCase +class Zend_Application_Module_AutoloaderTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Application/Module/BootstrapTest.php b/tests/Zend/Application/Module/BootstrapTest.php index 6977c197f4..a5b67947dd 100644 --- a/tests/Zend/Application/Module/BootstrapTest.php +++ b/tests/Zend/Application/Module/BootstrapTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Application */ -class Zend_Application_Module_BootstrapTest extends PHPUnit_Framework_TestCase +class Zend_Application_Module_BootstrapTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -217,7 +217,7 @@ public function testModuleBootstrapShouldInheritApplicationBootstrapPluginPaths( foreach ($modules as $bootstrap) { $loader = $bootstrap->getPluginLoader(); $paths = $loader->getPaths(); - $this->assertTrue(array_key_exists('ZfModuleBootstrap_Resource_', $paths)); + $this->assertArrayHasKey('ZfModuleBootstrap_Resource_', $paths); } } } diff --git a/tests/Zend/Application/Resource/CacheManagerTest.php b/tests/Zend/Application/Resource/CacheManagerTest.php index 743a5b90b1..09e0a0663a 100644 --- a/tests/Zend/Application/Resource/CacheManagerTest.php +++ b/tests/Zend/Application/Resource/CacheManagerTest.php @@ -53,7 +53,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Application */ -class Zend_Application_Resource_CacheManagerTest extends PHPUnit_Framework_TestCase +class Zend_Application_Resource_CacheManagerTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -255,8 +255,8 @@ public function testLoggerFactory() $event = current($options['page']['frontend']['options']['logger'][0]->events); - $this->assertTrue(is_array($event)); - $this->assertTrue(array_key_exists('message', $event)); + $this->assertInternalType('array', $event); + $this->assertArrayHasKey('message', $event); $this->assertContains('Zend_Cache_Backend_Static', $event['message']); } } diff --git a/tests/Zend/Application/Resource/DbTest.php b/tests/Zend/Application/Resource/DbTest.php index bf0be73dee..90588530ae 100644 --- a/tests/Zend/Application/Resource/DbTest.php +++ b/tests/Zend/Application/Resource/DbTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Application */ -class Zend_Application_Resource_DbTest extends PHPUnit_Framework_TestCase +class Zend_Application_Resource_DbTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -91,7 +91,7 @@ public function testParamsAreEmptyByDefault() require_once 'Zend/Application/Resource/Db.php'; $resource = new Zend_Application_Resource_Db(); $params = $resource->getParams(); - $this->assertTrue(empty($params)); + $this->assertEmpty($params); } public function testIsDefaultTableAdapter() diff --git a/tests/Zend/Application/Resource/DojoTest.php b/tests/Zend/Application/Resource/DojoTest.php index d184eb3488..fdd5355f1e 100644 --- a/tests/Zend/Application/Resource/DojoTest.php +++ b/tests/Zend/Application/Resource/DojoTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Application */ -class Zend_Application_Resource_DojoTest extends PHPUnit_Framework_TestCase +class Zend_Application_Resource_DojoTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Application/Resource/FrontcontrollerTest.php b/tests/Zend/Application/Resource/FrontcontrollerTest.php index 020a24d01b..be378ecc7c 100644 --- a/tests/Zend/Application/Resource/FrontcontrollerTest.php +++ b/tests/Zend/Application/Resource/FrontcontrollerTest.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Application */ -class Zend_Application_Resource_FrontcontrollerTest extends PHPUnit_Framework_TestCase +class Zend_Application_Resource_FrontcontrollerTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Application/Resource/LayoutTest.php b/tests/Zend/Application/Resource/LayoutTest.php index d01e3e0e60..e125582fcc 100644 --- a/tests/Zend/Application/Resource/LayoutTest.php +++ b/tests/Zend/Application/Resource/LayoutTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Application */ -class Zend_Application_Resource_LayoutTest extends PHPUnit_Framework_TestCase +class Zend_Application_Resource_LayoutTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Application/Resource/LocaleTest.php b/tests/Zend/Application/Resource/LocaleTest.php index 508a0312c8..5804189df2 100644 --- a/tests/Zend/Application/Resource/LocaleTest.php +++ b/tests/Zend/Application/Resource/LocaleTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Application */ -class Zend_Application_Resource_LocaleTest extends PHPUnit_Framework_TestCase +class Zend_Application_Resource_LocaleTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Application/Resource/LogTest.php b/tests/Zend/Application/Resource/LogTest.php index 544d7f524b..21554f86a6 100644 --- a/tests/Zend/Application/Resource/LogTest.php +++ b/tests/Zend/Application/Resource/LogTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Application */ -class Zend_Application_Resource_LogTest extends PHPUnit_Framework_TestCase +class Zend_Application_Resource_LogTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Application/Resource/MailTest.php b/tests/Zend/Application/Resource/MailTest.php index db2891b7d8..85dd312d51 100644 --- a/tests/Zend/Application/Resource/MailTest.php +++ b/tests/Zend/Application/Resource/MailTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Application */ -class Zend_Application_Resource_MailTest extends PHPUnit_Framework_TestCase +class Zend_Application_Resource_MailTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -216,7 +216,7 @@ public function testOptionRegisterIsUnset() $resource->setOptions($options); $parameters = $resource->getMail()->parameters; - $this->assertTrue(empty($parameters)); + $this->assertEmpty($parameters); } } diff --git a/tests/Zend/Application/Resource/ModulesTest.php b/tests/Zend/Application/Resource/ModulesTest.php index 7bba0a4e08..90b0453683 100644 --- a/tests/Zend/Application/Resource/ModulesTest.php +++ b/tests/Zend/Application/Resource/ModulesTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Application */ -class Zend_Application_Resource_ModulesTest extends PHPUnit_Framework_TestCase +class Zend_Application_Resource_ModulesTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Application/Resource/MultidbTest.php b/tests/Zend/Application/Resource/MultidbTest.php index 54a51602ee..4f3dc8e347 100644 --- a/tests/Zend/Application/Resource/MultidbTest.php +++ b/tests/Zend/Application/Resource/MultidbTest.php @@ -41,7 +41,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Application */ -class Zend_Application_Resource_MultidbTest extends PHPUnit_Framework_TestCase +class Zend_Application_Resource_MultidbTest extends PHPUnit\Framework\TestCase { protected $_dbOptions = array('db1' => array('adapter' => 'pdo_mysql','dbname' => 'db1','password' => 'XXXX','username' => 'webuser'), 'db2' => array('adapter' => 'pdo_pgsql', 'dbname' => 'db2', 'password' => 'notthatpublic', 'username' => 'dba')); diff --git a/tests/Zend/Application/Resource/NavigationTest.php b/tests/Zend/Application/Resource/NavigationTest.php index 04d218eb4d..8a9d287542 100644 --- a/tests/Zend/Application/Resource/NavigationTest.php +++ b/tests/Zend/Application/Resource/NavigationTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Application */ -class Zend_Application_Resource_NavigationTest extends PHPUnit_Framework_TestCase +class Zend_Application_Resource_NavigationTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Application/Resource/ResourceAbstractTest.php b/tests/Zend/Application/Resource/ResourceAbstractTest.php index b42fce1417..9a15b4a901 100644 --- a/tests/Zend/Application/Resource/ResourceAbstractTest.php +++ b/tests/Zend/Application/Resource/ResourceAbstractTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Application */ -class Zend_Application_Resource_ResourceAbstractTest extends PHPUnit_Framework_TestCase +class Zend_Application_Resource_ResourceAbstractTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Application/Resource/RouterTest.php b/tests/Zend/Application/Resource/RouterTest.php index 59b0b7ffe3..a5d7d3f483 100644 --- a/tests/Zend/Application/Resource/RouterTest.php +++ b/tests/Zend/Application/Resource/RouterTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Application */ -class Zend_Application_Resource_RouterTest extends PHPUnit_Framework_TestCase +class Zend_Application_Resource_RouterTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Application/Resource/SessionTest.php b/tests/Zend/Application/Resource/SessionTest.php index 3f033a7903..6015bb8ecf 100644 --- a/tests/Zend/Application/Resource/SessionTest.php +++ b/tests/Zend/Application/Resource/SessionTest.php @@ -34,7 +34,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Application_Resource_SessionTest extends PHPUnit_Framework_TestCase +class Zend_Application_Resource_SessionTest extends PHPUnit\Framework\TestCase { public $resource; diff --git a/tests/Zend/Application/Resource/TranslateTest.php b/tests/Zend/Application/Resource/TranslateTest.php index 8c119a1dbd..cb547e18b6 100644 --- a/tests/Zend/Application/Resource/TranslateTest.php +++ b/tests/Zend/Application/Resource/TranslateTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Application */ -class Zend_Application_Resource_TranslateTest extends PHPUnit_Framework_TestCase +class Zend_Application_Resource_TranslateTest extends PHPUnit\Framework\TestCase { /** * @var array @@ -208,10 +208,11 @@ public function testToUseTheSameKeyAsTheOptionsZendTranslate() /** * @group ZF-10352 - * @expectedException Zend_Application_Resource_Exception */ public function testToUseTheTwoKeysContentAndDataShouldThrowsException() { + $this->expectException(\Zend_Application_Resource_Exception::class); + $options = array( 'adapter' => 'array', 'content' => array( @@ -245,8 +246,8 @@ public function testLogFactory() $resource->init()->translate('untranslated'); $event = current($options['log'][0]->events); - $this->assertTrue(is_array($event)); - $this->assertTrue(array_key_exists('message', $event)); + $this->assertInternalType('array', $event); + $this->assertArrayHasKey('message', $event); $this->assertEquals( "Untranslated message within 'en': untranslated", $event['message'] diff --git a/tests/Zend/Application/Resource/UseragentTest.php b/tests/Zend/Application/Resource/UseragentTest.php index 93df6966f3..8f289c276c 100644 --- a/tests/Zend/Application/Resource/UseragentTest.php +++ b/tests/Zend/Application/Resource/UseragentTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Application */ -class Zend_Application_Resource_UseragentTest extends PHPUnit_Framework_TestCase +class Zend_Application_Resource_UseragentTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Application/Resource/ViewTest.php b/tests/Zend/Application/Resource/ViewTest.php index 38527f8339..617116dd0c 100644 --- a/tests/Zend/Application/Resource/ViewTest.php +++ b/tests/Zend/Application/Resource/ViewTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Application */ -class Zend_Application_Resource_ViewTest extends PHPUnit_Framework_TestCase +class Zend_Application_Resource_ViewTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Auth/Adapter/DbTable/BasicSqliteTest.php b/tests/Zend/Auth/Adapter/DbTable/BasicSqliteTest.php index f8076304a1..bcfb5119c9 100644 --- a/tests/Zend/Auth/Adapter/DbTable/BasicSqliteTest.php +++ b/tests/Zend/Auth/Adapter/DbTable/BasicSqliteTest.php @@ -50,7 +50,7 @@ * @group Zend_Auth * @group Zend_Db_Table */ -class Zend_Auth_Adapter_DbTable_BasicSqliteTest extends PHPUnit_Framework_TestCase +class Zend_Auth_Adapter_DbTable_BasicSqliteTest extends PHPUnit\Framework\TestCase { /** * Sqlite database connection @@ -260,10 +260,11 @@ public function testAdapterReturnsASelectObjectWithoutAuthTimeModificationsAfter /** * Ensure that exceptions are caught * - * @expectedException Zend_Auth_Exception */ public function testCatchExceptionNoTable() { + $this->expectException(\Zend_Auth_Exception::class); + $adapter = new Zend_Auth_Adapter_DbTable($this->_db); $result = $adapter->authenticate(); // $this->assertEquals($e->getMessage(), 'A table must be supplied for the Zend_Auth_Adapter_DbTable authentication adapter.'); @@ -272,10 +273,11 @@ public function testCatchExceptionNoTable() /** * Ensure that exceptions are caught * - * @expectedException Zend_Auth_Exception */ public function testCatchExceptionNoIdentityColumn() { + $this->expectException(\Zend_Auth_Exception::class); + $adapter = new Zend_Auth_Adapter_DbTable($this->_db, 'users'); $result = $adapter->authenticate(); // $this->assertEquals($e->getMessage(), 'An identity column must be supplied for the Zend_Auth_Adapter_DbTable authentication adapter.'); @@ -284,10 +286,11 @@ public function testCatchExceptionNoIdentityColumn() /** * Ensure that exceptions are caught * - * @expectedException Zend_Auth_Exception */ public function testCatchExceptionNoCredentialColumn() { + $this->expectException(\Zend_Auth_Exception::class); + $adapter = new Zend_Auth_Adapter_DbTable($this->_db, 'users', 'username'); $result = $adapter->authenticate(); // $this->assertEquals($e->getMessage(), 'A credential column must be supplied for the Zend_Auth_Adapter_DbTable authentication adapter.'); @@ -296,10 +299,11 @@ public function testCatchExceptionNoCredentialColumn() /** * Ensure that exceptions are caught * - * @expectedException Zend_Auth_Exception */ public function testCatchExceptionNoIdentity() { + $this->expectException(\Zend_Auth_Exception::class); + $result = $this->_adapter->authenticate(); // $this->assertEquals($e->getMessage(), 'A value for the identity was not provided prior to authentication with Zend_Auth_Adapter_DbTable.'); } @@ -307,10 +311,11 @@ public function testCatchExceptionNoIdentity() /** * Ensure that exceptions are caught * - * @expectedException Zend_Auth_Exception */ public function testCatchExceptionNoCredential() { + $this->expectException(\Zend_Auth_Exception::class); + $this->_adapter->setIdentity('my_username'); $result = $this->_adapter->authenticate(); // $this->assertEquals($e->getMessage(), 'A credential value was not provided prior to authentication with Zend_Auth_Adapter_DbTable.'); @@ -319,10 +324,11 @@ public function testCatchExceptionNoCredential() /** * Ensure that exceptions are caught * - * @expectedException Zend_Auth_Exception */ public function testCatchExceptionBadSql() { + $this->expectException(\Zend_Auth_Exception::class); + $this->_adapter->setTableName('bad_table_name'); $this->_adapter->setIdentity('value'); $this->_adapter->setCredential('value'); @@ -350,11 +356,12 @@ public function testDbTableAdapterUsesCaseFolding() /** * Test fallback to default database adapter, when no such adapter set * - * @expectedException Zend_Auth_Adapter_Exception * @group ZF-7510 */ public function testAuthenticateWithDefaultDbAdapterNoAdapterException() { + $this->expectException(\Zend_Auth_Adapter_Exception::class); + require_once('Zend/Db/Table/Abstract.php'); // preserve default db adapter between cases $tmp = Zend_Db_Table_Abstract::getDefaultAdapter(); diff --git a/tests/Zend/Auth/Adapter/DigestTest.php b/tests/Zend/Auth/Adapter/DigestTest.php index e729ca2a36..683d6dfd5b 100644 --- a/tests/Zend/Auth/Adapter/DigestTest.php +++ b/tests/Zend/Auth/Adapter/DigestTest.php @@ -22,7 +22,7 @@ /** - * PHPUnit_Framework_TestCase + * PHPUnit\Framework\TestCase */ @@ -40,7 +40,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Auth */ -class Zend_Auth_Adapter_DigestTest extends PHPUnit_Framework_TestCase +class Zend_Auth_Adapter_DigestTest extends PHPUnit\Framework\TestCase { /** * Path to test files @@ -54,7 +54,7 @@ class Zend_Auth_Adapter_DigestTest extends PHPUnit_Framework_TestCase * * @return void */ - public function __construct() + public function setUp() { $this->_filesPath = dirname(__FILE__) . '/Digest/_files'; } diff --git a/tests/Zend/Auth/Adapter/Http/AuthTest.php b/tests/Zend/Auth/Adapter/Http/AuthTest.php index 44615957f4..5a29632185 100644 --- a/tests/Zend/Auth/Adapter/Http/AuthTest.php +++ b/tests/Zend/Auth/Adapter/Http/AuthTest.php @@ -22,7 +22,7 @@ /** - * PHPUnit_Framework_TestCase + * PHPUnit\Framework\TestCase */ @@ -58,7 +58,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Auth */ -class Zend_Auth_Adapter_Http_AuthTest extends PHPUnit_Framework_TestCase +class Zend_Auth_Adapter_Http_AuthTest extends PHPUnit\Framework\TestCase { /** * Path to test files @@ -107,7 +107,7 @@ class Zend_Auth_Adapter_Http_AuthTest extends PHPUnit_Framework_TestCase * * @return void */ - public function __construct() + public function setUp() { $this->_filesPath = dirname(__FILE__) . '/_files'; $this->_basicResolver = new Zend_Auth_Adapter_Http_Resolver_File("{$this->_filesPath}/htbasic.1"); diff --git a/tests/Zend/Auth/Adapter/Http/ObjectTest.php b/tests/Zend/Auth/Adapter/Http/ObjectTest.php index b91ee3ccbe..c9ff4ba327 100644 --- a/tests/Zend/Auth/Adapter/Http/ObjectTest.php +++ b/tests/Zend/Auth/Adapter/Http/ObjectTest.php @@ -22,7 +22,7 @@ /** - * PHPUnit_Framework_TestCase + * PHPUnit\Framework\TestCase */ @@ -62,7 +62,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Auth */ -class Zend_Auth_Adapter_Http_ObjectTest extends PHPUnit_Framework_TestCase +class Zend_Auth_Adapter_Http_ObjectTest extends PHPUnit\Framework\TestCase { /** * Path to test files @@ -111,7 +111,7 @@ class Zend_Auth_Adapter_Http_ObjectTest extends PHPUnit_Framework_TestCase * * @return void */ - public function __construct() + public function setUp() { $this->_filesPath = dirname(__FILE__) . '/_files'; $this->_basicResolver = new Zend_Auth_Adapter_Http_Resolver_File("$this->_filesPath/htbasic.1"); @@ -141,7 +141,7 @@ public function testValidConfigs() } catch (Zend_Auth_Adapter_Exception $e) { $this->fail('Valid config deemed invalid'); } - $this->assertFalse(empty($t)); + $this->assertNotEmpty($t); $this->assertTrue($t instanceof Zend_Auth_Adapter_Http); unset($t); @@ -150,7 +150,7 @@ public function testValidConfigs() } catch (Zend_Auth_Adapter_Exception $e) { $this->fail('Valid config deemed invalid'); } - $this->assertFalse(empty($t)); + $this->assertNotEmpty($t); $this->assertTrue($t instanceof Zend_Auth_Adapter_Http); unset($t); @@ -159,7 +159,7 @@ public function testValidConfigs() } catch (Zend_Auth_Adapter_Exception $e) { $this->fail('Valid config deemed invalid'); } - $this->assertFalse(empty($t)); + $this->assertNotEmpty($t); $this->assertTrue($t instanceof Zend_Auth_Adapter_Http); unset($t); } diff --git a/tests/Zend/Auth/Adapter/Http/ProxyTest.php b/tests/Zend/Auth/Adapter/Http/ProxyTest.php index d693233c10..9022b4d581 100644 --- a/tests/Zend/Auth/Adapter/Http/ProxyTest.php +++ b/tests/Zend/Auth/Adapter/Http/ProxyTest.php @@ -52,7 +52,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Auth */ -class Zend_Auth_Adapter_Http_ProxyTest extends PHPUnit_Framework_TestCase +class Zend_Auth_Adapter_Http_ProxyTest extends PHPUnit\Framework\TestCase { /** * Path to test files @@ -101,7 +101,7 @@ class Zend_Auth_Adapter_Http_ProxyTest extends PHPUnit_Framework_TestCase * * @return void */ - public function __construct() + public function setUp() { $this->_filesPath = dirname(__FILE__) . '/_files'; $this->_basicResolver = new Zend_Auth_Adapter_Http_Resolver_File("{$this->_filesPath}/htbasic.1"); diff --git a/tests/Zend/Auth/Adapter/Http/Resolver/FileTest.php b/tests/Zend/Auth/Adapter/Http/Resolver/FileTest.php index ccd36013ca..4a87860e77 100644 --- a/tests/Zend/Auth/Adapter/Http/Resolver/FileTest.php +++ b/tests/Zend/Auth/Adapter/Http/Resolver/FileTest.php @@ -22,7 +22,7 @@ /** - * PHPUnit_Framework_TestCase + * PHPUnit\Framework\TestCase */ @@ -40,7 +40,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Auth */ -class Zend_Auth_Adapter_Http_Resolver_FileTest extends PHPUnit_Framework_TestCase +class Zend_Auth_Adapter_Http_Resolver_FileTest extends PHPUnit\Framework\TestCase { /** * Path to test files @@ -76,7 +76,7 @@ class Zend_Auth_Adapter_Http_Resolver_FileTest extends PHPUnit_Framework_TestCas * * @return void */ - public function __construct() + public function setUp() { $this->_filesPath = dirname(dirname(__FILE__)) . '/_files'; $this->_validPath = "$this->_filesPath/htdigest.3"; diff --git a/tests/Zend/Auth/Adapter/Ldap/OfflineTest.php b/tests/Zend/Auth/Adapter/Ldap/OfflineTest.php index 0c2738844a..e24a198c87 100644 --- a/tests/Zend/Auth/Adapter/Ldap/OfflineTest.php +++ b/tests/Zend/Auth/Adapter/Ldap/OfflineTest.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Auth */ -class Zend_Auth_Adapter_Ldap_OfflineTest extends PHPUnit_Framework_TestCase +class Zend_Auth_Adapter_Ldap_OfflineTest extends PHPUnit\Framework\TestCase { /** * Authentication adapter instance diff --git a/tests/Zend/Auth/Adapter/Ldap/OnlineTest.php b/tests/Zend/Auth/Adapter/Ldap/OnlineTest.php index 212ccfd8d3..5c0a3f6b3b 100644 --- a/tests/Zend/Auth/Adapter/Ldap/OnlineTest.php +++ b/tests/Zend/Auth/Adapter/Ldap/OnlineTest.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Auth */ -class Zend_Auth_Adapter_Ldap_OnlineTest extends PHPUnit_Framework_TestCase +class Zend_Auth_Adapter_Ldap_OnlineTest extends PHPUnit\Framework\TestCase { /** * LDAP connection options diff --git a/tests/Zend/Auth/Adapter/OpenId/OpenIdTest.php b/tests/Zend/Auth/Adapter/OpenId/OpenIdTest.php index a90dcaa913..c3f0d77bdf 100644 --- a/tests/Zend/Auth/Adapter/OpenId/OpenIdTest.php +++ b/tests/Zend/Auth/Adapter/OpenId/OpenIdTest.php @@ -22,7 +22,7 @@ /** - * PHPUnit_Framework_TestCase + * PHPUnit\Framework\TestCase */ /** @@ -66,7 +66,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Auth */ -class Zend_Auth_Adapter_OpenIdTest extends PHPUnit_Framework_TestCase +class Zend_Auth_Adapter_OpenIdTest extends PHPUnit\Framework\TestCase { const ID = "http://id.myopenid.com/"; const REAL_ID = "http://real_id.myopenid.com/"; @@ -84,7 +84,7 @@ public function testAuthenticateInvalid() $this->assertSame("", $ret->getIdentity()); $this->assertSame(0, $ret->getCode()); $msgs = $ret->getMessages(); - $this->assertTrue(is_array($msgs)); + $this->assertInternalType('array', $msgs); $this->assertSame(2, count($msgs)); $this->assertSame("Authentication failed", $msgs[0]); $this->assertSame("Missing openid.mode", $msgs[1]); @@ -98,7 +98,7 @@ public function testAuthenticateLoginInvalid() $this->assertSame("%sd", $ret->getIdentity()); $this->assertSame(0, $ret->getCode()); $msgs = $ret->getMessages(); - $this->assertTrue(is_array($msgs)); + $this->assertInternalType('array', $msgs); $this->assertSame(2, count($msgs)); $this->assertSame("Authentication failed", $msgs[0]); $this->assertSame("Normalisation failed", $msgs[1]); @@ -120,12 +120,12 @@ public function testAuthenticateLoginValid() $adapter = new Zend_Auth_Adapter_OpenId(self::ID, $storage); $this->assertSame($adapter, $adapter->setResponse($response)); $ret = $adapter->authenticate(); - $this->assertTrue(is_null($ret)); + $this->assertNull($ret); $headers = $response->getHeaders(); $this->assertSame( '', $response->getBody() ); - $this->assertTrue( is_array($headers) ); + $this->assertInternalType( 'array', $headers ); $this->assertSame( 1, count($headers) ); - $this->assertTrue( is_array($headers[0]) ); + $this->assertInternalType( 'array', $headers[0] ); $this->assertSame( 3, count($headers[0]) ); $this->assertSame( 'Location', $headers[0]['name'] ); $this->assertSame( true, $headers[0]['replace'] ); @@ -141,7 +141,7 @@ public function testAuthenticateLoginValid() $query[$key] = $val; } } - $this->assertTrue( is_array($query) ); + $this->assertInternalType( 'array', $query ); $this->assertSame( 6, count($query) ); $this->assertSame( 'checkid_setup', $query['openid.mode'] ); $this->assertSame( 'http%3A%2F%2Freal_id.myopenid.com%2F', $query['openid.identity'] ); @@ -168,12 +168,12 @@ public function testSetIdentity() $this->assertSame($adapter, $adapter->setIdentity(self::ID)); $adapter->setResponse($response); $ret = $adapter->authenticate(); - $this->assertTrue(is_null($ret)); + $this->assertNull($ret); $headers = $response->getHeaders(); $this->assertSame( '', $response->getBody() ); - $this->assertTrue( is_array($headers) ); + $this->assertInternalType( 'array', $headers ); $this->assertSame( 1, count($headers) ); - $this->assertTrue( is_array($headers[0]) ); + $this->assertInternalType( 'array', $headers[0] ); $this->assertSame( 3, count($headers[0]) ); $this->assertSame( 'Location', $headers[0]['name'] ); $this->assertSame( true, $headers[0]['replace'] ); @@ -189,7 +189,7 @@ public function testSetIdentity() $query[$key] = $val; } } - $this->assertTrue( is_array($query) ); + $this->assertInternalType( 'array', $query ); $this->assertSame( 6, count($query) ); $this->assertSame( 'checkid_setup', $query['openid.mode'] ); $this->assertSame( 'http%3A%2F%2Freal_id.myopenid.com%2F', $query['openid.identity'] ); @@ -216,12 +216,12 @@ public function testSetStorage() $this->assertSame($adapter, $adapter->setStorage($storage)); $adapter->setResponse($response); $ret = $adapter->authenticate(); - $this->assertTrue(is_null($ret)); + $this->assertNull($ret); $headers = $response->getHeaders(); $this->assertSame( '', $response->getBody() ); - $this->assertTrue( is_array($headers) ); + $this->assertInternalType( 'array', $headers ); $this->assertSame( 1, count($headers) ); - $this->assertTrue( is_array($headers[0]) ); + $this->assertInternalType( 'array', $headers[0] ); $this->assertSame( 3, count($headers[0]) ); $this->assertSame( 'Location', $headers[0]['name'] ); $this->assertSame( true, $headers[0]['replace'] ); @@ -237,7 +237,7 @@ public function testSetStorage() $query[$key] = $val; } } - $this->assertTrue( is_array($query) ); + $this->assertInternalType( 'array', $query ); $this->assertSame( 6, count($query) ); $this->assertSame( 'checkid_setup', $query['openid.mode'] ); $this->assertSame( 'http%3A%2F%2Freal_id.myopenid.com%2F', $query['openid.identity'] ); @@ -264,12 +264,12 @@ public function testSetReturnTo() $adapter->setResponse($response); $this->assertSame($adapter, $adapter->setReturnTo("http://www.zf-test.com/return.php")); $ret = $adapter->authenticate(); - $this->assertTrue(is_null($ret)); + $this->assertNull($ret); $headers = $response->getHeaders(); $this->assertSame( '', $response->getBody() ); - $this->assertTrue( is_array($headers) ); + $this->assertInternalType( 'array', $headers ); $this->assertSame( 1, count($headers) ); - $this->assertTrue( is_array($headers[0]) ); + $this->assertInternalType( 'array', $headers[0] ); $this->assertSame( 3, count($headers[0]) ); $this->assertSame( 'Location', $headers[0]['name'] ); $this->assertSame( true, $headers[0]['replace'] ); @@ -285,7 +285,7 @@ public function testSetReturnTo() $query[$key] = $val; } } - $this->assertTrue( is_array($query) ); + $this->assertInternalType( 'array', $query ); $this->assertSame( 6, count($query) ); $this->assertSame( 'checkid_setup', $query['openid.mode'] ); $this->assertSame( 'http%3A%2F%2Freal_id.myopenid.com%2F', $query['openid.identity'] ); @@ -312,12 +312,12 @@ public function testSetRoot() $adapter->setResponse($response); $this->assertSame($adapter, $adapter->setRoot("http://www.zf-test.com/root.php")); $ret = $adapter->authenticate(); - $this->assertTrue(is_null($ret)); + $this->assertNull($ret); $headers = $response->getHeaders(); $this->assertSame( '', $response->getBody() ); - $this->assertTrue( is_array($headers) ); + $this->assertInternalType( 'array', $headers ); $this->assertSame( 1, count($headers) ); - $this->assertTrue( is_array($headers[0]) ); + $this->assertInternalType( 'array', $headers[0] ); $this->assertSame( 3, count($headers[0]) ); $this->assertSame( 'Location', $headers[0]['name'] ); $this->assertSame( true, $headers[0]['replace'] ); @@ -333,7 +333,7 @@ public function testSetRoot() $query[$key] = $val; } } - $this->assertTrue( is_array($query) ); + $this->assertInternalType( 'array', $query ); $this->assertSame( 6, count($query) ); $this->assertSame( 'checkid_setup', $query['openid.mode'] ); $this->assertSame( 'http%3A%2F%2Freal_id.myopenid.com%2F', $query['openid.identity'] ); @@ -363,7 +363,7 @@ public function testAuthenticateVerifyInvalid() $this->assertSame(self::ID, $ret->getIdentity()); $this->assertSame(0, $ret->getCode()); $msgs = $ret->getMessages(); - $this->assertTrue(is_array($msgs)); + $this->assertInternalType('array', $msgs); $this->assertSame(2, count($msgs)); $this->assertSame("Authentication failed", $msgs[0]); $this->assertSame("Signature check failed", $msgs[1]); @@ -478,12 +478,12 @@ function testSetCheckImmediate() { $adapter->setCheckImmediate(true); $this->assertSame($adapter, $adapter->setResponse($response)); $ret = $adapter->authenticate(); - $this->assertTrue(is_null($ret)); + $this->assertNull($ret); $headers = $response->getHeaders(); $this->assertSame( '', $response->getBody() ); - $this->assertTrue( is_array($headers) ); + $this->assertInternalType( 'array', $headers ); $this->assertSame( 1, count($headers) ); - $this->assertTrue( is_array($headers[0]) ); + $this->assertInternalType( 'array', $headers[0] ); $this->assertSame( 3, count($headers[0]) ); $this->assertSame( 'Location', $headers[0]['name'] ); $this->assertSame( true, $headers[0]['replace'] ); @@ -499,7 +499,7 @@ function testSetCheckImmediate() { $query[$key] = $val; } } - $this->assertTrue( is_array($query) ); + $this->assertInternalType( 'array', $query ); $this->assertSame( 6, count($query) ); $this->assertSame( 'checkid_immediate', $query['openid.mode'] ); $this->assertSame( 'http%3A%2F%2Freal_id.myopenid.com%2F', $query['openid.identity'] ); diff --git a/tests/Zend/AuthTest.php b/tests/Zend/AuthTest.php index 0d87b5bb9e..dd0b17b574 100644 --- a/tests/Zend/AuthTest.php +++ b/tests/Zend/AuthTest.php @@ -50,7 +50,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Auth */ -class Zend_AuthTest extends PHPUnit_Framework_TestCase +class Zend_AuthTest extends PHPUnit\Framework\TestCase { /** * Ensures that the Singleton pattern is implemented properly diff --git a/tests/Zend/Barcode/FactoryTest.php b/tests/Zend/Barcode/FactoryTest.php index 60afe89263..9a2879f0fc 100644 --- a/tests/Zend/Barcode/FactoryTest.php +++ b/tests/Zend/Barcode/FactoryTest.php @@ -31,7 +31,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Barcode_FactoryTest extends PHPUnit_Framework_TestCase +class Zend_Barcode_FactoryTest extends PHPUnit\Framework\TestCase { public function testMinimalFactory() @@ -70,19 +70,21 @@ public function testFactoryWithAutomaticExceptionRendering() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testFactoryWithoutAutomaticObjectExceptionRendering() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $options = array('barHeight' => - 1); $renderer = Zend_Barcode::factory('code39', 'image', $options, array(), false); } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testFactoryWithoutAutomaticRendererExceptionRendering() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + $this->_checkGDRequirement(); $options = array('imageType' => 'my'); @@ -199,10 +201,11 @@ public function testBarcodeObjectFactoryWithBarcodeAsZendConfig() } /** - * @expectedException Zend_Barcode_Exception */ public function testBarcodeObjectFactoryWithBarcodeAsZendConfigButNoBarcodeParameter() { + $this->expectException(\Zend_Barcode_Exception::class); + $config = new Zend_Config( array( 'barcodeParams' => array( @@ -211,10 +214,11 @@ public function testBarcodeObjectFactoryWithBarcodeAsZendConfigButNoBarcodeParam } /** - * @expectedException Zend_Barcode_Exception */ public function testBarcodeObjectFactoryWithBarcodeAsZendConfigAndBadBarcodeParameters() { + $this->expectException(\Zend_Barcode_Exception::class); + $barcode = Zend_Barcode::makeBarcode('code25', null); } @@ -228,10 +232,11 @@ public function testBarcodeObjectFactoryWithNamespace() } /** - * @expectedException Zend_Barcode_Exception */ public function testBarcodeObjectFactoryWithNamespaceButWithoutExtendingObjectAbstract() { + $this->expectException(\Zend_Barcode_Exception::class); + require_once dirname(__FILE__) . '/Object/_files/BarcodeNamespaceWithoutExtendingObjectAbstract.php'; $barcode = Zend_Barcode::makeBarcode('error', array( @@ -239,11 +244,12 @@ public function testBarcodeObjectFactoryWithNamespaceButWithoutExtendingObjectAb } /** - * @expectedException Zend_Exception - * @expectedExceptionMessage does not exist or class "Zend_Barcode_Object_Zf123" was not found in the file */ public function testBarcodeObjectFactoryWithUnexistantBarcode() { + $this->expectException(\Zend_Exception::class); + $this->expectExceptionMessage('does not exist or class "Zend_Barcode_Object_Zf123" was not found in the file'); + $barcode = Zend_Barcode::makeBarcode('zf123', array()); } @@ -297,10 +303,11 @@ public function testBarcodeRendererFactoryWithBarcodeAsZendConfig() } /** - * @expectedException Zend_Barcode_Exception */ public function testBarcodeRendererFactoryWithBarcodeAsZendConfigButNoBarcodeParameter() { + $this->expectException(\Zend_Barcode_Exception::class); + $config = new Zend_Config( array( 'rendererParams' => array( @@ -309,10 +316,11 @@ public function testBarcodeRendererFactoryWithBarcodeAsZendConfigButNoBarcodePar } /** - * @expectedException Zend_Barcode_Exception */ public function testBarcodeRendererFactoryWithBarcodeAsZendConfigAndBadBarcodeParameters() { + $this->expectException(\Zend_Barcode_Exception::class); + $renderer = Zend_Barcode::makeRenderer('image', null); } @@ -328,10 +336,11 @@ public function testBarcodeRendererFactoryWithNamespace() } /** - * @expectedException Zend_Barcode_Exception */ public function testBarcodeFactoryWithNamespaceButWithoutExtendingRendererAbstract() { + $this->expectException(\Zend_Barcode_Exception::class); + require_once dirname(__FILE__) . '/Renderer/_files/RendererNamespaceWithoutExtendingRendererAbstract.php'; $renderer = Zend_Barcode::makeRenderer('image', array( @@ -339,11 +348,12 @@ public function testBarcodeFactoryWithNamespaceButWithoutExtendingRendererAbstra } /** - * @expectedException Zend_Exception - * @expectedExceptionMessage does not exist or class "Zend_Barcode_Renderer_Zend" was not found in the file */ public function testBarcodeRendererFactoryWithUnexistantRenderer() { + $this->expectException(\Zend_Exception::class); + $this->expectExceptionMessage('does not exist or class "Zend_Barcode_Renderer_Zend" was not found in the file'); + $renderer = Zend_Barcode::makeRenderer('zend', array()); } diff --git a/tests/Zend/Barcode/Object/Code25Test.php b/tests/Zend/Barcode/Object/Code25Test.php index 012c3dd27a..eecc0efa95 100644 --- a/tests/Zend/Barcode/Object/Code25Test.php +++ b/tests/Zend/Barcode/Object/Code25Test.php @@ -101,10 +101,11 @@ public function testBadTextAlwaysAllowed() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testBadTextDetectedIfChecksumWished() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('a'); $this->_object->setWithChecksum(true); $this->_object->getText(); @@ -117,10 +118,11 @@ public function testCheckGoodParams() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testCheckParamsWithLowRatio() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('0123456789'); $this->_object->setBarThinWidth(21); $this->_object->setBarThickWidth(40); @@ -128,10 +130,11 @@ public function testCheckParamsWithLowRatio() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testCheckParamsWithHighRatio() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('0123456789'); $this->_object->setBarThinWidth(20); $this->_object->setBarThickWidth(61); diff --git a/tests/Zend/Barcode/Object/Code25interleavedTest.php b/tests/Zend/Barcode/Object/Code25interleavedTest.php index 1e1f0c4dde..c92d13de46 100644 --- a/tests/Zend/Barcode/Object/Code25interleavedTest.php +++ b/tests/Zend/Barcode/Object/Code25interleavedTest.php @@ -127,10 +127,11 @@ public function testBadTextAlwaysAllowed() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testBadTextDetectedIfChecksumWished() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('a'); $this->_object->setWithChecksum(true); $this->_object->getText(); @@ -143,10 +144,11 @@ public function testCheckGoodParams() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testCheckParamsWithLowRatio() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('0123456789'); $this->_object->setBarThinWidth(21); $this->_object->setBarThickWidth(40); @@ -154,10 +156,11 @@ public function testCheckParamsWithLowRatio() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testCheckParamsWithHighRatio() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('0123456789'); $this->_object->setBarThinWidth(20); $this->_object->setBarThickWidth(61); diff --git a/tests/Zend/Barcode/Object/Code39Test.php b/tests/Zend/Barcode/Object/Code39Test.php index 1c8a776a34..f95cd0ddf6 100644 --- a/tests/Zend/Barcode/Object/Code39Test.php +++ b/tests/Zend/Barcode/Object/Code39Test.php @@ -94,10 +94,11 @@ public function testBadTextAlwaysAllowed() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testBadTextDetectedIfChecksumWished() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('&'); $this->_object->setWithChecksum(true); $this->_object->getText(); @@ -110,10 +111,11 @@ public function testCheckGoodParams() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testCheckParamsWithLowRatio() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('TEST'); $this->_object->setBarThinWidth(21); $this->_object->setBarThickWidth(40); @@ -121,10 +123,11 @@ public function testCheckParamsWithLowRatio() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testCheckParamsWithHighRatio() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('TEST'); $this->_object->setBarThinWidth(20); $this->_object->setBarThickWidth(61); diff --git a/tests/Zend/Barcode/Object/Ean13Test.php b/tests/Zend/Barcode/Object/Ean13Test.php index afebf757ca..1bde916702 100644 --- a/tests/Zend/Barcode/Object/Ean13Test.php +++ b/tests/Zend/Barcode/Object/Ean13Test.php @@ -93,10 +93,11 @@ public function testSetTextWithChecksumNotDisplayed() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testBadTextDetectedIfChecksumWished() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('a'); $this->_object->setWithChecksum(true); $this->_object->getText(); diff --git a/tests/Zend/Barcode/Object/Ean8Test.php b/tests/Zend/Barcode/Object/Ean8Test.php index bfa9578a17..f0cfa09e3a 100644 --- a/tests/Zend/Barcode/Object/Ean8Test.php +++ b/tests/Zend/Barcode/Object/Ean8Test.php @@ -93,10 +93,11 @@ public function testSetTextWithChecksumNotDisplayed() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testBadTextDetectedIfChecksumWished() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('a'); $this->_object->setWithChecksum(true); $this->_object->getText(); diff --git a/tests/Zend/Barcode/Object/IdentcodeTest.php b/tests/Zend/Barcode/Object/IdentcodeTest.php index 570e110567..0e46b0e21a 100644 --- a/tests/Zend/Barcode/Object/IdentcodeTest.php +++ b/tests/Zend/Barcode/Object/IdentcodeTest.php @@ -93,10 +93,11 @@ public function testSetTextWithChecksumNotDisplayed() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testBadTextDetectedIfChecksumWished() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('a'); $this->_object->setWithChecksum(true); $this->_object->getText(); diff --git a/tests/Zend/Barcode/Object/Itf14Test.php b/tests/Zend/Barcode/Object/Itf14Test.php index a55650c0ec..0eb3ecfcba 100644 --- a/tests/Zend/Barcode/Object/Itf14Test.php +++ b/tests/Zend/Barcode/Object/Itf14Test.php @@ -93,10 +93,11 @@ public function testSetTextWithChecksumNotDisplayed() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testBadTextDetectedIfChecksumWished() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('a'); $this->_object->setWithChecksum(true); $this->_object->getText(); @@ -109,10 +110,11 @@ public function testCheckGoodParams() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testCheckParamsWithLowRatio() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('0000123456789'); $this->_object->setBarThinWidth(21); $this->_object->setBarThickWidth(40); @@ -120,10 +122,11 @@ public function testCheckParamsWithLowRatio() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testCheckParamsWithHighRatio() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('0000123456789'); $this->_object->setBarThinWidth(20); $this->_object->setBarThickWidth(61); diff --git a/tests/Zend/Barcode/Object/LeitcodeTest.php b/tests/Zend/Barcode/Object/LeitcodeTest.php index b212e8ff32..fbedf838cd 100644 --- a/tests/Zend/Barcode/Object/LeitcodeTest.php +++ b/tests/Zend/Barcode/Object/LeitcodeTest.php @@ -93,10 +93,11 @@ public function testSetTextWithChecksumNotDisplayed() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testBadTextDetectedIfChecksumWished() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('a'); $this->_object->setWithChecksum(true); $this->_object->getText(); diff --git a/tests/Zend/Barcode/Object/PlanetTest.php b/tests/Zend/Barcode/Object/PlanetTest.php index 0277a4c2fa..949ca4259a 100644 --- a/tests/Zend/Barcode/Object/PlanetTest.php +++ b/tests/Zend/Barcode/Object/PlanetTest.php @@ -60,10 +60,11 @@ public function testSetText() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testSetTextWithoutGoodNumberOfCharacters() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('1234'); $this->_object->getText(); } @@ -95,10 +96,11 @@ public function testSetTextWithChecksumNotDisplayed() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testBadTextDetectedIfChecksumWished() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('a'); $this->_object->setWithChecksum(true); $this->_object->getText(); diff --git a/tests/Zend/Barcode/Object/PostnetTest.php b/tests/Zend/Barcode/Object/PostnetTest.php index 21047ed791..7618ab111e 100644 --- a/tests/Zend/Barcode/Object/PostnetTest.php +++ b/tests/Zend/Barcode/Object/PostnetTest.php @@ -60,10 +60,11 @@ public function testSetText() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testSetTextWithoutGoodNumberOfCharacters() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('1234'); $this->_object->getText(); } @@ -95,10 +96,11 @@ public function testSetTextWithChecksumNotDisplayed() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testBadTextDetectedIfChecksumWished() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('a'); $this->_object->setWithChecksum(true); $this->_object->getText(); diff --git a/tests/Zend/Barcode/Object/RoyalmailTest.php b/tests/Zend/Barcode/Object/RoyalmailTest.php index ef1420342d..53a97a95b8 100644 --- a/tests/Zend/Barcode/Object/RoyalmailTest.php +++ b/tests/Zend/Barcode/Object/RoyalmailTest.php @@ -87,10 +87,11 @@ public function testSetTextWithChecksumNotDisplayed() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testBadTextDetectedIfChecksumWished() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('a'); $this->_object->setWithChecksum(true); $this->_object->getText(); diff --git a/tests/Zend/Barcode/Object/TestCommon.php b/tests/Zend/Barcode/Object/TestCommon.php index 3283b53465..9bf74ca419 100644 --- a/tests/Zend/Barcode/Object/TestCommon.php +++ b/tests/Zend/Barcode/Object/TestCommon.php @@ -34,7 +34,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -abstract class Zend_Barcode_Object_TestCommon extends PHPUnit_Framework_TestCase +abstract class Zend_Barcode_Object_TestCommon extends PHPUnit\Framework\TestCase { /** @@ -130,10 +130,11 @@ public function testBarHeight() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testNegativeBarHeight() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setBarHeight(- 1); } @@ -148,10 +149,11 @@ public function testBarThinWidth() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testNegativeBarThinWidth() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setBarThinWidth(- 1); } @@ -166,10 +168,11 @@ public function testBarThickWidth() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testNegativeBarThickWidth() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setBarThickWidth(- 1); } @@ -186,10 +189,11 @@ public function testFactor() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testNegativeFactor() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setFactor(- 1); } @@ -202,18 +206,20 @@ public function testForeColor() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testNegativeForeColor() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setForeColor(- 1); } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testTooHighForeColor() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setForeColor(16777126); } @@ -226,18 +232,20 @@ public function testBackgroundColor() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testNegativeBackgroundColor() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setBackgroundColor(- 1); } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testTooHighBackgroundColor() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setBackgroundColor(16777126); } @@ -328,18 +336,20 @@ public function testSetFontAsNumberForGdImage() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testSetLowFontAsNumberForGdImage() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setFont(0); } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testSetHighFontAsNumberForGdImage() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setFont(6); } @@ -350,10 +360,11 @@ public function testSetFontAsString() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testSetFontAsBoolean() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setFont(true); } @@ -363,7 +374,7 @@ public function testFontAsNumberWithoutGd() $this->markTestSkipped( 'GD extension must not be loaded to run this test'); } - $this->setExpectedException('Zend_Barcode_Object_Exception'); + $this->expectException('Zend_Barcode_Object_Exception'); $this->_object->setFont(1); } @@ -385,10 +396,11 @@ public function testFontSizeWithoutEffectWithGdInternalFont() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testStringFontSize() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setFontSize('22a'); } @@ -478,10 +490,11 @@ public function testAddTextWithDefaultColor() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testCheckParamsFontWithOrientation() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('0'); $this->_object->setFont(1); $this->_object->setOrientation(45); diff --git a/tests/Zend/Barcode/Object/UpcaTest.php b/tests/Zend/Barcode/Object/UpcaTest.php index 0b6ad84622..9b3635b3c5 100644 --- a/tests/Zend/Barcode/Object/UpcaTest.php +++ b/tests/Zend/Barcode/Object/UpcaTest.php @@ -93,10 +93,11 @@ public function testSetTextWithChecksumNotDisplayed() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testBadTextDetectedIfChecksumWished() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('a'); $this->_object->setWithChecksum(true); $this->_object->getText(); diff --git a/tests/Zend/Barcode/Object/UpceTest.php b/tests/Zend/Barcode/Object/UpceTest.php index 33f73089cb..1d7bd60819 100644 --- a/tests/Zend/Barcode/Object/UpceTest.php +++ b/tests/Zend/Barcode/Object/UpceTest.php @@ -101,10 +101,11 @@ public function testSetTextWithChecksumNotDisplayed() } /** - * @expectedException Zend_Barcode_Object_Exception */ public function testBadTextDetectedIfChecksumWished() { + $this->expectException(\Zend_Barcode_Object_Exception::class); + $this->_object->setText('a'); $this->_object->setWithChecksum(true); $this->_object->getText(); diff --git a/tests/Zend/Barcode/Renderer/ImageTest.php b/tests/Zend/Barcode/Renderer/ImageTest.php index c4c27f47aa..09b59c5c9e 100644 --- a/tests/Zend/Barcode/Renderer/ImageTest.php +++ b/tests/Zend/Barcode/Renderer/ImageTest.php @@ -61,10 +61,11 @@ public function testGoodImageResource() } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testObjectImageResource() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + $imageResource = new StdClass(); $this->_renderer->setResource($imageResource); } @@ -79,10 +80,11 @@ public function testGoodHeight() } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testBadHeight() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + $this->_renderer->setHeight(- 1); } @@ -96,10 +98,11 @@ public function testGoodWidth() } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testBadWidth() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + $this->_renderer->setWidth(- 1); } @@ -115,10 +118,11 @@ public function testAllowedImageType() } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testNonAllowedImageType() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + $this->_renderer->setImageType('other'); } @@ -159,10 +163,11 @@ public function testGoodUserHeight() } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testBadUserHeightLessThanBarcodeHeight() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + $barcode = new Zend_Barcode_Object_Code39(array('text' => '0123456789')); $this->assertEquals(62, $barcode->getHeight()); $this->_renderer->setBarcode($barcode); @@ -180,10 +185,11 @@ public function testGoodUserWidth() } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testBadUserWidthLessThanBarcodeWidth() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + $barcode = new Zend_Barcode_Object_Code39(array('text' => '0123456789')); $this->assertEquals(211, $barcode->getWidth()); $this->_renderer->setBarcode($barcode); @@ -202,10 +208,11 @@ public function testGoodHeightOfUserResource() } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testBadHeightOfUserResource() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + $barcode = new Zend_Barcode_Object_Code39(array('text' => '0123456789')); $this->assertEquals(62, $barcode->getHeight()); $this->_renderer->setBarcode($barcode); @@ -225,10 +232,11 @@ public function testGoodWidthOfUserResource() } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testBadWidthOfUserResource() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + $barcode = new Zend_Barcode_Object_Code39(array('text' => '0123456789')); $this->assertEquals(211, $barcode->getWidth()); $this->_renderer->setBarcode($barcode); @@ -238,10 +246,11 @@ public function testBadWidthOfUserResource() } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testNoFontWithOrientation() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + Zend_Barcode::setBarcodeFont(''); $barcode = new Zend_Barcode_Object_Code39(array('text' => '0123456789')); $barcode->setOrientation(1); @@ -255,10 +264,11 @@ protected function _getRendererWithWidth500AndHeight300() } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testRendererWithUnknownInstructionProvideByObject() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + parent::testRendererWithUnknownInstructionProvideByObject(); } diff --git a/tests/Zend/Barcode/Renderer/PdfTest.php b/tests/Zend/Barcode/Renderer/PdfTest.php index 4ec9382b45..3e32f24a73 100644 --- a/tests/Zend/Barcode/Renderer/PdfTest.php +++ b/tests/Zend/Barcode/Renderer/PdfTest.php @@ -54,10 +54,11 @@ public function testGoodPdfResource() } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testObjectPdfResource() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + $pdfResource = new StdClass(); $this->_renderer->setResource($pdfResource); } diff --git a/tests/Zend/Barcode/Renderer/SvgTest.php b/tests/Zend/Barcode/Renderer/SvgTest.php index 635674cafd..f93d60c26f 100644 --- a/tests/Zend/Barcode/Renderer/SvgTest.php +++ b/tests/Zend/Barcode/Renderer/SvgTest.php @@ -56,10 +56,11 @@ public function testGoodHeight() } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testBadHeight() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + $this->_renderer->setHeight(-1); } @@ -73,10 +74,11 @@ public function testGoodWidth() } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testBadWidth() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + $this->_renderer->setWidth(-1); } @@ -87,10 +89,11 @@ public function testGoodSvgResource() } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testObjectSvgResource() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + $svgResource = new StdClass(); $this->_renderer->setResource($svgResource); } diff --git a/tests/Zend/Barcode/Renderer/TestCommon.php b/tests/Zend/Barcode/Renderer/TestCommon.php index d1bd8d6e08..141b647c78 100644 --- a/tests/Zend/Barcode/Renderer/TestCommon.php +++ b/tests/Zend/Barcode/Renderer/TestCommon.php @@ -30,7 +30,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -abstract class Zend_Barcode_Renderer_TestCommon extends PHPUnit_Framework_TestCase +abstract class Zend_Barcode_Renderer_TestCommon extends PHPUnit\Framework\TestCase { /** @@ -60,10 +60,11 @@ public function testSetBarcodeObject() } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testSetInvalidBarcodeObject() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + $barcode = new StdClass(); $this->_renderer->setBarcode($barcode); } @@ -75,18 +76,20 @@ public function testGoodModuleSize() } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testModuleSizeAsString() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + $this->_renderer->setModuleSize('abc'); } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testModuleSizeLessThan0() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + $this->_renderer->setModuleSize(-0.5); } @@ -108,10 +111,11 @@ public function testGoodHorizontalPosition() } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testBadHorizontalPosition() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + $this->_renderer->setHorizontalPosition('none'); } @@ -125,10 +129,11 @@ public function testGoodVerticalPosition() } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testBadVerticalPosition() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + $this->_renderer->setVerticalPosition('none'); } @@ -142,10 +147,11 @@ public function testGoodLeftOffset() } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testBadLeftOffset() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + $this->_renderer->setLeftOffset(- 1); } @@ -159,10 +165,11 @@ public function testGoodTopOffset() } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testBadTopOffset() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + $this->_renderer->setTopOffset(- 1); } @@ -209,10 +216,11 @@ public function testRendererNamespace() } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testRendererWithUnknownInstructionProvideByObject() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + require_once dirname(__FILE__) . '/../Object/_files/BarcodeTest.php'; $object = new Zend_Barcode_Object_Test(); $object->setText('test'); @@ -222,10 +230,11 @@ public function testRendererWithUnknownInstructionProvideByObject() } /** - * @expectedException Zend_Barcode_Renderer_Exception */ public function testBarcodeObjectProvided() { + $this->expectException(\Zend_Barcode_Renderer_Exception::class); + $this->_renderer->draw(); } diff --git a/tests/Zend/Cache/ClassFrontendTest.php b/tests/Zend/Cache/ClassFrontendTest.php index 5cc14d960c..5e03282f0a 100644 --- a/tests/Zend/Cache/ClassFrontendTest.php +++ b/tests/Zend/Cache/ClassFrontendTest.php @@ -78,7 +78,7 @@ public function throwException() * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Cache */ -class Zend_Cache_ClassFrontendTest extends PHPUnit_Framework_TestCase +class Zend_Cache_ClassFrontendTest extends PHPUnit\Framework\TestCase { private $_instance1; private $_instance2; @@ -295,7 +295,7 @@ public function testOutputBufferingOnException() */ public function testThrowExceptionOnInvalidCallback() { - $this->setExpectedException('Zend_Cache_Exception'); + $this->expectException('Zend_Cache_Exception'); $this->_instance2->unknownMethod(); } } diff --git a/tests/Zend/Cache/CommonBackendTest.php b/tests/Zend/Cache/CommonBackendTest.php index f3616f052e..989d42d6a9 100644 --- a/tests/Zend/Cache/CommonBackendTest.php +++ b/tests/Zend/Cache/CommonBackendTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Cache */ -abstract class Zend_Cache_CommonBackendTest extends PHPUnit_Framework_TestCase { +abstract class Zend_Cache_CommonBackendTest extends PHPUnit\Framework\TestCase { protected $_instance; protected $_className; @@ -290,9 +290,9 @@ public function testCleanModeNotMatchingTags3() public function testGetOption() { - $this->assertTrue(is_numeric($this->_instance->getOption('LifeTime'))); + $this->assertInternalType('numeric', $this->_instance->getOption('LifeTime')); - $this->setExpectedException('Zend_Cache_Exception'); + $this->expectException('Zend_Cache_Exception'); $this->_instance->getOption('unknown'); } } diff --git a/tests/Zend/Cache/CommonExtendedBackendTest.php b/tests/Zend/Cache/CommonExtendedBackendTest.php index 333e2997e6..cd435c43b0 100644 --- a/tests/Zend/Cache/CommonExtendedBackendTest.php +++ b/tests/Zend/Cache/CommonExtendedBackendTest.php @@ -51,7 +51,7 @@ public function setUp($notag = false) public function testGetFillingPercentage() { $res = $this->_instance->getFillingPercentage(); - $this->assertTrue(is_integer($res)); + $this->assertInternalType('integer', $res); $this->assertTrue($res >= 0); $this->assertTrue($res <= 100); } @@ -62,7 +62,7 @@ public function testGetFillingPercentageOnEmptyBackend() $this->_instance->clean(Zend_Cache::CLEANING_MODE_ALL); $res = $this->_instance->getFillingPercentage(); $this->_instance->setDirectives(array('logging' => true)); // ??? - $this->assertTrue(is_integer($res)); + $this->assertInternalType('integer', $res); $this->assertTrue($res >= 0); $this->assertTrue($res <= 100); } diff --git a/tests/Zend/Cache/CoreTest.php b/tests/Zend/Cache/CoreTest.php index cabd268c4f..43aeffb6e4 100644 --- a/tests/Zend/Cache/CoreTest.php +++ b/tests/Zend/Cache/CoreTest.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Cache */ -class Zend_Cache_CoreTest extends PHPUnit_Framework_TestCase +class Zend_Cache_CoreTest extends PHPUnit\Framework\TestCase { private $_instance; @@ -120,7 +120,7 @@ public function testSetBackendCorrectCall2() $this->_instance->setBackend($backend); $log = $backend->getLastLog(); $this->assertEquals('setDirectives', $log['methodName']); - $this->assertTrue(is_array($log['args'][0])); + $this->assertInternalType('array', $log['args'][0]); } public function testSetOptionCorrectCall() diff --git a/tests/Zend/Cache/FactoryException.php b/tests/Zend/Cache/FactoryException.php index b838f7846d..a3f0f24c16 100644 --- a/tests/Zend/Cache/FactoryException.php +++ b/tests/Zend/Cache/FactoryException.php @@ -29,10 +29,10 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Cache_FactoryException extends PHPUnit_Extensions_ExceptionTestCase +class Zend_Cache_FactoryException extends PHPUnit\Extensions\ExceptionTestCase { function setUp(){ - $this->setExpectedException('Zend_Cache_Exception'); + $this->expectException('Zend_Cache_Exception'); } public function testBadFrontend() diff --git a/tests/Zend/Cache/FactoryTest.php b/tests/Zend/Cache/FactoryTest.php index 3993d581af..0b16351e6c 100644 --- a/tests/Zend/Cache/FactoryTest.php +++ b/tests/Zend/Cache/FactoryTest.php @@ -42,7 +42,7 @@ class FooBarTestFrontend extends Zend_Cache_Core { } * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Cache */ -class Zend_Cache_FactoryTest extends PHPUnit_Framework_TestCase +class Zend_Cache_FactoryTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Cache/FileBackendTest.php b/tests/Zend/Cache/FileBackendTest.php index 81be3cf1f8..71b6db1857 100644 --- a/tests/Zend/Cache/FileBackendTest.php +++ b/tests/Zend/Cache/FileBackendTest.php @@ -84,7 +84,7 @@ public function testSetDeprecatedHashedDirectoryUmask() 'hashed_directory_umask' => 0700, )); $this->fail("Missing expected E_USER_NOTICE error"); - } catch (PHPUnit_Framework_Error $e) { + } catch (PHPUnit\Framework\Error\Error $e) { if ($e->getCode() != E_USER_NOTICE) { throw $e; } @@ -101,7 +101,7 @@ public function testSetDeprecatedCacheFileUmask() 'cache_file_umask' => 0700, )); $this->fail("Missing expected E_USER_NOTICE error"); - } catch (PHPUnit_Framework_Error $e) { + } catch (PHPUnit\Framework\Error\Error $e) { if ($e->getCode() != E_USER_NOTICE) { throw $e; } @@ -201,8 +201,8 @@ public function testShouldDeleteOldMetadataFiles() $file = fopen($fn, 'a+'); fclose($file); - $this->assertTrue(file_exists($fn)); + $this->assertFileExists($fn); $this->assertTrue($this->_instance->clean(Zend_Cache::CLEANING_MODE_ALL)); - $this->assertFalse(file_exists($fn)); + $this->assertFileNotExists($fn); } } diff --git a/tests/Zend/Cache/FileFrontendTest.php b/tests/Zend/Cache/FileFrontendTest.php index d468f917bd..62c0671ee2 100644 --- a/tests/Zend/Cache/FileFrontendTest.php +++ b/tests/Zend/Cache/FileFrontendTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Cache */ -class Zend_Cache_FileFrontendTest extends PHPUnit_Framework_TestCase { +class Zend_Cache_FileFrontendTest extends PHPUnit\Framework\TestCase { private $_instance1; private $_instance2; diff --git a/tests/Zend/Cache/FunctionFrontendTest.php b/tests/Zend/Cache/FunctionFrontendTest.php index 09ee51613d..775c96f346 100644 --- a/tests/Zend/Cache/FunctionFrontendTest.php +++ b/tests/Zend/Cache/FunctionFrontendTest.php @@ -55,7 +55,7 @@ public function foobar($param1, $param2) * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Cache */ -class Zend_Cache_FunctionFrontendTest extends PHPUnit_Framework_TestCase { +class Zend_Cache_FunctionFrontendTest extends PHPUnit\Framework\TestCase { private $_instance; @@ -199,7 +199,7 @@ public function testCallClosureThrowsException() $this->markTestSkipped(); } - $this->setExpectedException('Zend_Cache_Exception'); + $this->expectException('Zend_Cache_Exception'); eval('$closure = function () {};'); // no parse error on php < 5.3 $this->_instance->call($closure); } diff --git a/tests/Zend/Cache/ManagerTest.php b/tests/Zend/Cache/ManagerTest.php index 4324791c99..9a29015504 100644 --- a/tests/Zend/Cache/ManagerTest.php +++ b/tests/Zend/Cache/ManagerTest.php @@ -29,7 +29,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Cache_ManagerTest extends PHPUnit_Framework_TestCase +class Zend_Cache_ManagerTest extends PHPUnit\Framework\TestCase { public function setUp() @@ -63,7 +63,7 @@ public function testGetAvialableCaches() $manager = new Zend_Cache_Manager(); $caches = $manager->getCaches(); - $this->assertTrue(is_array($caches)); + $this->assertInternalType('array', $caches); $this->assertArrayHasKey('default', $caches); } diff --git a/tests/Zend/Cache/OutputFrontendTest.php b/tests/Zend/Cache/OutputFrontendTest.php index 964fcd4ffc..98f13725e2 100644 --- a/tests/Zend/Cache/OutputFrontendTest.php +++ b/tests/Zend/Cache/OutputFrontendTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Cache */ -class Zend_Cache_OutputFrontendTest extends PHPUnit_Framework_TestCase { +class Zend_Cache_OutputFrontendTest extends PHPUnit\Framework\TestCase { private $_instance; diff --git a/tests/Zend/Cache/PageFrontendTest.php b/tests/Zend/Cache/PageFrontendTest.php index 187519c4c1..2334572a30 100644 --- a/tests/Zend/Cache/PageFrontendTest.php +++ b/tests/Zend/Cache/PageFrontendTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Cache */ -class Zend_Cache_PageFrontendTest extends PHPUnit_Framework_TestCase { +class Zend_Cache_PageFrontendTest extends PHPUnit\Framework\TestCase { private $_instance; diff --git a/tests/Zend/Cache/StaticBackendTest.php b/tests/Zend/Cache/StaticBackendTest.php index 2052388662..2f54408446 100644 --- a/tests/Zend/Cache/StaticBackendTest.php +++ b/tests/Zend/Cache/StaticBackendTest.php @@ -161,7 +161,7 @@ public function testDirectoryUmaskTriggersError() try { $this->_instance->setOption('cache_directory_umask', '777'); $this->fail(); - } catch (PHPUnit_Framework_Error $e) { + } catch (PHPUnit\Framework\Error\Error $e) { $this->assertEquals( "'cache_directory_umask' is deprecated -> please use 'cache_directory_perm' instead", $e->getMessage() @@ -177,7 +177,7 @@ public function testFileUmaskTriggersError() try { $this->_instance->setOption('cache_file_umask', '777'); $this->fail(); - } catch (PHPUnit_Framework_Error $e) { + } catch (PHPUnit\Framework\Error\Error $e) { $this->assertEquals( "'cache_file_umask' is deprecated -> please use 'cache_file_perm' instead", $e->getMessage() diff --git a/tests/Zend/Captcha/DumbTest.php b/tests/Zend/Captcha/DumbTest.php index aacaac4c86..0065a2302e 100644 --- a/tests/Zend/Captcha/DumbTest.php +++ b/tests/Zend/Captcha/DumbTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Captcha */ -class Zend_Captcha_DumbTest extends PHPUnit_Framework_TestCase +class Zend_Captcha_DumbTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Captcha/FigletTest.php b/tests/Zend/Captcha/FigletTest.php index b0e6cd9399..a20d625619 100644 --- a/tests/Zend/Captcha/FigletTest.php +++ b/tests/Zend/Captcha/FigletTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Captcha */ -class Zend_Captcha_FigletTest extends PHPUnit_Framework_TestCase +class Zend_Captcha_FigletTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -114,8 +114,8 @@ public function testLabelIdIsCorrect() public function testTimeoutPopulatedByDefault() { $ttl = $this->captcha->getTimeout(); - $this->assertFalse(empty($ttl)); - $this->assertTrue(is_int($ttl)); + $this->assertNotEmpty($ttl); + $this->assertInternalType('int', $ttl); } public function testCanSetTimeout() @@ -129,8 +129,8 @@ public function testCanSetTimeout() public function testGenerateReturnsId() { $id = $this->captcha->generate(); - $this->assertFalse(empty($id)); - $this->assertTrue(is_string($id)); + $this->assertNotEmpty($id); + $this->assertInternalType('string', $id); $this->id = $id; } @@ -138,8 +138,8 @@ public function testGetWordReturnsWord() { $this->captcha->generate(); $word = $this->captcha->getWord(); - $this->assertFalse(empty($word)); - $this->assertTrue(is_string($word)); + $this->assertNotEmpty($word); + $this->assertInternalType('string', $word); $this->assertTrue(strlen($word) == 8); $this->word = $word; } @@ -149,7 +149,7 @@ public function testGetWordLength() $this->captcha->setWordLen(4); $this->captcha->generate(); $word = $this->captcha->getWord(); - $this->assertTrue(is_string($word)); + $this->assertInternalType('string', $word); $this->assertTrue(strlen($word) == 4); $this->word = $word; } @@ -167,8 +167,8 @@ public function testGenerateIsRandomised() $id2 = $this->captcha->generate(); $word2 = $this->captcha->getWord(); - $this->assertFalse(empty($id1)); - $this->assertFalse(empty($id2)); + $this->assertNotEmpty($id1); + $this->assertNotEmpty($id2); $this->assertFalse($id1 == $id2); $this->assertFalse($word1 == $word2); } diff --git a/tests/Zend/Captcha/ImageTest.php b/tests/Zend/Captcha/ImageTest.php index e892edbde1..04d5a7a441 100644 --- a/tests/Zend/Captcha/ImageTest.php +++ b/tests/Zend/Captcha/ImageTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Captcha */ -class Zend_Captcha_ImageTest extends PHPUnit_Framework_TestCase +class Zend_Captcha_ImageTest extends PHPUnit\Framework\TestCase { protected $_tmpDir; @@ -176,7 +176,7 @@ public function testCaptchaSetImgURL() public function testCaptchaCreatesImage() { $this->element->render($this->getView()); - $this->assertTrue(file_exists($this->testDir."/".$this->captcha->getId().".png")); + $this->assertFileExists($this->testDir."/".$this->captcha->getId().".png"); } public function testCaptchaSetExpiration() @@ -190,13 +190,13 @@ public function testCaptchaImageCleanup() { $this->element->render($this->getView()); $filename = $this->testDir."/".$this->captcha->getId().".png"; - $this->assertTrue(file_exists($filename)); + $this->assertFileExists($filename); $this->captcha->setExpiration(1); $this->captcha->setGcFreq(1); sleep(2); $this->captcha->generate(); clearstatcache(); - $this->assertFalse(file_exists($filename), "File $filename was found even after GC"); + $this->assertFileNotExists($filename, "File $filename was found even after GC"); } /** @@ -206,25 +206,25 @@ public function testCaptchaImageCleanupOnlyCaptchaFilesIdentifiedByTheirSuffix() { $this->element->render($this->getView()); $filename = $this->testDir."/".$this->captcha->getId().".png"; - $this->assertTrue(file_exists($filename)); + $this->assertFileExists($filename); //Create other cache file $otherFile = $this->testDir . "/zf10006.cache"; file_put_contents($otherFile, ''); - $this->assertTrue(file_exists($otherFile)); + $this->assertFileExists($otherFile); $this->captcha->setExpiration(1); $this->captcha->setGcFreq(1); sleep(2); $this->captcha->generate(); clearstatcache(); - $this->assertFalse(file_exists($filename), "File $filename was found even after GC"); - $this->assertTrue(file_exists($otherFile), "File $otherFile was not found after GC"); + $this->assertFileNotExists($filename, "File $filename was found even after GC"); + $this->assertFileExists($otherFile, "File $otherFile was not found after GC"); } public function testGenerateReturnsId() { $id = $this->captcha->generate(); - $this->assertFalse(empty($id)); - $this->assertTrue(is_string($id)); + $this->assertNotEmpty($id); + $this->assertInternalType('string', $id); $this->id = $id; } @@ -232,8 +232,8 @@ public function testGetWordReturnsWord() { $this->captcha->generate(); $word = $this->captcha->getWord(); - $this->assertFalse(empty($word)); - $this->assertTrue(is_string($word)); + $this->assertNotEmpty($word); + $this->assertInternalType('string', $word); $this->assertTrue(strlen($word) == 8); $this->word = $word; } @@ -243,7 +243,7 @@ public function testGetWordLength() $this->captcha->setWordLen(4); $this->captcha->generate(); $word = $this->captcha->getWord(); - $this->assertTrue(is_string($word)); + $this->assertInternalType('string', $word); $this->assertTrue(strlen($word) == 4); $this->word = $word; } @@ -261,8 +261,8 @@ public function testGenerateIsRandomised() $id2 = $this->captcha->generate(); $word2 = $this->captcha->getWord(); - $this->assertFalse(empty($id1)); - $this->assertFalse(empty($id2)); + $this->assertNotEmpty($id1); + $this->assertNotEmpty($id2); $this->assertFalse($id1 == $id2); $this->assertFalse($word1 == $word2); } diff --git a/tests/Zend/Captcha/ReCaptchaTest.php b/tests/Zend/Captcha/ReCaptchaTest.php index 8aaa73de97..65642be8f6 100644 --- a/tests/Zend/Captcha/ReCaptchaTest.php +++ b/tests/Zend/Captcha/ReCaptchaTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Captcha */ -class Zend_Captcha_ReCaptchaTest extends PHPUnit_Framework_TestCase +class Zend_Captcha_ReCaptchaTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -84,7 +84,7 @@ public function testConstructorShouldSetOptions() $test = $service->getParams(); $compare = array('ssl' => $options['ssl'], 'xhtml' => $options['xhtml']); foreach ($compare as $key => $value) { - $this->assertTrue(array_key_exists($key, $test)); + $this->assertArrayHasKey($key, $test); $this->assertSame($value, $test[$key]); } } diff --git a/tests/Zend/Cloud/DocumentService/FactoryTest.php b/tests/Zend/Cloud/DocumentService/FactoryTest.php index b7891ada1f..120abd4bb4 100644 --- a/tests/Zend/Cloud/DocumentService/FactoryTest.php +++ b/tests/Zend/Cloud/DocumentService/FactoryTest.php @@ -39,11 +39,11 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Cloud */ -class Zend_Cloud_DocumentService_FactoryTest extends PHPUnit_Framework_TestCase +class Zend_Cloud_DocumentService_FactoryTest extends PHPUnit\Framework\TestCase { public function testGetDocumentAdapterKey() { - $this->assertTrue(is_string(Zend_Cloud_DocumentService_Factory::DOCUMENT_ADAPTER_KEY)); + $this->assertInternalType('string', Zend_Cloud_DocumentService_Factory::DOCUMENT_ADAPTER_KEY); } public function testGetAdapterWithConfig() { diff --git a/tests/Zend/Cloud/DocumentService/TestCase.php b/tests/Zend/Cloud/DocumentService/TestCase.php index 1f3ee561fd..59725da0bb 100644 --- a/tests/Zend/Cloud/DocumentService/TestCase.php +++ b/tests/Zend/Cloud/DocumentService/TestCase.php @@ -40,7 +40,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -abstract class Zend_Cloud_DocumentService_TestCase extends PHPUnit_Framework_TestCase +abstract class Zend_Cloud_DocumentService_TestCase extends PHPUnit\Framework\TestCase { /** * Reference to Document adapter to test diff --git a/tests/Zend/Cloud/Infrastructure/Adapter/Ec2Test.php b/tests/Zend/Cloud/Infrastructure/Adapter/Ec2Test.php index 63c3cca3c3..90987b6481 100644 --- a/tests/Zend/Cloud/Infrastructure/Adapter/Ec2Test.php +++ b/tests/Zend/Cloud/Infrastructure/Adapter/Ec2Test.php @@ -24,7 +24,7 @@ require_once 'Zend/Cloud/Infrastructure/Adapter/Ec2.php'; require_once 'Zend/Cloud/Infrastructure/Factory.php'; -class Zend_Cloud_Infrastructure_Adapter_Ec2Test extends PHPUnit_Framework_TestCase +class Zend_Cloud_Infrastructure_Adapter_Ec2Test extends PHPUnit\Framework\TestCase { /** * Timeout in seconds for status change @@ -130,8 +130,10 @@ public function testConstants() */ public function testConstructExceptionMissingParams() { - $this->setExpectedException( - 'Zend_Cloud_Infrastructure_Exception', + $this->expectException( + 'Zend_Cloud_Infrastructure_Exception' + ); + $this->expectExceptionMessage( 'Invalid options provided' ); $image = new Zend_Cloud_Infrastructure_Adapter_Ec2('foo'); diff --git a/tests/Zend/Cloud/Infrastructure/Adapter/RackspaceTest.php b/tests/Zend/Cloud/Infrastructure/Adapter/RackspaceTest.php index 6615845204..53a64b18ff 100644 --- a/tests/Zend/Cloud/Infrastructure/Adapter/RackspaceTest.php +++ b/tests/Zend/Cloud/Infrastructure/Adapter/RackspaceTest.php @@ -23,7 +23,7 @@ require_once 'Zend/Cloud/Infrastructure/Adapter/Rackspace.php'; require_once 'Zend/Cloud/Infrastructure/Factory.php'; -class Zend_Cloud_Infrastructure_Adapter_RackspaceTest extends PHPUnit_Framework_TestCase +class Zend_Cloud_Infrastructure_Adapter_RackspaceTest extends PHPUnit\Framework\TestCase { /** * Timeout in seconds for status change @@ -131,8 +131,10 @@ public function testConstants() */ public function testConstructExceptionMissingParams() { - $this->setExpectedException( - 'Zend_Cloud_Infrastructure_Exception', + $this->expectException( + 'Zend_Cloud_Infrastructure_Exception' + ); + $this->expectExceptionMessage( 'Invalid options provided' ); $instance = new Zend_Cloud_Infrastructure_Adapter_Rackspace('foo'); diff --git a/tests/Zend/Cloud/Infrastructure/FactoryTest.php b/tests/Zend/Cloud/Infrastructure/FactoryTest.php index 99c2411121..890686eb27 100644 --- a/tests/Zend/Cloud/Infrastructure/FactoryTest.php +++ b/tests/Zend/Cloud/Infrastructure/FactoryTest.php @@ -44,11 +44,11 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Cloud */ -class Zend_Cloud_Infrastructure_FactoryTest extends PHPUnit_Framework_TestCase +class Zend_Cloud_Infrastructure_FactoryTest extends PHPUnit\Framework\TestCase { public function testGetInfrastructureAdapterKey() { - $this->assertTrue(is_string(Zend_Cloud_Infrastructure_Factory::INFRASTRUCTURE_ADAPTER_KEY)); + $this->assertInternalType('string', Zend_Cloud_Infrastructure_Factory::INFRASTRUCTURE_ADAPTER_KEY); } public function testGetAdapterWithConfig() { diff --git a/tests/Zend/Cloud/Infrastructure/TestCase.php b/tests/Zend/Cloud/Infrastructure/TestCase.php index 5573d1edaa..d4a8e63469 100644 --- a/tests/Zend/Cloud/Infrastructure/TestCase.php +++ b/tests/Zend/Cloud/Infrastructure/TestCase.php @@ -40,7 +40,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -abstract class Zend_Cloud_Infrastructure_TestCase extends PHPUnit_Framework_TestCase +abstract class Zend_Cloud_Infrastructure_TestCase extends PHPUnit\Framework\TestCase { /** * Reference to Document adapter to test @@ -122,8 +122,10 @@ public function testConstants() */ public function testConstructExceptionMissingParams() { - $this->setExpectedException( - 'Zend\Cloud\Infrastructure\Exception\InvalidArgumentException', + $this->expectException( + 'Zend\Cloud\Infrastructure\Exception\InvalidArgumentException' + ); + $this->expectExceptionMessage( 'You must pass an array of params' ); $instance = new Zend_Cloud_Infrastructure_Instance(self::$adapter,array()); @@ -134,8 +136,10 @@ public function testConstructExceptionMissingParams() */ public function testConstructExceptionInvalidKeys() { - $this->setExpectedException( - 'Zend\Cloud\Infrastructure\Exception\InvalidArgumentException', + $this->expectException( + 'Zend\Cloud\Infrastructure\Exception\InvalidArgumentException' + ); + $this->expectExceptionMessage( 'The param "'.Zend_Cloud_Infrastructure_Instance::INSTANCE_ID.'" is a required param for Zend\Cloud\Infrastructure\Instance' ); $instance = new Zend_Cloud_Infrastructure_Instance(self::$adapter,array('foo'=>'bar')); diff --git a/tests/Zend/Cloud/QueueService/FactoryTest.php b/tests/Zend/Cloud/QueueService/FactoryTest.php index 19faa6eded..33b626d7fe 100755 --- a/tests/Zend/Cloud/QueueService/FactoryTest.php +++ b/tests/Zend/Cloud/QueueService/FactoryTest.php @@ -41,11 +41,11 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Cloud */ -class Zend_Cloud_QueueService_FactoryTest extends PHPUnit_Framework_TestCase +class Zend_Cloud_QueueService_FactoryTest extends PHPUnit\Framework\TestCase { public function testGetQueueAdapterKey() { - $this->assertTrue(is_string(Zend_Cloud_QueueService_Factory::QUEUE_ADAPTER_KEY)); + $this->assertInternalType('string', Zend_Cloud_QueueService_Factory::QUEUE_ADAPTER_KEY); } public function testGetAdapterWithConfig() diff --git a/tests/Zend/Cloud/QueueService/TestCase.php b/tests/Zend/Cloud/QueueService/TestCase.php index 2778079fd1..10612ffb53 100644 --- a/tests/Zend/Cloud/QueueService/TestCase.php +++ b/tests/Zend/Cloud/QueueService/TestCase.php @@ -44,7 +44,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -abstract class Zend_Cloud_QueueService_TestCase extends PHPUnit_Framework_TestCase +abstract class Zend_Cloud_QueueService_TestCase extends PHPUnit\Framework\TestCase { /** * Reference to queue adapter to test @@ -179,7 +179,7 @@ public function testStoresAndFetchesQueueMetadata() $this->_commonQueue->storeQueueMetadata($queueURL, array('purpose' => 'test')); $this->_wait(); $metadata = $this->_commonQueue->fetchQueueMetadata($queueURL); - $this->assertTrue(is_array($metadata)); + $this->assertInternalType('array', $metadata); $this->assertGreaterThan(0, count($metadata)); $this->_commonQueue->deleteQueue($queueURL); } catch (Exception $e) { diff --git a/tests/Zend/Cloud/StorageService/Adapter/FileSystemTest.php b/tests/Zend/Cloud/StorageService/Adapter/FileSystemTest.php index 1192b48f84..9dcec7a896 100644 --- a/tests/Zend/Cloud/StorageService/Adapter/FileSystemTest.php +++ b/tests/Zend/Cloud/StorageService/Adapter/FileSystemTest.php @@ -60,7 +60,7 @@ public function setUp() public function testGetClient() { - $this->assertTrue(is_string($this->_commonStorage->getClient())); + $this->assertInternalType('string', $this->_commonStorage->getClient()); } public function testNoParams() diff --git a/tests/Zend/Cloud/StorageService/FactoryTest.php b/tests/Zend/Cloud/StorageService/FactoryTest.php index c1384410aa..4ec3dd05ae 100644 --- a/tests/Zend/Cloud/StorageService/FactoryTest.php +++ b/tests/Zend/Cloud/StorageService/FactoryTest.php @@ -47,11 +47,11 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Cloud */ -class Zend_Cloud_StorageService_FactoryTest extends PHPUnit_Framework_TestCase +class Zend_Cloud_StorageService_FactoryTest extends PHPUnit\Framework\TestCase { public function testGetStorageAdapterKey() { - $this->assertTrue(is_string(Zend_Cloud_StorageService_Factory::STORAGE_ADAPTER_KEY)); + $this->assertInternalType('string', Zend_Cloud_StorageService_Factory::STORAGE_ADAPTER_KEY); } public function testGetAdapterWithConfig() diff --git a/tests/Zend/Cloud/StorageService/TestCase.php b/tests/Zend/Cloud/StorageService/TestCase.php index 81b67c6a6f..33c9561542 100644 --- a/tests/Zend/Cloud/StorageService/TestCase.php +++ b/tests/Zend/Cloud/StorageService/TestCase.php @@ -44,7 +44,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -abstract class Zend_Cloud_StorageService_TestCase extends PHPUnit_Framework_TestCase +abstract class Zend_Cloud_StorageService_TestCase extends PHPUnit\Framework\TestCase { /** * Reference to storage adapter to test @@ -88,7 +88,7 @@ public function testGetClient() public function testNoParams() { $config = array(Zend_Cloud_StorageService_Factory::STORAGE_ADAPTER_KEY => $this->_config->get(Zend_Cloud_StorageService_Factory::STORAGE_ADAPTER_KEY)); - $this->setExpectedException('Zend_Cloud_StorageService_Exception'); + $this->expectException('Zend_Cloud_StorageService_Exception'); $s = Zend_Cloud_StorageService_Factory::getAdapter($config); } @@ -327,7 +327,7 @@ public function testFetchMetadata() $this->_wait(); // Hopefully we can assert more about the metadata in the future :/ - $this->assertTrue(is_array($this->_commonStorage->fetchMetadata($dummyName))); + $this->assertInternalType('array', $this->_commonStorage->fetchMetadata($dummyName)); $this->_commonStorage->deleteItem($dummyName); } catch (Exception $e) { try { diff --git a/tests/Zend/CodeGenerator/Php/ClassTest.php b/tests/Zend/CodeGenerator/Php/ClassTest.php index cfa1143536..aac1fa264f 100644 --- a/tests/Zend/CodeGenerator/Php/ClassTest.php +++ b/tests/Zend/CodeGenerator/Php/ClassTest.php @@ -35,7 +35,7 @@ * @group Zend_CodeGenerator * @group Zend_CodeGenerator_Php */ -class Zend_CodeGenerator_Php_ClassTest extends PHPUnit_Framework_TestCase +class Zend_CodeGenerator_Php_ClassTest extends PHPUnit\Framework\TestCase { public function testConstruction() @@ -106,14 +106,14 @@ public function testSetProperty_AlreadyExists_ThrowsException() $codeGenClass = new Zend_CodeGenerator_Php_Class(); $codeGenClass->setProperty(array('name' => 'prop3')); - $this->setExpectedException("Zend_CodeGenerator_Php_Exception"); + $this->expectException("Zend_CodeGenerator_Php_Exception"); $codeGenClass->setProperty(array('name' => 'prop3')); } public function testSetProperty_NoArrayOrProperty_ThrowsException() { - $this->setExpectedException("Zend_CodeGenerator_Php_Exception"); + $this->expectException("Zend_CodeGenerator_Php_Exception"); $codeGenClass = new Zend_CodeGenerator_Php_Class(); $codeGenClass->setProperty("propertyName"); @@ -142,7 +142,9 @@ public function testMethodAccessors() public function testSetMethod_NoMethodOrArray_ThrowsException() { - $this->setExpectedException("Zend_CodeGenerator_Php_Exception", + $this->expectException("Zend_CodeGenerator_Php_Exception" + ); + $this->expectExceptionMessage( 'setMethod() expects either an array of method options or an instance of Zend_CodeGenerator_Php_Method' ); @@ -160,7 +162,8 @@ public function testSetMethod_NameAlreadyExists_ThrowsException() $codeGenClass = new Zend_CodeGenerator_Php_Class(); $codeGenClass->setMethod($methodA); - $this->setExpectedException("Zend_CodeGenerator_Php_Exception", 'A method by name foo already exists in this class.'); + $this->expectException("Zend_CodeGenerator_Php_Exception"); + $this->expectExceptionMessage('A method by name foo already exists in this class.'); $codeGenClass->setMethod($methodB); } diff --git a/tests/Zend/CodeGenerator/Php/Docblock/Tag/ParamTest.php b/tests/Zend/CodeGenerator/Php/Docblock/Tag/ParamTest.php index fda2eb409c..aca94502d3 100644 --- a/tests/Zend/CodeGenerator/Php/Docblock/Tag/ParamTest.php +++ b/tests/Zend/CodeGenerator/Php/Docblock/Tag/ParamTest.php @@ -35,7 +35,7 @@ * @group Zend_CodeGenerator * @group Zend_CodeGenerator_Php */ -class Zend_CodeGenerator_Php_Docblock_Tag_ParamTest extends PHPUnit_Framework_TestCase +class Zend_CodeGenerator_Php_Docblock_Tag_ParamTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/CodeGenerator/Php/Docblock/Tag/ReturnTest.php b/tests/Zend/CodeGenerator/Php/Docblock/Tag/ReturnTest.php index 8d1c7dfb1b..169c9f83f7 100644 --- a/tests/Zend/CodeGenerator/Php/Docblock/Tag/ReturnTest.php +++ b/tests/Zend/CodeGenerator/Php/Docblock/Tag/ReturnTest.php @@ -35,7 +35,7 @@ * @group Zend_CodeGenerator * @group Zend_CodeGenerator_Php */ -class Zend_CodeGenerator_Php_Docblock_Tag_ReturnTest extends PHPUnit_Framework_TestCase +class Zend_CodeGenerator_Php_Docblock_Tag_ReturnTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/CodeGenerator/Php/Docblock/TagTest.php b/tests/Zend/CodeGenerator/Php/Docblock/TagTest.php index 7b59cce74e..9dbddb1f56 100644 --- a/tests/Zend/CodeGenerator/Php/Docblock/TagTest.php +++ b/tests/Zend/CodeGenerator/Php/Docblock/TagTest.php @@ -35,7 +35,7 @@ * @group Zend_CodeGenerator * @group Zend_CodeGenerator_Php */ -class Zend_CodeGenerator_Php_Docblock_TagTest extends PHPUnit_Framework_TestCase +class Zend_CodeGenerator_Php_Docblock_TagTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/CodeGenerator/Php/DocblockTest.php b/tests/Zend/CodeGenerator/Php/DocblockTest.php index 6be8a51c45..fcabf8120c 100644 --- a/tests/Zend/CodeGenerator/Php/DocblockTest.php +++ b/tests/Zend/CodeGenerator/Php/DocblockTest.php @@ -35,7 +35,7 @@ * @group Zend_CodeGenerator * @group Zend_CodeGenerator_Php */ -class Zend_CodeGenerator_Php_DocblockTest extends PHPUnit_Framework_TestCase +class Zend_CodeGenerator_Php_DocblockTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/CodeGenerator/Php/FileTest.php b/tests/Zend/CodeGenerator/Php/FileTest.php index 7e57764bd6..5ae779f8de 100644 --- a/tests/Zend/CodeGenerator/Php/FileTest.php +++ b/tests/Zend/CodeGenerator/Php/FileTest.php @@ -35,7 +35,7 @@ * @group Zend_CodeGenerator_Php * @group Zend_CodeGenerator_Php_File */ -class Zend_CodeGenerator_Php_FileTest extends PHPUnit_Framework_TestCase +class Zend_CodeGenerator_Php_FileTest extends PHPUnit\Framework\TestCase { public function testConstruction() diff --git a/tests/Zend/CodeGenerator/Php/MethodTest.php b/tests/Zend/CodeGenerator/Php/MethodTest.php index 3a46130c1a..34f8c34a0b 100644 --- a/tests/Zend/CodeGenerator/Php/MethodTest.php +++ b/tests/Zend/CodeGenerator/Php/MethodTest.php @@ -38,7 +38,7 @@ * @group Zend_CodeGenerator * @group Zend_CodeGenerator_Php */ -class Zend_CodeGenerator_Php_MethodTest extends PHPUnit_Framework_TestCase +class Zend_CodeGenerator_Php_MethodTest extends PHPUnit\Framework\TestCase { diff --git a/tests/Zend/CodeGenerator/Php/ParameterTest.php b/tests/Zend/CodeGenerator/Php/ParameterTest.php index ac86523620..fb935c0d9c 100644 --- a/tests/Zend/CodeGenerator/Php/ParameterTest.php +++ b/tests/Zend/CodeGenerator/Php/ParameterTest.php @@ -36,7 +36,7 @@ * @group Zend_CodeGenerator * @group Zend_CodeGenerator_Php */ -class Zend_CodeGenerator_Php_ParameterTest extends PHPUnit_Framework_TestCase +class Zend_CodeGenerator_Php_ParameterTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/CodeGenerator/Php/Property/DefaultValueTest.php b/tests/Zend/CodeGenerator/Php/Property/DefaultValueTest.php index 7acf8115b0..5cce6cf796 100644 --- a/tests/Zend/CodeGenerator/Php/Property/DefaultValueTest.php +++ b/tests/Zend/CodeGenerator/Php/Property/DefaultValueTest.php @@ -32,7 +32,7 @@ * @group Zend_CodeGenerator * @group Zend_CodeGenerator_Php */ -class Zend_CodeGenerator_Php_Property_DefaultValueTest extends PHPUnit_Framework_TestCase +class Zend_CodeGenerator_Php_Property_DefaultValueTest extends PHPUnit\Framework\TestCase { public function testPropertyDefaultValueConstructor() diff --git a/tests/Zend/CodeGenerator/Php/PropertyTest.php b/tests/Zend/CodeGenerator/Php/PropertyTest.php index 8178daa3ae..72f526b468 100644 --- a/tests/Zend/CodeGenerator/Php/PropertyTest.php +++ b/tests/Zend/CodeGenerator/Php/PropertyTest.php @@ -34,7 +34,7 @@ * @group Zend_CodeGenerator * @group Zend_CodeGenerator_Php */ -class Zend_CodeGenerator_Php_PropertyTest extends PHPUnit_Framework_TestCase +class Zend_CodeGenerator_Php_PropertyTest extends PHPUnit\Framework\TestCase { public function setup() @@ -172,7 +172,7 @@ public function testOtherTypesThrowExceptionOnGenerate() 'defaultValue' => new stdClass(), )); - $this->setExpectedException("Zend_CodeGenerator_Php_Exception"); + $this->expectException("Zend_CodeGenerator_Php_Exception"); $codeGenProperty->generate(); } diff --git a/tests/Zend/Config/IniTest.php b/tests/Zend/Config/IniTest.php index 80e7af8583..006321a686 100644 --- a/tests/Zend/Config/IniTest.php +++ b/tests/Zend/Config/IniTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Config */ -class Zend_Config_IniTest extends PHPUnit_Framework_TestCase +class Zend_Config_IniTest extends PHPUnit\Framework\TestCase { protected $_iniFileConfig; protected $_iniFileAllSectionsConfig; @@ -76,9 +76,9 @@ public function testTrueValues() { $config = new Zend_Config_Ini($this->_iniFileConfig, 'debug'); - $this->assertTrue(is_string($config->debug)); + $this->assertInternalType('string', $config->debug); $this->assertEquals('1', $config->debug); - $this->assertTrue(is_string($config->values->changed)); + $this->assertInternalType('string', $config->values->changed); $this->assertEquals('1', $config->values->changed); } @@ -86,11 +86,11 @@ public function testEmptyValues() { $config = new Zend_Config_Ini($this->_iniFileConfig, 'debug'); - $this->assertTrue(is_string($config->special->no)); + $this->assertInternalType('string', $config->special->no); $this->assertEquals('', $config->special->no); - $this->assertTrue(is_string($config->special->null)); + $this->assertInternalType('string', $config->special->null); $this->assertEquals('', $config->special->null); - $this->assertTrue(is_string($config->special->false)); + $this->assertInternalType('string', $config->special->false); $this->assertEquals('', $config->special->false); } diff --git a/tests/Zend/Config/JsonTest.php b/tests/Zend/Config/JsonTest.php index 725177743b..2d42540381 100644 --- a/tests/Zend/Config/JsonTest.php +++ b/tests/Zend/Config/JsonTest.php @@ -32,7 +32,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Config_JsonTest extends PHPUnit_Framework_TestCase +class Zend_Config_JsonTest extends PHPUnit\Framework\TestCase { protected $_iniFileConfig; protected $_iniFileAllSectionsConfig; @@ -81,7 +81,7 @@ public function testEmptyValues() { $config = new Zend_Config_Json($this->_iniFileConfig, 'debug'); - $this->assertTrue(is_string($config->special->no)); + $this->assertInternalType('string', $config->special->no); $this->assertEquals('no', $config->special->no); $this->assertNull($config->special->null); $this->assertFalse($config->special->false); @@ -105,7 +105,8 @@ public function testMultiDepthExtends() public function testRaisesExceptionWhenSectionNotFound() { - $this->setExpectedException('Zend_Config_Exception', 'cannot be found'); + $this->expectException('Zend_Config_Exception'); + $this->expectExceptionMessage('cannot be found'); $config = new Zend_Config_Json($this->_iniFileConfig, 'extendserror'); } @@ -142,19 +143,22 @@ public function testAllowsLoadingAllSectionsOrSomeSectionsSelectively() public function testDetectsCircularInheritance() { - $this->setExpectedException('Zend_Config_Exception', 'circular inheritance'); + $this->expectException('Zend_Config_Exception'); + $this->expectExceptionMessage('circular inheritance'); $config = new Zend_Config_Json($this->_iniFileCircularConfig, null); } public function testRaisesErrorWhenNoFileProvided() { - $this->setExpectedException('Zend_Config_Exception', 'not set'); + $this->expectException('Zend_Config_Exception'); + $this->expectExceptionMessage('not set'); $config = new Zend_Config_Json('',''); } public function testRaisesErrorOnAttemptsToExtendMultipleSectionsAtOnce() { - $this->setExpectedException('Zend_Config_Exception', 'Invalid'); + $this->expectException('Zend_Config_Exception'); + $this->expectExceptionMessage('Invalid'); $config = new Zend_Config_Json($this->_iniFileMultipleInheritanceConfig, 'multiinherit'); } @@ -188,7 +192,8 @@ public function testCanLoadConfigWithNoSections() public function testRaisesExceptionOnInvalidJsonMarkup() { - $this->setExpectedException('Zend_Config_Exception', 'Error parsing JSON data'); + $this->expectException('Zend_Config_Exception'); + $this->expectExceptionMessage('Error parsing JSON data'); $config = new Zend_Config_Json($this->_iniFileInvalid); } @@ -275,7 +280,8 @@ public function testIgnoringConstantsCanLeadToParseErrors() } $json = '{"env":"ZEND_CONFIG_JSON_ENV","path":"ZEND_CONFIG_JSON_ENV_PATH/tests","int":ZEND_CONFIG_JSON_ENV_INT}'; - $this->setExpectedException('Zend_Config_Exception', 'Error parsing JSON data'); + $this->expectException('Zend_Config_Exception'); + $this->expectExceptionMessage('Error parsing JSON data'); $config = new Zend_Config_Json($json, null, array('ignore_constants' => true)); } } diff --git a/tests/Zend/Config/Writer/ArrayTest.php b/tests/Zend/Config/Writer/ArrayTest.php index 1ace50dd43..5cce6634a7 100644 --- a/tests/Zend/Config/Writer/ArrayTest.php +++ b/tests/Zend/Config/Writer/ArrayTest.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Config */ -class Zend_Config_Writer_ArrayTest extends PHPUnit_Framework_TestCase +class Zend_Config_Writer_ArrayTest extends PHPUnit\Framework\TestCase { protected $_tempName; diff --git a/tests/Zend/Config/Writer/IniTest.php b/tests/Zend/Config/Writer/IniTest.php index 67602205b5..9b75622867 100644 --- a/tests/Zend/Config/Writer/IniTest.php +++ b/tests/Zend/Config/Writer/IniTest.php @@ -43,7 +43,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Config */ -class Zend_Config_Writer_IniTest extends PHPUnit_Framework_TestCase +class Zend_Config_Writer_IniTest extends PHPUnit\Framework\TestCase { protected $_tempName; diff --git a/tests/Zend/Config/Writer/JsonTest.php b/tests/Zend/Config/Writer/JsonTest.php index 2ca899e0d6..071fa50416 100644 --- a/tests/Zend/Config/Writer/JsonTest.php +++ b/tests/Zend/Config/Writer/JsonTest.php @@ -42,7 +42,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Config_Writer_JsonTest extends PHPUnit_Framework_TestCase +class Zend_Config_Writer_JsonTest extends PHPUnit\Framework\TestCase { protected $_tempName; diff --git a/tests/Zend/Config/Writer/XmlTest.php b/tests/Zend/Config/Writer/XmlTest.php index 16636b9c2e..e48a81ced0 100644 --- a/tests/Zend/Config/Writer/XmlTest.php +++ b/tests/Zend/Config/Writer/XmlTest.php @@ -43,7 +43,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Config */ -class Zend_Config_Writer_XmlTest extends PHPUnit_Framework_TestCase +class Zend_Config_Writer_XmlTest extends PHPUnit\Framework\TestCase { protected $_tempName; diff --git a/tests/Zend/Config/Writer/YamlTest.php b/tests/Zend/Config/Writer/YamlTest.php index a2484e5290..86911e1cd2 100644 --- a/tests/Zend/Config/Writer/YamlTest.php +++ b/tests/Zend/Config/Writer/YamlTest.php @@ -42,7 +42,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Config_Writer_YamlTest extends PHPUnit_Framework_TestCase +class Zend_Config_Writer_YamlTest extends PHPUnit\Framework\TestCase { protected $_tempName; diff --git a/tests/Zend/Config/XmlTest.php b/tests/Zend/Config/XmlTest.php index 7cefcb8b2d..553b2fb6d5 100644 --- a/tests/Zend/Config/XmlTest.php +++ b/tests/Zend/Config/XmlTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Config */ -class Zend_Config_XmlTest extends PHPUnit_Framework_TestCase +class Zend_Config_XmlTest extends PHPUnit\Framework\TestCase { protected $_xmlFileConfig; protected $_xmlFileAllSectionsConfig; diff --git a/tests/Zend/Config/YamlTest.php b/tests/Zend/Config/YamlTest.php index 4305400b93..fe45a65eb2 100755 --- a/tests/Zend/Config/YamlTest.php +++ b/tests/Zend/Config/YamlTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Config */ -class Zend_Config_YamlTest extends PHPUnit_Framework_TestCase +class Zend_Config_YamlTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -78,9 +78,9 @@ public function testTrueValues() { $config = new Zend_Config_Yaml($this->_iniFileConfig, 'debug'); - $this->assertTrue(is_string($config->debug)); + $this->assertInternalType('string', $config->debug); $this->assertEquals('1', $config->debug); - $this->assertTrue(is_string($config->values->changed)); + $this->assertInternalType('string', $config->values->changed); $this->assertEquals('1', $config->values->changed); } @@ -88,13 +88,13 @@ public function testEmptyValues() { $config = new Zend_Config_Yaml($this->_iniFileConfig, 'debug'); - $this->assertTrue(is_string($config->special->no)); + $this->assertInternalType('string', $config->special->no); $this->assertEquals('', $config->special->no); - $this->assertTrue(is_string($config->special->null)); + $this->assertInternalType('string', $config->special->null); $this->assertEquals('', $config->special->null); - $this->assertTrue(is_string($config->special->false)); + $this->assertInternalType('string', $config->special->false); $this->assertEquals('', $config->special->false); - $this->assertTrue(is_string($config->special->zero)); + $this->assertInternalType('string', $config->special->zero); $this->assertEquals('0', $config->special->zero); } @@ -242,19 +242,22 @@ public function testHonorsOptionsProvidedToConstructor() public function testConstructorRaisesExceptionWhenUnableToLoadFile() { - $this->setExpectedException('Zend_Config_Exception', 'file_get_contents'); + $this->expectException('Zend_Config_Exception'); + $this->expectExceptionMessage('file_get_contents'); $config = new Zend_Config_Yaml('__foo__'); } public function testBadIndentationRaisesException() { - $this->setExpectedException('Zend_Config_Exception', 'unsupported syntax'); + $this->expectException('Zend_Config_Exception'); + $this->expectExceptionMessage('unsupported syntax'); $config = new Zend_Config_Yaml($this->_badIndentationConfig, 'all'); } public function testPassingBadYamlDecoderRaisesException() { - $this->setExpectedException('Zend_Config_Exception', 'must be callable'); + $this->expectException('Zend_Config_Exception'); + $this->expectExceptionMessage('must be callable'); $config = new Zend_Config_Yaml($this->_iniFileAllSectionsConfig, 'debug', array( 'yaml_decoder' => '__foo__', )); @@ -340,8 +343,8 @@ public function testAllowsInlineCommentsInValuesUsingHash() $config = new Zend_Config_Yaml($this->_yamlInlineCommentsConfig, null); $this->assertTrue($config->resources instanceof Zend_Config); $this->assertTrue($config->resources->frontController instanceof Zend_Config); - $this->assertTrue( - is_string($config->resources->frontController->controllerDirectory) + $this->assertInternalType( + 'string', $config->resources->frontController->controllerDirectory ); $this->assertSame( 'APPLICATION_PATH/controllers', @@ -357,8 +360,8 @@ public function testAllowsIndentedCommentsUsingHash() $config = new Zend_Config_Yaml($this->_yamlIndentedCommentsConfig, null); $this->assertTrue($config->resources instanceof Zend_Config); $this->assertTrue($config->resources->frontController instanceof Zend_Config); - $this->assertTrue( - is_string($config->resources->frontController->controllerDirectory) + $this->assertInternalType( + 'string', $config->resources->frontController->controllerDirectory ); $this->assertSame( 'APPLICATION_PATH/controllers', diff --git a/tests/Zend/ConfigTest.php b/tests/Zend/ConfigTest.php index 220e7ecd57..472f8e08e4 100644 --- a/tests/Zend/ConfigTest.php +++ b/tests/Zend/ConfigTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Config */ -class Zend_ConfigTest extends PHPUnit_Framework_TestCase +class Zend_ConfigTest extends PHPUnit\Framework\TestCase { protected $_iniFileConfig; protected $_iniFileNested; diff --git a/tests/Zend/Console/GetoptTest.php b/tests/Zend/Console/GetoptTest.php index edfd130093..2eed70c184 100644 --- a/tests/Zend/Console/GetoptTest.php +++ b/tests/Zend/Console/GetoptTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Console_Getopt */ -class Zend_Console_GetoptTest extends PHPUnit_Framework_TestCase +class Zend_Console_GetoptTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Controller/Action/Helper/ActionStackTest.php b/tests/Zend/Controller/Action/Helper/ActionStackTest.php index 2ca09e7e36..a4cd0393d6 100644 --- a/tests/Zend/Controller/Action/Helper/ActionStackTest.php +++ b/tests/Zend/Controller/Action/Helper/ActionStackTest.php @@ -36,7 +36,7 @@ * @group Zend_Controller_Action * @group Zend_Controller_Action_Helper */ -class Zend_Controller_Action_Helper_ActionStackTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Action_Helper_ActionStackTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Controller/Action/Helper/AjaxContextTest.php b/tests/Zend/Controller/Action/Helper/AjaxContextTest.php index f3c7ccbbe5..36f591628a 100644 --- a/tests/Zend/Controller/Action/Helper/AjaxContextTest.php +++ b/tests/Zend/Controller/Action/Helper/AjaxContextTest.php @@ -44,7 +44,7 @@ * @group Zend_Controller_Action * @group Zend_Controller_Action_Helper */ -class Zend_Controller_Action_Helper_AjaxContextTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Action_Helper_AjaxContextTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -105,14 +105,14 @@ public function testDefaultContextsIncludesHtml() $this->assertTrue(isset($contexts['html'])); $this->assertEquals('ajax.phtml', $this->helper->getSuffix('html')); $header = $this->helper->getHeaders('html'); - $this->assertTrue(empty($header)); + $this->assertEmpty($header); } public function checkNothingIsDone() { $this->assertEquals('phtml', $this->viewRenderer->getViewSuffix()); $headers = $this->response->getHeaders(); - $this->assertTrue(empty($headers)); + $this->assertEmpty($headers); } public function testInitContextFailsOnNonXhrRequests() diff --git a/tests/Zend/Controller/Action/Helper/AutoCompleteTest.php b/tests/Zend/Controller/Action/Helper/AutoCompleteTest.php index 70c989bb05..3a84f9a417 100644 --- a/tests/Zend/Controller/Action/Helper/AutoCompleteTest.php +++ b/tests/Zend/Controller/Action/Helper/AutoCompleteTest.php @@ -43,7 +43,7 @@ * @group Zend_Controller_Action * @group Zend_Controller_Action_Helper */ -class Zend_Controller_Action_Helper_AutoCompleteTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Action_Helper_AutoCompleteTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Controller/Action/Helper/CacheTest.php b/tests/Zend/Controller/Action/Helper/CacheTest.php index e806d83222..48e05247ac 100644 --- a/tests/Zend/Controller/Action/Helper/CacheTest.php +++ b/tests/Zend/Controller/Action/Helper/CacheTest.php @@ -12,7 +12,7 @@ /** * Test class for Zend_Controller_Action_Helper_Cache */ -class Zend_Controller_Action_Helper_CacheTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Action_Helper_CacheTest extends PHPUnit\Framework\TestCase { protected $_requestUriOld; diff --git a/tests/Zend/Controller/Action/Helper/ContextSwitchTest.php b/tests/Zend/Controller/Action/Helper/ContextSwitchTest.php index f2bc05719e..011ddaac15 100644 --- a/tests/Zend/Controller/Action/Helper/ContextSwitchTest.php +++ b/tests/Zend/Controller/Action/Helper/ContextSwitchTest.php @@ -45,7 +45,7 @@ * @group Zend_Controller_Action * @group Zend_Controller_Action_Helper */ -class Zend_Controller_Action_Helper_ContextSwitchTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Action_Helper_ContextSwitchTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -309,7 +309,7 @@ public function testCanAddContext() )); $context = $this->helper->getContext('foobar'); $this->assertNotNull($context); - $this->assertTrue(is_array($context)); + $this->assertInternalType('array', $context); $this->assertTrue(isset($context['suffix'])); $this->assertTrue(isset($context['headers'])); $this->assertTrue(isset($context['callbacks'])); @@ -395,7 +395,7 @@ public function testCanClearAllContexts() $this->helper->clearContexts(); $received = $this->helper->getContexts(); $this->assertNotEquals($contexts, $received); - $this->assertTrue(empty($received)); + $this->assertEmpty($received); } public function testDefaultContextParam() @@ -447,7 +447,7 @@ public function checkNothingIsDone() { $this->assertEquals('phtml', $this->viewRenderer->getViewSuffix()); $headers = $this->response->getHeaders(); - $this->assertTrue(empty($headers)); + $this->assertEmpty($headers); } public function testInitContextDoesNothingIfNoContextsSet() @@ -654,7 +654,7 @@ public function testJsonContextShouldEncodeViewVariablesByDefaultAndNotRequireRe $body = $this->response->getBody(); $result = Zend_Json::decode($body); - $this->assertTrue(is_array($result), var_export($body, 1)); + $this->assertInternalType('array', $result, var_export($body, 1)); $this->assertTrue(isset($result['foo'])); $this->assertTrue(isset($result['bar'])); $this->assertEquals('bar', $result['foo']); @@ -683,7 +683,7 @@ public function testAutoJsonSerializationMayBeDisabled() $this->assertTrue($found, 'JSON content type header not found'); $body = $this->response->getBody(); - $this->assertTrue(empty($body), $body); + $this->assertEmpty($body, $body); } public function testCanAddOneOrMoreActionContexts() @@ -761,7 +761,7 @@ public function testCanClearAllActionContexts() { $this->helper->clearActionContexts(); $contexts = $this->helper->getActionContexts(); - $this->assertTrue(empty($contexts)); + $this->assertEmpty($contexts); } public function getOptions() diff --git a/tests/Zend/Controller/Action/Helper/FlashMessengerTest.php b/tests/Zend/Controller/Action/Helper/FlashMessengerTest.php index c9cfd36947..73a3dfbc0a 100644 --- a/tests/Zend/Controller/Action/Helper/FlashMessengerTest.php +++ b/tests/Zend/Controller/Action/Helper/FlashMessengerTest.php @@ -39,7 +39,7 @@ * @group Zend_Controller_Action * @group Zend_Controller_Action_Helper */ -class Zend_Controller_Action_Helper_FlashMessengerTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Action_Helper_FlashMessengerTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Controller_Action @@ -146,7 +146,7 @@ public function testAddMessageToCustomNamespace() // Ensure it didnt' bleed over into default namespace $defaultMessages = $this->helper->getCurrentMessages(); - $this->assertTrue(empty($defaultMessages), 'Default namespace not empty'); + $this->assertEmpty($defaultMessages, 'Default namespace not empty'); } /** @@ -165,7 +165,7 @@ public function testRemoveMessageToCustomNamespace() // Ensure it cleared the specified namespace $foobarMessages = $this->helper->getCurrentMessages('foobar'); - $this->assertTrue(empty($foobarMessages), 'Namespace foobar not empty'); + $this->assertEmpty($foobarMessages, 'Namespace foobar not empty'); // Ensure it didnt' clear the default namespace $defaultMessages = $this->helper->getCurrentMessages(); diff --git a/tests/Zend/Controller/Action/Helper/JsonTest.php b/tests/Zend/Controller/Action/Helper/JsonTest.php index 734d34d53e..6a6fb729f4 100644 --- a/tests/Zend/Controller/Action/Helper/JsonTest.php +++ b/tests/Zend/Controller/Action/Helper/JsonTest.php @@ -41,7 +41,7 @@ * @group Zend_Controller_Action * @group Zend_Controller_Action_Helper */ -class Zend_Controller_Action_Helper_JsonTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Action_Helper_JsonTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -101,7 +101,7 @@ public function testJsonHelperSetsResponseHeader() public function testJsonHelperReturnsJsonEncodedString() { $data = $this->helper->encodeJson(array('foobar')); - $this->assertTrue(is_string($data)); + $this->assertInternalType('string', $data); $this->assertEquals(array('foobar'), Zend_Json::decode($data)); } @@ -147,7 +147,7 @@ public function testCanPreventDirectSendingResponse() $this->assertSame(array('foobar'), Zend_Json::decode($data)); $this->verifyJsonHeader(); $response = $this->response->getBody(); - $this->assertTrue(empty($response)); + $this->assertEmpty($response); } public function testCanKeepLayoutsWhenUsingDirect() diff --git a/tests/Zend/Controller/Action/Helper/NamespaceTest.php b/tests/Zend/Controller/Action/Helper/NamespaceTest.php index 3a426ed81f..f3ebaa7080 100644 --- a/tests/Zend/Controller/Action/Helper/NamespaceTest.php +++ b/tests/Zend/Controller/Action/Helper/NamespaceTest.php @@ -33,7 +33,7 @@ * @group Zend_Controller_Action * @group Zend_Controller_Action_Helper */ -class Zend_Controller_Action_Helper_NamespaceTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Action_Helper_NamespaceTest extends PHPUnit\Framework\TestCase { /** * @group ZF-10158 diff --git a/tests/Zend/Controller/Action/Helper/RedirectorTest.php b/tests/Zend/Controller/Action/Helper/RedirectorTest.php index 5c22a07140..90b87f491c 100644 --- a/tests/Zend/Controller/Action/Helper/RedirectorTest.php +++ b/tests/Zend/Controller/Action/Helper/RedirectorTest.php @@ -39,7 +39,7 @@ * @group Zend_Controller_Action * @group Zend_Controller_Action_Helper */ -class Zend_Controller_Action_Helper_RedirectorTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Action_Helper_RedirectorTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Controller_Action_Helper_Redirector diff --git a/tests/Zend/Controller/Action/Helper/UrlTest.php b/tests/Zend/Controller/Action/Helper/UrlTest.php index b9c723e66c..bab9af7e56 100644 --- a/tests/Zend/Controller/Action/Helper/UrlTest.php +++ b/tests/Zend/Controller/Action/Helper/UrlTest.php @@ -37,7 +37,7 @@ * @group Zend_Controller_Action * @group Zend_Controller_Action_Helper */ -class Zend_Controller_Action_Helper_UrlTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Action_Helper_UrlTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Controller/Action/Helper/ViewRendererTest.php b/tests/Zend/Controller/Action/Helper/ViewRendererTest.php index be2bd6f188..2e9b9f71bb 100644 --- a/tests/Zend/Controller/Action/Helper/ViewRendererTest.php +++ b/tests/Zend/Controller/Action/Helper/ViewRendererTest.php @@ -42,7 +42,7 @@ * @group Zend_Controller_Action * @group Zend_Controller_Action_Helper */ -class Zend_Controller_Action_Helper_ViewRendererTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Action_Helper_ViewRendererTest extends PHPUnit\Framework\TestCase { /** * Base path to controllers, views @@ -399,7 +399,7 @@ public function testPostDispatchDoesNothingOnForward() $content = $this->response->getBody(); $this->assertNotContains('Rendered index/test.phtml in bar module', $content); - $this->assertTrue(empty($content)); + $this->assertEmpty($content); } public function testPostDispatchDoesNothingOnRedirect() @@ -415,7 +415,7 @@ public function testPostDispatchDoesNothingOnRedirect() $content = $this->response->getBody(); $this->assertNotContains('Rendered index/test.phtml in bar module', $content); - $this->assertTrue(empty($content)); + $this->assertEmpty($content); } public function testPostDispatchDoesNothingWithNoController() @@ -428,7 +428,7 @@ public function testPostDispatchDoesNothingWithNoController() $content = $this->response->getBody(); $this->assertNotContains('Rendered index/test.phtml in bar module', $content); - $this->assertTrue(empty($content)); + $this->assertEmpty($content); } public function testPostDispatchDoesNothingWithNeverController() @@ -442,7 +442,7 @@ public function testPostDispatchDoesNothingWithNeverController() $content = $this->response->getBody(); $this->assertNotContains('Rendered index/test.phtml in bar module', $content); - $this->assertTrue(empty($content)); + $this->assertEmpty($content); } public function testDirectProxiesToSetRender() @@ -650,7 +650,7 @@ public function testPostDispatchDoesNotRenderViewWhenNoViewRendererSet() $controller = new Bar_IndexController($this->request, $this->response, array()); $this->helper->postDispatch(); $body = $this->response->getBody(); - $this->assertTrue(empty($body)); + $this->assertEmpty($body); } public function testRenderNormalizationIsCorrect() diff --git a/tests/Zend/Controller/Action/HelperBroker/PriorityStackTest.php b/tests/Zend/Controller/Action/HelperBroker/PriorityStackTest.php index 54f5565639..6b1d33a7bd 100644 --- a/tests/Zend/Controller/Action/HelperBroker/PriorityStackTest.php +++ b/tests/Zend/Controller/Action/HelperBroker/PriorityStackTest.php @@ -34,7 +34,7 @@ * @group Zend_Controller_Action * @group Zend_Controller_Action_Helper */ -class Zend_Controller_Action_HelperBroker_PriorityStackTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Action_HelperBroker_PriorityStackTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Controller/Action/HelperBrokerTest.php b/tests/Zend/Controller/Action/HelperBrokerTest.php index 3cc8b17ae3..55ddabce36 100644 --- a/tests/Zend/Controller/Action/HelperBrokerTest.php +++ b/tests/Zend/Controller/Action/HelperBrokerTest.php @@ -38,7 +38,7 @@ * @group Zend_Controller_Action * @group Zend_Controller_Action_Helper */ -class Zend_Controller_Action_HelperBrokerTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Action_HelperBrokerTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Controller_Front @@ -211,7 +211,7 @@ public function testGetExistingHelpers() Zend_Controller_Action_HelperBroker::addHelper(new Zend_Controller_Action_Helper_ViewRenderer()); // @todo in future this should throw an exception $helpers = Zend_Controller_Action_HelperBroker::getExistingHelpers(); - $this->assertTrue(is_array($helpers)); + $this->assertInternalType('array', $helpers); $this->assertEquals(2, count($helpers)); $this->assertContains('ViewRenderer', array_keys($helpers)); $this->assertContains('Redirector', array_keys($helpers)); @@ -223,7 +223,7 @@ public function testGetHelperStatically() $this->assertTrue($helper instanceof Zend_Controller_Action_Helper_ViewRenderer); $helpers = Zend_Controller_Action_HelperBroker::getExistingHelpers(); - $this->assertTrue(is_array($helpers)); + $this->assertInternalType('array', $helpers); $this->assertEquals(1, count($helpers)); } @@ -301,7 +301,7 @@ public function testPluginLoaderShouldHaveDefaultPrefixPath() { $loader = Zend_Controller_Action_HelperBroker::getPluginLoader(); $paths = $loader->getPaths('Zend_Controller_Action_Helper'); - $this->assertFalse(empty($paths)); + $this->assertNotEmpty($paths); } public function testCanLoadNamespacedHelper() diff --git a/tests/Zend/Controller/ActionTest.php b/tests/Zend/Controller/ActionTest.php index 5bff699e6d..becbbe2f76 100644 --- a/tests/Zend/Controller/ActionTest.php +++ b/tests/Zend/Controller/ActionTest.php @@ -35,7 +35,7 @@ * @group Zend_Controller * @group Zend_Controller_Action */ -class Zend_Controller_ActionTest extends PHPUnit_Framework_TestCase +class Zend_Controller_ActionTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -275,7 +275,7 @@ public function testInitView() $view = $controller->initView(); $this->assertTrue($view instanceof Zend_View); $scriptPath = $view->getScriptPaths(); - $this->assertTrue(is_array($scriptPath)); + $this->assertInternalType('array', $scriptPath); $this->assertEquals(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'scripts/', $scriptPath[0]); } diff --git a/tests/Zend/Controller/Dispatcher/StandardTest.php b/tests/Zend/Controller/Dispatcher/StandardTest.php index 6fd06485cc..cff0808707 100644 --- a/tests/Zend/Controller/Dispatcher/StandardTest.php +++ b/tests/Zend/Controller/Dispatcher/StandardTest.php @@ -36,7 +36,7 @@ * @group Zend_Controller * @group Zend_Controller_Dispatcher */ -class Zend_Controller_Dispatcher_StandardTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Dispatcher_StandardTest extends PHPUnit\Framework\TestCase { protected $_dispatcher; @@ -591,7 +591,7 @@ public function testCanRemoveControllerDirectory() $this->_dispatcher->removeControllerDirectory('foo'); $test = $this->_dispatcher->getControllerDirectory(); $this->assertNotEquals($dirs, $test); - $this->assertFalse(array_key_exists('foo', $test)); + $this->assertArrayNotHasKey('foo', $test); } /** diff --git a/tests/Zend/Controller/FrontTest.php b/tests/Zend/Controller/FrontTest.php index 38cb69bf9a..de66369181 100644 --- a/tests/Zend/Controller/FrontTest.php +++ b/tests/Zend/Controller/FrontTest.php @@ -38,7 +38,7 @@ * @group Zend_Controller * @group Zend_Controller_Front */ -class Zend_Controller_FrontTest extends PHPUnit_Framework_TestCase +class Zend_Controller_FrontTest extends PHPUnit\Framework\TestCase { protected $_controller = null; @@ -78,13 +78,13 @@ public function testResetInstanceShouldResetHelperBroker() Zend_Controller_Action_HelperBroker::addHelper(new Zend_Controller_Action_Helper_ViewRenderer()); Zend_Controller_Action_HelperBroker::addHelper(new Zend_Controller_Action_Helper_Url()); $helpers = Zend_Controller_Action_HelperBroker::getExistingHelpers(); - $this->assertTrue(is_array($helpers)); - $this->assertFalse(empty($helpers)); + $this->assertInternalType('array', $helpers); + $this->assertNotEmpty($helpers); $this->_controller->resetInstance(); $helpers = Zend_Controller_Action_HelperBroker::getExistingHelpers(); - $this->assertTrue(is_array($helpers)); - $this->assertTrue(empty($helpers)); + $this->assertInternalType('array', $helpers); + $this->assertEmpty($helpers); } public function testSetGetRequest() @@ -574,7 +574,7 @@ public function testCanRemoveIndividualModuleDirectory() $this->_controller->removeControllerDirectory('foo'); $test = $this->_controller->getControllerDirectory(); $this->assertNotEquals($controllerDirs, $test); - $this->assertFalse(array_key_exists('foo', $test)); + $this->assertArrayNotHasKey('foo', $test); } public function testAddModuleDirectoryThrowsExceptionForInvalidDirectory() diff --git a/tests/Zend/Controller/Plugin/ActionStackTest.php b/tests/Zend/Controller/Plugin/ActionStackTest.php index c19b41d47f..d71863423a 100644 --- a/tests/Zend/Controller/Plugin/ActionStackTest.php +++ b/tests/Zend/Controller/Plugin/ActionStackTest.php @@ -35,7 +35,7 @@ * @group Zend_Controller * @group Zend_Controller_Plugin */ -class Zend_Controller_Plugin_ActionStackTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Plugin_ActionStackTest extends PHPUnit\Framework\TestCase { public $key = 'Zend_Controller_Plugin_ActionStack'; public $registry; @@ -147,8 +147,8 @@ public function testGetStackInitiallyReturnsEmptyArray() { $plugin = new Zend_Controller_Plugin_ActionStack(); $stack = $plugin->getStack(); - $this->assertTrue(is_array($stack)); - $this->assertTrue(empty($stack)); + $this->assertInternalType('array', $stack); + $this->assertEmpty($stack); } /** @@ -161,14 +161,14 @@ public function testPushStackAppendsToStack() $request1 = new Zend_Controller_Request_Simple(); $plugin->pushStack($request1); $received = $plugin->getStack(); - $this->assertTrue(is_array($received)); + $this->assertInternalType('array', $received); $this->assertEquals(1, count($received)); $this->assertSame($request1, $received[0]); $request2 = new Zend_Controller_Request_Simple(); $plugin->pushStack($request2); $received = $plugin->getStack(); - $this->assertTrue(is_array($received)); + $this->assertInternalType('array', $received); $this->assertEquals(2, count($received)); $this->assertSame($request2, $received[1]); $this->assertSame($request1, $received[0]); diff --git a/tests/Zend/Controller/Plugin/BrokerTest.php b/tests/Zend/Controller/Plugin/BrokerTest.php index 3585e46eb3..5a7d212eb4 100644 --- a/tests/Zend/Controller/Plugin/BrokerTest.php +++ b/tests/Zend/Controller/Plugin/BrokerTest.php @@ -35,7 +35,7 @@ * @group Zend_Controller * @group Zend_Controller_Plugin */ -class Zend_Controller_Plugin_BrokerTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Plugin_BrokerTest extends PHPUnit\Framework\TestCase { public $controller; @@ -137,7 +137,7 @@ public function testGetPluginByNameReturnsArray() $broker->registerPlugin($plugin2); $retrieved = $broker->getPlugin('Zend_Controller_Plugin_BrokerTest_TestPlugin'); - $this->assertTrue(is_array($retrieved)); + $this->assertInternalType('array', $retrieved); $this->assertEquals(2, count($retrieved)); $this->assertSame($plugin, $retrieved[0]); $this->assertSame($plugin2, $retrieved[1]); diff --git a/tests/Zend/Controller/Plugin/ErrorHandlerTest.php b/tests/Zend/Controller/Plugin/ErrorHandlerTest.php index 6ee4abcf97..de5044ad85 100644 --- a/tests/Zend/Controller/Plugin/ErrorHandlerTest.php +++ b/tests/Zend/Controller/Plugin/ErrorHandlerTest.php @@ -41,7 +41,7 @@ * @group Zend_Controller * @group Zend_Controller_Plugin */ -class Zend_Controller_Plugin_ErrorHandlerTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Plugin_ErrorHandlerTest extends PHPUnit\Framework\TestCase { /** * Request object diff --git a/tests/Zend/Controller/Plugin/PutHandlerTest.php b/tests/Zend/Controller/Plugin/PutHandlerTest.php index e6a5258473..152cd736aa 100644 --- a/tests/Zend/Controller/Plugin/PutHandlerTest.php +++ b/tests/Zend/Controller/Plugin/PutHandlerTest.php @@ -36,7 +36,7 @@ * @group Zend_Controller * @group Zend_Controller_Plugin */ -class Zend_Controller_Plugin_PutHandlerTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Plugin_PutHandlerTest extends PHPUnit\Framework\TestCase { /** * Request object diff --git a/tests/Zend/Controller/Request/Apache404Test.php b/tests/Zend/Controller/Request/Apache404Test.php index 565394291b..0e3fb2fd9c 100644 --- a/tests/Zend/Controller/Request/Apache404Test.php +++ b/tests/Zend/Controller/Request/Apache404Test.php @@ -34,7 +34,7 @@ * @group Zend_Controller * @group Zend_Controller_Request */ -class Zend_Controller_Request_Apache404Test extends PHPUnit_Framework_TestCase +class Zend_Controller_Request_Apache404Test extends PHPUnit\Framework\TestCase { /** * Copy of $_SERVER diff --git a/tests/Zend/Controller/Request/HttpTest.php b/tests/Zend/Controller/Request/HttpTest.php index c0d309951d..495f0b4a25 100644 --- a/tests/Zend/Controller/Request/HttpTest.php +++ b/tests/Zend/Controller/Request/HttpTest.php @@ -31,7 +31,7 @@ * @group Zend_Controller * @group Zend_Controller_Request */ -class Zend_Controller_Request_HttpTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Request_HttpTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Controller_Request_Http diff --git a/tests/Zend/Controller/Request/HttpTestCaseTest.php b/tests/Zend/Controller/Request/HttpTestCaseTest.php index 98cb4866f5..7748b212a6 100644 --- a/tests/Zend/Controller/Request/HttpTestCaseTest.php +++ b/tests/Zend/Controller/Request/HttpTestCaseTest.php @@ -34,7 +34,7 @@ * @group Zend_Controller * @group Zend_Controller_Request */ -class Zend_Controller_Request_HttpTestCaseTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Request_HttpTestCaseTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -68,14 +68,14 @@ public function testGetRequestUriShouldNotAttemptToAutoDiscoverFromEnvironment() public function testGetPathInfoShouldNotAttemptToAutoDiscoverFromEnvironment() { $pathInfo = $this->request->getPathInfo(); - $this->assertTrue(empty($pathInfo)); + $this->assertEmpty($pathInfo); } public function testGetShouldBeEmptyByDefault() { $post = $this->request->getQuery(); - $this->assertTrue(is_array($post)); - $this->assertTrue(empty($post)); + $this->assertInternalType('array', $post); + $this->assertEmpty($post); } public function testShouldAllowSpecifyingGetParameters() @@ -117,15 +117,15 @@ public function testShouldAllowClearingQuery() $this->testShouldPopulateGetSuperglobal(); $this->request->clearQuery(); $test = $this->request->getQuery(); - $this->assertTrue(is_array($test)); - $this->assertTrue(empty($test)); + $this->assertInternalType('array', $test); + $this->assertEmpty($test); } public function testPostShouldBeEmptyByDefault() { $post = $this->request->getPost(); - $this->assertTrue(is_array($post)); - $this->assertTrue(empty($post)); + $this->assertInternalType('array', $post); + $this->assertEmpty($post); } public function testShouldAllowSpecifyingPostParameters() @@ -167,8 +167,8 @@ public function testShouldAllowClearingPost() $this->testShouldPopulatePostSuperglobal(); $this->request->clearPost(); $test = $this->request->getPost(); - $this->assertTrue(is_array($test)); - $this->assertTrue(empty($test)); + $this->assertInternalType('array', $test); + $this->assertEmpty($test); } public function testRawPostBodyShouldBeNullByDefault() @@ -192,8 +192,8 @@ public function testShouldAllowClearingRawPostBody() public function testHeadersShouldBeEmptyByDefault() { $headers = $this->request->getHeaders(); - $this->assertTrue(is_array($headers)); - $this->assertTrue(empty($headers)); + $this->assertInternalType('array', $headers); + $this->assertEmpty($headers); } public function testShouldAllowSpecifyingRequestHeaders() @@ -204,14 +204,14 @@ public function testShouldAllowSpecifyingRequestHeaders() ); $this->request->setHeaders($headers); $test = $this->request->getHeaders(); - $this->assertTrue(is_array($test)); + $this->assertInternalType('array', $test); $this->assertEquals(2, count($test)); foreach ($headers as $key => $value) { $this->assertEquals($value, $this->request->getHeader($key)); } $this->request->setHeader('X-Requested-With', 'XMLHttpRequest'); $test = $this->request->getHeaders(); - $this->assertTrue(is_array($test)); + $this->assertInternalType('array', $test); $this->assertEquals(3, count($test)); $this->assertEquals('XMLHttpRequest', $this->request->getHeader('X-Requested-With')); } @@ -221,15 +221,15 @@ public function testShouldAllowClearingRequestHeaders() $this->testShouldAllowSpecifyingRequestHeaders(); $this->request->clearHeaders(); $headers = $this->request->getHeaders(); - $this->assertTrue(is_array($headers)); - $this->assertTrue(empty($headers)); + $this->assertInternalType('array', $headers); + $this->assertEmpty($headers); } public function testCookiesShouldBeEmptyByDefault() { $cookies = $this->request->getCookie(); - $this->assertTrue(is_array($cookies)); - $this->assertTrue(empty($cookies)); + $this->assertInternalType('array', $cookies); + $this->assertEmpty($cookies); } public function testShouldAllowSpecifyingCookies() @@ -264,8 +264,8 @@ public function testShouldAllowClearingAllCookies() $this->testShouldAllowSpecifyingCookies(); $this->request->clearCookies(); $test = $this->request->getCookie(); - $this->assertTrue(is_array($test)); - $this->assertTrue(empty($test)); + $this->assertInternalType('array', $test); + $this->assertEmpty($test); } /** diff --git a/tests/Zend/Controller/Request/SimpleTest.php b/tests/Zend/Controller/Request/SimpleTest.php index df033fad28..d2595aeb1f 100644 --- a/tests/Zend/Controller/Request/SimpleTest.php +++ b/tests/Zend/Controller/Request/SimpleTest.php @@ -33,7 +33,7 @@ * @group Zend_Controller * @group Zend_Controller_Request */ -class Zend_Controller_Request_SimpleTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Request_SimpleTest extends PHPUnit\Framework\TestCase { public function testSimpleRequestIsOfAbstractRequestType() { diff --git a/tests/Zend/Controller/Response/HttpTest.php b/tests/Zend/Controller/Response/HttpTest.php index 99bf74badc..98781e9990 100644 --- a/tests/Zend/Controller/Response/HttpTest.php +++ b/tests/Zend/Controller/Response/HttpTest.php @@ -32,7 +32,7 @@ * @group Zend_Controller * @group Zend_Controller_Response */ -class Zend_Controller_Response_HttpTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Response_HttpTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Http_Response @@ -129,7 +129,7 @@ public function testClearRawHeaders() $this->_response->clearRawHeaders(); $headers = $this->_response->getRawHeaders(); - $this->assertTrue(empty($headers)); + $this->assertEmpty($headers); } /** @@ -168,16 +168,16 @@ public function testClearAllHeaders() $this->_response->setHeader('Content-Type', 'text/xml'); $headers = $this->_response->getHeaders(); - $this->assertFalse(empty($headers)); + $this->assertNotEmpty($headers); $headers = $this->_response->getRawHeaders(); - $this->assertFalse(empty($headers)); + $this->assertNotEmpty($headers); $this->_response->clearAllHeaders(); $headers = $this->_response->getHeaders(); - $this->assertTrue(empty($headers)); + $this->assertEmpty($headers); $headers = $this->_response->getRawHeaders(); - $this->assertTrue(empty($headers)); + $this->assertEmpty($headers); } public function testSetHttpResponseCode() @@ -333,7 +333,7 @@ public function testAppend() $this->_response->append('more', "more content\n"); $content = $this->_response->getBody(true); - $this->assertTrue(is_array($content)); + $this->assertInternalType('array', $content); $expected = array( 'some' => "some content\n", 'more' => "more content\n" @@ -347,7 +347,7 @@ public function testAppendUsingExistingSegmentOverwrites() $this->_response->append('some', "more content\n"); $content = $this->_response->getBody(true); - $this->assertTrue(is_array($content)); + $this->assertInternalType('array', $content); $expected = array( 'some' => "more content\n" ); @@ -360,7 +360,7 @@ public function testPrepend() $this->_response->prepend('more', "more content\n"); $content = $this->_response->getBody(true); - $this->assertTrue(is_array($content)); + $this->assertInternalType('array', $content); $expected = array( 'more' => "more content\n", 'some' => "some content\n" @@ -374,7 +374,7 @@ public function testPrependUsingExistingSegmentOverwrites() $this->_response->prepend('some', "more content\n"); $content = $this->_response->getBody(true); - $this->assertTrue(is_array($content)); + $this->assertInternalType('array', $content); $expected = array( 'some' => "more content\n" ); @@ -388,7 +388,7 @@ public function testInsert() $this->_response->insert('foobar', "foobar content\n", 'some'); $content = $this->_response->getBody(true); - $this->assertTrue(is_array($content)); + $this->assertInternalType('array', $content); $expected = array( 'some' => "some content\n", 'foobar' => "foobar content\n", @@ -404,7 +404,7 @@ public function testInsertBefore() $this->_response->insert('foobar', "foobar content\n", 'some', true); $content = $this->_response->getBody(true); - $this->assertTrue(is_array($content)); + $this->assertInternalType('array', $content); $expected = array( 'foobar' => "foobar content\n", 'some' => "some content\n", @@ -420,7 +420,7 @@ public function testInsertWithFalseParent() $this->_response->insert('foobar', "foobar content\n", 'baz', true); $content = $this->_response->getBody(true); - $this->assertTrue(is_array($content)); + $this->assertInternalType('array', $content); $expected = array( 'some' => "some content\n", 'more' => "more content\n", @@ -435,7 +435,7 @@ public function testSetBodyNamedSegment() $this->_response->setBody("more content\n", 'some'); $content = $this->_response->getBody(true); - $this->assertTrue(is_array($content)); + $this->assertInternalType('array', $content); $expected = array( 'some' => "more content\n" ); @@ -448,7 +448,7 @@ public function testSetBodyOverwritesWithDefaultSegment() $this->_response->setBody("more content\n"); $content = $this->_response->getBody(true); - $this->assertTrue(is_array($content)); + $this->assertInternalType('array', $content); $expected = array( 'default' => "more content\n" ); @@ -461,7 +461,7 @@ public function testAppendBodyAppendsDefaultSegment() $this->_response->appendBody("more content\n"); $content = $this->_response->getBody(true); - $this->assertTrue(is_array($content)); + $this->assertInternalType('array', $content); $expected = array( 'default' => "some content\nmore content\n" ); @@ -474,7 +474,7 @@ public function testAppendBodyAppendsExistingSegment() $this->_response->appendBody("more content\n", 'some'); $content = $this->_response->getBody(true); - $this->assertTrue(is_array($content)); + $this->assertInternalType('array', $content); $expected = array( 'some' => "some content\nmore content\n" ); @@ -514,7 +514,7 @@ public function testClearBody() $this->assertTrue($this->_response->clearBody()); $body = $this->_response->getBody(true); - $this->assertTrue(is_array($body)); + $this->assertInternalType('array', $body); $this->assertEquals(0, count($body)); } @@ -527,7 +527,7 @@ public function testClearBodySegment() $this->assertFalse($this->_response->clearBody('many')); $this->assertTrue($this->_response->clearBody('more')); $body = $this->_response->getBody(true); - $this->assertTrue(is_array($body)); + $this->assertInternalType('array', $body); $this->assertEquals(2, count($body)); $this->assertTrue(isset($body['some'])); $this->assertTrue(isset($body['superfluous'])); diff --git a/tests/Zend/Controller/Response/HttpTestCaseTest.php b/tests/Zend/Controller/Response/HttpTestCaseTest.php index 6aa22b452c..0f66d54461 100644 --- a/tests/Zend/Controller/Response/HttpTestCaseTest.php +++ b/tests/Zend/Controller/Response/HttpTestCaseTest.php @@ -34,7 +34,7 @@ * @group Zend_Controller * @group Zend_Controller_Response */ -class Zend_Controller_Response_HttpTestCaseTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Response_HttpTestCaseTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -64,7 +64,7 @@ public function testToStringAndSendResponseShouldNotEchoOutput() ob_start(); $this->response->sendResponse(); $test = ob_get_clean(); - $this->assertTrue(empty($test)); + $this->assertEmpty($test); } public function testSendResponseShouldRenderHeaders() @@ -83,8 +83,8 @@ public function testOutputBodyShouldReturnStringInsteadOfEchoingOutput() ob_start(); $content = $this->response->outputBody(); $test = ob_get_clean(); - $this->assertTrue(empty($test)); - $this->assertFalse(empty($content)); + $this->assertEmpty($test); + $this->assertNotEmpty($content); $this->assertContains("Baz Content\nFoo Content\nBar Content\n", $content, $content); } @@ -95,7 +95,7 @@ public function testSendHeadersShouldReturnArrayOfHeadersInsteadOfSendingHeaders ->setHeader('Content-Type', 'text/html', true) ->setHeader('X-Foo-Bar', 'baz'); $test = $this->response->sendHeaders(); - $this->assertTrue(is_array($test)); + $this->assertInternalType('array', $test); $this->assertEquals(3, count($test)); $this->assertNotContains('Content-Type: text/xml', $test); $this->assertContains('Content-Type: text/html', $test); diff --git a/tests/Zend/Controller/Router/RewriteTest.php b/tests/Zend/Controller/Router/RewriteTest.php index 482b5a483b..5b4e94d12a 100644 --- a/tests/Zend/Controller/Router/RewriteTest.php +++ b/tests/Zend/Controller/Router/RewriteTest.php @@ -54,7 +54,7 @@ * @group Zend_Controller * @group Zend_Controller_Router */ -class Zend_Controller_Router_RewriteTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Router_RewriteTest extends PHPUnit\Framework\TestCase { protected $_router; @@ -742,10 +742,11 @@ public function testCanGenerateNumericKeyUri() /** * @group ZF-11393 - * @expectedException Zend_Controller_Router_Exception */ public function testCallingAssembleWithNullArgumentShouldThrowException() { + $this->expectException(\Zend_Controller_Router_Exception::class); + $this->_router->assemble(null); } } diff --git a/tests/Zend/Controller/Router/Route/ChainTest.php b/tests/Zend/Controller/Router/Route/ChainTest.php index 00f5466b30..2c0a26f953 100644 --- a/tests/Zend/Controller/Router/Route/ChainTest.php +++ b/tests/Zend/Controller/Router/Route/ChainTest.php @@ -65,7 +65,7 @@ * @group Zend_Controller * @group Zend_Controller_Router */ -class Zend_Controller_Router_Route_ChainTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Router_Route_ChainTest extends PHPUnit\Framework\TestCase { public function testChaining() { @@ -121,7 +121,7 @@ public function testChainingMatchToDefaultValues() $request = new Zend_Controller_Router_ChainTest_Request('http://www.zend.com/'); $res = $chain->match($request); - $this->assertTrue(is_array($res), 'Route did not match to default values.'); + $this->assertInternalType('array', $res, 'Route did not match to default values.'); } public function testChainingShortcutMatch() @@ -255,7 +255,7 @@ public function testChainingSeparatorOverriding() $res = $chain->match(new Zend_Controller_Router_ChainTest_Request('http://localhost/foo.bar')); - $this->assertTrue(is_array($res)); + $this->assertInternalType('array', $res); $res = $chain->match(new Zend_Controller_Router_ChainTest_Request('http://localhost/foo/bar')); $this->assertEquals(false, $res); @@ -263,7 +263,7 @@ public function testChainingSeparatorOverriding() $chain->chain($baz, ':'); $res = $chain->match(new Zend_Controller_Router_ChainTest_Request('http://localhost/foo.bar:baz')); - $this->assertTrue(is_array($res)); + $this->assertInternalType('array', $res); } public function testI18nChaining() @@ -291,7 +291,7 @@ public function testChainingAssembleWithRoutePlaceholder() $request = new Zend_Controller_Router_ChainTest_Request('http://foobar.zend.com/bar'); $res = $chain->match($request); - $this->assertTrue(is_array($res)); + $this->assertInternalType('array', $res); $this->assertRegexp('#[^a-z0-9]?foobar\.zend\.com/bar/foo/bar#i', $chain->assemble(array('account' => 'foobar', 'foo' => 'bar'))); } @@ -307,7 +307,7 @@ public function testChainingAssembleWithStatic() $request = new Zend_Controller_Router_ChainTest_Request('http://www.zend.com/bar'); $res = $chain->match($request); - $this->assertTrue(is_array($res)); + $this->assertInternalType('array', $res); $this->assertRegexp('#[^a-z0-9]?www\.zend\.com/bar$#i', $chain->assemble()); } @@ -323,7 +323,7 @@ public function testChainingAssembleWithRegex() $request = new Zend_Controller_Router_ChainTest_Request('http://www.zend.com/bar'); $res = $chain->match($request); - $this->assertTrue(is_array($res)); + $this->assertInternalType('array', $res); $this->assertRegexp('#[^a-z0-9]?www\.zend\.com/bar$#i', $chain->assemble()); } @@ -339,13 +339,13 @@ public function testChainingReuse() $request = new Zend_Controller_Router_ChainTest_Request('http://www.zend.com/user/1'); $res = $profileChain->match($request); - $this->assertTrue(is_array($res)); + $this->assertInternalType('array', $res); $this->assertEquals('prof', $res['controller']); $request = new Zend_Controller_Router_ChainTest_Request('http://www.zend.com/article/1'); $res = $articleChain->match($request); - $this->assertTrue(is_array($res)); + $this->assertInternalType('array', $res); $this->assertEquals('art', $res['controller']); $this->assertEquals('art', $res['action']); } @@ -778,7 +778,7 @@ public function testChainingStaticDynamicMatchToDefaults() $request = new Zend_Controller_Router_ChainTest_Request('http://www.zend.com/foo'); $res = $chain->match($request); - $this->assertTrue(is_array($res), 'Route did not match'); + $this->assertInternalType('array', $res, 'Route did not match'); $this->assertEquals(0, $res['bar']); } @@ -794,7 +794,7 @@ public function testChainingStaticDynamicMatchToParams() $request = new Zend_Controller_Router_ChainTest_Request('http://www.zend.com/foo/2'); $res = $chain->match($request); - $this->assertTrue(is_array($res), 'Route did not match'); + $this->assertInternalType('array', $res, 'Route did not match'); $this->assertEquals(2, $res['bar']); } @@ -920,7 +920,7 @@ public function testGetDefaults() $values = $chain->getDefaults(); // Test - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertSame('foo', $values['foo']); $this->assertSame('bar', $values['bar']); $this->assertSame('baz', $values['baz']); diff --git a/tests/Zend/Controller/Router/Route/HostnameTest.php b/tests/Zend/Controller/Router/Route/HostnameTest.php index d2a0e22639..9d34c08ced 100644 --- a/tests/Zend/Controller/Router/Route/HostnameTest.php +++ b/tests/Zend/Controller/Router/Route/HostnameTest.php @@ -35,7 +35,7 @@ * @group Zend_Controller * @group Zend_Controller_Router */ -class Zend_Controller_Router_Route_HostnameTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Router_Route_HostnameTest extends PHPUnit\Framework\TestCase { public function testCorrectStaticHostMatch() { diff --git a/tests/Zend/Controller/Router/Route/ModuleTest.php b/tests/Zend/Controller/Router/Route/ModuleTest.php index 15c2b7fe37..132b038493 100644 --- a/tests/Zend/Controller/Router/Route/ModuleTest.php +++ b/tests/Zend/Controller/Router/Route/ModuleTest.php @@ -35,7 +35,7 @@ * @group Zend_Controller * @group Zend_Controller_Router */ -class Zend_Controller_Router_Route_ModuleTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Router_Route_ModuleTest extends PHPUnit\Framework\TestCase { protected $_request; @@ -73,7 +73,7 @@ public function testModuleMatch() { $values = $this->route->match('mod'); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); } @@ -81,7 +81,7 @@ public function testModuleMatch() public function testModuleAndControllerMatch() { $values = $this->route->match('mod/con'); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertTrue(isset($values['controller'])); @@ -91,7 +91,7 @@ public function testModuleAndControllerMatch() public function testModuleControllerAndActionMatch() { $values = $this->route->match('mod/con/act'); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertTrue(isset($values['controller'])); @@ -103,7 +103,7 @@ public function testModuleControllerAndActionMatch() public function testModuleControllerActionAndParamsMatch() { $values = $this->route->match('mod/con/act/var/val/foo'); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertTrue(isset($values['controller'])); @@ -112,14 +112,14 @@ public function testModuleControllerActionAndParamsMatch() $this->assertEquals('act', $values['action']); $this->assertTrue(isset($values['var'])); $this->assertEquals('val', $values['var']); - $this->assertTrue(array_key_exists('foo', $values), var_export($values, 1)); - $this->assertTrue(empty($values['foo'])); + $this->assertArrayHasKey('foo', $values, var_export($values, 1)); + $this->assertEmpty($values['foo']); } public function testControllerOnlyMatch() { $values = $this->route->match('con'); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['controller'])); $this->assertEquals('con', $values['controller']); } @@ -127,7 +127,7 @@ public function testControllerOnlyMatch() public function testControllerOnlyAndActionMatch() { $values = $this->route->match('con/act'); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['controller'])); $this->assertEquals('con', $values['controller']); $this->assertTrue(isset($values['action'])); @@ -137,15 +137,15 @@ public function testControllerOnlyAndActionMatch() public function testControllerOnlyActionAndParamsMatch() { $values = $this->route->match('con/act/var/val/foo'); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['controller'])); $this->assertEquals('con', $values['controller']); $this->assertTrue(isset($values['action'])); $this->assertEquals('act', $values['action']); $this->assertTrue(isset($values['var'])); $this->assertEquals('val', $values['var']); - $this->assertTrue(array_key_exists('foo', $values), var_export($values, 1)); - $this->assertTrue(empty($values['foo'])); + $this->assertArrayHasKey('foo', $values, var_export($values, 1)); + $this->assertEmpty($values['foo']); } public function testModuleMatchWithControlKeysChange() @@ -158,7 +158,7 @@ public function testModuleMatchWithControlKeysChange() $values = $this->route->match('mod/ctrl'); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertSame('mod', $values['m']); $this->assertSame('ctrl', $values['c']); $this->assertSame('index', $values['a']); @@ -172,7 +172,7 @@ public function testModuleMatchWithLateControlKeysChange() $values = $this->route->match('mod/ctrl'); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertSame('mod', $values['m'], var_export(array_keys($values), 1)); $this->assertSame('ctrl', $values['c'], var_export(array_keys($values), 1)); $this->assertSame('index', $values['a'], var_export(array_keys($values), 1)); @@ -445,7 +445,7 @@ public function testGetInstanceMatching() $values = $this->route->match('mod/ctrl'); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertSame('mod', $values['m'], var_export(array_keys($values), 1)); $this->assertSame('ctrl', $values['c'], var_export(array_keys($values), 1)); $this->assertSame('index', $values['a'], var_export(array_keys($values), 1)); diff --git a/tests/Zend/Controller/Router/Route/RegexTest.php b/tests/Zend/Controller/Router/Route/RegexTest.php index bbd75004fd..967cf8d4ba 100644 --- a/tests/Zend/Controller/Router/Route/RegexTest.php +++ b/tests/Zend/Controller/Router/Route/RegexTest.php @@ -32,7 +32,7 @@ * @group Zend_Controller * @group Zend_Controller_Router */ -class Zend_Controller_Router_Route_RegexTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Router_Route_RegexTest extends PHPUnit\Framework\TestCase { public function testStaticMatch() diff --git a/tests/Zend/Controller/Router/Route/StaticTest.php b/tests/Zend/Controller/Router/Route/StaticTest.php index d9fb1d68cb..38502875f3 100644 --- a/tests/Zend/Controller/Router/Route/StaticTest.php +++ b/tests/Zend/Controller/Router/Route/StaticTest.php @@ -32,7 +32,7 @@ * @group Zend_Controller * @group Zend_Controller_Router */ -class Zend_Controller_Router_Route_StaticTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Router_Route_StaticTest extends PHPUnit\Framework\TestCase { public function testStaticMatch() @@ -40,7 +40,7 @@ public function testStaticMatch() $route = new Zend_Controller_Router_Route_Static('users/all'); $values = $route->match('users/all'); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); } public function testStaticMatchFailure() @@ -57,7 +57,7 @@ public function testStaticMatchWithDefaults() array('controller' => 'ctrl', 'action' => 'act')); $values = $route->match('users/all'); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertSame('ctrl', $values['controller']); $this->assertSame('act', $values['action']); } @@ -67,7 +67,7 @@ public function testStaticUTFMatch() $route = new Zend_Controller_Router_Route_Static('żółć'); $values = $route->match('żółć'); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); } public function testRootRoute() @@ -93,7 +93,7 @@ public function testGetDefaults() $values = $route->getDefaults(); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertSame('ctrl', $values['controller']); $this->assertSame('act', $values['action']); } diff --git a/tests/Zend/Controller/Router/RouteTest.php b/tests/Zend/Controller/Router/RouteTest.php index 7f22e26b62..a8725acb3c 100644 --- a/tests/Zend/Controller/Router/RouteTest.php +++ b/tests/Zend/Controller/Router/RouteTest.php @@ -41,7 +41,7 @@ * @group Zend_Controller * @group Zend_Controller_Router */ -class Zend_Controller_Router_RouteTest extends PHPUnit_Framework_TestCase +class Zend_Controller_Router_RouteTest extends PHPUnit\Framework\TestCase { /** * Server backup @@ -306,7 +306,7 @@ public function testVariablesWithWildcardAndNumericKey() $this->assertEquals('c', $values['controller']); $this->assertEquals('a', $values['action']); $this->assertEquals('next', $values['next']); - $this->assertTrue(array_key_exists('2000', $values)); + $this->assertArrayHasKey('2000', $values); } public function testRootRoute() @@ -423,7 +423,7 @@ public function testAssembleWithUrlVariablesReuse() { $route = new Zend_Controller_Router_Route('archives/:year/:month'); $values = $route->match('archives/2006/07'); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $url = $route->assemble(array('month' => '03')); $this->assertEquals('archives/2006/03', $url); @@ -451,7 +451,7 @@ public function testWildcardUrlVariablesOverwriting() { $route = new Zend_Controller_Router_Route('archives/:year/:month/*', array('controller' => 'archive')); $values = $route->match('archives/2006/07/controller/test/year/10000/sort/author'); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertEquals('archive', $values['controller']); $this->assertEquals('2006', $values['year']); @@ -466,7 +466,7 @@ public function testGetDefaults() $values = $route->getDefaults(); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertEquals('ctrl', $values['controller']); $this->assertEquals('act', $values['action']); } @@ -596,7 +596,7 @@ public function testForZF2543() $this->assertEquals('families', $route->assemble()); $values = $route->match('families/edit/id/4'); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertEquals('families/edit/id/4', $route->assemble()); } @@ -636,7 +636,7 @@ public function testPartialMatch() $values = $route->match('en/tmp/ctrl/action/id/1', true); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertEquals('en', $values['lang']); $this->assertEquals('tmp', $values['temp']); $this->assertEquals('en/tmp', $route->getMatchedPath()); @@ -659,7 +659,7 @@ public function testStaticTranslationMatch() $route = new Zend_Controller_Router_Route('foo/@foo'); $values = $route->match('foo/en_foo'); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); } public function testDynamicTranslationAssemble() diff --git a/tests/Zend/Crypt/DiffieHellmanTest.php b/tests/Zend/Crypt/DiffieHellmanTest.php index de6d1bd216..2f05e68e25 100644 --- a/tests/Zend/Crypt/DiffieHellmanTest.php +++ b/tests/Zend/Crypt/DiffieHellmanTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Crypt */ -class Zend_Crypt_DiffieHellmanTest extends PHPUnit_Framework_TestCase +class Zend_Crypt_DiffieHellmanTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Crypt/HmacTest.php b/tests/Zend/Crypt/HmacTest.php index eb1d0ff4bb..0cbf87a816 100644 --- a/tests/Zend/Crypt/HmacTest.php +++ b/tests/Zend/Crypt/HmacTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Crypt */ -class Zend_Crypt_HmacTest extends PHPUnit_Framework_TestCase +class Zend_Crypt_HmacTest extends PHPUnit\Framework\TestCase { // MD5 tests taken from RFC 2202 diff --git a/tests/Zend/Crypt/Math/BigInteger/BcmathTest.php b/tests/Zend/Crypt/Math/BigInteger/BcmathTest.php index 094ebd8b95..d3ae1de5e4 100644 --- a/tests/Zend/Crypt/Math/BigInteger/BcmathTest.php +++ b/tests/Zend/Crypt/Math/BigInteger/BcmathTest.php @@ -30,7 +30,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Crypt */ -class Zend_Crypt_Math_BigInteger_BcmathTest extends PHPUnit_Framework_TestCase +class Zend_Crypt_Math_BigInteger_BcmathTest extends PHPUnit\Framework\TestCase { private $_math = null; diff --git a/tests/Zend/Crypt/Math/BigInteger/GmpTest.php b/tests/Zend/Crypt/Math/BigInteger/GmpTest.php index 58e19d39aa..c95e74af66 100644 --- a/tests/Zend/Crypt/Math/BigInteger/GmpTest.php +++ b/tests/Zend/Crypt/Math/BigInteger/GmpTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Crypt */ -class Zend_Crypt_Math_BigInteger_GmpTest extends PHPUnit_Framework_TestCase +class Zend_Crypt_Math_BigInteger_GmpTest extends PHPUnit\Framework\TestCase { private $_math = null; diff --git a/tests/Zend/Crypt/MathTest.php b/tests/Zend/Crypt/MathTest.php index 70559e14b7..aed10321c1 100644 --- a/tests/Zend/Crypt/MathTest.php +++ b/tests/Zend/Crypt/MathTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Crypt */ -class Zend_Crypt_MathTest extends PHPUnit_Framework_TestCase +class Zend_Crypt_MathTest extends PHPUnit\Framework\TestCase { public function testRand() diff --git a/tests/Zend/Crypt/Rsa/RsaTest.php b/tests/Zend/Crypt/Rsa/RsaTest.php index 4cd2fed2c5..3e85f0aa5c 100644 --- a/tests/Zend/Crypt/Rsa/RsaTest.php +++ b/tests/Zend/Crypt/Rsa/RsaTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Crypt */ -class Zend_Crypt_RsaTest extends PHPUnit_Framework_TestCase +class Zend_Crypt_RsaTest extends PHPUnit\Framework\TestCase { protected $_testPemString = null; diff --git a/tests/Zend/CurrencyTest.php b/tests/Zend/CurrencyTest.php index adfe8c09ba..d43abb5949 100644 --- a/tests/Zend/CurrencyTest.php +++ b/tests/Zend/CurrencyTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Currency */ -class Zend_CurrencyTest extends PHPUnit_Framework_TestCase +class Zend_CurrencyTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Date/DateObjectTest.php b/tests/Zend/Date/DateObjectTest.php index 467a009f18..35dac8072c 100644 --- a/tests/Zend/Date/DateObjectTest.php +++ b/tests/Zend/Date/DateObjectTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Date */ -class Zend_Date_DateObjectTest extends PHPUnit_Framework_TestCase +class Zend_Date_DateObjectTest extends PHPUnit\Framework\TestCase { public function setUp() @@ -361,8 +361,8 @@ public function testCalcSunInternal() public function testGetDate() { $date = new Zend_Date_DateObjectTestHelper(0); - $this->assertTrue(is_array($date->getDateParts())); - $this->assertTrue(is_array($date->getDateParts(1000000))); + $this->assertInternalType('array', $date->getDateParts()); + $this->assertInternalType('array', $date->getDateParts(1000000)); $test = array( 'seconds' => 40, 'minutes' => 46, 'hours' => 14, 'mday' => 12, 'wday' => 1, diff --git a/tests/Zend/DateTest.php b/tests/Zend/DateTest.php index d72976877d..06f4ea2221 100644 --- a/tests/Zend/DateTest.php +++ b/tests/Zend/DateTest.php @@ -53,7 +53,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Date */ -class Zend_DateTest extends PHPUnit_Framework_TestCase +class Zend_DateTest extends PHPUnit\Framework\TestCase { private $_cache = null; @@ -3562,7 +3562,7 @@ public function testGetIso() $d2 = new Zend_Date(1010101010,null,$locale); $result = $date->getIso(); - $this->assertTrue(is_string($result)); + $this->assertInternalType('string', $result); $this->assertSame('2002-01-04T04:36:50+05:00', $result); } @@ -3692,7 +3692,7 @@ public function testGetArpa() $date = new Zend_Date(1010101010,null,$locale); $result = $date->getArpa(); - $this->assertTrue(is_string($result)); + $this->assertInternalType('string', $result); $this->assertSame('Fri, 04 Jan 02 04:36:50 +0500', $result); } @@ -3816,7 +3816,7 @@ public function testSunFunc() $date->setTimezone(date_default_timezone_get()); $result = Zend_Date_Cities::City('vienna'); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $result = $date->getSunset($result); // PHP's internal sunrise/sunset calculation changed in 7.2.0 // See comment in Zend/Date/DateObjectTest.php::testCalcSunInternal @@ -3829,7 +3829,7 @@ public function testSunFunc() unset($result); $result = Zend_Date_Cities::City('vienna', 'civil'); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $result = $date->getSunset($result); if (version_compare(PHP_VERSION, '7.2.0', '>=')) { $this->assertSame('2002-01-04T20:09:01+05:00', $result->get(Zend_Date::W3C)); @@ -3839,7 +3839,7 @@ public function testSunFunc() unset($result); $result = Zend_Date_Cities::City('vienna', 'nautic'); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $result = $date->getSunset($result); if (version_compare(PHP_VERSION, '7.2.0', '>=')) { $this->assertSame('2002-01-04T20:08:15+05:00', $result->get(Zend_Date::W3C)); @@ -3849,7 +3849,7 @@ public function testSunFunc() unset($result); $result = Zend_Date_Cities::City('vienna', 'astronomic'); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $result = $date->getSunset($result); if (version_compare(PHP_VERSION, '7.2.0', '>=')) { $this->assertSame('2002-01-04T20:07:30+05:00', $result->get(Zend_Date::W3C)); @@ -3859,7 +3859,7 @@ public function testSunFunc() unset($result); $result = Zend_Date_Cities::City('BERLIN'); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $result = $date->getSunrise($result); if (version_compare(PHP_VERSION, '7.2.0', '>=')) { $this->assertSame('2002-01-04T12:21:26+05:00', $result->get(Zend_Date::W3C)); @@ -3869,7 +3869,7 @@ public function testSunFunc() unset($result); $result = Zend_Date_Cities::City('London'); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $result = $date->getSunInfo($result); if (version_compare(PHP_VERSION, '7.2.0', '>=')) { $this->assertSame('2002-01-04T13:10:15+05:00', $result['sunrise']['effective']->get(Zend_Date::W3C )); @@ -3948,7 +3948,7 @@ public function testSunFunc() unset($result); $result = array('latitude' => 0, 'longitude' => 0); $result = $date->getSunInfo($result); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); unset($result); $result = array('latitude' => 0, 'longitude' => 0); @@ -5241,7 +5241,7 @@ public function testDaylightsaving() public function testSetOptions() { $options = Zend_Date::setOptions(); - $this->assertTrue(is_array($options)); + $this->assertInternalType('array', $options); $this->assertEquals('iso', $options['format_type']); Zend_Date::setOptions(array('format_type' => 'php')); diff --git a/tests/Zend/Db/Adapter/OracleTest.php b/tests/Zend/Db/Adapter/OracleTest.php index b6e9e7c272..7442828b36 100644 --- a/tests/Zend/Db/Adapter/OracleTest.php +++ b/tests/Zend/Db/Adapter/OracleTest.php @@ -104,7 +104,7 @@ public function testAdapterFetchAllOverrideFetchMode() // Test associative array $result = $this->_db->fetchAll("SELECT * FROM $products WHERE $product_id > :id ORDER BY $product_id ASC", array(":id"=>1), Zend_Db::FETCH_ASSOC); $this->assertEquals(2, count($result)); - $this->assertTrue(is_array($result[0])); + $this->assertInternalType('array', $result[0]); $this->assertEquals(2, count($result[0])); // count columns $this->assertEquals(2, $result[0][$col_name]); @@ -114,7 +114,7 @@ public function testAdapterFetchAllOverrideFetchMode() // Ensure original fetch mode has been retained $result = $this->_db->fetchAll("SELECT * FROM $products WHERE $product_id > :id ORDER BY $product_id", array(":id"=>1)); $this->assertEquals(2, count($result)); - $this->assertTrue(is_object($result[0])); + $this->assertInternalType('object', $result[0]); $this->assertEquals(2, $result[0]->$col_name); } @@ -145,7 +145,7 @@ public function testAdapterFetchAssocAfterSetFetchMode() $this->_db->setFetchMode(Zend_Db::FETCH_OBJ); $result = $this->_db->fetchAssoc("SELECT * FROM $products WHERE $product_id > :id ORDER BY $product_id DESC", array(":id"=>1)); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertEquals(array('product_id', 'product_name'), array_keys(current($result))); } @@ -175,7 +175,7 @@ public function testAdapterFetchColAfterSetFetchMode() $this->_db->setFetchMode(Zend_Db::FETCH_OBJ); $result = $this->_db->fetchCol("SELECT * FROM $products WHERE $product_id > :id ORDER BY $product_id ASC", array(":id"=>1)); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertEquals(2, count($result)); // count rows $this->assertEquals(2, $result[0]); $this->assertEquals(3, $result[1]); @@ -210,7 +210,7 @@ public function testAdapterFetchOneAfterSetFetchMode() $this->_db->setFetchMode(Zend_Db::FETCH_OBJ); $prod = 'Linux'; $result = $this->_db->fetchOne("SELECT $product_name FROM $products WHERE $product_id > :id ORDER BY $product_id", array(":id"=>1)); - $this->assertTrue(is_string($result)); + $this->assertInternalType('string', $result); $this->assertEquals($prod, $result); } @@ -242,7 +242,7 @@ public function testAdapterFetchPairsAfterSetFetchMode() $this->_db->setFetchMode(Zend_Db::FETCH_OBJ); $prod = 'Linux'; $result = $this->_db->fetchPairs("SELECT $product_id, $product_name FROM $products WHERE $product_id > :id ORDER BY $product_id ASC", array(":id"=>1)); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertEquals(2, count($result)); // count rows $this->assertEquals($prod, $result[2]); } @@ -275,7 +275,7 @@ public function testAdapterFetchRowOverrideFetchMode() // Test associative array $result = $this->_db->fetchRow("SELECT * FROM $products WHERE $product_id > :id ORDER BY $product_id", array(":id"=>1), Zend_Db::FETCH_ASSOC); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertEquals(2, count($result)); // count columns $this->assertEquals(2, $result['product_id']); @@ -284,7 +284,7 @@ public function testAdapterFetchRowOverrideFetchMode() // Ensure original fetch mode has been retained $result = $this->_db->fetchRow("SELECT * FROM $products WHERE $product_id > :id ORDER BY $product_id", array(":id"=>1)); - $this->assertTrue(is_object($result)); + $this->assertInternalType('object', $result); $this->assertEquals(2, $result->$col_name); } @@ -327,7 +327,7 @@ public function testAdapterInsertDbExpr() ->from('zfproducts') ->where("$product_id = 4"); $result = $this->_db->fetchAll($select); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertEquals('SOLARIS', $result[0]['product_name']); } diff --git a/tests/Zend/Db/Adapter/Pdo/MssqlTest.php b/tests/Zend/Db/Adapter/Pdo/MssqlTest.php index 45ac012204..71b3d0a5ab 100644 --- a/tests/Zend/Db/Adapter/Pdo/MssqlTest.php +++ b/tests/Zend/Db/Adapter/Pdo/MssqlTest.php @@ -286,7 +286,7 @@ public function testAdapterInsert() $rowsAffected = $this->_db->insert('zfbugs', $row); $this->assertEquals(1, $rowsAffected); $lastInsertId = $this->_db->lastInsertId(); - $this->assertTrue(is_int($lastInsertId)); + $this->assertInternalType('int', $lastInsertId); $this->assertEquals('5', (string) $lastInsertId, 'Expected new id to be 5'); } diff --git a/tests/Zend/Db/Adapter/Pdo/OciTest.php b/tests/Zend/Db/Adapter/Pdo/OciTest.php index 5c9df449ac..568f8e934f 100644 --- a/tests/Zend/Db/Adapter/Pdo/OciTest.php +++ b/tests/Zend/Db/Adapter/Pdo/OciTest.php @@ -76,8 +76,8 @@ public function testAdapterInsert() $this->assertEquals(1, $rowsAffected); $lastInsertId = $this->_db->lastInsertId('zfproducts', null); // implies 'products_seq' $lastSequenceId = $this->_db->lastSequenceId('zfproducts_seq'); - $this->assertTrue(is_string($lastInsertId)); - $this->assertTrue(is_string($lastSequenceId)); + $this->assertInternalType('string', $lastInsertId); + $this->assertInternalType('string', $lastSequenceId); $this->assertEquals('4', (string) $lastInsertId, 'Expected new id to be 4'); $this->assertEquals('4', (string) $lastSequenceId, 'Expected new id to be 4'); } @@ -95,7 +95,7 @@ public function testAdapterInsertDbExpr() ->from('zfproducts') ->where("$product_id = 4"); $result = $this->_db->fetchAll($select); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertEquals('SOLARIS', $result[0]['product_name']); } diff --git a/tests/Zend/Db/Adapter/SkipTests.php b/tests/Zend/Db/Adapter/SkipTests.php index 7aee34fa32..7fd5a58d18 100644 --- a/tests/Zend/Db/Adapter/SkipTests.php +++ b/tests/Zend/Db/Adapter/SkipTests.php @@ -30,7 +30,7 @@ * @group Zend_Db * @group Zend_Db_Adapter */ -abstract class Zend_Db_Adapter_Skip_CommonTest extends PHPUnit_Framework_TestCase +abstract class Zend_Db_Adapter_Skip_CommonTest extends PHPUnit\Framework\TestCase { abstract public function getDriver(); diff --git a/tests/Zend/Db/Adapter/SqlsrvTest.php b/tests/Zend/Db/Adapter/SqlsrvTest.php index f9d4714af3..b510c9b1be 100644 --- a/tests/Zend/Db/Adapter/SqlsrvTest.php +++ b/tests/Zend/Db/Adapter/SqlsrvTest.php @@ -98,7 +98,7 @@ public function testAdapterInsert() $this->assertEquals(1, $rowsAffected); $lastInsertId = $this->_db->lastInsertId(); - $this->assertTrue(is_string($lastInsertId)); + $this->assertInternalType('string', $lastInsertId); $this->assertEquals('5', (string) $lastInsertId, 'Expected new id to be 5'); diff --git a/tests/Zend/Db/Adapter/StaticTest.php b/tests/Zend/Db/Adapter/StaticTest.php index 918a8bbde0..58e83be3c9 100644 --- a/tests/Zend/Db/Adapter/StaticTest.php +++ b/tests/Zend/Db/Adapter/StaticTest.php @@ -45,7 +45,7 @@ * @group Zend_Db * @group Zend_Db_Adapter */ -class Zend_Db_Adapter_StaticTest extends PHPUnit_Framework_TestCase +class Zend_Db_Adapter_StaticTest extends PHPUnit\Framework\TestCase { protected static $_isCaseSensitiveFileSystem = null; @@ -272,7 +272,7 @@ public function testDbGetFetchMode() { $db = Zend_Db::factory('Static', array('dbname' => 'dummy')); $mode = $db->getFetchMode(); - $this->assertTrue(is_int($mode)); + $this->assertInternalType('int', $mode); } /** diff --git a/tests/Zend/Db/Adapter/TestCommon.php b/tests/Zend/Db/Adapter/TestCommon.php index e757b26f1c..ac004bd704 100644 --- a/tests/Zend/Db/Adapter/TestCommon.php +++ b/tests/Zend/Db/Adapter/TestCommon.php @@ -459,14 +459,14 @@ public function testAdapterFetchAllOverrideFetchMode() // Test associative array $result = $this->_db->fetchAll("SELECT * FROM $products WHERE $product_id > ? ORDER BY $product_id ASC", 1, Zend_Db::FETCH_ASSOC); $this->assertEquals(2, count($result)); - $this->assertTrue(is_array($result[0])); + $this->assertInternalType('array', $result[0]); $this->assertEquals(2, count($result[0])); // count columns $this->assertEquals(2, $result[0][$col_name]); // Test numeric and associative array $result = $this->_db->fetchAll("SELECT * FROM $products WHERE $product_id > ? ORDER BY $product_id ASC", 1, Zend_Db::FETCH_BOTH); $this->assertEquals(2, count($result)); - $this->assertTrue(is_array($result[0])); + $this->assertInternalType('array', $result[0]); $this->assertEquals(4, count($result[0])); // count columns $this->assertEquals(2, $result[0][$col_name]); $this->assertEquals(2, $result[0][0]); @@ -474,7 +474,7 @@ public function testAdapterFetchAllOverrideFetchMode() // Ensure original fetch mode has been retained $result = $this->_db->fetchAll("SELECT * FROM $products WHERE $product_id > ? ORDER BY $product_id", 1); $this->assertEquals(2, count($result)); - $this->assertTrue(is_object($result[0])); + $this->assertInternalType('object', $result[0]); $this->assertEquals(2, $result[0]->$col_name); } @@ -503,7 +503,7 @@ public function testAdapterFetchAssocAfterSetFetchMode() $this->_db->setFetchMode(Zend_Db::FETCH_OBJ); $result = $this->_db->fetchAssoc("SELECT * FROM $products WHERE $product_id > ? ORDER BY $product_id DESC", 1); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertEquals(array('product_id', 'product_name'), array_keys(current($result))); } @@ -516,7 +516,7 @@ public function testAdapterFetchCol() $product_id = $this->_db->quoteIdentifier('product_id'); $result = $this->_db->fetchCol("SELECT * FROM $products WHERE $product_id > ? ORDER BY $product_id ASC", 1); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertEquals(2, count($result)); // count rows $this->assertEquals(2, $result[0]); $this->assertEquals(3, $result[1]); @@ -533,7 +533,7 @@ public function testAdapterFetchColAfterSetFetchMode() $this->_db->setFetchMode(Zend_Db::FETCH_OBJ); $result = $this->_db->fetchCol("SELECT * FROM $products WHERE $product_id > ? ORDER BY $product_id ASC", 1); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertEquals(2, count($result)); // count rows $this->assertEquals(2, $result[0]); $this->assertEquals(3, $result[1]); @@ -566,7 +566,7 @@ public function testAdapterFetchOneAfterSetFetchMode() $this->_db->setFetchMode(Zend_Db::FETCH_OBJ); $prod = 'Linux'; $result = $this->_db->fetchOne("SELECT $product_name FROM $products WHERE $product_id > ? ORDER BY $product_id", 1); - $this->assertTrue(is_string($result)); + $this->assertInternalType('string', $result); $this->assertEquals($prod, $result); } @@ -597,7 +597,7 @@ public function testAdapterFetchPairsAfterSetFetchMode() $this->_db->setFetchMode(Zend_Db::FETCH_OBJ); $prod = 'Linux'; $result = $this->_db->fetchPairs("SELECT $product_id, $product_name FROM $products WHERE $product_id > ? ORDER BY $product_id ASC", 1); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertEquals(2, count($result)); // count rows $this->assertEquals($prod, $result[2]); } @@ -629,20 +629,20 @@ public function testAdapterFetchRowOverrideFetchMode() // Test associative array $result = $this->_db->fetchRow("SELECT * FROM $products WHERE $product_id > ? ORDER BY $product_id", 1, Zend_Db::FETCH_ASSOC); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertEquals(2, count($result)); // count columns $this->assertEquals(2, $result['product_id']); // Test numeric and associative array $result = $this->_db->fetchRow("SELECT * FROM $products WHERE $product_id > ? ORDER BY $product_id", 1, Zend_Db::FETCH_BOTH); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertEquals(4, count($result)); // count columns $this->assertEquals(2, $result['product_id']); $this->assertEquals(2, $result[0]); // Ensure original fetch mode has been retained $result = $this->_db->fetchRow("SELECT * FROM $products WHERE $product_id > ? ORDER BY $product_id", 1); - $this->assertTrue(is_object($result)); + $this->assertInternalType('object', $result); $this->assertEquals(2, $result->$col_name); } @@ -664,7 +664,7 @@ public function testAdapterInsert() $rowsAffected = $this->_db->insert('zfbugs', $row); $this->assertEquals(1, $rowsAffected); $lastInsertId = $this->_db->lastInsertId(); - $this->assertTrue(is_string($lastInsertId)); + $this->assertInternalType('string', $lastInsertId); $this->assertEquals('5', (string) $lastInsertId, 'Expected new id to be 5'); } @@ -679,8 +679,8 @@ public function testAdapterInsertSequence() $this->assertEquals(1, $rowsAffected); $lastInsertId = $this->_db->lastInsertId('zfproducts'); $lastSequenceId = $this->_db->lastSequenceId('zfproducts_seq'); - $this->assertTrue(is_string($lastInsertId)); - $this->assertTrue(is_string($lastSequenceId)); + $this->assertInternalType('string', $lastInsertId); + $this->assertInternalType('string', $lastSequenceId); $this->assertEquals('4', (string) $lastInsertId, 'Expected new id to be 4'); } @@ -954,7 +954,7 @@ public function testAdapterQueryResultsNone() $stmt = $this->_db->query('SELECT * FROM ' . $this->_db->quoteIdentifier('zfbugs') . ' WHERE ' . $this->_db->quoteIdentifier('bug_id') . ' = -1'); - $this->assertTrue(is_object($stmt), + $this->assertInternalType('object', $stmt, 'Expected query() to return object; got ' . gettype($stmt)); $this->assertTrue($stmt instanceof Zend_Db_Statement_Interface, @@ -1234,27 +1234,27 @@ public function testAdapterQuoteIntoSingleQuote() public function testAdapterQuoteIntoType() { $value = $this->_db->quoteInto('foo = ?', 1234, Zend_Db::INT_TYPE); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('foo = 1234', $value, 'Incorrect quoteInto() result for INT_TYPE'); $value = $this->_db->quoteInto('foo = ?', 1234, Zend_Db::BIGINT_TYPE); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('foo = 1234', $value, 'Incorrect quoteInto() result for BIGINT_TYPE'); $value = $this->_db->quoteInto('foo = ?', 12.34, Zend_Db::FLOAT_TYPE); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('foo = 12.340000', $value, 'Incorrect quoteInto() result for FLOAT_TYPE'); $value = $this->_db->quoteInto('foo = ?', 1234, 'CHAR'); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals("foo = 1234", $value, 'Incorrect quoteInto() result for CHAR'); $value = $this->_db->quoteInto('foo = ?', '1234', 'CHAR'); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals("foo = '1234'", $value, 'Incorrect quoteInto() result for CHAR'); } @@ -1262,7 +1262,7 @@ public function testAdapterQuoteIntoType() public function testAdapterQuoteIntoCount() { $value = $this->_db->quoteInto('foo = ? and bar = ?', 1234, null, 1); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('foo = 1234 and bar = ?', $value, 'Incorrect quoteInto() result for count'); } @@ -1272,7 +1272,7 @@ public function testAdapterQuoteIntoCountAndQuestionMark() $string = 'foo = ? OR moo = ? OR boo = ?'; $param = 'What?'; $value = $this->_db->quoteInto($string, $param, null, 2); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals("foo = 'What?' OR moo = 'What?' OR boo = ?", $value, 'Incorrect quoteInto() result for count and question mark in value'); } @@ -1286,43 +1286,43 @@ public function testAdapterQuoteTypeInt() // test int value $value = $this->_db->quote(1234, $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('1234', $value, "Incorrect quote() INT_TYPE result for int"); // test int string $value = $this->_db->quote('1234', $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('1234', $value, "Incorrect quote() INT_TYPE result for int string"); // test int string with + sign $value = $this->_db->quote('+1234', $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('1234', $value, "Incorrect quote() INT_TYPE result for int string with + sign"); // test int string with - sign $value = $this->_db->quote('-1234', $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('-1234', $value, "Incorrect quote() INT_TYPE result for int string with - sign"); // test int string with non-digit text $value = $this->_db->quote('1234abcd', $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('1234', $value, "Incorrect quote() INT_TYPE result for int string with non-digit text"); // test non-digit test; it should return 0 $value = $this->_db->quote('abcd', $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('0', $value, "Incorrect quote() INT_TYPE result for non-digit string"); // test Zend_Db_Expr is passed through literally $value = $this->_db->quote(new Zend_Db_Expr('1+2+3'), $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals("1+2+3", $value, "Incorrect quote() INT_TYPE result for Zend_Db_Expr"); } @@ -1337,78 +1337,78 @@ public function testAdapterQuoteTypeBigInt() // test int value $value = $this->_db->quote(1234, $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals(1234, $value, "Incorrect quote() BIGINT_TYPE result for int"); // test int string $value = $this->_db->quote('1234', $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('1234', $value, "Incorrect quote() BIGINT_TYPE result for int string"); // test int string with + sign $value = $this->_db->quote('+1234', $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('+1234', $value, "Incorrect quote() BIGINT_TYPE result for int string"); // test int string with - sign $value = $this->_db->quote('-1234', $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('-1234', $value, "Incorrect quote() BIGINT_TYPE result for int string"); // test int string with positive exponent $value = $this->_db->quote('1234e15', $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('1234e15', $value, "Incorrect quote() BIGINT_TYPE result for int string"); $value = $this->_db->quote('1234e+15', $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('1234e+15', $value, "Incorrect quote() BIGINT_TYPE result for int string"); // test int value with negative exponent $value = $this->_db->quote('1234e-15', $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('1234e-15', $value, "Incorrect quote() BIGINT_TYPE result for int string"); // test bigint value $value = $this->_db->quote('2200000000', $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('2200000000', $value, "Incorrect quote() BIGINT_TYPE result for big int string"); // test octal value with leading zeroes $value = $this->_db->quote('020310253000', $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('020310253000', $value, "Incorrect quote() BIGINT_TYPE result for big octal int string with leading zeroes"); // test decimal value with leading zeroes $value = $this->_db->quote('09091', $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('09091', $value, "Incorrect quote() BIGINT_TYPE result for decimal int string with leading zeroes"); // test hex value with ODBC-style notation $value = $this->_db->quote('0x83215600', $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('0x83215600', $value, "Incorrect quote() BIGINT_TYPE result for big hex int string"); // test non-numeric value; it should be zero $value = $this->_db->quote('abcd', $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('0', $value, "Incorrect quote() BIGINT_TYPE result for non-digt string"); // test Zend_Db_Expr is passed through literally $value = $this->_db->quote(new Zend_Db_Expr('1+2+3'), $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals("1+2+3", $value, "Incorrect quote() BIGINT_TYPE result for Zend_Db_Expr"); } @@ -1422,37 +1422,37 @@ public function testAdapterQuoteTypeFloat() } $value = $this->_db->quote(12.34, $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('12.34', $value, "Incorrect quote() FLOAT_TYPE result"); $value = $this->_db->quote('12.34', $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('12.34', $value, "Incorrect quote() FLOAT_TYPE result"); $value = $this->_db->quote('+12.34', $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('12.34', $value, "Incorrect quote() FLOAT_TYPE result"); $value = $this->_db->quote('-12.34', $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('-12.34', $value, "Incorrect quote() FLOAT_TYPE result"); $value = $this->_db->quote('12.34abcd', $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('12.34', $value, "Incorrect quote() FLOAT_TYPE result"); $value = $this->_db->quote('abcd', $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals('0', $value, "Incorrect quote() FLOAT_TYPE result"); $value = $this->_db->quote(new Zend_Db_Expr('1+2+3'), $typeName); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals("1+2+3", $value, "Incorrect quote() FLOAT_TYPE result"); } @@ -1461,28 +1461,28 @@ public function testAdapterQuoteTypeFloat() public function testAdapterQuoteTypeNonNumeric() { $value = $this->_db->quote(1234, 'CHAR'); - $this->assertTrue(is_int($value)); + $this->assertInternalType('int', $value); $this->assertEquals(1234, $value, "Incorrect quote() CHAR type result"); $value = $this->_db->quote('1234', 'CHAR'); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals("'1234'", $value, "Incorrect quote() CHAR type result"); $value = $this->_db->quote('1234abcd', 'CHAR'); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals("'1234abcd'", $value, "Incorrect quote() CHAR type result"); $value = $this->_db->quote('1234abcd56', 'CHAR'); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals("'1234abcd56'", $value, "Incorrect quote() CHAR type result"); // test Zend_Db_Expr is passed through literally $value = $this->_db->quote(new Zend_Db_Expr('1+2+3'), 'CHAR'); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals("1+2+3", $value, "Incorrect quote() CHAR type result for Zend_Db_Expr"); } @@ -1980,8 +1980,8 @@ public function testAdapterReadClobFetchOne() public function testAdapterSerializationIsOkByDefault() { $serialized = serialize($this->_db); - $this->assertTrue(is_string($serialized)); - $this->assertThat(unserialize($serialized), new PHPUnit_Framework_Constraint_IsInstanceOf('Zend_Db_Adapter_Abstract')); + $this->assertInternalType('string', $serialized); + $this->assertThat(unserialize($serialized), new PHPUnit\Framework\Constraint\IsInstanceOf('Zend_Db_Adapter_Abstract')); } public function testAdapterSerializationFailsWhenNotAllowedToBeSerialized() @@ -1991,7 +1991,7 @@ public function testAdapterSerializationFailsWhenNotAllowedToBeSerialized() Zend_Db::ALLOW_SERIALIZATION => false ); $db = Zend_Db::factory($this->getDriver(), $params); - $this->setExpectedException('Zend_Db_Adapter_Exception'); + $this->expectException('Zend_Db_Adapter_Exception'); $serialized = serialize($db); } diff --git a/tests/Zend/Db/Profiler/FirebugTest.php b/tests/Zend/Db/Profiler/FirebugTest.php index eb2f89ebeb..871c05d0ec 100644 --- a/tests/Zend/Db/Profiler/FirebugTest.php +++ b/tests/Zend/Db/Profiler/FirebugTest.php @@ -48,7 +48,7 @@ * @group Zend_Db * @group Zend_Db_Profiler */ -class Zend_Db_Profiler_FirebugTest extends PHPUnit_Framework_TestCase +class Zend_Db_Profiler_FirebugTest extends PHPUnit\Framework\TestCase { protected $_controller = null; @@ -66,8 +66,8 @@ class Zend_Db_Profiler_FirebugTest extends PHPUnit_Framework_TestCase public static function main() { - $suite = new PHPUnit_Framework_TestSuite("Zend_Db_Profiler_FirebugTest"); - $result = PHPUnit_TextUI_TestRunner::run($suite); + $suite = new PHPUnit\Framework\TestSuite("Zend_Db_Profiler_FirebugTest"); + $result = PHPUnit\TextUI\TestRunner::run($suite); } public function setUp() diff --git a/tests/Zend/Db/Profiler/OracleTest.php b/tests/Zend/Db/Profiler/OracleTest.php index f0f471c729..beb1429964 100644 --- a/tests/Zend/Db/Profiler/OracleTest.php +++ b/tests/Zend/Db/Profiler/OracleTest.php @@ -52,12 +52,12 @@ public function testProfilerPreparedStatementWithParams() // execute query a first time $stmt->execute(array(':bug_id' => 2)); $results = $stmt->fetchAll(); - $this->assertTrue(is_array($results)); + $this->assertInternalType('array', $results); $this->assertEquals(2, $results[0]['bug_id']); // analyze query profiles $profiles = $this->_db->getProfiler()->getQueryProfiles(null, true); - $this->assertTrue(is_array($profiles), 'Expected array, got '.gettype($profiles)); + $this->assertInternalType('array', $profiles, 'Expected array, got '.gettype($profiles)); $this->assertEquals(1, count($profiles), 'Expected to find 1 profile'); $qp = $profiles[0]; $this->assertTrue($qp instanceof Zend_Db_Profiler_Query); @@ -66,18 +66,18 @@ public function testProfilerPreparedStatementWithParams() $sql = $qp->getQuery(); $this->assertContains(" = :bug_id", $sql); $params = $qp->getQueryParams(); - $this->assertTrue(is_array($params)); + $this->assertInternalType('array', $params); $this->assertEquals(array(':bug_id' => 2), $params); // execute query a second time $stmt->execute(array(':bug_id' => 3)); $results = $stmt->fetchAll(); - $this->assertTrue(is_array($results)); + $this->assertInternalType('array', $results); $this->assertEquals(3, $results[0]['bug_id']); // analyze query profiles $profiles = $this->_db->getProfiler()->getQueryProfiles(null, true); - $this->assertTrue(is_array($profiles), 'Expected array, got '.gettype($profiles)); + $this->assertInternalType('array', $profiles, 'Expected array, got '.gettype($profiles)); $this->assertEquals(2, count($profiles), 'Expected to find 2 profiles'); $qp = $profiles[1]; $this->assertTrue($qp instanceof Zend_Db_Profiler_Query); @@ -86,7 +86,7 @@ public function testProfilerPreparedStatementWithParams() $sql = $qp->getQuery(); $this->assertContains(" = :bug_id", $sql); $params = $qp->getQueryParams(); - $this->assertTrue(is_array($params)); + $this->assertInternalType('array', $params); $this->assertEquals(array(':bug_id' => 3), $params); } @@ -106,12 +106,12 @@ public function testProfilerPreparedStatementWithBoundParams() $id = 2; $stmt->execute(); $results = $stmt->fetchAll(); - $this->assertTrue(is_array($results)); + $this->assertInternalType('array', $results); $this->assertEquals(2, $results[0]['bug_id']); // analyze query profiles $profiles = $this->_db->getProfiler()->getQueryProfiles(null, true); - $this->assertTrue(is_array($profiles)); + $this->assertInternalType('array', $profiles); $this->assertEquals(1, count($profiles), 'Expected to find 1 profile'); $qp = $profiles[0]; $this->assertTrue($qp instanceof Zend_Db_Profiler_Query); @@ -120,19 +120,19 @@ public function testProfilerPreparedStatementWithBoundParams() $sql = $qp->getQuery(); $this->assertContains(" = :bug_id", $sql); $params = $qp->getQueryParams(); - $this->assertTrue(is_array($params)); + $this->assertInternalType('array', $params); $this->assertEquals(array(':bug_id' => 2), $params); // execute query a first time $id = 3; $stmt->execute(); $results = $stmt->fetchAll(); - $this->assertTrue(is_array($results)); + $this->assertInternalType('array', $results); $this->assertEquals(3, $results[0]['bug_id']); // analyze query profiles $profiles = $this->_db->getProfiler()->getQueryProfiles(null, true); - $this->assertTrue(is_array($profiles)); + $this->assertInternalType('array', $profiles); $this->assertEquals(2, count($profiles), 'Expected to find 2 profiles'); $qp = $profiles[1]; $this->assertTrue($qp instanceof Zend_Db_Profiler_Query); @@ -141,7 +141,7 @@ public function testProfilerPreparedStatementWithBoundParams() $sql = $qp->getQuery(); $this->assertContains(" = :bug_id", $sql); $params = $qp->getQueryParams(); - $this->assertTrue(is_array($params)); + $this->assertInternalType('array', $params); $this->assertEquals(array(':bug_id' => 3), $params); } @@ -168,7 +168,7 @@ protected function _testProfilerSetFilterQueryTypeCommon($queryType) $this->_db->query("UPDATE $bugs SET $bug_status = :status", array(':status'=>'FIXED')); $qps = $prof->getQueryProfiles(); - $this->assertTrue(is_array($qps), 'Expecting some query profiles, got none'); + $this->assertInternalType('array', $qps, 'Expecting some query profiles, got none'); foreach ($qps as $qp) { $qtype = $qp->getQueryType(); $this->assertEquals($queryType, $qtype, diff --git a/tests/Zend/Db/Profiler/Pdo/OciTest.php b/tests/Zend/Db/Profiler/Pdo/OciTest.php index 84b2044454..3258247f78 100644 --- a/tests/Zend/Db/Profiler/Pdo/OciTest.php +++ b/tests/Zend/Db/Profiler/Pdo/OciTest.php @@ -65,7 +65,7 @@ protected function _testProfilerSetFilterQueryTypeCommon($queryType) $this->_db->query("UPDATE $bugs SET $bug_status = :status", array(':status'=>'FIXED')); $qps = $prof->getQueryProfiles(); - $this->assertTrue(is_array($qps), 'Expecting some query profiles, got none'); + $this->assertInternalType('array', $qps, 'Expecting some query profiles, got none'); foreach ($qps as $qp) { $qtype = $qp->getQueryType(); $this->assertEquals($queryType, $qtype, diff --git a/tests/Zend/Db/Profiler/TestCommon.php b/tests/Zend/Db/Profiler/TestCommon.php index eb8df2af39..38a86a3245 100644 --- a/tests/Zend/Db/Profiler/TestCommon.php +++ b/tests/Zend/Db/Profiler/TestCommon.php @@ -69,12 +69,12 @@ public function testProfilerPreparedStatement() // execute query a first time $stmt->execute(); $results = $stmt->fetchAll(); - $this->assertTrue(is_array($results)); + $this->assertInternalType('array', $results); $this->assertEquals(2, $results[0]['bug_id']); // analyze query profiles $profiles = $this->_db->getProfiler()->getQueryProfiles(); - $this->assertTrue(is_array($profiles)); + $this->assertInternalType('array', $profiles); $this->assertEquals(1, count($profiles), 'Expected to find 1 profile'); $qp = $profiles[0]; $this->assertTrue($qp instanceof Zend_Db_Profiler_Query); @@ -82,12 +82,12 @@ public function testProfilerPreparedStatement() // execute query a second time $stmt->execute(); $results = $stmt->fetchAll(); - $this->assertTrue(is_array($results)); + $this->assertInternalType('array', $results); $this->assertEquals(2, $results[0]['bug_id']); // analyze query profiles $profiles = $this->_db->getProfiler()->getQueryProfiles(); - $this->assertTrue(is_array($profiles)); + $this->assertInternalType('array', $profiles); $this->assertEquals(2, count($profiles), 'Expected to find 2 profiles'); $qp = $profiles[1]; $this->assertTrue($qp instanceof Zend_Db_Profiler_Query); @@ -110,12 +110,12 @@ public function testProfilerPreparedStatementWithParams() // execute query a first time $stmt->execute(array(2, 'VERIFIED')); $results = $stmt->fetchAll(); - $this->assertTrue(is_array($results)); + $this->assertInternalType('array', $results); $this->assertEquals(2, $results[0]['bug_id']); // analyze query profiles $profiles = $this->_db->getProfiler()->getQueryProfiles(); - $this->assertTrue(is_array($profiles)); + $this->assertInternalType('array', $profiles); $this->assertEquals(1, count($profiles), 'Expected to find 1 profile'); $qp = $profiles[0]; $this->assertTrue($qp instanceof Zend_Db_Profiler_Query); @@ -124,18 +124,18 @@ public function testProfilerPreparedStatementWithParams() $sql = $qp->getQuery(); $this->assertContains(" = ?", $sql); $params = $qp->getQueryParams(); - $this->assertTrue(is_array($params)); + $this->assertInternalType('array', $params); $this->assertEquals(array(1 => 2, 2 => 'VERIFIED'), $params); // execute query a second time $stmt->execute(array(3, 'FIXED')); $results = $stmt->fetchAll(); - $this->assertTrue(is_array($results)); + $this->assertInternalType('array', $results); $this->assertEquals(3, $results[0]['bug_id']); // analyze query profiles $profiles = $this->_db->getProfiler()->getQueryProfiles(); - $this->assertTrue(is_array($profiles)); + $this->assertInternalType('array', $profiles); $this->assertEquals(2, count($profiles), 'Expected to find 2 profiles'); $qp = $profiles[1]; $this->assertTrue($qp instanceof Zend_Db_Profiler_Query); @@ -146,7 +146,7 @@ public function testProfilerPreparedStatementWithParams() $sql = $qp->getQuery(); $this->assertContains(" = ?", $sql); $params = $qp->getQueryParams(); - $this->assertTrue(is_array($params)); + $this->assertInternalType('array', $params); $this->assertEquals(array(1 => 3, 2 => 'FIXED'), $params); $this->assertNotSame($profiles[0], $profiles[1]); @@ -173,12 +173,12 @@ public function testProfilerPreparedStatementWithBoundParams() $status = 'VERIFIED'; $stmt->execute(); $results = $stmt->fetchAll(); - $this->assertTrue(is_array($results)); + $this->assertInternalType('array', $results); $this->assertEquals(2, $results[0]['bug_id']); // analyze query profiles $profiles = $this->_db->getProfiler()->getQueryProfiles(); - $this->assertTrue(is_array($profiles), 'Expected array, got '.gettype($profiles)); + $this->assertInternalType('array', $profiles, 'Expected array, got '.gettype($profiles)); $this->assertEquals(1, count($profiles), 'Expected to find 1 profile'); $qp = $profiles[0]; $this->assertTrue($qp instanceof Zend_Db_Profiler_Query); @@ -187,7 +187,7 @@ public function testProfilerPreparedStatementWithBoundParams() $sql = $qp->getQuery(); $this->assertContains(" = ?", $sql); $params = $qp->getQueryParams(); - $this->assertTrue(is_array($params)); + $this->assertInternalType('array', $params); $this->assertEquals(array(1 => 2, 2 => 'VERIFIED'), $params); // execute query a second time @@ -195,12 +195,12 @@ public function testProfilerPreparedStatementWithBoundParams() $status = 'FIXED'; $stmt->execute(); $results = $stmt->fetchAll(); - $this->assertTrue(is_array($results)); + $this->assertInternalType('array', $results); $this->assertEquals(3, $results[0]['bug_id']); // analyze query profiles $profiles = $this->_db->getProfiler()->getQueryProfiles(); - $this->assertTrue(is_array($profiles), 'Expected array, got '.gettype($profiles)); + $this->assertInternalType('array', $profiles, 'Expected array, got '.gettype($profiles)); $this->assertEquals(2, count($profiles), 'Expected to find 2 profiles'); $qp = $profiles[1]; $this->assertTrue($qp instanceof Zend_Db_Profiler_Query); @@ -209,7 +209,7 @@ public function testProfilerPreparedStatementWithBoundParams() $sql = $qp->getQuery(); $this->assertContains(" = ?", $sql); $params = $qp->getQueryParams(); - $this->assertTrue(is_array($params)); + $this->assertInternalType('array', $params); $this->assertEquals(array(1 => 3, 2 => 'FIXED'), $params); } @@ -235,7 +235,7 @@ protected function _testProfilerSetFilterQueryTypeCommon($queryType) $this->_db->query("UPDATE $bugs SET $bug_status = ?", array('FIXED')); $qps = $prof->getQueryProfiles(); - $this->assertTrue(is_array($qps), 'Expecting some query profiles, got none'); + $this->assertInternalType('array', $qps, 'Expecting some query profiles, got none'); foreach ($qps as $qp) { $qtype = $qp->getQueryType(); $this->assertEquals($queryType, $qtype, diff --git a/tests/Zend/Db/Select/MysqliTest.php b/tests/Zend/Db/Select/MysqliTest.php index f05070fc79..c62db7c07f 100644 --- a/tests/Zend/Db/Select/MysqliTest.php +++ b/tests/Zend/Db/Select/MysqliTest.php @@ -47,10 +47,11 @@ public function getDriver() * Mysqli does not support named binds * ZF-2017: Test bind use of the Zend_Db_Select class. * @group ZF-2017 - * @expectedException Zend_Db_Statement_Exception */ public function testSelectQueryWithBinds() { + $this->expectException(\Zend_Db_Statement_Exception::class); + parent::testSelectQueryWithBinds(); } diff --git a/tests/Zend/Db/Select/TestCommon.php b/tests/Zend/Db/Select/TestCommon.php index 0b02e919ee..464cf297ab 100644 --- a/tests/Zend/Db/Select/TestCommon.php +++ b/tests/Zend/Db/Select/TestCommon.php @@ -1580,7 +1580,7 @@ public function testSelectGetPartAndReset() $select->reset(); // reset the whole object $from = $select->getPart(Zend_Db_Select::FROM); - $this->assertTrue(empty($from)); + $this->assertEmpty($from); } /** @@ -1700,7 +1700,7 @@ public function testSerializeSelect() /* checks if the adapter has effectively gotten serialized, no exceptions are thrown here, so it's all right */ $serialize = serialize($this->_select()); - $this->assertTrue(is_string($serialize)); + $this->assertInternalType('string', $serialize); } /** diff --git a/tests/Zend/Db/Statement/Db2Test.php b/tests/Zend/Db/Statement/Db2Test.php index 24b2e4663c..c5270cabe9 100644 --- a/tests/Zend/Db/Statement/Db2Test.php +++ b/tests/Zend/Db/Statement/Db2Test.php @@ -62,7 +62,7 @@ public function testStatementColumnCountForSelect() $n = $stmt->columnCount(); $stmt->closeCursor(); - $this->assertTrue(is_int($n)); + $this->assertInternalType('int', $n); $this->assertEquals(2, $n); } diff --git a/tests/Zend/Db/Statement/MysqliTest.php b/tests/Zend/Db/Statement/MysqliTest.php index 83e1c3fd97..3e5b528b5f 100644 --- a/tests/Zend/Db/Statement/MysqliTest.php +++ b/tests/Zend/Db/Statement/MysqliTest.php @@ -158,7 +158,7 @@ public function testStatementRowCount() $stmt = $this->_db->prepare("DELETE FROM $products WHERE $product_id = 1"); $n = $stmt->rowCount(); - $this->assertTrue(is_int($n)); + $this->assertInternalType('int', $n); $this->assertEquals(-1, $n, 'Expecting row count to be -1 before executing query'); $stmt->execute(); @@ -166,7 +166,7 @@ public function testStatementRowCount() $n = $stmt->rowCount(); $stmt->closeCursor(); - $this->assertTrue(is_int($n)); + $this->assertInternalType('int', $n); $this->assertEquals(1, $n, 'Expected row count to be one after executing query'); } @@ -233,7 +233,7 @@ public function testStatementExceptionShouldContainErrorCode() $stmt = $this->_db->query($sql); $this->fail('Expected to catch Zend_Db_Statement_Exception'); } catch (Zend_Exception $e) { - $this->assertTrue(is_int($e->getCode())); + $this->assertInternalType('int', $e->getCode()); } } @@ -293,7 +293,7 @@ public function testNumberOfBoundParamsDoesNotMatchNumberOfTokens() $this->fail('Bounding params failed: ' . $e->getMessage()); } $result = $stmt->fetch(); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertEquals(5, count($result)); $this->assertEquals(1, $result['object_id']); $this->assertEquals(1, $result['object_type']); diff --git a/tests/Zend/Db/Statement/OracleTest.php b/tests/Zend/Db/Statement/OracleTest.php index 51f98e77a9..aba791e455 100644 --- a/tests/Zend/Db/Statement/OracleTest.php +++ b/tests/Zend/Db/Statement/OracleTest.php @@ -116,9 +116,9 @@ public function testStatementReturnNullWithEmptyField() ->where("$product_id = 4"); $result = $this->_db->fetchAll($select); - $this->assertTrue(array_key_exists('product_name', $result[0]), 'fetchAll must return null for empty fields with Oracle'); + $this->assertArrayHasKey('product_name', $result[0], 'fetchAll must return null for empty fields with Oracle'); $result = $this->_db->fetchRow($select); - $this->assertTrue(array_key_exists('product_name', $result), 'fetchRow must return null for empty fields with Oracle'); + $this->assertArrayHasKey('product_name', $result, 'fetchRow must return null for empty fields with Oracle'); } public function testStatementSetFetchModeBoth() diff --git a/tests/Zend/Db/Statement/Pdo/IbmTest.php b/tests/Zend/Db/Statement/Pdo/IbmTest.php index c3a9cd353d..bf614aa11c 100644 --- a/tests/Zend/Db/Statement/Pdo/IbmTest.php +++ b/tests/Zend/Db/Statement/Pdo/IbmTest.php @@ -76,7 +76,7 @@ public function testStatementColumnCountForSelect() $n = $stmt->columnCount(); $stmt->closeCursor(); - $this->assertTrue(is_int($n)); + $this->assertInternalType('int', $n); $this->assertEquals(2, $n); } diff --git a/tests/Zend/Db/Statement/Pdo/TestCommon.php b/tests/Zend/Db/Statement/Pdo/TestCommon.php index 730145cbe8..24a428fd98 100644 --- a/tests/Zend/Db/Statement/Pdo/TestCommon.php +++ b/tests/Zend/Db/Statement/Pdo/TestCommon.php @@ -81,7 +81,7 @@ public function testStatementIsIterableThroughtForeach() foreach ($stmt as $test) { $this->assertTrue($test instanceof stdClass); } - $this->assertTrue(is_int(iterator_count($stmt))); + $this->assertInternalType('int', iterator_count($stmt)); } public function testStatementConstructExceptionBadSql() diff --git a/tests/Zend/Db/Statement/SqlsrvTest.php b/tests/Zend/Db/Statement/SqlsrvTest.php index 5816849050..860acf7fd5 100644 --- a/tests/Zend/Db/Statement/SqlsrvTest.php +++ b/tests/Zend/Db/Statement/SqlsrvTest.php @@ -183,7 +183,7 @@ public function testStatementErrorInfo() $errors = $stmt->errorInfo(); $this->assertEquals(2, count($errors)); $this->assertEquals($stmt->errorCode(), $errors[0]); - $this->assertTrue(is_string($errors[1])); + $this->assertInternalType('string', $errors[1]); } public function getDriver() diff --git a/tests/Zend/Db/Statement/StaticTest.php b/tests/Zend/Db/Statement/StaticTest.php index f534c1339d..6df58a405e 100644 --- a/tests/Zend/Db/Statement/StaticTest.php +++ b/tests/Zend/Db/Statement/StaticTest.php @@ -32,7 +32,7 @@ * @group Zend_Db * @group Zend_Db_Statement */ -class Zend_Db_Statement_StaticTest extends PHPUnit_Framework_TestCase +class Zend_Db_Statement_StaticTest extends PHPUnit\Framework\TestCase { public function testStatic() diff --git a/tests/Zend/Db/Statement/TestCommon.php b/tests/Zend/Db/Statement/TestCommon.php index 334c3ed348..08fa0195b3 100644 --- a/tests/Zend/Db/Statement/TestCommon.php +++ b/tests/Zend/Db/Statement/TestCommon.php @@ -111,8 +111,8 @@ public function testStatementRowCount() $stmt = $this->_db->prepare("DELETE FROM $products WHERE $product_id = 1"); $n = $stmt->rowCount(); - $this->assertTrue(is_int($n)); - $this->assertTrue(is_int($n)); + $this->assertInternalType('int', $n); + $this->assertInternalType('int', $n); $this->assertEquals(0, $n, 'Expecting row count to be 0 before executing query'); $stmt->execute(); @@ -120,7 +120,7 @@ public function testStatementRowCount() $n = $stmt->rowCount(); $stmt->closeCursor(); - $this->assertTrue(is_int($n)); + $this->assertInternalType('int', $n); $this->assertEquals(1, $n, 'Expected row count to be one after executing query'); } @@ -139,7 +139,7 @@ public function testStatementColumnCountForSelect() $n = $stmt->columnCount(); $stmt->closeCursor(); - $this->assertTrue(is_int($n)); + $this->assertInternalType('int', $n); $this->assertEquals(2, $n); } @@ -426,7 +426,7 @@ public function testStatementFetchAllStyleColumnWithArg() $result = $stmt->fetchAll(Zend_Db::FETCH_COLUMN, 1); $this->assertEquals(2, count($result)); - $this->assertTrue(is_string($result[0])); + $this->assertInternalType('string', $result[0]); $this->assertEquals('Linux', $result[0]); $this->assertEquals('OS X', $result[1]); } @@ -527,7 +527,7 @@ public function testStatementFetchStyleNum() $result = $stmt->fetch(Zend_Db::FETCH_NUM); $stmt->closeCursor(); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertEquals('Linux', $result[1]); $this->assertFalse(isset($result['product_name'])); } @@ -541,7 +541,7 @@ public function testStatementFetchStyleAssoc() $result = $stmt->fetch(Zend_Db::FETCH_ASSOC); $stmt->closeCursor(); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertEquals('Linux', $result['product_name']); $this->assertFalse(isset($result[1])); } @@ -555,7 +555,7 @@ public function testStatementFetchStyleBoth() $result = $stmt->fetch(Zend_Db::FETCH_BOTH); $stmt->closeCursor(); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertEquals('Linux', $result[1]); $this->assertEquals('Linux', $result['product_name']); } @@ -805,7 +805,7 @@ public function testStatementGetColumnMeta() $stmt->execute(); for ($i = 0; $i < $stmt->columnCount(); ++$i) { $meta = $stmt->getColumnMeta($i); - $this->assertTrue(is_array($meta)); + $this->assertInternalType('array', $meta); foreach ($this->_getColumnMetaKeys as $key) { if ($key == 'table' && version_compare(PHP_VERSION, '5.2.0', '<')) { continue; diff --git a/tests/Zend/Db/Table/Relationships/StaticTest.php b/tests/Zend/Db/Table/Relationships/StaticTest.php index 337ed81255..28f56636df 100644 --- a/tests/Zend/Db/Table/Relationships/StaticTest.php +++ b/tests/Zend/Db/Table/Relationships/StaticTest.php @@ -22,7 +22,7 @@ /** - * PHPUnit_Framework_TestCase + * PHPUnit\Framework\TestCase */ /** @@ -40,7 +40,7 @@ * @group Zend_Db_Table * @group Zend_Db_Table_Relationships */ -class Zend_Db_Table_Relationships_StaticTest extends PHPUnit_Framework_TestCase +class Zend_Db_Table_Relationships_StaticTest extends PHPUnit\Framework\TestCase { public function testTableRelationshipsFindDependentMagic() diff --git a/tests/Zend/Db/Table/Row/StaticTest.php b/tests/Zend/Db/Table/Row/StaticTest.php index c7279b7b73..86207e20b2 100644 --- a/tests/Zend/Db/Table/Row/StaticTest.php +++ b/tests/Zend/Db/Table/Row/StaticTest.php @@ -36,7 +36,7 @@ * @group Zend_Db_Table * @group Zend_Db_Table_Row */ -class Zend_Db_Table_Row_StaticTest extends PHPUnit_Framework_TestCase +class Zend_Db_Table_Row_StaticTest extends PHPUnit\Framework\TestCase { public function testTableRowTransformColumnNotUsedInConstructor() { diff --git a/tests/Zend/Db/Table/Row/TestCommon.php b/tests/Zend/Db/Table/Row/TestCommon.php index 074e308be2..c97f8cef01 100644 --- a/tests/Zend/Db/Table/Row/TestCommon.php +++ b/tests/Zend/Db/Table/Row/TestCommon.php @@ -174,7 +174,7 @@ public function testTableRowToArray() $a = $row1->toArray(); - $this->assertTrue(is_array($a)); + $this->assertInternalType('array', $a); // fix for #ZF-1898 $arrayObject = new ArrayObject($row1->toArray(),ArrayObject::ARRAY_AS_PROPS); @@ -252,7 +252,7 @@ public function testTableRowMagicUnsetWhenUnsettingPkValueThrowsException() { $table = $this->_table['bugs']; $row = $table->find(1)->current(); - $this->setExpectedException('Zend_Db_Table_Row_Exception'); + $this->expectException('Zend_Db_Table_Row_Exception'); unset($row->bug_id); } diff --git a/tests/Zend/Db/Table/Rowset/StaticTest.php b/tests/Zend/Db/Table/Rowset/StaticTest.php index f3a124276c..7e7b8f17b6 100644 --- a/tests/Zend/Db/Table/Rowset/StaticTest.php +++ b/tests/Zend/Db/Table/Rowset/StaticTest.php @@ -33,7 +33,7 @@ * @group Zend_Db_Table * @group Zend_Db_Table_Rowset */ -class Zend_Db_Table_Rowset_StaticTest extends PHPUnit_Framework_TestCase +class Zend_Db_Table_Rowset_StaticTest extends PHPUnit\Framework\TestCase { public function testStatic() diff --git a/tests/Zend/Db/Table/Rowset/TestCommon.php b/tests/Zend/Db/Table/Rowset/TestCommon.php index 28c223ce91..25a6a01b3c 100644 --- a/tests/Zend/Db/Table/Rowset/TestCommon.php +++ b/tests/Zend/Db/Table/Rowset/TestCommon.php @@ -175,9 +175,9 @@ public function testTableRowsetToArray() $a = $rows->toArray(); - $this->assertTrue(is_array($a)); + $this->assertInternalType('array', $a); $this->assertEquals(count($a), count($rows)); - $this->assertTrue(is_array($a[0])); + $this->assertInternalType('array', $a[0]); $this->assertEquals(8, count($a[0])); $this->assertEquals('foo', $a[0][$bug_description]); } @@ -322,7 +322,8 @@ public function testTableRowsetThrowsExceptionOnInvalidSeek() $rowset = $table->fetchAll('bug_id IN (1,2,3,4)', 'bug_id ASC'); $rowset->seek(3); - $this->setExpectedException('Zend_Db_Table_Rowset_Exception', 'Illegal index 4'); + $this->expectException('Zend_Db_Table_Rowset_Exception'); + $this->expectExceptionMessage('Illegal index 4'); $rowset->seek(4); } @@ -335,7 +336,8 @@ public function testTableRowsetThrowsExceptionOnInvalidGetRow() $rowset = $table->fetchAll('bug_id IN (1,2,3,4)', 'bug_id ASC'); $rowset->getRow(3); - $this->setExpectedException('Zend_Db_Table_Rowset_Exception', 'No row could be found at position 4'); + $this->expectException('Zend_Db_Table_Rowset_Exception'); + $this->expectExceptionMessage('No row could be found at position 4'); $rowset->getRow(4); } diff --git a/tests/Zend/Db/Table/Select/MysqliTest.php b/tests/Zend/Db/Table/Select/MysqliTest.php index f3d358fe15..20c9620071 100644 --- a/tests/Zend/Db/Table/Select/MysqliTest.php +++ b/tests/Zend/Db/Table/Select/MysqliTest.php @@ -47,10 +47,11 @@ public function getDriver() * Mysqli does not support named binds * ZF-2017: Test bind use of the Zend_Db_Select class. * @group ZF-2017 - * @expectedException Zend_Db_Statement_Exception */ public function testSelectQueryWithBinds() { + $this->expectException(\Zend_Db_Statement_Exception::class); + parent::testSelectQueryWithBinds(); } diff --git a/tests/Zend/Db/Table/StaticTest.php b/tests/Zend/Db/Table/StaticTest.php index 3cc1dabb59..55cf651dc1 100644 --- a/tests/Zend/Db/Table/StaticTest.php +++ b/tests/Zend/Db/Table/StaticTest.php @@ -35,7 +35,7 @@ * @group Zend_Db * @group Zend_Db_Table */ -class Zend_Db_Table_StaticTest extends PHPUnit_Framework_TestCase +class Zend_Db_Table_StaticTest extends PHPUnit\Framework\TestCase { public function testStatic() diff --git a/tests/Zend/Db/Table/TestCommon.php b/tests/Zend/Db/Table/TestCommon.php index e5ede7b6a9..11ce8c7c0b 100644 --- a/tests/Zend/Db/Table/TestCommon.php +++ b/tests/Zend/Db/Table/TestCommon.php @@ -751,7 +751,7 @@ public function testTableInsertNaturalCompound() 'product_id' => 1 ); $primary = $table->insert($row); - $this->assertTrue(is_array($primary)); + $this->assertInternalType('array', $primary); $this->assertEquals(2, count($primary)); $this->assertEquals(array(2, 1), array_values($primary)); } @@ -856,17 +856,17 @@ public function testTableInsertWithEmptyValueAsPrimaryKey() // empty string $row['bug_id'] = ''; $insertResult = $table->insert($row); - $this->assertTrue(is_numeric($insertResult), 'Empty string did not return assigned primary key'); + $this->assertInternalType('numeric', $insertResult, 'Empty string did not return assigned primary key'); // false (bool) $row['bug_id'] = false; $insertResult = $table->insert($row); - $this->assertTrue(is_numeric($insertResult), 'Bool false did not return assigned primary key'); + $this->assertInternalType('numeric', $insertResult, 'Bool false did not return assigned primary key'); // empty array $row['bug_id'] = array(); $insertResult = $table->insert($row); - $this->assertTrue(is_numeric($insertResult), 'Empty array did not return assigned primary key'); + $this->assertInternalType('numeric', $insertResult, 'Empty array did not return assigned primary key'); // zero '0' $row['bug_id'] = '0'; @@ -1414,8 +1414,8 @@ public function testTableSetDefaultMetadataCacheWriteAccess() try { $bugsTable = $this->_getTable('My_ZendDbTable_TableBugs'); $primary = $bugsTable->info(Zend_Db_Table_Abstract::PRIMARY); - $this->fail('Expected to catch PHPUnit_Framework_Error'); - } catch (PHPUnit_Framework_Error $e) { + $this->fail('Expected to catch PHPUnit\Framework\Error\Error'); + } catch (PHPUnit\Framework\Error\Error $e) { $this->assertEquals(E_USER_NOTICE, $e->getCode(), 'Error type not E_USER_NOTICE'); $this->assertEquals('Failed saving metadata to metadataCache', $e->getMessage()); } @@ -1683,7 +1683,7 @@ public function testTableCascadeRecurseDeleteUsingTableDeleteMethod() public function testSerialiseTable() { $table = $this->_table['products']; - $this->assertTrue(is_string(serialize($table))); + $this->assertInternalType('string', serialize($table)); } /** diff --git a/tests/Zend/Db/TestSetup.php b/tests/Zend/Db/TestSetup.php index fdae8a886a..a912d04a0e 100644 --- a/tests/Zend/Db/TestSetup.php +++ b/tests/Zend/Db/TestSetup.php @@ -39,7 +39,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Db */ -abstract class Zend_Db_TestSetup extends PHPUnit_Framework_TestCase +abstract class Zend_Db_TestSetup extends PHPUnit\Framework\TestCase { /** * @var Zend_Db_TestUtil_Common diff --git a/tests/Zend/DebugTest.php b/tests/Zend/DebugTest.php index c2333a3e39..212fc57707 100644 --- a/tests/Zend/DebugTest.php +++ b/tests/Zend/DebugTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Debug */ -class Zend_DebugTest extends PHPUnit_Framework_TestCase +class Zend_DebugTest extends PHPUnit\Framework\TestCase { public function testDebugDefaultSapi() diff --git a/tests/Zend/Dojo/BuildLayerTest.php b/tests/Zend/Dojo/BuildLayerTest.php index 0c926bb090..6ebc7eb4ba 100644 --- a/tests/Zend/Dojo/BuildLayerTest.php +++ b/tests/Zend/Dojo/BuildLayerTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Dojo */ -class Zend_Dojo_BuildLayerTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_BuildLayerTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -59,10 +59,11 @@ public function testViewShouldBeNullByDefault() } /** - * @expectedException Zend_Dojo_Exception */ public function testRetrievingDojoHelperShouldRaiseExceptionWhenNoViewPresent() { + $this->expectException(\Zend_Dojo_Exception::class); + $build = new Zend_Dojo_BuildLayer(); $build->getDojoHelper(); } @@ -128,10 +129,11 @@ public function testLayerNameShouldBeMutable() } /** - * @expectedException Zend_Dojo_Exception */ public function testSettingLayerNameToInvalidFormatShouldRaiseException() { + $this->expectException(\Zend_Dojo_Exception::class); + $build = new Zend_Dojo_BuildLayer(); $build->setLayerName('customFoo#bar'); } @@ -273,14 +275,14 @@ public function testProfilePrefixesAreEmptyByDefault() { $build = new Zend_Dojo_BuildLayer(); $prefixes = $build->getProfilePrefixes(); - $this->assertTrue(empty($prefixes)); + $this->assertEmpty($prefixes); } public function testProfilePrefixesIncludeLayerNamePrefix() { $build = new Zend_Dojo_BuildLayer(array('layerName' => 'foo.main')); $prefixes = $build->getProfilePrefixes(); - $this->assertTrue(array_key_exists('foo', $prefixes), var_export($prefixes, 1)); + $this->assertArrayHasKey('foo', $prefixes, var_export($prefixes, 1)); $this->assertEquals(array('foo', '../foo'), $prefixes['foo']); } @@ -291,9 +293,9 @@ public function testProfilePrefixesShouldIncludePrefixesOfAllRequiredModules() $build = new Zend_Dojo_BuildLayer(array('view' => $this->view)); $prefixes = $build->getProfilePrefixes(); - $this->assertTrue(array_key_exists('dijit', $prefixes), var_export($prefixes, 1)); + $this->assertArrayHasKey('dijit', $prefixes, var_export($prefixes, 1)); $this->assertEquals(array('dijit', '../dijit'), $prefixes['dijit']); - $this->assertTrue(array_key_exists('dojox', $prefixes), var_export($prefixes, 1)); + $this->assertArrayHasKey('dojox', $prefixes, var_export($prefixes, 1)); $this->assertEquals(array('dojox', '../dojox'), $prefixes['dojox']); } diff --git a/tests/Zend/Dojo/DataTest.php b/tests/Zend/Dojo/DataTest.php index 06ea5c0382..2b1fe8228d 100644 --- a/tests/Zend/Dojo/DataTest.php +++ b/tests/Zend/Dojo/DataTest.php @@ -30,7 +30,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Dojo */ -class Zend_Dojo_DataTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_DataTest extends PHPUnit\Framework\TestCase { public $dojoData; @@ -72,10 +72,11 @@ public function testIntegerIdentifierShouldBeAllowed() } /** - * @expectedException Zend_Dojo_Exception */ public function testSetIdentifierShouldThrowExceptionOnInvalidType() { + $this->expectException(\Zend_Dojo_Exception::class); + $this->dojoData->setIdentifier(true); } @@ -185,10 +186,10 @@ public function testAddItemShouldAllowSpecifyingIdentifier() $this->dojoData->addItem($item, 'foo'); $this->assertEquals(1, count($this->dojoData)); $stored = $this->dojoData->getItem('foo'); - $this->assertTrue(array_key_exists('id', $stored)); + $this->assertArrayHasKey('id', $stored); $this->assertEquals('foo', $stored['id']); foreach ($item as $key => $value) { - $this->assertTrue(array_key_exists($key, $stored)); + $this->assertArrayHasKey($key, $stored); $this->assertEquals($value, $stored[$key]); } } @@ -278,10 +279,11 @@ public function testAddItemsShouldAcceptTraversableObject() } /** - * @expectedException Zend_Dojo_Exception */ public function testAddItemsShouldThrowExceptionForInvalidItems() { + $this->expectException(\Zend_Dojo_Exception::class); + $this->dojoData->addItems('foo'); } @@ -320,7 +322,7 @@ public function testGetItemsShouldReturnArrayOfItems() { $this->testAddItemsShouldAcceptArray(); $items = $this->dojoData->getItems(); - $this->assertTrue(is_array($items)); + $this->assertInternalType('array', $items); } public function testConstructorShouldSetIdentifierItemsAndLabelWhenPassed() @@ -354,8 +356,8 @@ public function testShouldSerializeToArray() { $this->testAddItemsShouldAcceptTraversableObject(); $array = $this->dojoData->toArray(); - $this->assertTrue(is_array($array)); - $this->assertTrue(array_key_exists('identifier', $array)); + $this->assertInternalType('array', $array); + $this->assertArrayHasKey('identifier', $array); $this->assertEquals($this->dojoData->getIdentifier(), $array['identifier']); $this->assertEquals(array_values($this->dojoData->getItems()), $array['items']); } @@ -365,8 +367,8 @@ public function testSerializingToArrayShouldIncludeLabelIfPresent() $this->testShouldSerializeToArray(); $this->dojoData->setLabel('title'); $array = $this->dojoData->toArray(); - $this->assertTrue(is_array($array)); - $this->assertTrue(array_key_exists('label', $array)); + $this->assertInternalType('array', $array); + $this->assertArrayHasKey('label', $array); $this->assertEquals($this->dojoData->getLabel(), $array['label']); } @@ -416,7 +418,7 @@ public function testShouldImplementIterator() $this->assertTrue($this->dojoData instanceof Iterator); $this->testAddItemsShouldAcceptTraversableObject(); foreach ($this->dojoData as $key => $item) { - $this->assertTrue(is_array($item)); + $this->assertInternalType('array', $item); $this->assertEquals($key, $item['id']); } } @@ -447,10 +449,11 @@ public function testShouldAllowPopulationFromJson() } /** - * @expectedException Zend_Dojo_Exception */ public function testFromJsonShouldThrowExceptionOnInvalidData() { + $this->expectException(\Zend_Dojo_Exception::class); + $this->dojoData->fromJson(new stdClass); } @@ -470,8 +473,8 @@ public function testDataContainerShouldAcceptAdditionalMetadataPerKey() public function testDataContainerShouldAcceptAdditionalMetadataEnMasse() { $metadata = $this->dojoData->getMetadata(); - $this->assertTrue(is_array($metadata)); - $this->assertTrue(empty($metadata)); + $this->assertInternalType('array', $metadata); + $this->assertEmpty($metadata); $metadata = array('numRows' => 100, 'sort' => 'name'); $this->dojoData->setMetadata($metadata); @@ -488,8 +491,8 @@ public function testDataContainerShouldAllowClearingIndividualMetadataItems() $this->dojoData->clearMetadata('numRows'); $metadata = $this->dojoData->getMetadata(); $this->assertEquals(1, count($metadata)); - $this->assertFalse(array_key_exists('numRows', $metadata)); - $this->assertTrue(array_key_exists('sort', $metadata)); + $this->assertArrayNotHasKey('numRows', $metadata); + $this->assertArrayHasKey('sort', $metadata); } /** @@ -511,8 +514,8 @@ public function testSerializingToArrayShouldIncludeMetadata() $this->testDataContainerShouldAcceptAdditionalMetadataEnMasse(); $this->dojoData->setIdentifier('id'); $array = $this->dojoData->toArray(); - $this->assertTrue(array_key_exists('numRows', $array)); - $this->assertTrue(array_key_exists('sort', $array)); + $this->assertArrayHasKey('numRows', $array); + $this->assertArrayHasKey('sort', $array); } } diff --git a/tests/Zend/Dojo/DojoTest.php b/tests/Zend/Dojo/DojoTest.php index 3fd50ce961..785d6f2383 100644 --- a/tests/Zend/Dojo/DojoTest.php +++ b/tests/Zend/Dojo/DojoTest.php @@ -45,7 +45,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Dojo */ -class Zend_Dojo_DojoTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_DojoTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -92,27 +92,27 @@ public function testEnableFormShouldSetAppropriateDecoratorAndElementPaths() $decPluginLoader = $form->getPluginLoader('decorator'); $paths = $decPluginLoader->getPaths('Zend_Dojo_Form_Decorator'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $elPluginLoader = $form->getPluginLoader('element'); $paths = $elPluginLoader->getPaths('Zend_Dojo_Form_Element'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $decPluginLoader = $form->baz->getPluginLoader('decorator'); $paths = $decPluginLoader->getPaths('Zend_Dojo_Form_Decorator'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $decPluginLoader = $form->foobar->getPluginLoader(); $paths = $decPluginLoader->getPaths('Zend_Dojo_Form_Decorator'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $decPluginLoader = $form->sub->getPluginLoader('decorator'); $paths = $decPluginLoader->getPaths('Zend_Dojo_Form_Decorator'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $elPluginLoader = $form->sub->getPluginLoader('element'); $paths = $elPluginLoader->getPaths('Zend_Dojo_Form_Element'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } public function testEnableFormShouldSetAppropriateDefaultDisplayGroup() @@ -129,7 +129,7 @@ public function testEnableFormShouldSetAppropriateViewHelperPaths() $view = $form->getView(); $helperLoader = $view->getPluginLoader('helper'); $paths = $helperLoader->getPaths('Zend_Dojo_View_Helper'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } public function testEnableViewShouldSetAppropriateViewHelperPaths() @@ -138,6 +138,6 @@ public function testEnableViewShouldSetAppropriateViewHelperPaths() Zend_Dojo::enableView($view); $helperLoader = $view->getPluginLoader('helper'); $paths = $helperLoader->getPaths('Zend_Dojo_View_Helper'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } } diff --git a/tests/Zend/Dojo/Form/Decorator/AccordionContainerTest.php b/tests/Zend/Dojo/Form/Decorator/AccordionContainerTest.php index 404bf58495..4408e5bc4f 100644 --- a/tests/Zend/Dojo/Form/Decorator/AccordionContainerTest.php +++ b/tests/Zend/Dojo/Form/Decorator/AccordionContainerTest.php @@ -46,7 +46,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Decorator_AccordionContainerTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Decorator_AccordionContainerTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/Form/Decorator/AccordionPaneTest.php b/tests/Zend/Dojo/Form/Decorator/AccordionPaneTest.php index dd68fccc89..e7475f0830 100644 --- a/tests/Zend/Dojo/Form/Decorator/AccordionPaneTest.php +++ b/tests/Zend/Dojo/Form/Decorator/AccordionPaneTest.php @@ -46,7 +46,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Decorator_AccordionPaneTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Decorator_AccordionPaneTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/Form/Decorator/BorderContainerTest.php b/tests/Zend/Dojo/Form/Decorator/BorderContainerTest.php index 26a85a74d9..6bc2cfa1c2 100644 --- a/tests/Zend/Dojo/Form/Decorator/BorderContainerTest.php +++ b/tests/Zend/Dojo/Form/Decorator/BorderContainerTest.php @@ -46,7 +46,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Decorator_BorderContainerTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Decorator_BorderContainerTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/Form/Decorator/DijitContainerTest.php b/tests/Zend/Dojo/Form/Decorator/DijitContainerTest.php index 373c79fbf5..848dc5b757 100644 --- a/tests/Zend/Dojo/Form/Decorator/DijitContainerTest.php +++ b/tests/Zend/Dojo/Form/Decorator/DijitContainerTest.php @@ -49,7 +49,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Decorator_DijitContainerTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Decorator_DijitContainerTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -118,16 +118,16 @@ public function handleError($errno, $errstr) public function testRetrievingElementAttributesShouldOmitDijitParams() { $attribs = $this->decorator->getAttribs(); - $this->assertTrue(is_array($attribs)); - $this->assertFalse(array_key_exists('dijitParams', $attribs)); + $this->assertInternalType('array', $attribs); + $this->assertArrayNotHasKey('dijitParams', $attribs); } public function testRetrievingDijitParamsShouldOmitNormalAttributes() { $params = $this->decorator->getDijitParams(); - $this->assertTrue(is_array($params)); - $this->assertFalse(array_key_exists('class', $params)); - $this->assertFalse(array_key_exists('style', $params)); + $this->assertInternalType('array', $params); + $this->assertArrayNotHasKey('class', $params); + $this->assertArrayNotHasKey('style', $params); } public function testLegendShouldBeUsedAsTitleByDefault() @@ -165,7 +165,7 @@ public function testRenderingShouldTriggerErrorWhenDuplicateDijitDetected() $html = $this->decorator->render(''); restore_error_handler(); - $this->assertFalse(empty($this->errors), var_export($this->errors, 1)); + $this->assertNotEmpty($this->errors, var_export($this->errors, 1)); $found = false; foreach ($this->errors as $error) { if (strstr($error, 'Duplicate')) { @@ -183,10 +183,11 @@ public function testRenderingShouldCreateDijit() } /** - * @expectedException Zend_Form_Decorator_Exception */ public function testAbsenceOfHelperShouldRaiseException() { + $this->expectException(\Zend_Form_Decorator_Exception::class); + $decorator = new Zend_Dojo_Form_Decorator_DijitContainerTest_Example(); $helper = $decorator->getHelper(); } diff --git a/tests/Zend/Dojo/Form/Decorator/DijitElementTest.php b/tests/Zend/Dojo/Form/Decorator/DijitElementTest.php index 496c3c1c81..446cbc772b 100644 --- a/tests/Zend/Dojo/Form/Decorator/DijitElementTest.php +++ b/tests/Zend/Dojo/Form/Decorator/DijitElementTest.php @@ -46,7 +46,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Decorator_DijitElementTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Decorator_DijitElementTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -116,20 +116,20 @@ public function handleError($errno, $errstr) public function testRetrievingElementAttributesShouldOmitDijitParams() { $attribs = $this->decorator->getElementAttribs(); - $this->assertTrue(is_array($attribs)); - $this->assertFalse(array_key_exists('dijitParams', $attribs)); - $this->assertFalse(array_key_exists('propercase', $attribs)); - $this->assertFalse(array_key_exists('trim', $attribs)); + $this->assertInternalType('array', $attribs); + $this->assertArrayNotHasKey('dijitParams', $attribs); + $this->assertArrayNotHasKey('propercase', $attribs); + $this->assertArrayNotHasKey('trim', $attribs); } public function testRetrievingDijitParamsShouldOmitNormalAttributes() { $params = $this->decorator->getDijitParams(); - $this->assertTrue(is_array($params)); - $this->assertFalse(array_key_exists('class', $params)); - $this->assertFalse(array_key_exists('style', $params)); - $this->assertFalse(array_key_exists('value', $params)); - $this->assertFalse(array_key_exists('label', $params)); + $this->assertInternalType('array', $params); + $this->assertArrayNotHasKey('class', $params); + $this->assertArrayNotHasKey('style', $params); + $this->assertArrayNotHasKey('value', $params); + $this->assertArrayNotHasKey('label', $params); } public function testRenderingShouldEnableDojo() @@ -145,7 +145,7 @@ public function testRenderingShouldTriggerErrorWhenDuplicateDijitDetected() $handler = set_error_handler(array($this, 'handleError')); $html = $this->decorator->render(''); restore_error_handler(); - $this->assertFalse(empty($this->errors), var_export($this->errors, 1)); + $this->assertNotEmpty($this->errors, var_export($this->errors, 1)); $found = false; foreach ($this->errors as $error) { if (strstr($error, 'Duplicate')) { @@ -164,10 +164,11 @@ public function testShouldAllowAddingAndRetrievingIndividualDijitParams() } /** - * @expectedException Zend_Form_Decorator_Exception */ public function testRenderingShouldThrowExceptionWhenNoViewObjectRegistered() { + $this->expectException(\Zend_Form_Decorator_Exception::class); + $element = new Zend_Dojo_Form_Element_TextBox( 'foo', array( diff --git a/tests/Zend/Dojo/Form/Decorator/DijitFormTest.php b/tests/Zend/Dojo/Form/Decorator/DijitFormTest.php index 1ed45ee621..b16c3f0ce2 100644 --- a/tests/Zend/Dojo/Form/Decorator/DijitFormTest.php +++ b/tests/Zend/Dojo/Form/Decorator/DijitFormTest.php @@ -46,7 +46,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Decorator_DijitFormTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Decorator_DijitFormTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/Form/Decorator/SplitContainerTest.php b/tests/Zend/Dojo/Form/Decorator/SplitContainerTest.php index be811c7a2c..b29f54288c 100644 --- a/tests/Zend/Dojo/Form/Decorator/SplitContainerTest.php +++ b/tests/Zend/Dojo/Form/Decorator/SplitContainerTest.php @@ -46,7 +46,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Decorator_SplitContainerTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Decorator_SplitContainerTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/Form/Decorator/StackContainerTest.php b/tests/Zend/Dojo/Form/Decorator/StackContainerTest.php index 4ebbf1e834..117a5a15c7 100644 --- a/tests/Zend/Dojo/Form/Decorator/StackContainerTest.php +++ b/tests/Zend/Dojo/Form/Decorator/StackContainerTest.php @@ -46,7 +46,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Decorator_StackContainerTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Decorator_StackContainerTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/Form/Decorator/TabContainerTest.php b/tests/Zend/Dojo/Form/Decorator/TabContainerTest.php index 5277d4f855..0124c0d354 100644 --- a/tests/Zend/Dojo/Form/Decorator/TabContainerTest.php +++ b/tests/Zend/Dojo/Form/Decorator/TabContainerTest.php @@ -46,7 +46,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Decorator_TabContainerTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Decorator_TabContainerTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/Form/Element/ButtonTest.php b/tests/Zend/Dojo/Form/Element/ButtonTest.php index efcebca2d6..1fee130354 100644 --- a/tests/Zend/Dojo/Form/Element/ButtonTest.php +++ b/tests/Zend/Dojo/Form/Element/ButtonTest.php @@ -46,7 +46,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Element_ButtonTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Element_ButtonTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/Form/Element/CheckBoxTest.php b/tests/Zend/Dojo/Form/Element/CheckBoxTest.php index c312af3b8a..eea6eb2204 100644 --- a/tests/Zend/Dojo/Form/Element/CheckBoxTest.php +++ b/tests/Zend/Dojo/Form/Element/CheckBoxTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Element_CheckBoxTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Element_CheckBoxTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/Form/Element/ComboBoxTest.php b/tests/Zend/Dojo/Form/Element/ComboBoxTest.php index 842b9a913c..2c6730fb09 100644 --- a/tests/Zend/Dojo/Form/Element/ComboBoxTest.php +++ b/tests/Zend/Dojo/Form/Element/ComboBoxTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Element_ComboBoxTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Element_ComboBoxTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -95,7 +95,7 @@ public function testSettingStoreIdShouldProxyToStoreDijitParam() $this->element->setStoreId('someStore'); $this->assertTrue($this->element->hasDijitParam('store')); $store = $this->element->getDijitParam('store'); - $this->assertTrue(array_key_exists('store', $store)); + $this->assertArrayHasKey('store', $store); $this->assertEquals('someStore', $store['store']); $this->assertEquals($this->element->getStoreId(), $store['store']); } @@ -105,7 +105,7 @@ public function testSettingStoreTypeShouldProxyToStoreDijitParam() $this->element->setStoreType('dojo.data.ItemFileReadStore'); $this->assertTrue($this->element->hasDijitParam('store')); $store = $this->element->getDijitParam('store'); - $this->assertTrue(array_key_exists('type', $store)); + $this->assertArrayHasKey('type', $store); $this->assertEquals('dojo.data.ItemFileReadStore', $store['type']); $this->assertEquals($this->element->getStoreType(), $store['type']); } @@ -115,7 +115,7 @@ public function testSettingStoreParamsShouldProxyToStoreDijitParam() $this->element->setStoreParams(array('url' => '/js/foo.json')); $this->assertTrue($this->element->hasDijitParam('store')); $store = $this->element->getDijitParam('store'); - $this->assertTrue(array_key_exists('params', $store)); + $this->assertArrayHasKey('params', $store); $this->assertEquals(array('url' => '/js/foo.json'), $store['params']); $this->assertEquals($this->element->getStoreParams(), $store['params']); } @@ -123,10 +123,10 @@ public function testSettingStoreParamsShouldProxyToStoreDijitParam() public function testAutocompleteAccessorsShouldProxyToDijitParams() { $this->assertFalse($this->element->getAutocomplete()); - $this->assertFalse(array_key_exists('autocomplete', $this->element->dijitParams)); + $this->assertArrayNotHasKey('autocomplete', $this->element->dijitParams); $this->element->setAutocomplete(true); $this->assertTrue($this->element->getAutocomplete()); - $this->assertTrue(array_key_exists('autocomplete', $this->element->dijitParams)); + $this->assertArrayHasKey('autocomplete', $this->element->dijitParams); } /**#@+ diff --git a/tests/Zend/Dojo/Form/Element/CurrencyTextBoxTest.php b/tests/Zend/Dojo/Form/Element/CurrencyTextBoxTest.php index 723e124b86..f4604d3759 100644 --- a/tests/Zend/Dojo/Form/Element/CurrencyTextBoxTest.php +++ b/tests/Zend/Dojo/Form/Element/CurrencyTextBoxTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Element_CurrencyTextBoxTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Element_CurrencyTextBoxTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -110,7 +110,7 @@ public function testCurrencyAccessorsShouldProxyToDijitParams() public function testFractionalAccessorsShouldProxyToConstraints() { $this->assertFalse($this->element->getFractional()); - $this->assertFalse(array_key_exists('constraints', $this->element->dijitParams)); + $this->assertArrayNotHasKey('constraints', $this->element->dijitParams); $this->element->setFractional(true); $this->assertTrue($this->element->getFractional()); $this->assertEquals('true', $this->element->dijitParams['constraints']['fractional']); @@ -133,10 +133,11 @@ public function testSymbolMutatorShouldCastToStringAndUppercaseAndLimitTo3Chars( } /** - * @expectedException Zend_Form_Element_Exception */ public function testSymbolMutatorShouldRaiseExceptionWhenFewerThan3CharsProvided() { + $this->expectException(\Zend_Form_Element_Exception::class); + $this->element->setSymbol('$'); } diff --git a/tests/Zend/Dojo/Form/Element/DateTextBoxTest.php b/tests/Zend/Dojo/Form/Element/DateTextBoxTest.php index 261c51e9f3..9b5150835c 100644 --- a/tests/Zend/Dojo/Form/Element/DateTextBoxTest.php +++ b/tests/Zend/Dojo/Form/Element/DateTextBoxTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Element_DateTextBoxTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Element_DateTextBoxTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -97,11 +97,11 @@ public function testAmPmAccessorsShouldProxyToConstraints() { $this->assertFalse($this->element->getAmPm()); $constraints = $this->element->getConstraints(); - $this->assertFalse(array_key_exists('am,pm', $constraints)); + $this->assertArrayNotHasKey('am,pm', $constraints); $this->element->setAmPm(true); $this->assertTrue($this->element->getAmPm()); $constraints = $this->element->getConstraints(); - $this->assertTrue(array_key_exists('am,pm', $constraints)); + $this->assertArrayHasKey('am,pm', $constraints); $this->assertEquals('true', $this->element->dijitParams['constraints']['am,pm']); } @@ -109,11 +109,11 @@ public function testStrictAccessorsShouldProxyToConstraints() { $this->assertFalse($this->element->getStrict()); $constraints = $this->element->getConstraints(); - $this->assertFalse(array_key_exists('strict', $constraints)); + $this->assertArrayNotHasKey('strict', $constraints); $this->element->setStrict(true); $this->assertTrue($this->element->getStrict()); $constraints = $this->element->getConstraints(); - $this->assertTrue(array_key_exists('strict', $constraints)); + $this->assertArrayHasKey('strict', $constraints); $this->assertEquals('true', $this->element->dijitParams['constraints']['strict']); } @@ -121,7 +121,7 @@ public function testLocaleAccessorsShouldProxyToConstraints() { $this->assertNull($this->element->getLocale()); $constraints = $this->element->getConstraints(); - $this->assertFalse(array_key_exists('locale', $constraints)); + $this->assertArrayNotHasKey('locale', $constraints); $this->element->setLocale('en-US'); $this->assertEquals('en-US', $this->element->getLocale()); $constraints = $this->element->getConstraints(); @@ -132,7 +132,7 @@ public function testFormatLengthAccessorsShouldProxyToConstraints() { $this->assertNull($this->element->getFormatLength()); $constraints = $this->element->getConstraints(); - $this->assertFalse(array_key_exists('formatLength', $constraints)); + $this->assertArrayNotHasKey('formatLength', $constraints); $this->element->setFormatLength('long'); $this->assertEquals('long', $this->element->getFormatLength()); $constraints = $this->element->getConstraints(); @@ -140,10 +140,11 @@ public function testFormatLengthAccessorsShouldProxyToConstraints() } /** - * @expectedException Zend_Form_Element_Exception */ public function testFormatLengthMutatorShouldThrowExceptionWithInvalidFormatLength() { + $this->expectException(\Zend_Form_Element_Exception::class); + $this->element->setFormatLength('foobar'); } @@ -151,7 +152,7 @@ public function testSelectorAccessorsShouldProxyToConstraints() { $this->assertNull($this->element->getSelector()); $constraints = $this->element->getConstraints(); - $this->assertFalse(array_key_exists('selector', $constraints)); + $this->assertArrayNotHasKey('selector', $constraints); $this->element->setSelector('time'); $this->assertEquals('time', $this->element->getSelector()); $constraints = $this->element->getConstraints(); @@ -159,10 +160,11 @@ public function testSelectorAccessorsShouldProxyToConstraints() } /** - * @expectedException Zend_Form_Element_Exception */ public function testSelectorMutatorShouldThrowExceptionWithInvalidSelector() { + $this->expectException(\Zend_Form_Element_Exception::class); + $this->element->setSelector('foobar'); } diff --git a/tests/Zend/Dojo/Form/Element/DijitTest.php b/tests/Zend/Dojo/Form/Element/DijitTest.php index 2d2bb88640..870631e602 100644 --- a/tests/Zend/Dojo/Form/Element/DijitTest.php +++ b/tests/Zend/Dojo/Form/Element/DijitTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Element_DijitTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Element_DijitTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -107,8 +107,8 @@ public function testShouldAbstractDijitParameterManipulation() $this->assertFalse($this->element->hasDijitParam('foo')); $this->element->clearDijitParams(); $params = $this->element->getDijitParams(); - $this->assertTrue(empty($params)); - $this->assertTrue(empty($this->element->dijitParams)); + $this->assertEmpty($params); + $this->assertEmpty($this->element->dijitParams); } public function testDijitElementDecoratorShouldBeEnabledByDefault() @@ -138,6 +138,6 @@ public function testElementShouldDojoEnableViewObject() $view = $this->element->getView(); $loader = $view->getPluginLoader('helper'); $paths = $loader->getPaths('Zend_Dojo_View_Helper'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } } diff --git a/tests/Zend/Dojo/Form/Element/EditorTest.php b/tests/Zend/Dojo/Form/Element/EditorTest.php index 2b82f125ee..4dba3a28e9 100644 --- a/tests/Zend/Dojo/Form/Element/EditorTest.php +++ b/tests/Zend/Dojo/Form/Element/EditorTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Element_EditorTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Element_EditorTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -102,7 +102,7 @@ public function testShouldRenderEditorDijit() public function testShouldNotHaveCaptureEventsByDefault() { $events = $this->element->getCaptureEvents(); - $this->assertTrue(empty($events)); + $this->assertEmpty($events); } public function testCaptureEventAccessorsShouldProxyToDijitParams() @@ -121,7 +121,7 @@ public function testCaptureEventAccessorsShouldProxyToDijitParams() public function testShouldNotHaveEventsByDefault() { $events = $this->element->getEvents(); - $this->assertTrue(empty($events)); + $this->assertEmpty($events); } public function testEventAccessorsShouldProxyToDijitParams() @@ -140,7 +140,7 @@ public function testEventAccessorsShouldProxyToDijitParams() public function testShouldNotHavePluginsByDefault() { $plugins = $this->element->getPlugins(); - $this->assertTrue(empty($plugins)); + $this->assertEmpty($plugins); } public function testPluginAccessorsShouldProxyToDijitParams() @@ -219,7 +219,7 @@ public function testMinHeightAccessorsShouldProxyToDijitParams() public function testShouldNotHaveStyleSheetsByDefault() { $styleSheets = $this->element->getStyleSheets(); - $this->assertTrue(empty($styleSheets)); + $this->assertEmpty($styleSheets); } public function testStyleSheetAccessorsShouldProxyToDijitParams() @@ -280,7 +280,7 @@ public function testMinHeightDefaultMeasurementIsEm() public function testShouldNotHaveExtraPluginsByDefault() { $extraPlugins = $this->element->getExtraPlugins(); - $this->assertTrue(empty($extraPlugins)); + $this->assertEmpty($extraPlugins); } /** @group ZF-11511 */ diff --git a/tests/Zend/Dojo/Form/Element/FilteringSelectTest.php b/tests/Zend/Dojo/Form/Element/FilteringSelectTest.php index 010eac864c..771181ac45 100644 --- a/tests/Zend/Dojo/Form/Element/FilteringSelectTest.php +++ b/tests/Zend/Dojo/Form/Element/FilteringSelectTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Element_FilteringSelectTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Element_FilteringSelectTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/Form/Element/HorizontalSliderTest.php b/tests/Zend/Dojo/Form/Element/HorizontalSliderTest.php index c3fa9c8eed..3afbc62510 100644 --- a/tests/Zend/Dojo/Form/Element/HorizontalSliderTest.php +++ b/tests/Zend/Dojo/Form/Element/HorizontalSliderTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Element_HorizontalSliderTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Element_HorizontalSliderTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -96,7 +96,7 @@ public function getElement() public function testClickSelectAccessorsShouldProxyToDijitParams() { $this->assertFalse($this->element->getClickSelect()); - $this->assertFalse(array_key_exists('clickSelect', $this->element->dijitParams)); + $this->assertArrayNotHasKey('clickSelect', $this->element->dijitParams); $this->element->setClickSelect(true); $this->assertTrue($this->element->getClickSelect()); $this->assertTrue($this->element->dijitParams['clickSelect']); @@ -105,7 +105,7 @@ public function testClickSelectAccessorsShouldProxyToDijitParams() public function testIntermediateChangesAccessorsShouldProxyToDijitParams() { $this->assertFalse($this->element->getIntermediateChanges()); - $this->assertFalse(array_key_exists('intermediateChanges', $this->element->dijitParams)); + $this->assertArrayNotHasKey('intermediateChanges', $this->element->dijitParams); $this->element->setIntermediateChanges(true); $this->assertTrue($this->element->getIntermediateChanges()); $this->assertTrue($this->element->dijitParams['intermediateChanges']); @@ -114,7 +114,7 @@ public function testIntermediateChangesAccessorsShouldProxyToDijitParams() public function testShowButtonsAccessorsShouldProxyToDijitParams() { $this->assertFalse($this->element->getShowButtons()); - $this->assertFalse(array_key_exists('showButtons', $this->element->dijitParams)); + $this->assertArrayNotHasKey('showButtons', $this->element->dijitParams); $this->element->setShowButtons(true); $this->assertTrue($this->element->getShowButtons()); $this->assertTrue($this->element->dijitParams['showButtons']); @@ -123,7 +123,7 @@ public function testShowButtonsAccessorsShouldProxyToDijitParams() public function testDiscreteValuesAccessorsShouldProxyToDijitParams() { $this->assertNull($this->element->getDiscreteValues()); - $this->assertFalse(array_key_exists('discreteValues', $this->element->dijitParams)); + $this->assertArrayNotHasKey('discreteValues', $this->element->dijitParams); $this->element->setDiscreteValues(20); $this->assertEquals(20, $this->element->getDiscreteValues()); $this->assertEquals(20, $this->element->dijitParams['discreteValues']); @@ -132,7 +132,7 @@ public function testDiscreteValuesAccessorsShouldProxyToDijitParams() public function testMinimumAccessorsShouldProxyToDijitParams() { $this->assertNull($this->element->getMinimum()); - $this->assertFalse(array_key_exists('minimum', $this->element->dijitParams)); + $this->assertArrayNotHasKey('minimum', $this->element->dijitParams); $this->element->setMinimum(20); $this->assertEquals(20, $this->element->getMinimum()); $this->assertEquals(20, $this->element->dijitParams['minimum']); @@ -141,7 +141,7 @@ public function testMinimumAccessorsShouldProxyToDijitParams() public function testMaximumAccessorsShouldProxyToDijitParams() { $this->assertNull($this->element->getMaximum()); - $this->assertFalse(array_key_exists('maximum', $this->element->dijitParams)); + $this->assertArrayNotHasKey('maximum', $this->element->dijitParams); $this->element->setMaximum(20); $this->assertEquals(20, $this->element->getMaximum()); $this->assertEquals(20, $this->element->dijitParams['maximum']); @@ -150,7 +150,7 @@ public function testMaximumAccessorsShouldProxyToDijitParams() public function testPageIncrementAccessorsShouldProxyToDijitParams() { $this->assertNull($this->element->getPageIncrement()); - $this->assertFalse(array_key_exists('pageIncrement', $this->element->dijitParams)); + $this->assertArrayNotHasKey('pageIncrement', $this->element->dijitParams); $this->element->setPageIncrement(20); $this->assertEquals(20, $this->element->getPageIncrement()); $this->assertEquals(20, $this->element->dijitParams['pageIncrement']); @@ -165,7 +165,7 @@ public function testSettingTopDecorationDijitShouldProxyToTopDecorationDijitPara $test = $this->element->getTopDecoration(); $this->assertSame($topDecoration, $test); - $this->assertTrue(array_key_exists('dijit', $topDecoration)); + $this->assertArrayHasKey('dijit', $topDecoration); $this->assertEquals('HorizontalRule', $topDecoration['dijit']); } @@ -178,7 +178,7 @@ public function testSettingTopDecorationContainerShouldProxyToTopDecorationDijit $test = $this->element->getTopDecoration(); $this->assertSame($topDecoration, $test); - $this->assertTrue(array_key_exists('container', $topDecoration)); + $this->assertArrayHasKey('container', $topDecoration); $this->assertEquals('top', $topDecoration['container']); } @@ -192,7 +192,7 @@ public function testSettingTopDecorationLabelsShouldProxyToTopDecorationDijitPar $test = $this->element->getTopDecoration(); $this->assertSame($topDecoration, $test); - $this->assertTrue(array_key_exists('labels', $topDecoration)); + $this->assertArrayHasKey('labels', $topDecoration); $this->assertSame($labels, $topDecoration['labels']); } @@ -213,7 +213,7 @@ public function testSettingTopDecorationParamsShouldProxyToTopDecorationDijitPar $test = $this->element->getTopDecoration(); $this->assertSame($topDecoration, $test); - $this->assertTrue(array_key_exists('params', $topDecoration)); + $this->assertArrayHasKey('params', $topDecoration); $this->assertSame($params, $topDecoration['params']); } @@ -234,7 +234,7 @@ public function testSettingTopDecorationAttribsShouldProxyToTopDecorationDijitPa $test = $this->element->getTopDecoration(); $this->assertSame($topDecoration, $test); - $this->assertTrue(array_key_exists('attribs', $topDecoration)); + $this->assertArrayHasKey('attribs', $topDecoration); $this->assertSame($attribs, $topDecoration['attribs']); } @@ -247,7 +247,7 @@ public function testSettingBottomDecorationDijitShouldProxyToBottomDecorationDij $test = $this->element->getBottomDecoration(); $this->assertSame($bottomDecoration, $test); - $this->assertTrue(array_key_exists('dijit', $bottomDecoration)); + $this->assertArrayHasKey('dijit', $bottomDecoration); $this->assertEquals('HorizontalRule', $bottomDecoration['dijit']); } @@ -260,7 +260,7 @@ public function testSettingBottomDecorationContainerShouldProxyToBottomDecoratio $test = $this->element->getBottomDecoration(); $this->assertSame($bottomDecoration, $test); - $this->assertTrue(array_key_exists('container', $bottomDecoration)); + $this->assertArrayHasKey('container', $bottomDecoration); $this->assertEquals('bottom', $bottomDecoration['container']); } @@ -274,7 +274,7 @@ public function testSettingBottomDecorationLabelsShouldProxyToBottomDecorationDi $test = $this->element->getBottomDecoration(); $this->assertSame($bottomDecoration, $test); - $this->assertTrue(array_key_exists('labels', $bottomDecoration)); + $this->assertArrayHasKey('labels', $bottomDecoration); $this->assertSame($labels, $bottomDecoration['labels']); } @@ -295,7 +295,7 @@ public function testSettingBottomDecorationParamsShouldProxyToBottomDecorationDi $test = $this->element->getBottomDecoration(); $this->assertSame($bottomDecoration, $test); - $this->assertTrue(array_key_exists('params', $bottomDecoration)); + $this->assertArrayHasKey('params', $bottomDecoration); $this->assertSame($params, $bottomDecoration['params']); } @@ -316,7 +316,7 @@ public function testSettingBottomDecorationAttribsShouldProxyToBottomDecorationD $test = $this->element->getBottomDecoration(); $this->assertSame($bottomDecoration, $test); - $this->assertTrue(array_key_exists('attribs', $bottomDecoration)); + $this->assertArrayHasKey('attribs', $bottomDecoration); $this->assertSame($attribs, $bottomDecoration['attribs']); } diff --git a/tests/Zend/Dojo/Form/Element/NumberSpinnerTest.php b/tests/Zend/Dojo/Form/Element/NumberSpinnerTest.php index 08170cf483..c19a42da2c 100644 --- a/tests/Zend/Dojo/Form/Element/NumberSpinnerTest.php +++ b/tests/Zend/Dojo/Form/Element/NumberSpinnerTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Element_NumberSpinnerTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Element_NumberSpinnerTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -96,7 +96,7 @@ public function getElement() public function testDefaultTimeoutAccessorsShouldProxyToDijitParams() { $this->assertNull($this->element->getDefaultTimeout()); - $this->assertFalse(array_key_exists('defaultTimeout', $this->element->dijitParams)); + $this->assertArrayNotHasKey('defaultTimeout', $this->element->dijitParams); $this->element->setDefaultTimeout(20); $this->assertEquals(20, $this->element->getDefaultTimeout()); $this->assertEquals(20, $this->element->dijitParams['defaultTimeout']); @@ -105,7 +105,7 @@ public function testDefaultTimeoutAccessorsShouldProxyToDijitParams() public function testTimeoutChangeRateAccessorsShouldProxyToDijitParams() { $this->assertNull($this->element->getTimeoutChangeRate()); - $this->assertFalse(array_key_exists('timeoutChangeRate', $this->element->dijitParams)); + $this->assertArrayNotHasKey('timeoutChangeRate', $this->element->dijitParams); $this->element->setTimeoutChangeRate(20); $this->assertEquals(20, $this->element->getTimeoutChangeRate()); $this->assertEquals(20, $this->element->dijitParams['timeoutChangeRate']); @@ -114,7 +114,7 @@ public function testTimeoutChangeRateAccessorsShouldProxyToDijitParams() public function testLargeDeltaAccessorsShouldProxyToDijitParams() { $this->assertNull($this->element->getLargeDelta()); - $this->assertFalse(array_key_exists('largeDelta', $this->element->dijitParams)); + $this->assertArrayNotHasKey('largeDelta', $this->element->dijitParams); $this->element->setLargeDelta(20); $this->assertEquals(20, $this->element->getLargeDelta()); $this->assertEquals(20, $this->element->dijitParams['largeDelta']); @@ -123,7 +123,7 @@ public function testLargeDeltaAccessorsShouldProxyToDijitParams() public function testSmallDeltaAccessorsShouldProxyToDijitParams() { $this->assertNull($this->element->getSmallDelta()); - $this->assertFalse(array_key_exists('smallDelta', $this->element->dijitParams)); + $this->assertArrayNotHasKey('smallDelta', $this->element->dijitParams); $this->element->setSmallDelta(20); $this->assertEquals(20, $this->element->getSmallDelta()); $this->assertEquals(20, $this->element->dijitParams['smallDelta']); @@ -132,7 +132,7 @@ public function testSmallDeltaAccessorsShouldProxyToDijitParams() public function testIntermediateChangesAccessorsShouldProxyToDijitParams() { $this->assertFalse($this->element->getIntermediateChanges()); - $this->assertFalse(array_key_exists('intermediateChanges', $this->element->dijitParams)); + $this->assertArrayNotHasKey('intermediateChanges', $this->element->dijitParams); $this->element->setIntermediateChanges(true); $this->assertTrue($this->element->getIntermediateChanges()); $this->assertTrue($this->element->dijitParams['intermediateChanges']); @@ -141,7 +141,7 @@ public function testIntermediateChangesAccessorsShouldProxyToDijitParams() public function testRangeMessageAccessorsShouldProxyToDijitParams() { $this->assertNull($this->element->getRangeMessage()); - $this->assertFalse(array_key_exists('rangeMessage', $this->element->dijitParams)); + $this->assertArrayNotHasKey('rangeMessage', $this->element->dijitParams); $this->element->setRangeMessage('foo'); $this->assertEquals('foo', $this->element->getRangeMessage()); $this->assertEquals('foo', $this->element->dijitParams['rangeMessage']); @@ -150,7 +150,7 @@ public function testRangeMessageAccessorsShouldProxyToDijitParams() public function testMinAccessorsShouldProxyToConstraintsDijitParam() { $this->assertNull($this->element->getMin()); - $this->assertFalse(array_key_exists('constraints', $this->element->dijitParams)); + $this->assertArrayNotHasKey('constraints', $this->element->dijitParams); $this->element->setMin(5); $this->assertEquals(5, $this->element->getMin()); $this->assertEquals(5, $this->element->dijitParams['constraints']['min']); @@ -159,7 +159,7 @@ public function testMinAccessorsShouldProxyToConstraintsDijitParam() public function testMaxAccessorsShouldProxyToConstraintsDijitParam() { $this->assertNull($this->element->getMax()); - $this->assertFalse(array_key_exists('constraints', $this->element->dijitParams)); + $this->assertArrayNotHasKey('constraints', $this->element->dijitParams); $this->element->setMax(5); $this->assertEquals(5, $this->element->getMax()); $this->assertEquals(5, $this->element->dijitParams['constraints']['max']); diff --git a/tests/Zend/Dojo/Form/Element/NumberTextBoxTest.php b/tests/Zend/Dojo/Form/Element/NumberTextBoxTest.php index fd636c3cf1..9cb6ff86e6 100644 --- a/tests/Zend/Dojo/Form/Element/NumberTextBoxTest.php +++ b/tests/Zend/Dojo/Form/Element/NumberTextBoxTest.php @@ -42,7 +42,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Element_NumberTextBoxTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Element_NumberTextBoxTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -123,10 +123,11 @@ public function testTypeAccessorsShouldProxyToConstraints() } /** - * @expectedException Zend_Form_Element_Exception */ public function testTypeMutatorShouldThrowExceptionWithInvalidType() { + $this->expectException(\Zend_Form_Element_Exception::class); + $this->element->setType('foobar'); } diff --git a/tests/Zend/Dojo/Form/Element/PasswordTextBoxTest.php b/tests/Zend/Dojo/Form/Element/PasswordTextBoxTest.php index 8f21cf6860..703ff3eb24 100644 --- a/tests/Zend/Dojo/Form/Element/PasswordTextBoxTest.php +++ b/tests/Zend/Dojo/Form/Element/PasswordTextBoxTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Element_PasswordTextBoxTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Element_PasswordTextBoxTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/Form/Element/RadioButtonTest.php b/tests/Zend/Dojo/Form/Element/RadioButtonTest.php index ddb815c081..fc3079be5a 100644 --- a/tests/Zend/Dojo/Form/Element/RadioButtonTest.php +++ b/tests/Zend/Dojo/Form/Element/RadioButtonTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Element_RadioButtonTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Element_RadioButtonTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -108,7 +108,7 @@ public function testAddingAnOptionShouldResetOptionsToArrayIfScalar() { $this->element->options = 'foo'; $this->element->addMultiOption('bar', 'baz'); - $this->assertTrue(is_array($this->element->options)); + $this->assertInternalType('array', $this->element->options); } public function testAddMultiOptionsShouldPassKeyValueArraysAsIndividualOptions() diff --git a/tests/Zend/Dojo/Form/Element/SimpleTextareaTest.php b/tests/Zend/Dojo/Form/Element/SimpleTextareaTest.php index 390294c309..87a4dbf45e 100644 --- a/tests/Zend/Dojo/Form/Element/SimpleTextareaTest.php +++ b/tests/Zend/Dojo/Form/Element/SimpleTextareaTest.php @@ -46,7 +46,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Element_SimpleTextareaTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Element_SimpleTextareaTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/Form/Element/SubmitButtonTest.php b/tests/Zend/Dojo/Form/Element/SubmitButtonTest.php index e9ad4f6fb2..93cec9db16 100644 --- a/tests/Zend/Dojo/Form/Element/SubmitButtonTest.php +++ b/tests/Zend/Dojo/Form/Element/SubmitButtonTest.php @@ -46,7 +46,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Element_SubmitButtonTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Element_SubmitButtonTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/Form/Element/TextBoxTest.php b/tests/Zend/Dojo/Form/Element/TextBoxTest.php index 91d82e4337..31861d461a 100644 --- a/tests/Zend/Dojo/Form/Element/TextBoxTest.php +++ b/tests/Zend/Dojo/Form/Element/TextBoxTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Element_TextBoxTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Element_TextBoxTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -98,7 +98,7 @@ public function getElement() public function testLowercaseAccessorsShouldProxyToDijitParams() { $this->assertFalse($this->element->getLowercase()); - $this->assertFalse(array_key_exists('lowercase', $this->element->dijitParams)); + $this->assertArrayNotHasKey('lowercase', $this->element->dijitParams); $this->element->setLowercase(true); $this->assertTrue($this->element->getLowercase()); $this->assertTrue($this->element->dijitParams['lowercase']); @@ -107,7 +107,7 @@ public function testLowercaseAccessorsShouldProxyToDijitParams() public function testPropercaseAccessorsShouldProxyToDijitParams() { $this->assertTrue($this->element->getPropercase()); - $this->assertTrue(array_key_exists('propercase', $this->element->dijitParams)); + $this->assertArrayHasKey('propercase', $this->element->dijitParams); $this->element->setPropercase(false); $this->assertFalse($this->element->getPropercase()); } @@ -115,7 +115,7 @@ public function testPropercaseAccessorsShouldProxyToDijitParams() public function testUppercaseAccessorsShouldProxyToDijitParams() { $this->assertFalse($this->element->getUppercase()); - $this->assertFalse(array_key_exists('uppercase', $this->element->dijitParams)); + $this->assertArrayNotHasKey('uppercase', $this->element->dijitParams); $this->element->setUppercase(true); $this->assertTrue($this->element->getUppercase()); $this->assertTrue($this->element->dijitParams['uppercase']); @@ -124,7 +124,7 @@ public function testUppercaseAccessorsShouldProxyToDijitParams() public function testTrimAccessorsShouldProxyToDijitParams() { $this->assertTrue($this->element->getTrim()); - $this->assertTrue(array_key_exists('trim', $this->element->dijitParams)); + $this->assertArrayHasKey('trim', $this->element->dijitParams); $this->element->setTrim(false); $this->assertFalse($this->element->getTrim()); } @@ -132,7 +132,7 @@ public function testTrimAccessorsShouldProxyToDijitParams() public function testMaxLengthAccessorsShouldProxyToDijitParams() { $this->assertNull($this->element->getMaxLength()); - $this->assertFalse(array_key_exists('maxLength', $this->element->dijitParams)); + $this->assertArrayNotHasKey('maxLength', $this->element->dijitParams); $this->element->setMaxLength(20); $this->assertEquals(20, $this->element->getMaxLength()); $this->assertEquals(20, $this->element->dijitParams['maxLength']); diff --git a/tests/Zend/Dojo/Form/Element/TextareaTest.php b/tests/Zend/Dojo/Form/Element/TextareaTest.php index cccb1e811d..815db448e1 100644 --- a/tests/Zend/Dojo/Form/Element/TextareaTest.php +++ b/tests/Zend/Dojo/Form/Element/TextareaTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Element_TextareaTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Element_TextareaTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/Form/Element/TimeTextBoxTest.php b/tests/Zend/Dojo/Form/Element/TimeTextBoxTest.php index 1f39c24a4e..bcaf5f95c3 100644 --- a/tests/Zend/Dojo/Form/Element/TimeTextBoxTest.php +++ b/tests/Zend/Dojo/Form/Element/TimeTextBoxTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Element_TimeTextBoxTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Element_TimeTextBoxTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -119,10 +119,11 @@ public function testClickableIncrementAccessorsShouldProxyToConstraints() } /** - * @expectedException Zend_Form_Element_Exception */ public function testClickableIncrementMutatorShouldRaiseExceptionOnInvalidFormat() { + $this->expectException(\Zend_Form_Element_Exception::class); + $this->element->setClickableIncrement('en-US'); } @@ -137,10 +138,11 @@ public function testVisibleIncrementAccessorsShouldProxyToDijitParams() } /** - * @expectedException Zend_Form_Element_Exception */ public function testVisibleIncrementMutatorShouldRaiseExceptionOnInvalidFormat() { + $this->expectException(\Zend_Form_Element_Exception::class); + $this->element->setVisibleIncrement('en-US'); } @@ -155,10 +157,11 @@ public function testVisibleRangeAccessorsShouldProxyToDijitParams() } /** - * @expectedException Zend_Form_Element_Exception */ public function testVisibleRangeMutatorShouldRaiseExceptionOnInvalidFormat() { + $this->expectException(\Zend_Form_Element_Exception::class); + $this->element->setVisibleRange('en-US'); } diff --git a/tests/Zend/Dojo/Form/Element/ValidationTextBoxTest.php b/tests/Zend/Dojo/Form/Element/ValidationTextBoxTest.php index 3d9e471145..c378ce3c8b 100644 --- a/tests/Zend/Dojo/Form/Element/ValidationTextBoxTest.php +++ b/tests/Zend/Dojo/Form/Element/ValidationTextBoxTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Element_ValidationTextBoxTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Element_ValidationTextBoxTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -96,7 +96,7 @@ public function getElement() public function testInvalidMessageAccessorsShouldProxyToDijitParams() { $this->assertNull($this->element->getInvalidMessage()); - $this->assertFalse(array_key_exists('invalidMessage', $this->element->dijitParams)); + $this->assertArrayNotHasKey('invalidMessage', $this->element->dijitParams); $this->element->setInvalidMessage('message'); $this->assertEquals('message', $this->element->getInvalidMessage()); $this->assertEquals('message', $this->element->dijitParams['invalidMessage']); @@ -105,7 +105,7 @@ public function testInvalidMessageAccessorsShouldProxyToDijitParams() public function testPromptMessageAccessorsShouldProxyToDijitParams() { $this->assertNull($this->element->getPromptMessage()); - $this->assertFalse(array_key_exists('promptMessage', $this->element->dijitParams)); + $this->assertArrayNotHasKey('promptMessage', $this->element->dijitParams); $this->element->setPromptMessage('message'); $this->assertEquals('message', $this->element->getPromptMessage()); $this->assertEquals('message', $this->element->dijitParams['promptMessage']); @@ -114,7 +114,7 @@ public function testPromptMessageAccessorsShouldProxyToDijitParams() public function testRegExpAccessorsShouldProxyToDijitParams() { $this->assertNull($this->element->getRegExp()); - $this->assertFalse(array_key_exists('regExp', $this->element->dijitParams)); + $this->assertArrayNotHasKey('regExp', $this->element->dijitParams); $this->element->setRegExp('[\w]+'); $this->assertEquals('[\w]+', $this->element->getRegExp()); $this->assertEquals('[\w]+', $this->element->dijitParams['regExp']); @@ -123,8 +123,8 @@ public function testRegExpAccessorsShouldProxyToDijitParams() public function testConstraintsAccessorsShouldProxyToDijitParams() { $constraints = $this->element->getConstraints(); - $this->assertTrue(empty($constraints)); - $this->assertFalse(array_key_exists('constraints', $this->element->dijitParams)); + $this->assertEmpty($constraints); + $this->assertArrayNotHasKey('constraints', $this->element->dijitParams); $constraints = array('foo' => 'bar', 'bar' => 'baz'); $this->element->setConstraints($constraints); @@ -135,7 +135,7 @@ public function testConstraintsAccessorsShouldProxyToDijitParams() public function testShouldAllowSettingRetrievingAndRemovingInvididualConstraints() { $constraints = $this->element->getConstraints(); - $this->assertTrue(empty($constraints)); + $this->assertEmpty($constraints); $this->assertFalse($this->element->hasDijitParam('constraints')); $this->element->setConstraint('foo', 'bar'); @@ -147,7 +147,7 @@ public function testShouldAllowSettingRetrievingAndRemovingInvididualConstraints $this->element->removeConstraint('foo'); $this->assertFalse($this->element->hasConstraint('foo')); $this->assertTrue($this->element->hasDijitParam('constraints')); - $this->assertTrue(empty($this->element->dijitParams['constraints'])); + $this->assertEmpty($this->element->dijitParams['constraints']); } public function testShouldAllowClearingConstraints() diff --git a/tests/Zend/Dojo/Form/Element/VerticalSliderTest.php b/tests/Zend/Dojo/Form/Element/VerticalSliderTest.php index a537d652ce..52acaa6b82 100644 --- a/tests/Zend/Dojo/Form/Element/VerticalSliderTest.php +++ b/tests/Zend/Dojo/Form/Element/VerticalSliderTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_Element_VerticalSliderTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_Element_VerticalSliderTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -102,7 +102,7 @@ public function testSettingLeftDecorationDijitShouldProxyToLeftDecorationDijitPa $test = $this->element->getLeftDecoration(); $this->assertSame($leftDecoration, $test); - $this->assertTrue(array_key_exists('dijit', $leftDecoration)); + $this->assertArrayHasKey('dijit', $leftDecoration); $this->assertEquals('VerticalRule', $leftDecoration['dijit']); } @@ -115,7 +115,7 @@ public function testSettingLeftDecorationContainerShouldProxyToLeftDecorationDij $test = $this->element->getLeftDecoration(); $this->assertSame($leftDecoration, $test); - $this->assertTrue(array_key_exists('container', $leftDecoration)); + $this->assertArrayHasKey('container', $leftDecoration); $this->assertEquals('left', $leftDecoration['container']); } @@ -129,7 +129,7 @@ public function testSettingLeftDecorationLabelsShouldProxyToLeftDecorationDijitP $test = $this->element->getLeftDecoration(); $this->assertSame($leftDecoration, $test); - $this->assertTrue(array_key_exists('labels', $leftDecoration)); + $this->assertArrayHasKey('labels', $leftDecoration); $this->assertSame($labels, $leftDecoration['labels']); } @@ -150,7 +150,7 @@ public function testSettingLeftDecorationParamsShouldProxyToLeftDecorationDijitP $test = $this->element->getLeftDecoration(); $this->assertSame($leftDecoration, $test); - $this->assertTrue(array_key_exists('params', $leftDecoration)); + $this->assertArrayHasKey('params', $leftDecoration); $this->assertSame($params, $leftDecoration['params']); } @@ -171,7 +171,7 @@ public function testSettingLeftDecorationAttribsShouldProxyToLeftDecorationDijit $test = $this->element->getLeftDecoration(); $this->assertSame($leftDecoration, $test); - $this->assertTrue(array_key_exists('attribs', $leftDecoration)); + $this->assertArrayHasKey('attribs', $leftDecoration); $this->assertSame($attribs, $leftDecoration['attribs']); } @@ -184,7 +184,7 @@ public function testSettingRightDecorationDijitShouldProxyToRightDecorationDijit $test = $this->element->getRightDecoration(); $this->assertSame($rightDecoration, $test); - $this->assertTrue(array_key_exists('dijit', $rightDecoration)); + $this->assertArrayHasKey('dijit', $rightDecoration); $this->assertEquals('VerticalRule', $rightDecoration['dijit']); } @@ -197,7 +197,7 @@ public function testSettingRightDecorationContainerShouldProxyToRightDecorationD $test = $this->element->getRightDecoration(); $this->assertSame($rightDecoration, $test); - $this->assertTrue(array_key_exists('container', $rightDecoration)); + $this->assertArrayHasKey('container', $rightDecoration); $this->assertEquals('right', $rightDecoration['container']); } @@ -211,7 +211,7 @@ public function testSettingRightDecorationLabelsShouldProxyToRightDecorationDiji $test = $this->element->getRightDecoration(); $this->assertSame($rightDecoration, $test); - $this->assertTrue(array_key_exists('labels', $rightDecoration)); + $this->assertArrayHasKey('labels', $rightDecoration); $this->assertSame($labels, $rightDecoration['labels']); } @@ -232,7 +232,7 @@ public function testSettingRightDecorationParamsShouldProxyToRightDecorationDiji $test = $this->element->getRightDecoration(); $this->assertSame($rightDecoration, $test); - $this->assertTrue(array_key_exists('params', $rightDecoration)); + $this->assertArrayHasKey('params', $rightDecoration); $this->assertSame($params, $rightDecoration['params']); } @@ -253,7 +253,7 @@ public function testSettingRightDecorationAttribsShouldProxyToRightDecorationDij $test = $this->element->getRightDecoration(); $this->assertSame($rightDecoration, $test); - $this->assertTrue(array_key_exists('attribs', $rightDecoration)); + $this->assertArrayHasKey('attribs', $rightDecoration); $this->assertSame($attribs, $rightDecoration['attribs']); } diff --git a/tests/Zend/Dojo/Form/FormTest.php b/tests/Zend/Dojo/Form/FormTest.php index 7146e71c3b..c10f212e40 100644 --- a/tests/Zend/Dojo/Form/FormTest.php +++ b/tests/Zend/Dojo/Form/FormTest.php @@ -37,7 +37,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_FormTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_FormTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -66,25 +66,25 @@ public function tearDown() public function testDojoFormDecoratorPathShouldBeRegisteredByDefault() { $paths = $this->form->getPluginLoader('decorator')->getPaths('Zend_Dojo_Form_Decorator'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } public function testDojoFormElementPathShouldBeRegisteredByDefault() { $paths = $this->form->getPluginLoader('element')->getPaths('Zend_Dojo_Form_Element'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } public function testDojoFormElementDecoratorPathShouldBeRegisteredByDefault() { $paths = $this->form->foo->getPluginLoader('decorator')->getPaths('Zend_Dojo_Form_Decorator'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } public function testDojoFormDisplayGroupDecoratorPathShouldBeRegisteredByDefault() { $paths = $this->form->dg->getPluginLoader()->getPaths('Zend_Dojo_Form_Decorator'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } public function testDefaultDisplayGroupClassShouldBeDojoDisplayGroupByDefault() @@ -102,7 +102,7 @@ public function testShouldRegisterDojoViewHelperPath() $view = $this->form->getView(); $loader = $view->getPluginLoader('helper'); $paths = $loader->getPaths('Zend_Dojo_View_Helper'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } public function testDisplayGroupShouldRegisterDojoViewHelperPath() @@ -111,7 +111,7 @@ public function testDisplayGroupShouldRegisterDojoViewHelperPath() $view = $this->form->dg->getView(); $loader = $view->getPluginLoader('helper'); $paths = $loader->getPaths('Zend_Dojo_View_Helper'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } /** diff --git a/tests/Zend/Dojo/Form/SubFormTest.php b/tests/Zend/Dojo/Form/SubFormTest.php index 0e40f22a77..a663baae71 100644 --- a/tests/Zend/Dojo/Form/SubFormTest.php +++ b/tests/Zend/Dojo/Form/SubFormTest.php @@ -37,7 +37,7 @@ * @group Zend_Dojo * @group Zend_Dojo_Form */ -class Zend_Dojo_Form_SubFormTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_Form_SubFormTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -66,25 +66,25 @@ public function tearDown() public function testDojoFormDecoratorPathShouldBeRegisteredByDefault() { $paths = $this->form->getPluginLoader('decorator')->getPaths('Zend_Dojo_Form_Decorator'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } public function testDojoFormElementPathShouldBeRegisteredByDefault() { $paths = $this->form->getPluginLoader('element')->getPaths('Zend_Dojo_Form_Element'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } public function testDojoFormElementDecoratorPathShouldBeRegisteredByDefault() { $paths = $this->form->foo->getPluginLoader('decorator')->getPaths('Zend_Dojo_Form_Decorator'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } public function testDojoFormDisplayGroupDecoratorPathShouldBeRegisteredByDefault() { $paths = $this->form->dg->getPluginLoader()->getPaths('Zend_Dojo_Form_Decorator'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } public function testDefaultDisplayGroupClassShouldBeDojoDisplayGroupByDefault() @@ -102,6 +102,6 @@ public function testShouldRegisterDojoViewHelperPath() $view = $this->form->getView(); $loader = $view->getPluginLoader('helper'); $paths = $loader->getPaths('Zend_Dojo_View_Helper'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } } diff --git a/tests/Zend/Dojo/View/Helper/AccordionContainerTest.php b/tests/Zend/Dojo/View/Helper/AccordionContainerTest.php index b9e6b12944..31091226b8 100644 --- a/tests/Zend/Dojo/View/Helper/AccordionContainerTest.php +++ b/tests/Zend/Dojo/View/Helper/AccordionContainerTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_AccordionContainerTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_AccordionContainerTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -127,10 +127,11 @@ public function testShouldAllowCapturingNestedContent() } /** - * @expectedException Zend_Dojo_View_Exception */ public function testCapturingShouldRaiseErrorWhenDuplicateIdDiscovered() { + $this->expectException(\Zend_Dojo_View_Exception::class); + $this->helper->captureStart('foo', array(), array('style' => 'height: 200px; width: 100px;')); $this->view->accordionPane()->captureStart('bar', array('title' => 'Captured Pane')); $this->view->accordionPane()->captureStart('bar', array('title' => 'Captured Pane')); @@ -141,10 +142,11 @@ public function testCapturingShouldRaiseErrorWhenDuplicateIdDiscovered() } /** - * @expectedException Zend_Dojo_View_Exception */ public function testCapturingShouldRaiseErrorWhenNonexistentIdPassedToEnd() { + $this->expectException(\Zend_Dojo_View_Exception::class); + $this->helper->captureStart('foo', array(), array('style' => 'height: 200px; width: 100px;')); $html = $this->helper->captureEnd('bar'); } diff --git a/tests/Zend/Dojo/View/Helper/AccordionPaneTest.php b/tests/Zend/Dojo/View/Helper/AccordionPaneTest.php index 5fd7f5e114..91a75f4d41 100644 --- a/tests/Zend/Dojo/View/Helper/AccordionPaneTest.php +++ b/tests/Zend/Dojo/View/Helper/AccordionPaneTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_AccordionPaneTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_AccordionPaneTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/View/Helper/BorderContainerTest.php b/tests/Zend/Dojo/View/Helper/BorderContainerTest.php index 8e3f937053..b3d76e98f6 100644 --- a/tests/Zend/Dojo/View/Helper/BorderContainerTest.php +++ b/tests/Zend/Dojo/View/Helper/BorderContainerTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_BorderContainerTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_BorderContainerTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/View/Helper/ButtonTest.php b/tests/Zend/Dojo/View/Helper/ButtonTest.php index dcb3ba50bf..0c74c151f0 100644 --- a/tests/Zend/Dojo/View/Helper/ButtonTest.php +++ b/tests/Zend/Dojo/View/Helper/ButtonTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_ButtonTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_ButtonTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/View/Helper/CheckBoxTest.php b/tests/Zend/Dojo/View/Helper/CheckBoxTest.php index 23a2b9e699..6b902f9083 100644 --- a/tests/Zend/Dojo/View/Helper/CheckBoxTest.php +++ b/tests/Zend/Dojo/View/Helper/CheckBoxTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_CheckBoxTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_CheckBoxTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/View/Helper/ComboBoxTest.php b/tests/Zend/Dojo/View/Helper/ComboBoxTest.php index a152031eda..042c718d0f 100644 --- a/tests/Zend/Dojo/View/Helper/ComboBoxTest.php +++ b/tests/Zend/Dojo/View/Helper/ComboBoxTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_ComboBoxTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_ComboBoxTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/View/Helper/ContentPaneTest.php b/tests/Zend/Dojo/View/Helper/ContentPaneTest.php index e1b007e308..791b66242a 100644 --- a/tests/Zend/Dojo/View/Helper/ContentPaneTest.php +++ b/tests/Zend/Dojo/View/Helper/ContentPaneTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_ContentPaneTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_ContentPaneTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/View/Helper/CurrencyTextBoxTest.php b/tests/Zend/Dojo/View/Helper/CurrencyTextBoxTest.php index 49bbebc50b..dd7a4936c2 100644 --- a/tests/Zend/Dojo/View/Helper/CurrencyTextBoxTest.php +++ b/tests/Zend/Dojo/View/Helper/CurrencyTextBoxTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_CurrencyTextBoxTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_CurrencyTextBoxTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/View/Helper/CustomDijitTest.php b/tests/Zend/Dojo/View/Helper/CustomDijitTest.php index 018b096d40..97c8eb1ac2 100644 --- a/tests/Zend/Dojo/View/Helper/CustomDijitTest.php +++ b/tests/Zend/Dojo/View/Helper/CustomDijitTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_CustomDijitTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_CustomDijitTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -78,10 +78,11 @@ public function getView() } /** - * @expectedException Zend_Dojo_View_Exception */ public function testHelperShouldRaiseExceptionIfNoDojoTypePassed() { + $this->expectException(\Zend_Dojo_View_Exception::class); + $this->view->customDijit('foo'); } diff --git a/tests/Zend/Dojo/View/Helper/DateTextBoxTest.php b/tests/Zend/Dojo/View/Helper/DateTextBoxTest.php index 09786653fd..f4c33dfbcc 100644 --- a/tests/Zend/Dojo/View/Helper/DateTextBoxTest.php +++ b/tests/Zend/Dojo/View/Helper/DateTextBoxTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_DateTextBoxTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_DateTextBoxTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/View/Helper/DojoTest.php b/tests/Zend/Dojo/View/Helper/DojoTest.php index 08f63d123d..bbb94e29fa 100644 --- a/tests/Zend/Dojo/View/Helper/DojoTest.php +++ b/tests/Zend/Dojo/View/Helper/DojoTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_DojoTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_DojoTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Dojo_View_Helper_Dojo_Container @@ -98,7 +98,7 @@ public function testShouldBeAbleToSetViewProperty() public function testNoModulesShouldBeRegisteredByDefault() { $modules = $this->helper->getModules(); - $this->assertTrue(empty($modules)); + $this->assertEmpty($modules); } public function testShouldBeAbleToRequireModules() @@ -152,14 +152,14 @@ public function testShouldNotRegisterDuplicateModules() public function testModulePathsShouldBeEmptyByDefault() { $paths = $this->helper->getModulePaths(); - $this->assertTrue(empty($paths)); + $this->assertEmpty($paths); } public function testShouldBeAbleToRegisterModulePaths() { $this->helper->registerModulePath('custom', '../custom'); $paths = $this->helper->getModulePaths(); - $this->assertTrue(array_key_exists('custom', $paths), var_export($paths, 1)); + $this->assertArrayHasKey('custom', $paths, var_export($paths, 1)); $this->assertContains('../custom', $paths); } @@ -169,7 +169,7 @@ public function testShouldNotBeAbleToRegisterDuplicateModulePaths() $this->helper->registerModulePath('custom', '../custom'); $paths = $this->helper->getModulePaths(); $this->assertEquals(1, count($paths)); - $this->assertTrue(array_key_exists('custom', $paths)); + $this->assertArrayHasKey('custom', $paths); $this->assertContains('../custom', $paths); } @@ -259,8 +259,8 @@ public function testShouldAllowSpecifyingDjConfig() { $this->helper->setDjConfig(array('parseOnLoad' => 'true')); $config = $this->helper->getDjConfig(); - $this->assertTrue(is_array($config)); - $this->assertTrue(array_key_exists('parseOnLoad', $config)); + $this->assertInternalType('array', $config); + $this->assertArrayHasKey('parseOnLoad', $config); $this->assertEquals('true', $config['parseOnLoad']); } @@ -345,7 +345,7 @@ public function testShouldAllowSpecifyingLocalStylesheet() { $this->helper->addStylesheet('/css/foo.css'); $css = $this->helper->getStylesheets(); - $this->assertTrue(is_array($css)); + $this->assertInternalType('array', $css); $this->assertContains('/css/foo.css', $css); } @@ -354,7 +354,7 @@ public function testShouldNotAllowSpecifyingDuplicateLocalStylesheets() $this->testShouldAllowSpecifyingLocalStylesheet(); $this->helper->addStylesheet('/css/foo.css'); $css = $this->helper->getStylesheets(); - $this->assertTrue(is_array($css)); + $this->assertInternalType('array', $css); $this->assertEquals(1, count($css)); $this->assertContains('/css/foo.css', $css); } @@ -363,10 +363,10 @@ public function testShouldAllowSpecifyingOnLoadFunctionPointer() { $this->helper->addOnLoad('foo'); $onLoad = $this->helper->getOnLoadActions(); - $this->assertTrue(is_array($onLoad)); + $this->assertInternalType('array', $onLoad); $this->assertEquals(1, count($onLoad)); $action = array_shift($onLoad); - $this->assertTrue(is_string($action)); + $this->assertInternalType('string', $action); $this->assertEquals('foo', $action); } @@ -379,10 +379,10 @@ function() { } helper->onLoadCaptureEnd(); $onLoad = $this->helper->getOnLoadActions(); - $this->assertTrue(is_array($onLoad)); + $this->assertInternalType('array', $onLoad); $this->assertEquals(1, count($onLoad)); $action = array_shift($onLoad); - $this->assertTrue(is_string($action)); + $this->assertInternalType('string', $action); $this->assertContains('function() {', $action); $this->assertContains('bar();', $action); $this->assertContains('baz();', $action); @@ -393,7 +393,7 @@ public function testShouldNotAllowSpecifyingDuplicateOnLoadActions() $this->helper->addOnLoad('foo'); $this->helper->addOnLoad('foo'); $onLoad = $this->helper->getOnLoadActions(); - $this->assertTrue(is_array($onLoad)); + $this->assertInternalType('array', $onLoad); $this->assertEquals(1, count($onLoad)); $action = array_shift($onLoad); $this->assertEquals('foo', $action); @@ -514,25 +514,26 @@ public function testAddingProgrammaticDijitsShouldAcceptIdAndArrayOfDijitParams( { $this->helper->addDijit('foo', array('dojoType' => 'dijit.form.Form')); $dijits = $this->helper->getDijits(); - $this->assertTrue(is_array($dijits)); + $this->assertInternalType('array', $dijits); $this->assertEquals(1, count($dijits)); $dijit = array_shift($dijits); - $this->assertTrue(is_array($dijit)); + $this->assertInternalType('array', $dijit); $this->assertEquals(2, count($dijit)); - $this->assertTrue(array_key_exists('id', $dijit)); - $this->assertTrue(array_key_exists('params', $dijit)); + $this->assertArrayHasKey('id', $dijit); + $this->assertArrayHasKey('params', $dijit); $this->assertEquals('foo', $dijit['id']); - $this->assertTrue(is_array($dijit['params'])); + $this->assertInternalType('array', $dijit['params']); $this->assertEquals(1, count($dijit['params'])); - $this->assertTrue(array_key_exists('dojoType', $dijit['params'])); + $this->assertArrayHasKey('dojoType', $dijit['params']); $this->assertEquals('dijit.form.Form', $dijit['params']['dojoType']); } /** - * @expectedException Zend_Dojo_View_Exception */ public function testAddingDuplicateProgrammaticDijitsShouldRaiseExceptions() { + $this->expectException(\Zend_Dojo_View_Exception::class); + $this->helper->addDijit('foo', array('dojoType' => 'dijit.form.Form')); $this->helper->addDijit('foo', array('dojoType' => 'dijit.form.ComboBox')); } @@ -542,7 +543,7 @@ public function testSettingProgrammaticDijitsShouldOverwriteExistingDijits() $this->testAddingProgrammaticDijitsShouldAcceptIdAndArrayOfDijitParams(); $this->helper->setDijit('foo', array('dojoType' => 'dijit.form.ComboBox')); $dijits = $this->helper->getDijits(); - $this->assertTrue(is_array($dijits)); + $this->assertInternalType('array', $dijits); $this->assertEquals(1, count($dijits)); $dijit = array_shift($dijits); $this->assertEquals('dijit.form.ComboBox', $dijit['params']['dojoType']); @@ -560,7 +561,7 @@ public function testShouldAllowAddingMultipleDijitsAtOnce() ); $this->helper->addDijits($dijits); $test = $this->helper->getDijits(); - $this->assertTrue(is_array($test)); + $this->assertInternalType('array', $test); $this->assertEquals(2, count($test)); $keys = array(); foreach ($test as $dijit) { @@ -582,7 +583,7 @@ public function testSettingMultipleDijitsAtOnceShouldOverwriteAllDijits() ); $this->helper->setDijits($dijits); $test = $this->helper->getDijits(); - $this->assertTrue(is_array($test)); + $this->assertInternalType('array', $test); $this->assertEquals(2, count($test)); $keys = array(); foreach ($test as $dijit) { @@ -595,9 +596,9 @@ public function testRetrievingDijitsByIdShouldReturnJustParams() { $this->helper->addDijit('foo', array('dojoType' => 'dijit.form.Form')); $params = $this->helper->getDijit('foo'); - $this->assertTrue(is_array($params)); + $this->assertInternalType('array', $params); $this->assertEquals(1, count($params), var_export($params, 1)); - $this->assertTrue(array_key_exists('dojoType', $params)); + $this->assertArrayHasKey('dojoType', $params); $this->assertEquals('dijit.form.Form', $params['dojoType']); } @@ -605,11 +606,11 @@ public function testShouldAllowRemovingIndividualDijits() { $this->helper->addDijit('foo', array('dojoType' => 'dijit.form.Form')); $dijits = $this->helper->getDijits(); - $this->assertTrue(is_array($dijits)); + $this->assertInternalType('array', $dijits); $this->assertEquals(1, count($dijits)); $this->helper->removeDijit('foo'); $dijits = $this->helper->getDijits(); - $this->assertTrue(is_array($dijits)); + $this->assertInternalType('array', $dijits); $this->assertEquals(0, count($dijits)); } @@ -618,7 +619,7 @@ public function testShouldAllowClearingAllDijits() $this->testShouldAllowAddingMultipleDijitsAtOnce(); $this->helper->clearDijits(); $dijits = $this->helper->getDijits(); - $this->assertTrue(is_array($dijits)); + $this->assertInternalType('array', $dijits); $this->assertEquals(0, count($dijits)); } @@ -627,13 +628,13 @@ public function testShouldAllowRetrievingDijitsAsJsonArray() $this->testShouldAllowAddingMultipleDijitsAtOnce(); $json = $this->helper->dijitsToJson(); $array = Zend_Json::decode($json); - $this->assertTrue(is_array($array)); + $this->assertInternalType('array', $array); $keys = array(); foreach ($array as $dijit) { $keys[] = $dijit['id']; - $this->assertTrue(array_key_exists('params', $dijit)); - $this->assertTrue(is_array($dijit['params'])); + $this->assertArrayHasKey('params', $dijit); + $this->assertInternalType('array', $dijit['params']); } $this->assertSame(array('foo', 'bar'), $keys); } @@ -679,7 +680,7 @@ public function testShouldAllowClearingArbitraryJsStack() $this->testShouldAllowAddingArbitraryJsToPrimaryDojoScriptTag(); $this->helper->clearJavascript(); $js = $this->helper->getJavascript(); - $this->assertTrue(is_array($js)); + $this->assertInternalType('array', $js); $this->assertEquals(0, count($js)); } @@ -688,7 +689,7 @@ public function testShouldNotAllowAddingDuplicateArbitraryJsToPrimaryDojoScriptT $this->helper->addJavascript('var foo = "bar";'); $this->helper->addJavascript('var foo = "bar";'); $js = $this->helper->getJavascript(); - $this->assertTrue(is_array($js)); + $this->assertInternalType('array', $js); $this->assertEquals(1, count($js), var_export($js, 1)); $this->assertEquals('var foo = "bar";', $js[0]); } @@ -706,8 +707,8 @@ public function testShouldAllowCapturingArbitraryJsToPrimaryDojoScriptTag() public function testNoLayersShouldBeRegisteredByDefault() { $layers = $this->helper->getLayers(); - $this->assertTrue(is_array($layers)); - $this->assertTrue(empty($layers)); + $this->assertInternalType('array', $layers); + $this->assertEmpty($layers); } public function testShouldAllowAddingLayers() @@ -749,8 +750,8 @@ public function testShouldAllowClearingLayers() $this->testShouldAllowAddingLayers(); $this->helper->clearLayers(); $layers = $this->helper->getLayers(); - $this->assertTrue(is_array($layers)); - $this->assertTrue(empty($layers)); + $this->assertInternalType('array', $layers); + $this->assertEmpty($layers); } public function testShouldRenderScriptTagsWithLayersWhenLayersAreRegistered() @@ -778,10 +779,11 @@ public function testShouldRenderScriptTagsWithLayersWhenLayersAreRegistered() } /** - * @expectedException Zend_Dojo_View_Exception */ public function testCallingMethodThatDoesNotExistInContainerShouldRaiseException() { + $this->expectException(\Zend_Dojo_View_Exception::class); + $dojo = new Zend_Dojo_View_Helper_Dojo(); $dojo->bogus(); } diff --git a/tests/Zend/Dojo/View/Helper/EditorTest.php b/tests/Zend/Dojo/View/Helper/EditorTest.php index 5891c3ca69..08e9ad89d9 100644 --- a/tests/Zend/Dojo/View/Helper/EditorTest.php +++ b/tests/Zend/Dojo/View/Helper/EditorTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_EditorTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_EditorTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/View/Helper/FilteringSelectTest.php b/tests/Zend/Dojo/View/Helper/FilteringSelectTest.php index 3dbcad8666..9dafd3795c 100644 --- a/tests/Zend/Dojo/View/Helper/FilteringSelectTest.php +++ b/tests/Zend/Dojo/View/Helper/FilteringSelectTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_FilteringSelectTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_FilteringSelectTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/View/Helper/FormTest.php b/tests/Zend/Dojo/View/Helper/FormTest.php index 249c5ed6cb..b575495fd1 100644 --- a/tests/Zend/Dojo/View/Helper/FormTest.php +++ b/tests/Zend/Dojo/View/Helper/FormTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_FormTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_FormTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/View/Helper/HorizontalSliderTest.php b/tests/Zend/Dojo/View/Helper/HorizontalSliderTest.php index 64291c0198..784cb55fdd 100644 --- a/tests/Zend/Dojo/View/Helper/HorizontalSliderTest.php +++ b/tests/Zend/Dojo/View/Helper/HorizontalSliderTest.php @@ -49,7 +49,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_HorizontalSliderTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_HorizontalSliderTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -210,10 +210,11 @@ public function testShouldIgnoreLeftAndRightDecorationsWhenPassed() } /** - * @expectedException Zend_Dojo_View_Exception */ public function testSliderShouldRaiseExceptionIfMissingRequiredParameters() { + $this->expectException(\Zend_Dojo_View_Exception::class); + $this->helper->prepareSlider('foo', 4); } diff --git a/tests/Zend/Dojo/View/Helper/NumberSpinnerTest.php b/tests/Zend/Dojo/View/Helper/NumberSpinnerTest.php index 36cd572e07..86a0264bf3 100644 --- a/tests/Zend/Dojo/View/Helper/NumberSpinnerTest.php +++ b/tests/Zend/Dojo/View/Helper/NumberSpinnerTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_NumberSpinnerTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_NumberSpinnerTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -127,10 +127,10 @@ public function testShouldJsonEncodeConstraints() $constraints = str_replace(''', '"', $constraints); } $constraints = Zend_Json::decode($constraints); - $this->assertTrue(is_array($constraints), var_export($m[1], 1)); - $this->assertTrue(array_key_exists('min', $constraints)); - $this->assertTrue(array_key_exists('max', $constraints)); - $this->assertTrue(array_key_exists('places', $constraints)); + $this->assertInternalType('array', $constraints, var_export($m[1], 1)); + $this->assertArrayHasKey('min', $constraints); + $this->assertArrayHasKey('max', $constraints); + $this->assertArrayHasKey('places', $constraints); } public function testInvalidConstraintsShouldBeStrippedPriorToRendering() diff --git a/tests/Zend/Dojo/View/Helper/NumberTextBoxTest.php b/tests/Zend/Dojo/View/Helper/NumberTextBoxTest.php index a0e5c15c3b..f1abe87d2e 100644 --- a/tests/Zend/Dojo/View/Helper/NumberTextBoxTest.php +++ b/tests/Zend/Dojo/View/Helper/NumberTextBoxTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_NumberTextBoxTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_NumberTextBoxTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/View/Helper/PasswordTextBoxTest.php b/tests/Zend/Dojo/View/Helper/PasswordTextBoxTest.php index 1e27de3dfc..b1d40a86f4 100644 --- a/tests/Zend/Dojo/View/Helper/PasswordTextBoxTest.php +++ b/tests/Zend/Dojo/View/Helper/PasswordTextBoxTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_PasswordTextBoxTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_PasswordTextBoxTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/View/Helper/RadioButtonTest.php b/tests/Zend/Dojo/View/Helper/RadioButtonTest.php index 7f80a06b47..5c765a179b 100644 --- a/tests/Zend/Dojo/View/Helper/RadioButtonTest.php +++ b/tests/Zend/Dojo/View/Helper/RadioButtonTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_RadioButtonTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_RadioButtonTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/View/Helper/SimpleTextareaTest.php b/tests/Zend/Dojo/View/Helper/SimpleTextareaTest.php index 79ed7d59ee..2794387496 100644 --- a/tests/Zend/Dojo/View/Helper/SimpleTextareaTest.php +++ b/tests/Zend/Dojo/View/Helper/SimpleTextareaTest.php @@ -46,7 +46,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_SimpleTextareaTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_SimpleTextareaTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/View/Helper/SplitContainerTest.php b/tests/Zend/Dojo/View/Helper/SplitContainerTest.php index 1ef21c1650..afa066140d 100644 --- a/tests/Zend/Dojo/View/Helper/SplitContainerTest.php +++ b/tests/Zend/Dojo/View/Helper/SplitContainerTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_SplitContainerTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_SplitContainerTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/View/Helper/StackContainerTest.php b/tests/Zend/Dojo/View/Helper/StackContainerTest.php index 0f065045fd..2b5fc786f1 100644 --- a/tests/Zend/Dojo/View/Helper/StackContainerTest.php +++ b/tests/Zend/Dojo/View/Helper/StackContainerTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_StackContainerTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_StackContainerTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/View/Helper/SubmitButtonTest.php b/tests/Zend/Dojo/View/Helper/SubmitButtonTest.php index bdb03eb58d..449ab7b337 100644 --- a/tests/Zend/Dojo/View/Helper/SubmitButtonTest.php +++ b/tests/Zend/Dojo/View/Helper/SubmitButtonTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_SubmitButtonTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_SubmitButtonTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/View/Helper/TabContainerTest.php b/tests/Zend/Dojo/View/Helper/TabContainerTest.php index 37e36d561c..0083ebf412 100644 --- a/tests/Zend/Dojo/View/Helper/TabContainerTest.php +++ b/tests/Zend/Dojo/View/Helper/TabContainerTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_TabContainerTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_TabContainerTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/View/Helper/TextBoxTest.php b/tests/Zend/Dojo/View/Helper/TextBoxTest.php index ed53906933..45dcc03b94 100644 --- a/tests/Zend/Dojo/View/Helper/TextBoxTest.php +++ b/tests/Zend/Dojo/View/Helper/TextBoxTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_TextBoxTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_TextBoxTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/View/Helper/TextareaTest.php b/tests/Zend/Dojo/View/Helper/TextareaTest.php index 9f5e4bce6f..7d3159aa69 100644 --- a/tests/Zend/Dojo/View/Helper/TextareaTest.php +++ b/tests/Zend/Dojo/View/Helper/TextareaTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_TextareaTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_TextareaTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/View/Helper/TimeTextBoxTest.php b/tests/Zend/Dojo/View/Helper/TimeTextBoxTest.php index d74e42b0f4..1fb07d2f8e 100644 --- a/tests/Zend/Dojo/View/Helper/TimeTextBoxTest.php +++ b/tests/Zend/Dojo/View/Helper/TimeTextBoxTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_TimeTextBoxTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_TimeTextBoxTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/View/Helper/ValidationTextBoxTest.php b/tests/Zend/Dojo/View/Helper/ValidationTextBoxTest.php index 5eaddb9a62..55372adb5f 100644 --- a/tests/Zend/Dojo/View/Helper/ValidationTextBoxTest.php +++ b/tests/Zend/Dojo/View/Helper/ValidationTextBoxTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_ValidationTextBoxTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_ValidationTextBoxTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dojo/View/Helper/VerticalSliderTest.php b/tests/Zend/Dojo/View/Helper/VerticalSliderTest.php index 72b646da4c..87eaada420 100644 --- a/tests/Zend/Dojo/View/Helper/VerticalSliderTest.php +++ b/tests/Zend/Dojo/View/Helper/VerticalSliderTest.php @@ -43,7 +43,7 @@ * @group Zend_Dojo * @group Zend_Dojo_View */ -class Zend_Dojo_View_Helper_VerticalSliderTest extends PHPUnit_Framework_TestCase +class Zend_Dojo_View_Helper_VerticalSliderTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Dom/Query/Css2XpathTest.php b/tests/Zend/Dom/Query/Css2XpathTest.php index ac4c7fd8d6..7795d5aeff 100644 --- a/tests/Zend/Dom/Query/Css2XpathTest.php +++ b/tests/Zend/Dom/Query/Css2XpathTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Dom */ -class Zend_Dom_Query_Css2XpathTest extends PHPUnit_Framework_TestCase +class Zend_Dom_Query_Css2XpathTest extends PHPUnit\Framework\TestCase { public function testTransformShouldBeCalledStatically() { @@ -42,7 +42,7 @@ public function testTransformShouldBeCalledStatically() public function testTransformShouldReturnStringByDefault() { $test = Zend_Dom_Query_Css2Xpath::transform(''); - $this->assertTrue(is_string($test)); + $this->assertInternalType('string', $test); } /** @@ -51,7 +51,7 @@ public function testTransformShouldReturnStringByDefault() public function testTransformShouldReturnMultiplePathsWhenExpressionContainsCommas() { $test = Zend_Dom_Query_Css2Xpath::transform('#foo, #bar'); - $this->assertTrue(is_string($test)); + $this->assertInternalType('string', $test); $this->assertContains('|', $test); $this->assertEquals(2, count(explode('|', $test))); } @@ -93,7 +93,7 @@ public function testTransformShouldWriteChildSelectorsAsAbsoluteXpathRelations() public function testMultipleComplexCssSpecificationShouldTransformToExpectedXpath() { $test = Zend_Dom_Query_Css2Xpath::transform('div#foo span.bar, #bar li.baz a'); - $this->assertTrue(is_string($test)); + $this->assertInternalType('string', $test); $this->assertContains('|', $test); $actual = explode('|', $test); $expected = array( diff --git a/tests/Zend/Dom/Query/ResultTest.php b/tests/Zend/Dom/Query/ResultTest.php index 33f7167815..17a4a437a4 100644 --- a/tests/Zend/Dom/Query/ResultTest.php +++ b/tests/Zend/Dom/Query/ResultTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Dom */ -class Zend_Dom_Query_ResultTest extends PHPUnit_Framework_TestCase +class Zend_Dom_Query_ResultTest extends PHPUnit\Framework\TestCase { /** * @group ZF-4631 diff --git a/tests/Zend/Dom/QueryTest.php b/tests/Zend/Dom/QueryTest.php index 79c3bc5d64..e8c296d15b 100644 --- a/tests/Zend/Dom/QueryTest.php +++ b/tests/Zend/Dom/QueryTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Dom */ -class Zend_Dom_QueryTest extends PHPUnit_Framework_TestCase +class Zend_Dom_QueryTest extends PHPUnit\Framework\TestCase { public $html; @@ -242,7 +242,7 @@ public function testLoadingDocumentWithErrorsShouldNotRaisePhpErrors() $this->query->setDocument($file); $this->query->query('p'); $errors = $this->query->getDocumentErrors(); - $this->assertTrue(is_array($errors)); + $this->assertInternalType('array', $errors); $this->assertTrue(0 < count($errors)); } @@ -363,7 +363,7 @@ public function testLoadingXmlContainingDoctypeShouldFailToPreventXxeAndXeeAttac XML; $this->query->setDocumentXml($xml); - $this->setExpectedException("Zend_Dom_Exception"); + $this->expectException("Zend_Dom_Exception"); $this->query->queryXpath('/'); } } diff --git a/tests/Zend/EventManager/EventManagerTest.php b/tests/Zend/EventManager/EventManagerTest.php index 6c701ba092..33695d550d 100644 --- a/tests/Zend/EventManager/EventManagerTest.php +++ b/tests/Zend/EventManager/EventManagerTest.php @@ -35,7 +35,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_EventManager_EventManagerTest extends PHPUnit_Framework_TestCase +class Zend_EventManager_EventManagerTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -63,10 +63,10 @@ public function testAttachShouldAddListenerToEvent() public function testAttachShouldAddEventIfItDoesNotExist() { $events = $this->events->getEvents(); - $this->assertTrue(empty($events), var_export($events, 1)); + $this->assertEmpty($events, var_export($events, 1)); $listener = $this->events->attach('test', array($this, __METHOD__)); $events = $this->events->getEvents(); - $this->assertFalse(empty($events)); + $this->assertNotEmpty($events); $this->assertContains('test', $events); } @@ -89,7 +89,7 @@ public function testPassingArrayOfEventNamesWhenAttachingReturnsArrayOfCallbackH $callback = array($this, 'returnName'); $listeners = $this->events->attach(array('foo', 'bar'), $callback); - $this->assertTrue(is_array($listeners)); + $this->assertInternalType('array', $listeners); foreach ($listeners as $listener) { $this->assertTrue($listener instanceof Zend_Stdlib_CallbackHandler); @@ -555,10 +555,11 @@ public function testListenersAttachedWithWildcardAreTriggeredForAllEvents() /** * @group ZF-12185 - * @expectedException Zend_EventManager_Exception_InvalidArgumentException */ public function testInvalidArgumentExceptionCanBeThrown() { + $this->expectException(\Zend_EventManager_Exception_InvalidArgumentException::class); + require_once "Zend/EventManager/Exception/InvalidArgumentException.php"; throw new Zend_EventManager_Exception_InvalidArgumentException(); } diff --git a/tests/Zend/EventManager/FilterChainTest.php b/tests/Zend/EventManager/FilterChainTest.php index e3ed1cbd06..da9b0d8938 100644 --- a/tests/Zend/EventManager/FilterChainTest.php +++ b/tests/Zend/EventManager/FilterChainTest.php @@ -31,7 +31,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_EventManager_FilterChainTest extends PHPUnit_Framework_TestCase +class Zend_EventManager_FilterChainTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/EventManager/GlobalEventManagerTest.php b/tests/Zend/EventManager/GlobalEventManagerTest.php index 286f173298..5d45e4ecfb 100644 --- a/tests/Zend/EventManager/GlobalEventManagerTest.php +++ b/tests/Zend/EventManager/GlobalEventManagerTest.php @@ -30,7 +30,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_EventManager_GlobalEventManagerTest extends PHPUnit_Framework_TestCase +class Zend_EventManager_GlobalEventManagerTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/EventManager/StaticEventManagerTest.php b/tests/Zend/EventManager/StaticEventManagerTest.php index 81982b2f01..ddd658a93c 100644 --- a/tests/Zend/EventManager/StaticEventManagerTest.php +++ b/tests/Zend/EventManager/StaticEventManagerTest.php @@ -30,7 +30,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_EventManager_StaticEventManagerTest extends PHPUnit_Framework_TestCase +class Zend_EventManager_StaticEventManagerTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/EventManager/StaticIntegrationTest.php b/tests/Zend/EventManager/StaticIntegrationTest.php index e207452187..9c109f2282 100644 --- a/tests/Zend/EventManager/StaticIntegrationTest.php +++ b/tests/Zend/EventManager/StaticIntegrationTest.php @@ -32,7 +32,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_EventManager_StaticIntegrationTest extends PHPUnit_Framework_TestCase +class Zend_EventManager_StaticIntegrationTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/ExceptionTest.php b/tests/Zend/ExceptionTest.php index 175dc65c42..1ee7a09e60 100644 --- a/tests/Zend/ExceptionTest.php +++ b/tests/Zend/ExceptionTest.php @@ -30,7 +30,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_ExceptionTest extends PHPUnit_Framework_TestCase +class Zend_ExceptionTest extends PHPUnit\Framework\TestCase { public function testConstructorDefaults() { diff --git a/tests/Zend/Feed/AbstractFeedTest.php b/tests/Zend/Feed/AbstractFeedTest.php index c998a1ae0e..762d67be3f 100644 --- a/tests/Zend/Feed/AbstractFeedTest.php +++ b/tests/Zend/Feed/AbstractFeedTest.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed */ -class Zend_Feed_AbstractFeedTest extends PHPUnit_Framework_TestCase +class Zend_Feed_AbstractFeedTest extends PHPUnit\Framework\TestCase { public $baseUri; diff --git a/tests/Zend/Feed/ArrayAccessTest.php b/tests/Zend/Feed/ArrayAccessTest.php index 5ecd6e4e11..65bf233157 100644 --- a/tests/Zend/Feed/ArrayAccessTest.php +++ b/tests/Zend/Feed/ArrayAccessTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed */ -class Zend_Feed_ArrayAccessTest extends PHPUnit_Framework_TestCase +class Zend_Feed_ArrayAccessTest extends PHPUnit\Framework\TestCase { protected $_feed; protected $_nsfeed; diff --git a/tests/Zend/Feed/AtomEntryOnlyTest.php b/tests/Zend/Feed/AtomEntryOnlyTest.php index efe858ea86..ba737d94cc 100644 --- a/tests/Zend/Feed/AtomEntryOnlyTest.php +++ b/tests/Zend/Feed/AtomEntryOnlyTest.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed */ -class Zend_Feed_AtomEntryOnlyTest extends PHPUnit_Framework_TestCase +class Zend_Feed_AtomEntryOnlyTest extends PHPUnit\Framework\TestCase { public function testEntryOnly() diff --git a/tests/Zend/Feed/AtomPublishingTest.php b/tests/Zend/Feed/AtomPublishingTest.php index 53d5be42c7..bce4a992cf 100644 --- a/tests/Zend/Feed/AtomPublishingTest.php +++ b/tests/Zend/Feed/AtomPublishingTest.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed */ -class Zend_Feed_AtomPublishingTest extends PHPUnit_Framework_TestCase +class Zend_Feed_AtomPublishingTest extends PHPUnit\Framework\TestCase { protected $_uri; diff --git a/tests/Zend/Feed/AtomTest.php b/tests/Zend/Feed/AtomTest.php index abd3ba5870..29ab2008aa 100644 --- a/tests/Zend/Feed/AtomTest.php +++ b/tests/Zend/Feed/AtomTest.php @@ -42,7 +42,8 @@ class Zend_Feed_AtomTest extends Zend_Feed_AbstractFeedTest public function testPreventsXxeAttacksOnParsing() { $uri = $this->baseUri . '/' . $this->prepareFeed('zend_feed_atom_xxe.xml'); - $this->setExpectedException('Zend_Feed_Exception', 'parse'); + $this->expectException('Zend_Feed_Exception'); + $this->expectExceptionMessage('parse'); $feed = new Zend_Feed_Atom($uri); } } diff --git a/tests/Zend/Feed/CountTest.php b/tests/Zend/Feed/CountTest.php index da1b12cb26..35b19da53f 100644 --- a/tests/Zend/Feed/CountTest.php +++ b/tests/Zend/Feed/CountTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed */ -class Zend_Feed_CountTest extends PHPUnit_Framework_TestCase +class Zend_Feed_CountTest extends PHPUnit\Framework\TestCase { public function testCount() diff --git a/tests/Zend/Feed/ElementTest.php b/tests/Zend/Feed/ElementTest.php index 6baec5505f..aaaffa39d9 100644 --- a/tests/Zend/Feed/ElementTest.php +++ b/tests/Zend/Feed/ElementTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed */ -class Zend_Feed_ElementTest extends PHPUnit_Framework_TestCase +class Zend_Feed_ElementTest extends PHPUnit\Framework\TestCase { public function testIsInitialized() @@ -78,8 +78,8 @@ public function testStrings() $this->assertTrue($entry->summary instanceof Zend_Feed_Element, '__get access should return an Zend_Feed_Element instance'); $this->assertFalse($entry->summary() instanceof Zend_Feed_Element, 'method access should not return an Zend_Feed_Element instance'); - $this->assertTrue(is_string($entry->summary()), 'method access should return a string'); - $this->assertFalse(is_string($entry->summary), '__get access should not return a string'); + $this->assertInternalType('string', $entry->summary(), 'method access should return a string'); + $this->assertNotInternalType('string', $entry->summary, '__get access should not return a string'); } public function testSetNamespacedAttributes() diff --git a/tests/Zend/Feed/Entry/RssTest.php b/tests/Zend/Feed/Entry/RssTest.php index 0240e15f42..16ec18efb1 100644 --- a/tests/Zend/Feed/Entry/RssTest.php +++ b/tests/Zend/Feed/Entry/RssTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed */ -class Zend_Feed_Entry_RssTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Entry_RssTest extends PHPUnit\Framework\TestCase { public function testContentEncodedSupport() diff --git a/tests/Zend/Feed/ImportTest.php b/tests/Zend/Feed/ImportTest.php index 859ab47e8c..b0928f5adf 100644 --- a/tests/Zend/Feed/ImportTest.php +++ b/tests/Zend/Feed/ImportTest.php @@ -48,7 +48,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed */ -class Zend_Feed_ImportTest extends PHPUnit_Framework_TestCase +class Zend_Feed_ImportTest extends PHPUnit\Framework\TestCase { protected $_client; protected $_feedDir; diff --git a/tests/Zend/Feed/IteratorTest.php b/tests/Zend/Feed/IteratorTest.php index 8fdf2403a4..db462489ce 100644 --- a/tests/Zend/Feed/IteratorTest.php +++ b/tests/Zend/Feed/IteratorTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed */ -class Zend_Feed_IteratorTest extends PHPUnit_Framework_TestCase +class Zend_Feed_IteratorTest extends PHPUnit\Framework\TestCase { private $_feed; private $_nsfeed; diff --git a/tests/Zend/Feed/Pubsubhubbub/Model/SubscriptionTest.php b/tests/Zend/Feed/Pubsubhubbub/Model/SubscriptionTest.php index 27603a1027..0999a162e6 100644 --- a/tests/Zend/Feed/Pubsubhubbub/Model/SubscriptionTest.php +++ b/tests/Zend/Feed/Pubsubhubbub/Model/SubscriptionTest.php @@ -29,7 +29,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Feed_Pubsubhubbub_Model_SubscriptionTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Pubsubhubbub_Model_SubscriptionTest extends PHPUnit\Framework\TestCase { /** * @group ZF-10069 @@ -46,7 +46,7 @@ public function testAllOperations() $this->assertTrue($subscription->hasSubscription($id)); $dataSubscription = $subscription->getSubscription($id); - $this->assertTrue(is_array($dataSubscription)); + $this->assertInternalType('array', $dataSubscription); $keys = array('id', 'topic_url', 'hub_url', 'created_time', 'lease_seconds', 'verify_token', 'secret', diff --git a/tests/Zend/Feed/Pubsubhubbub/PublisherTest.php b/tests/Zend/Feed/Pubsubhubbub/PublisherTest.php index 801afbd519..1a42265d61 100644 --- a/tests/Zend/Feed/Pubsubhubbub/PublisherTest.php +++ b/tests/Zend/Feed/Pubsubhubbub/PublisherTest.php @@ -30,7 +30,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Feed_Pubsubhubbub_PublisherTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Pubsubhubbub_PublisherTest extends PHPUnit\Framework\TestCase { protected $_publisher = null; diff --git a/tests/Zend/Feed/Pubsubhubbub/PubsubhubbubTest.php b/tests/Zend/Feed/Pubsubhubbub/PubsubhubbubTest.php index 709272abf6..b971d23fbd 100644 --- a/tests/Zend/Feed/Pubsubhubbub/PubsubhubbubTest.php +++ b/tests/Zend/Feed/Pubsubhubbub/PubsubhubbubTest.php @@ -30,7 +30,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Feed_Pubsubhubbub_PubsubhubbubTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Pubsubhubbub_PubsubhubbubTest extends PHPUnit\Framework\TestCase { public function teardown() diff --git a/tests/Zend/Feed/Pubsubhubbub/Subscriber/CallbackTest.php b/tests/Zend/Feed/Pubsubhubbub/Subscriber/CallbackTest.php index ddba01d2ba..9662283344 100644 --- a/tests/Zend/Feed/Pubsubhubbub/Subscriber/CallbackTest.php +++ b/tests/Zend/Feed/Pubsubhubbub/Subscriber/CallbackTest.php @@ -36,7 +36,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Feed_Pubsubhubbub_Subscriber_CallbackTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Pubsubhubbub_Subscriber_CallbackTest extends PHPUnit\Framework\TestCase { protected $_originalServer = null; diff --git a/tests/Zend/Feed/Pubsubhubbub/SubscriberHttpTest.php b/tests/Zend/Feed/Pubsubhubbub/SubscriberHttpTest.php index ff0a68e5af..a2fe1effde 100644 --- a/tests/Zend/Feed/Pubsubhubbub/SubscriberHttpTest.php +++ b/tests/Zend/Feed/Pubsubhubbub/SubscriberHttpTest.php @@ -41,7 +41,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Feed_Pubsubhubbub_SubscriberHttpTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Pubsubhubbub_SubscriberHttpTest extends PHPUnit\Framework\TestCase { protected $_subscriber = null; diff --git a/tests/Zend/Feed/Pubsubhubbub/SubscriberTest.php b/tests/Zend/Feed/Pubsubhubbub/SubscriberTest.php index 18e9b5c8f8..94b3a8f6f5 100644 --- a/tests/Zend/Feed/Pubsubhubbub/SubscriberTest.php +++ b/tests/Zend/Feed/Pubsubhubbub/SubscriberTest.php @@ -32,7 +32,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Feed_Pubsubhubbub_SubscriberTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Pubsubhubbub_SubscriberTest extends PHPUnit\Framework\TestCase { protected $_subscriber = null; @@ -324,10 +324,11 @@ public function testCanSetStorageImplementation() } /** - * @expectedException Zend_Feed_Pubsubhubbub_Exception */ public function testGetStorageThrowsExceptionIfNoneSet() { + $this->expectException(\Zend_Feed_Pubsubhubbub_Exception::class); + $this->_subscriber->getStorage(); } diff --git a/tests/Zend/Feed/Reader/Entry/AtomStandaloneEntryTest.php b/tests/Zend/Feed/Reader/Entry/AtomStandaloneEntryTest.php index 928662a2eb..763d8c0c65 100644 --- a/tests/Zend/Feed/Reader/Entry/AtomStandaloneEntryTest.php +++ b/tests/Zend/Feed/Reader/Entry/AtomStandaloneEntryTest.php @@ -31,7 +31,7 @@ * @group Zend_Feed * @group Zend_Feed_Reader */ -class Zend_Feed_Reader_Entry_AtomStandaloneEntryTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Reader_Entry_AtomStandaloneEntryTest extends PHPUnit\Framework\TestCase { protected $_feedSamplePath = null; diff --git a/tests/Zend/Feed/Reader/Entry/AtomTest.php b/tests/Zend/Feed/Reader/Entry/AtomTest.php index aaed04ea18..135656d273 100644 --- a/tests/Zend/Feed/Reader/Entry/AtomTest.php +++ b/tests/Zend/Feed/Reader/Entry/AtomTest.php @@ -31,7 +31,7 @@ * @group Zend_Feed * @group Zend_Feed_Reader */ -class Zend_Feed_Reader_Entry_AtomTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Reader_Entry_AtomTest extends PHPUnit\Framework\TestCase { protected $_feedSamplePath = null; diff --git a/tests/Zend/Feed/Reader/Entry/CommonTest.php b/tests/Zend/Feed/Reader/Entry/CommonTest.php index 134e002c2c..ffdc48859e 100644 --- a/tests/Zend/Feed/Reader/Entry/CommonTest.php +++ b/tests/Zend/Feed/Reader/Entry/CommonTest.php @@ -31,7 +31,7 @@ * @group Zend_Feed * @group Zend_Feed_Reader */ -class Zend_Feed_Reader_Entry_CommonTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Reader_Entry_CommonTest extends PHPUnit\Framework\TestCase { protected $_feedSamplePath = null; diff --git a/tests/Zend/Feed/Reader/Entry/RssTest.php b/tests/Zend/Feed/Reader/Entry/RssTest.php index e2c87a9aee..63961064d7 100644 --- a/tests/Zend/Feed/Reader/Entry/RssTest.php +++ b/tests/Zend/Feed/Reader/Entry/RssTest.php @@ -31,7 +31,7 @@ * @group Zend_Feed * @group Zend_Feed_Reader */ -class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Reader_Entry_RssTest extends PHPUnit\Framework\TestCase { protected $_feedSamplePath = null; diff --git a/tests/Zend/Feed/Reader/Feed/AtomSourceTest.php b/tests/Zend/Feed/Reader/Feed/AtomSourceTest.php index 96f78c3a72..4d9469714e 100644 --- a/tests/Zend/Feed/Reader/Feed/AtomSourceTest.php +++ b/tests/Zend/Feed/Reader/Feed/AtomSourceTest.php @@ -31,7 +31,7 @@ * @group Zend_Feed * @group Zend_Feed_Reader */ -class Zend_Feed_Reader_Feed_AtomSourceTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Reader_Feed_AtomSourceTest extends PHPUnit\Framework\TestCase { protected $_feedSamplePath = null; diff --git a/tests/Zend/Feed/Reader/Feed/AtomTest.php b/tests/Zend/Feed/Reader/Feed/AtomTest.php index f4e22c6098..adce2d20b0 100644 --- a/tests/Zend/Feed/Reader/Feed/AtomTest.php +++ b/tests/Zend/Feed/Reader/Feed/AtomTest.php @@ -31,7 +31,7 @@ * @group Zend_Feed * @group Zend_Feed_Reader */ -class Zend_Feed_Reader_Feed_AtomTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Reader_Feed_AtomTest extends PHPUnit\Framework\TestCase { protected $_feedSamplePath = null; diff --git a/tests/Zend/Feed/Reader/Feed/CommonTest.php b/tests/Zend/Feed/Reader/Feed/CommonTest.php index 7e8c223f74..96dcf711b6 100644 --- a/tests/Zend/Feed/Reader/Feed/CommonTest.php +++ b/tests/Zend/Feed/Reader/Feed/CommonTest.php @@ -32,7 +32,7 @@ * @group Zend_Feed * @group Zend_Feed_Reader */ -class Zend_Feed_Reader_Feed_CommonTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Reader_Feed_CommonTest extends PHPUnit\Framework\TestCase { protected $_feedSamplePath = null; diff --git a/tests/Zend/Feed/Reader/Feed/RssTest.php b/tests/Zend/Feed/Reader/Feed/RssTest.php index 45ba6dcaec..f52506c120 100644 --- a/tests/Zend/Feed/Reader/Feed/RssTest.php +++ b/tests/Zend/Feed/Reader/Feed/RssTest.php @@ -32,7 +32,7 @@ * @group Zend_Feed * @group Zend_Feed_Reader */ -class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Reader_Feed_RssTest extends PHPUnit\Framework\TestCase { protected $_feedSamplePath = null; diff --git a/tests/Zend/Feed/Reader/Integration/H-OnlineComAtom10Test.php b/tests/Zend/Feed/Reader/Integration/H-OnlineComAtom10Test.php index 09c3d3a378..c4a5efe871 100644 --- a/tests/Zend/Feed/Reader/Integration/H-OnlineComAtom10Test.php +++ b/tests/Zend/Feed/Reader/Integration/H-OnlineComAtom10Test.php @@ -31,7 +31,7 @@ * @group Zend_Feed * @group Zend_Feed_Reader */ -class Zend_Feed_Reader_Integration_HOnlineComAtom10Test extends PHPUnit_Framework_TestCase +class Zend_Feed_Reader_Integration_HOnlineComAtom10Test extends PHPUnit\Framework\TestCase { protected $_feedSamplePath = null; diff --git a/tests/Zend/Feed/Reader/Integration/LautDeRdfTest.php b/tests/Zend/Feed/Reader/Integration/LautDeRdfTest.php index e614ea8290..bf9cae5254 100644 --- a/tests/Zend/Feed/Reader/Integration/LautDeRdfTest.php +++ b/tests/Zend/Feed/Reader/Integration/LautDeRdfTest.php @@ -31,7 +31,7 @@ * @group Zend_Feed * @group Zend_Feed_Reader */ -class Zend_Feed_Reader_Integration_LautDeRdfTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Reader_Integration_LautDeRdfTest extends PHPUnit\Framework\TestCase { protected $_feedSamplePath = null; diff --git a/tests/Zend/Feed/Reader/Integration/PodcastRss2Test.php b/tests/Zend/Feed/Reader/Integration/PodcastRss2Test.php index 3cba9b7d86..0030cb6257 100644 --- a/tests/Zend/Feed/Reader/Integration/PodcastRss2Test.php +++ b/tests/Zend/Feed/Reader/Integration/PodcastRss2Test.php @@ -31,7 +31,7 @@ * @group Zend_Feed * @group Zend_Feed_Reader */ -class Zend_Feed_Reader_Integration_PodcastRss2Test extends PHPUnit_Framework_TestCase +class Zend_Feed_Reader_Integration_PodcastRss2Test extends PHPUnit\Framework\TestCase { protected $_feedSamplePath = null; diff --git a/tests/Zend/Feed/Reader/Integration/WordpressAtom10Test.php b/tests/Zend/Feed/Reader/Integration/WordpressAtom10Test.php index e6cf480907..c556c3ca2a 100644 --- a/tests/Zend/Feed/Reader/Integration/WordpressAtom10Test.php +++ b/tests/Zend/Feed/Reader/Integration/WordpressAtom10Test.php @@ -31,7 +31,7 @@ * @group Zend_Feed * @group Zend_Feed_Reader */ -class Zend_Feed_Reader_Integration_WordpressAtom10Test extends PHPUnit_Framework_TestCase +class Zend_Feed_Reader_Integration_WordpressAtom10Test extends PHPUnit\Framework\TestCase { protected $_feedSamplePath = null; diff --git a/tests/Zend/Feed/Reader/Integration/WordpressRss2DcAtomTest.php b/tests/Zend/Feed/Reader/Integration/WordpressRss2DcAtomTest.php index fbf85a3a01..5d06b19e3d 100644 --- a/tests/Zend/Feed/Reader/Integration/WordpressRss2DcAtomTest.php +++ b/tests/Zend/Feed/Reader/Integration/WordpressRss2DcAtomTest.php @@ -31,7 +31,7 @@ * @group Zend_Feed * @group Zend_Feed_Reader */ -class Zend_Feed_Reader_Integration_WordpressRss2DcAtomTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Reader_Integration_WordpressRss2DcAtomTest extends PHPUnit\Framework\TestCase { protected $_feedSamplePath = null; diff --git a/tests/Zend/Feed/ReaderTest.php b/tests/Zend/Feed/ReaderTest.php index c5916a5fd6..33db4ee17b 100644 --- a/tests/Zend/Feed/ReaderTest.php +++ b/tests/Zend/Feed/ReaderTest.php @@ -32,7 +32,7 @@ * @group Zend_Feed * @group Zend_Feed_Reader */ -class Zend_Feed_ReaderTest extends PHPUnit_Framework_TestCase +class Zend_Feed_ReaderTest extends PHPUnit\Framework\TestCase { protected $_feedSamplePath = null; @@ -168,10 +168,11 @@ public function testImportsUri() /** * @group ZF-8328 - * @expectedException Zend_Feed_Exception */ public function testImportsUriAndThrowsExceptionIfNotAFeed() { + $this->expectException(\Zend_Feed_Exception::class); + if (!defined('TESTS_ZEND_FEED_READER_ONLINE_ENABLED') || !constant('TESTS_ZEND_FEED_READER_ONLINE_ENABLED') ) { @@ -332,7 +333,8 @@ public function testImportingUriWithEmptyResponseBodyTriggersException() 'adapter'=>$testAdapter ))); - $this->setExpectedException('Zend_Feed_Exception', 'Feed failed to load'); + $this->expectException('Zend_Feed_Exception'); + $this->expectExceptionMessage('Feed failed to load'); $result = Zend_Feed_Reader::import('http://www.example.com'); } @@ -340,7 +342,7 @@ public function testXxePreventionOnFeedParsing() { $string = file_get_contents($this->_feedSamplePath.'/Reader/xxe-atom10.xml'); $string = str_replace('XXE_URI', $this->_feedSamplePath.'/Reader/xxe-info.txt', $string); - $this->setExpectedException('Zend_Feed_Exception'); + $this->expectException('Zend_Feed_Exception'); $feed = Zend_Feed_Reader::importString($string); } diff --git a/tests/Zend/Feed/RssTest.php b/tests/Zend/Feed/RssTest.php index 6f023864ab..a906ec673b 100644 --- a/tests/Zend/Feed/RssTest.php +++ b/tests/Zend/Feed/RssTest.php @@ -42,7 +42,8 @@ class Zend_Feed_RssTest extends Zend_Feed_AbstractFeedTest public function testPreventsXxeAttacksOnParsing() { $uri = $this->baseUri . '/' . $this->prepareFeed('zend_feed_rss_xxe.xml'); - $this->setExpectedException('Zend_Feed_Exception', 'parse'); + $this->expectException('Zend_Feed_Exception'); + $this->expectExceptionMessage('parse'); $feed = new Zend_Feed_Rss($uri); } } diff --git a/tests/Zend/Feed/Writer/DeletedTest.php b/tests/Zend/Feed/Writer/DeletedTest.php index adf02fa752..91dc53a47a 100644 --- a/tests/Zend/Feed/Writer/DeletedTest.php +++ b/tests/Zend/Feed/Writer/DeletedTest.php @@ -31,7 +31,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Feed_Writer_DeletedTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Writer_DeletedTest extends PHPUnit\Framework\TestCase { public function testSetsReference() @@ -54,7 +54,7 @@ public function testSetReferenceThrowsExceptionOnInvalidParameter() public function testGetReferenceReturnsNullIfNotSet() { $entry = new Zend_Feed_Writer_Deleted; - $this->assertTrue(is_null($entry->getReference())); + $this->assertNull($entry->getReference()); } public function testSetWhenDefaultsToCurrentTime() @@ -116,7 +116,7 @@ public function testSetWhenThrowsExceptionOnInvalidParameter() public function testGetWhenReturnsNullIfDateNotSet() { $entry = new Zend_Feed_Writer_Deleted; - $this->assertTrue(is_null($entry->getWhen())); + $this->assertNull($entry->getWhen()); } public function testAddsByNameFromArray() diff --git a/tests/Zend/Feed/Writer/EntryTest.php b/tests/Zend/Feed/Writer/EntryTest.php index 67c712979d..9d83f1444d 100644 --- a/tests/Zend/Feed/Writer/EntryTest.php +++ b/tests/Zend/Feed/Writer/EntryTest.php @@ -31,7 +31,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Feed_Writer_EntryTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Writer_EntryTest extends PHPUnit\Framework\TestCase { protected $_feedSamplePath = null; @@ -184,10 +184,11 @@ public function testAddsEnclosure() } /** - * @expectedException Zend_Feed_Exception */ public function testAddsEnclosureThrowsExceptionOnMissingUri() { + $this->expectException(\Zend_Feed_Exception::class); + $entry = new Zend_Feed_Writer_Entry; $entry->setEnclosure(array( 'type' => 'audio/mpeg', @@ -196,10 +197,11 @@ public function testAddsEnclosureThrowsExceptionOnMissingUri() } /** - * @expectedException Zend_Feed_Exception */ public function testAddsEnclosureThrowsExceptionWhenUriIsInvalid() { + $this->expectException(\Zend_Feed_Exception::class); + $entry = new Zend_Feed_Writer_Entry; $entry->setEnclosure(array( 'type' => 'audio/mpeg', @@ -357,25 +359,25 @@ public function testSetDateModifiedThrowsExceptionOnInvalidParameter() public function testGetDateCreatedReturnsNullIfDateNotSet() { $entry = new Zend_Feed_Writer_Entry; - $this->assertTrue(is_null($entry->getDateCreated())); + $this->assertNull($entry->getDateCreated()); } public function testGetDateModifiedReturnsNullIfDateNotSet() { $entry = new Zend_Feed_Writer_Entry; - $this->assertTrue(is_null($entry->getDateModified())); + $this->assertNull($entry->getDateModified()); } public function testGetCopyrightReturnsNullIfDateNotSet() { $entry = new Zend_Feed_Writer_Entry; - $this->assertTrue(is_null($entry->getCopyright())); + $this->assertNull($entry->getCopyright()); } public function testGetContentReturnsNullIfDateNotSet() { $entry = new Zend_Feed_Writer_Entry; - $this->assertTrue(is_null($entry->getContent())); + $this->assertNull($entry->getContent()); } public function testSetsDescription() @@ -398,7 +400,7 @@ public function testSetDescriptionThrowsExceptionOnInvalidParameter() public function testGetDescriptionReturnsNullIfDateNotSet() { $entry = new Zend_Feed_Writer_Entry; - $this->assertTrue(is_null($entry->getDescription())); + $this->assertNull($entry->getDescription()); } public function testSetsId() @@ -421,7 +423,7 @@ public function testSetIdThrowsExceptionOnInvalidParameter() public function testGetIdReturnsNullIfNotSet() { $entry = new Zend_Feed_Writer_Entry; - $this->assertTrue(is_null($entry->getId())); + $this->assertNull($entry->getId()); } public function testSetsLink() @@ -454,7 +456,7 @@ public function testSetLinkThrowsExceptionOnInvalidUri() public function testGetLinkReturnsNullIfNotSet() { $entry = new Zend_Feed_Writer_Entry; - $this->assertTrue(is_null($entry->getLink())); + $this->assertNull($entry->getLink()); } public function testSetsCommentLink() @@ -487,7 +489,7 @@ public function testSetCommentLinkThrowsExceptionOnInvalidUri() public function testGetCommentLinkReturnsNullIfDateNotSet() { $entry = new Zend_Feed_Writer_Entry; - $this->assertTrue(is_null($entry->getCommentLink())); + $this->assertNull($entry->getCommentLink()); } public function testSetsCommentFeedLink() @@ -531,7 +533,7 @@ public function testSetCommentFeedLinkThrowsExceptionOnInvalidType() public function testGetCommentFeedLinkReturnsNullIfNoneSet() { $entry = new Zend_Feed_Writer_Entry; - $this->assertTrue(is_null($entry->getCommentFeedLinks())); + $this->assertNull($entry->getCommentFeedLinks()); } public function testSetsTitle() @@ -554,7 +556,7 @@ public function testSetTitleThrowsExceptionOnInvalidParameter() public function testGetTitleReturnsNullIfDateNotSet() { $entry = new Zend_Feed_Writer_Entry; - $this->assertTrue(is_null($entry->getTitle())); + $this->assertNull($entry->getTitle()); } public function testSetsCommentCount() @@ -597,7 +599,7 @@ public function testSetCommentCountThrowsExceptionOnInvalidNonIntegerParameter() public function testGetCommentCountReturnsNullIfDateNotSet() { $entry = new Zend_Feed_Writer_Entry; - $this->assertTrue(is_null($entry->getCommentCount())); + $this->assertNull($entry->getCommentCount()); } } diff --git a/tests/Zend/Feed/Writer/Extension/ITunes/EntryTest.php b/tests/Zend/Feed/Writer/Extension/ITunes/EntryTest.php index 1a7373d872..559749ced1 100644 --- a/tests/Zend/Feed/Writer/Extension/ITunes/EntryTest.php +++ b/tests/Zend/Feed/Writer/Extension/ITunes/EntryTest.php @@ -31,7 +31,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Feed_Writer_Extension_ITunes_EntryTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Writer_Extension_ITunes_EntryTest extends PHPUnit\Framework\TestCase { public function testSetBlock() @@ -42,19 +42,21 @@ public function testSetBlock() } /** - * @expectedException Zend_Feed_Exception */ public function testSetBlockThrowsExceptionOnNonAlphaValue() { + $this->expectException(\Zend_Feed_Exception::class); + $entry = new Zend_Feed_Writer_Entry; $entry->setItunesBlock('123'); } /** - * @expectedException Zend_Feed_Exception */ public function testSetBlockThrowsExceptionIfValueGreaterThan255CharsLength() { + $this->expectException(\Zend_Feed_Exception::class); + $entry = new Zend_Feed_Writer_Entry; $entry->setItunesBlock(str_repeat('a', 256)); } @@ -74,10 +76,11 @@ public function testAddAuthor() } /** - * @expectedException Zend_Feed_Exception */ public function testAddAuthorThrowsExceptionIfValueGreaterThan255CharsLength() { + $this->expectException(\Zend_Feed_Exception::class); + $entry = new Zend_Feed_Writer_Entry; $entry->addItunesAuthor(str_repeat('a', 256)); } @@ -104,28 +107,31 @@ public function testSetDurationAsHoursMinutesAndSeconds() } /** - * @expectedException Zend_Feed_Exception */ public function testSetDurationThrowsExceptionOnUnknownFormat() { + $this->expectException(\Zend_Feed_Exception::class); + $entry = new Zend_Feed_Writer_Entry; $entry->setItunesDuration('abc'); } /** - * @expectedException Zend_Feed_Exception */ public function testSetDurationThrowsExceptionOnInvalidSeconds() { + $this->expectException(\Zend_Feed_Exception::class); + $entry = new Zend_Feed_Writer_Entry; $entry->setItunesDuration('23:456'); } /** - * @expectedException Zend_Feed_Exception */ public function testSetDurationThrowsExceptionOnInvalidMinutes() { + $this->expectException(\Zend_Feed_Exception::class); + $entry = new Zend_Feed_Writer_Entry; $entry->setItunesDuration('23:234:45'); } @@ -152,10 +158,11 @@ public function testSetExplicitToClean() } /** - * @expectedException Zend_Feed_Exception */ public function testSetExplicitThrowsExceptionOnUnknownTerm() { + $this->expectException(\Zend_Feed_Exception::class); + $entry = new Zend_Feed_Writer_Entry; $entry->setItunesExplicit('abc'); } @@ -171,10 +178,11 @@ public function testSetKeywords() } /** - * @expectedException Zend_Feed_Exception */ public function testSetKeywordsThrowsExceptionIfMaxKeywordsExceeded() { + $this->expectException(\Zend_Feed_Exception::class); + $entry = new Zend_Feed_Writer_Entry; $words = array( 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'a10', 'a11', 'a12', 'a13' @@ -183,10 +191,11 @@ public function testSetKeywordsThrowsExceptionIfMaxKeywordsExceeded() } /** - * @expectedException Zend_Feed_Exception */ public function testSetKeywordsThrowsExceptionIfFormattedKeywordsExceeds255CharLength() { + $this->expectException(\Zend_Feed_Exception::class); + $entry = new Zend_Feed_Writer_Entry; $words = array( str_repeat('a', 253), str_repeat('b', 2) @@ -202,10 +211,11 @@ public function testSetSubtitle() } /** - * @expectedException Zend_Feed_Exception */ public function testSetSubtitleThrowsExceptionWhenValueExceeds255Chars() { + $this->expectException(\Zend_Feed_Exception::class); + $entry = new Zend_Feed_Writer_Entry; $entry->setItunesSubtitle(str_repeat('a', 256)); } @@ -218,10 +228,11 @@ public function testSetSummary() } /** - * @expectedException Zend_Feed_Exception */ public function testSetSummaryThrowsExceptionWhenValueExceeds255Chars() { + $this->expectException(\Zend_Feed_Exception::class); + $entry = new Zend_Feed_Writer_Entry; $entry->setItunesSummary(str_repeat('a', 4001)); } diff --git a/tests/Zend/Feed/Writer/Extension/ITunes/FeedTest.php b/tests/Zend/Feed/Writer/Extension/ITunes/FeedTest.php index 30676b1765..6ffc8f4258 100644 --- a/tests/Zend/Feed/Writer/Extension/ITunes/FeedTest.php +++ b/tests/Zend/Feed/Writer/Extension/ITunes/FeedTest.php @@ -31,7 +31,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Feed_Writer_Extension_ITunes_FeedTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Writer_Extension_ITunes_FeedTest extends PHPUnit\Framework\TestCase { public function testSetBlock() @@ -42,19 +42,21 @@ public function testSetBlock() } /** - * @expectedException Zend_Feed_Exception */ public function testSetBlockThrowsExceptionOnNonAlphaValue() { + $this->expectException(\Zend_Feed_Exception::class); + $feed = new Zend_Feed_Writer_Feed; $feed->setItunesBlock('123'); } /** - * @expectedException Zend_Feed_Exception */ public function testSetBlockThrowsExceptionIfValueGreaterThan255CharsLength() { + $this->expectException(\Zend_Feed_Exception::class); + $feed = new Zend_Feed_Writer_Feed; $feed->setItunesBlock(str_repeat('a', 256)); } @@ -74,10 +76,11 @@ public function testAddAuthor() } /** - * @expectedException Zend_Feed_Exception */ public function testAddAuthorThrowsExceptionIfValueGreaterThan255CharsLength() { + $this->expectException(\Zend_Feed_Exception::class); + $feed = new Zend_Feed_Writer_Feed; $feed->addItunesAuthor(str_repeat('a', 256)); } @@ -94,10 +97,11 @@ public function testSetCategories() } /** - * @expectedException Zend_Feed_Exception */ public function testSetCategoriesThrowsExceptionIfAnyCatNameGreaterThan255CharsLength() { + $this->expectException(\Zend_Feed_Exception::class); + $feed = new Zend_Feed_Writer_Feed; $cats = array( 'cat1', @@ -122,19 +126,21 @@ public function testSetImageAsJpgFile() } /** - * @expectedException Zend_Feed_Exception */ public function testSetImageThrowsExceptionOnInvalidUri() { + $this->expectException(\Zend_Feed_Exception::class); + $feed = new Zend_Feed_Writer_Feed; $feed->setItunesImage('http://'); } /** - * @expectedException Zend_Feed_Exception */ public function testSetImageThrowsExceptionOnInvalidImageExtension() { + $this->expectException(\Zend_Feed_Exception::class); + $feed = new Zend_Feed_Writer_Feed; $feed->setItunesImage('http://www.example.com/image.gif'); } @@ -161,28 +167,31 @@ public function testSetDurationAsHoursMinutesAndSeconds() } /** - * @expectedException Zend_Feed_Exception */ public function testSetDurationThrowsExceptionOnUnknownFormat() { + $this->expectException(\Zend_Feed_Exception::class); + $feed = new Zend_Feed_Writer_Feed; $feed->setItunesDuration('abc'); } /** - * @expectedException Zend_Feed_Exception */ public function testSetDurationThrowsExceptionOnInvalidSeconds() { + $this->expectException(\Zend_Feed_Exception::class); + $feed = new Zend_Feed_Writer_Feed; $feed->setItunesDuration('23:456'); } /** - * @expectedException Zend_Feed_Exception */ public function testSetDurationThrowsExceptionOnInvalidMinutes() { + $this->expectException(\Zend_Feed_Exception::class); + $feed = new Zend_Feed_Writer_Feed; $feed->setItunesDuration('23:234:45'); } @@ -209,10 +218,11 @@ public function testSetExplicitToClean() } /** - * @expectedException Zend_Feed_Exception */ public function testSetExplicitThrowsExceptionOnUnknownTerm() { + $this->expectException(\Zend_Feed_Exception::class); + $feed = new Zend_Feed_Writer_Feed; $feed->setItunesExplicit('abc'); } @@ -228,10 +238,11 @@ public function testSetKeywords() } /** - * @expectedException Zend_Feed_Exception */ public function testSetKeywordsThrowsExceptionIfMaxKeywordsExceeded() { + $this->expectException(\Zend_Feed_Exception::class); + $feed = new Zend_Feed_Writer_Feed; $words = array( 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'a10', 'a11', 'a12', 'a13' @@ -240,10 +251,11 @@ public function testSetKeywordsThrowsExceptionIfMaxKeywordsExceeded() } /** - * @expectedException Zend_Feed_Exception */ public function testSetKeywordsThrowsExceptionIfFormattedKeywordsExceeds255CharLength() { + $this->expectException(\Zend_Feed_Exception::class); + $feed = new Zend_Feed_Writer_Feed; $words = array( str_repeat('a', 253), str_repeat('b', 2) @@ -259,10 +271,11 @@ public function testSetNewFeedUrl() } /** - * @expectedException Zend_Feed_Exception */ public function testSetNewFeedUrlThrowsExceptionOnInvalidUri() { + $this->expectException(\Zend_Feed_Exception::class); + $feed = new Zend_Feed_Writer_Feed; $feed->setItunesNewFeedUrl('http://'); } @@ -289,10 +302,11 @@ public function testSetSubtitle() } /** - * @expectedException Zend_Feed_Exception */ public function testSetSubtitleThrowsExceptionWhenValueExceeds255Chars() { + $this->expectException(\Zend_Feed_Exception::class); + $feed = new Zend_Feed_Writer_Feed; $feed->setItunesSubtitle(str_repeat('a', 256)); } @@ -305,10 +319,11 @@ public function testSetSummary() } /** - * @expectedException Zend_Feed_Exception */ public function testSetSummaryThrowsExceptionWhenValueExceeds4000Chars() { + $this->expectException(\Zend_Feed_Exception::class); + $feed = new Zend_Feed_Writer_Feed; $feed->setItunesSummary(str_repeat('a',4001)); } diff --git a/tests/Zend/Feed/Writer/FeedTest.php b/tests/Zend/Feed/Writer/FeedTest.php index c37729d155..656f61cbe0 100644 --- a/tests/Zend/Feed/Writer/FeedTest.php +++ b/tests/Zend/Feed/Writer/FeedTest.php @@ -31,7 +31,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Feed_Writer_FeedTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Writer_FeedTest extends PHPUnit\Framework\TestCase { protected $_feedSamplePath = null; @@ -295,13 +295,13 @@ public function testSetDateModifiedThrowsExceptionOnInvalidParameter() public function testGetDateCreatedReturnsNullIfDateNotSet() { $writer = new Zend_Feed_Writer_Feed; - $this->assertTrue(is_null($writer->getDateCreated())); + $this->assertNull($writer->getDateCreated()); } public function testGetDateModifiedReturnsNullIfDateNotSet() { $writer = new Zend_Feed_Writer_Feed; - $this->assertTrue(is_null($writer->getDateModified())); + $this->assertNull($writer->getDateModified()); } public function testSetLastBuildDateDefaultsToCurrentTime() @@ -363,13 +363,13 @@ public function testSetLastBuildDateThrowsExceptionOnInvalidParameter() public function testGetLastBuildDateReturnsNullIfDateNotSet() { $writer = new Zend_Feed_Writer_Feed; - $this->assertTrue(is_null($writer->getLastBuildDate())); + $this->assertNull($writer->getLastBuildDate()); } public function testGetCopyrightReturnsNullIfDateNotSet() { $writer = new Zend_Feed_Writer_Feed; - $this->assertTrue(is_null($writer->getCopyright())); + $this->assertNull($writer->getCopyright()); } public function testSetsDescription() @@ -392,7 +392,7 @@ public function testSetDescriptionThrowsExceptionOnInvalidParameter() public function testGetDescriptionReturnsNullIfDateNotSet() { $writer = new Zend_Feed_Writer_Feed; - $this->assertTrue(is_null($writer->getDescription())); + $this->assertNull($writer->getDescription()); } public function testSetsId() @@ -446,7 +446,7 @@ public function testSetIdThrowsExceptionOnInvalidUri() public function testGetIdReturnsNullIfDateNotSet() { $writer = new Zend_Feed_Writer_Feed; - $this->assertTrue(is_null($writer->getId())); + $this->assertNull($writer->getId()); } public function testSetsLanguage() @@ -469,7 +469,7 @@ public function testSetLanguageThrowsExceptionOnInvalidParameter() public function testGetLanguageReturnsNullIfDateNotSet() { $writer = new Zend_Feed_Writer_Feed; - $this->assertTrue(is_null($writer->getLanguage())); + $this->assertNull($writer->getLanguage()); } public function testSetsLink() @@ -502,7 +502,7 @@ public function testSetLinkThrowsExceptionOnInvalidUri() public function testGetLinkReturnsNullIfDateNotSet() { $writer = new Zend_Feed_Writer_Feed; - $this->assertTrue(is_null($writer->getLink())); + $this->assertNull($writer->getLink()); } public function testSetsEncoding() @@ -548,7 +548,7 @@ public function testSetTitleThrowsExceptionOnInvalidParameter() public function testGetTitleReturnsNullIfDateNotSet() { $writer = new Zend_Feed_Writer_Feed; - $this->assertTrue(is_null($writer->getTitle())); + $this->assertNull($writer->getTitle()); } public function testSetsGeneratorName() @@ -674,7 +674,7 @@ public function testSetsGeneratorThrowsExceptionOnInvalidUri_Deprecated() public function testGetGeneratorReturnsNullIfDateNotSet() { $writer = new Zend_Feed_Writer_Feed; - $this->assertTrue(is_null($writer->getGenerator())); + $this->assertNull($writer->getGenerator()); } public function testSetsFeedLink() @@ -707,7 +707,7 @@ public function testSetsFeedLinkThrowsExceptionOnInvalidUri() public function testGetFeedLinksReturnsNullIfNotSet() { $writer = new Zend_Feed_Writer_Feed; - $this->assertTrue(is_null($writer->getFeedLinks())); + $this->assertNull($writer->getFeedLinks()); } public function testSetsBaseUrl() @@ -730,7 +730,7 @@ public function testSetsBaseUrlThrowsExceptionOnInvalidUri() public function testGetBaseUrlReturnsNullIfNotSet() { $writer = new Zend_Feed_Writer_Feed; - $this->assertTrue(is_null($writer->getBaseUrl())); + $this->assertNull($writer->getBaseUrl()); } public function testAddsHubUrl() @@ -760,7 +760,7 @@ public function testAddingHubUrlThrowsExceptionOnInvalidUri() public function testAddingHubUrlReturnsNullIfNotSet() { $writer = new Zend_Feed_Writer_Feed; - $this->assertTrue(is_null($writer->getHubs())); + $this->assertNull($writer->getHubs()); } public function testCreatesNewEntryDataContainer() @@ -818,10 +818,11 @@ public function testSetsImageUri() } /** - * @expectedException Zend_Feed_Exception */ public function testSetsImageUriThrowsExceptionOnEmptyUri() { + $this->expectException(\Zend_Feed_Exception::class); + $writer = new Zend_Feed_Writer_Feed; $writer->setImage(array( 'uri' => '' @@ -829,19 +830,21 @@ public function testSetsImageUriThrowsExceptionOnEmptyUri() } /** - * @expectedException Zend_Feed_Exception */ public function testSetsImageUriThrowsExceptionOnMissingUri() { + $this->expectException(\Zend_Feed_Exception::class); + $writer = new Zend_Feed_Writer_Feed; $writer->setImage(array()); } /** - * @expectedException Zend_Feed_Exception */ public function testSetsImageUriThrowsExceptionOnInvalidUri() { + $this->expectException(\Zend_Feed_Exception::class); + $writer = new Zend_Feed_Writer_Feed; $writer->setImage(array( 'uri' => 'http://' @@ -927,10 +930,11 @@ public function testSetsIconUri() } /** - * @expectedException Zend_Feed_Exception */ public function testSetsIconUriThrowsExceptionOnEmptyUri() { + $this->expectException(\Zend_Feed_Exception::class); + $writer = new Zend_Feed_Writer_Feed; $writer->setIcon(array( 'uri' => '' @@ -938,19 +942,21 @@ public function testSetsIconUriThrowsExceptionOnEmptyUri() } /** - * @expectedException Zend_Feed_Exception */ public function testSetsIconUriThrowsExceptionOnMissingUri() { + $this->expectException(\Zend_Feed_Exception::class); + $writer = new Zend_Feed_Writer_Feed; $writer->setIcon(array()); } /** - * @expectedException Zend_Feed_Exception */ public function testSetsIconUriThrowsExceptionOnInvalidUri() { + $this->expectException(\Zend_Feed_Exception::class); + $writer = new Zend_Feed_Writer_Feed; $writer->setIcon(array( 'uri' => 'http://' @@ -960,7 +966,7 @@ public function testSetsIconUriThrowsExceptionOnInvalidUri() public function testGetCategoriesReturnsNullIfNotSet() { $writer = new Zend_Feed_Writer_Feed; - $this->assertTrue(is_null($writer->getCategories())); + $this->assertNull($writer->getCategories()); } public function testAddsAndOrdersEntriesByDateIfRequested() diff --git a/tests/Zend/Feed/Writer/Renderer/Entry/AtomTest.php b/tests/Zend/Feed/Writer/Renderer/Entry/AtomTest.php index e2e9a50188..4ee9f51a64 100644 --- a/tests/Zend/Feed/Writer/Renderer/Entry/AtomTest.php +++ b/tests/Zend/Feed/Writer/Renderer/Entry/AtomTest.php @@ -33,7 +33,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Feed_Writer_Renderer_Entry_AtomTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Writer_Renderer_Entry_AtomTest extends PHPUnit\Framework\TestCase { protected $_validWriter = null; @@ -104,10 +104,11 @@ public function testEntryTitleHasBeenSet() } /** - * @expectedException Zend_Feed_Exception */ public function testFeedTitleIfMissingThrowsException() { + $this->expectException(\Zend_Feed_Exception::class); + $atomFeed = new Zend_Feed_Writer_Renderer_Feed_Atom($this->_validWriter); $this->_validEntry->remove('title'); $atomFeed->render(); @@ -133,10 +134,11 @@ public function testEntryContentHasBeenSet_Xhtml() } /** - * @expectedException Zend_Feed_Exception */ public function testFeedContentIfMissingThrowsExceptionIfThereIsNoLink() { + $this->expectException(\Zend_Feed_Exception::class); + $atomFeed = new Zend_Feed_Writer_Renderer_Feed_Atom($this->_validWriter); $this->_validEntry->remove('content'); $this->_validEntry->remove('link'); @@ -152,10 +154,11 @@ public function testEntryUpdatedDateHasBeenSet() } /** - * @expectedException Zend_Feed_Exception */ public function testFeedUpdatedDateIfMissingThrowsException() { + $this->expectException(\Zend_Feed_Exception::class); + $atomFeed = new Zend_Feed_Writer_Renderer_Feed_Atom($this->_validWriter); $this->_validEntry->remove('dateModified'); $atomFeed->render(); @@ -241,10 +244,11 @@ public function testFeedIdDefaultIsUsedIfNotSetByHand() } /** - * @expectedException Zend_Feed_Exception */ public function testFeedIdIfMissingThrowsException() { + $this->expectException(\Zend_Feed_Exception::class); + $atomFeed = new Zend_Feed_Writer_Renderer_Feed_Atom($this->_validWriter); $this->_validEntry->remove('id'); $this->_validEntry->remove('link'); @@ -252,10 +256,11 @@ public function testFeedIdIfMissingThrowsException() } /** - * @expectedException Zend_Feed_Exception */ public function testFeedIdThrowsExceptionIfNotUri() { + $this->expectException(\Zend_Feed_Exception::class); + $atomFeed = new Zend_Feed_Writer_Renderer_Feed_Atom($this->_validWriter); $this->_validEntry->remove('id'); $this->_validEntry->remove('link'); diff --git a/tests/Zend/Feed/Writer/Renderer/Entry/RssTest.php b/tests/Zend/Feed/Writer/Renderer/Entry/RssTest.php index 24b17a01e9..d5bbc0eb6e 100644 --- a/tests/Zend/Feed/Writer/Renderer/Entry/RssTest.php +++ b/tests/Zend/Feed/Writer/Renderer/Entry/RssTest.php @@ -33,7 +33,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Feed_Writer_Renderer_Entry_RssTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Writer_Renderer_Entry_RssTest extends PHPUnit\Framework\TestCase { protected $_validWriter = null; @@ -97,10 +97,11 @@ public function testEntryTitleHasBeenSet() } /** - * @expectedException Zend_Feed_Exception */ public function testEntryTitleIfMissingThrowsExceptionIfDescriptionAlsoMissing() { + $this->expectException(\Zend_Feed_Exception::class); + $atomFeed = new Zend_Feed_Writer_Renderer_Feed_Rss($this->_validWriter); $this->_validEntry->remove('title'); $this->_validEntry->remove('description'); @@ -125,10 +126,11 @@ public function testEntrySummaryDescriptionHasBeenSet() } /** - * @expectedException Zend_Feed_Exception */ public function testEntryDescriptionIfMissingThrowsExceptionIfAlsoNoTitle() { + $this->expectException(\Zend_Feed_Exception::class); + $atomFeed = new Zend_Feed_Writer_Renderer_Feed_Rss($this->_validWriter); $this->_validEntry->remove('description'); $this->_validEntry->remove('title'); @@ -225,10 +227,11 @@ public function testEntryHoldsAnyEnclosureAdded() } /** - * @expectedException Zend_Feed_Exception */ public function testAddsEnclosureThrowsExceptionOnMissingType() { + $this->expectException(\Zend_Feed_Exception::class); + $renderer = new Zend_Feed_Writer_Renderer_Feed_Rss($this->_validWriter); $this->_validEntry->setEnclosure(array( 'uri' => 'http://example.com/audio.mp3', @@ -238,10 +241,11 @@ public function testAddsEnclosureThrowsExceptionOnMissingType() } /** - * @expectedException Zend_Feed_Exception */ public function testAddsEnclosureThrowsExceptionOnMissingLength() { + $this->expectException(\Zend_Feed_Exception::class); + $renderer = new Zend_Feed_Writer_Renderer_Feed_Rss($this->_validWriter); $this->_validEntry->setEnclosure(array( 'type' => 'audio/mpeg', @@ -251,10 +255,11 @@ public function testAddsEnclosureThrowsExceptionOnMissingLength() } /** - * @expectedException Zend_Feed_Exception */ public function testAddsEnclosureThrowsExceptionOnNonNumericLength() { + $this->expectException(\Zend_Feed_Exception::class); + $renderer = new Zend_Feed_Writer_Renderer_Feed_Rss($this->_validWriter); $this->_validEntry->setEnclosure(array( 'type' => 'audio/mpeg', @@ -265,10 +270,11 @@ public function testAddsEnclosureThrowsExceptionOnNonNumericLength() } /** - * @expectedException Zend_Feed_Exception */ public function testAddsEnclosureThrowsExceptionOnNegativeLength() { + $this->expectException(\Zend_Feed_Exception::class); + $renderer = new Zend_Feed_Writer_Renderer_Feed_Rss($this->_validWriter); $this->_validEntry->setEnclosure(array( 'type' => 'audio/mpeg', diff --git a/tests/Zend/Feed/Writer/Renderer/Feed/AtomTest.php b/tests/Zend/Feed/Writer/Renderer/Feed/AtomTest.php index db1944d30d..4579f7acf8 100644 --- a/tests/Zend/Feed/Writer/Renderer/Feed/AtomTest.php +++ b/tests/Zend/Feed/Writer/Renderer/Feed/AtomTest.php @@ -33,7 +33,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Feed_Writer_Renderer_Feed_AtomTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Writer_Renderer_Feed_AtomTest extends PHPUnit\Framework\TestCase { protected $_validWriter = null; @@ -99,10 +99,11 @@ public function testFeedTitleHasBeenSet() } /** - * @expectedException Zend_Feed_Exception */ public function testFeedTitleIfMissingThrowsException() { + $this->expectException(\Zend_Feed_Exception::class); + $atomFeed = new Zend_Feed_Writer_Renderer_Feed_Atom($this->_validWriter); $this->_validWriter->remove('title'); $atomFeed->render(); @@ -156,10 +157,11 @@ public function testFeedUpdatedDateHasBeenSet() } /** - * @expectedException Zend_Feed_Exception */ public function testFeedUpdatedDateIfMissingThrowsException() { + $this->expectException(\Zend_Feed_Exception::class); + $atomFeed = new Zend_Feed_Writer_Renderer_Feed_Atom($this->_validWriter); $this->_validWriter->remove('dateModified'); $atomFeed->render(); @@ -242,10 +244,11 @@ public function testFeedLinkToHtmlVersionOfFeedIfMissingThrowsNoExceptionIfIdSet } /** - * @expectedException Zend_Feed_Exception */ public function testFeedLinkToHtmlVersionOfFeedIfMissingThrowsExceptionIfIdMissing() { + $this->expectException(\Zend_Feed_Exception::class); + $atomFeed = new Zend_Feed_Writer_Renderer_Feed_Atom($this->_validWriter); $this->_validWriter->remove('link'); $atomFeed->render(); @@ -260,10 +263,11 @@ public function testFeedIncludesLinkToXmlAtomWhereTheFeedWillBeAvailable() } /** - * @expectedException Zend_Feed_Exception */ public function testFeedLinkToXmlAtomWhereTheFeedWillBeAvailableIfMissingThrowsException() { + $this->expectException(\Zend_Feed_Exception::class); + $atomFeed = new Zend_Feed_Writer_Renderer_Feed_Atom($this->_validWriter); $this->_validWriter->remove('feedLinks'); $atomFeed->render(); diff --git a/tests/Zend/Feed/Writer/Renderer/Feed/RssTest.php b/tests/Zend/Feed/Writer/Renderer/Feed/RssTest.php index a68c0f3d3f..4a94643ee0 100644 --- a/tests/Zend/Feed/Writer/Renderer/Feed/RssTest.php +++ b/tests/Zend/Feed/Writer/Renderer/Feed/RssTest.php @@ -33,7 +33,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Feed_Writer_Renderer_Feed_RssTest extends PHPUnit_Framework_TestCase +class Zend_Feed_Writer_Renderer_Feed_RssTest extends PHPUnit\Framework\TestCase { protected $_validWriter = null; @@ -96,10 +96,11 @@ public function testFeedTitleHasBeenSet() } /** - * @expectedException Zend_Feed_Exception */ public function testFeedTitleIfMissingThrowsException() { + $this->expectException(\Zend_Feed_Exception::class); + $rssFeed = new Zend_Feed_Writer_Renderer_Feed_Rss($this->_validWriter); $this->_validWriter->remove('title'); $rssFeed->render(); @@ -126,10 +127,11 @@ public function testFeedDescriptionHasBeenSet() } /** - * @expectedException Zend_Feed_Exception */ public function testFeedDescriptionThrowsExceptionIfMissing() { + $this->expectException(\Zend_Feed_Exception::class); + $rssFeed = new Zend_Feed_Writer_Renderer_Feed_Rss($this->_validWriter); $this->_validWriter->remove('description'); $rssFeed->render(); @@ -229,10 +231,11 @@ public function testFeedIncludesLinkToHtmlVersionOfFeed() } /** - * @expectedException Zend_Feed_Exception */ public function testFeedLinkToHtmlVersionOfFeedIfMissingThrowsException() { + $this->expectException(\Zend_Feed_Exception::class); + $rssFeed = new Zend_Feed_Writer_Renderer_Feed_Rss($this->_validWriter); $this->_validWriter->remove('link'); $rssFeed->render(); @@ -402,10 +405,11 @@ public function testImageCanBeSetWithOnlyRequiredElements() } /** - * @expectedException Zend_Feed_Exception */ public function testImageThrowsExceptionOnMissingLink() { + $this->expectException(\Zend_Feed_Exception::class); + $this->_validWriter->setImage(array( 'uri' => 'http://www.example.com/logo.gif', 'title' => 'Image ALT' @@ -415,10 +419,11 @@ public function testImageThrowsExceptionOnMissingLink() } /** - * @expectedException Zend_Feed_Exception */ public function testImageThrowsExceptionOnMissingTitle() { + $this->expectException(\Zend_Feed_Exception::class); + $this->_validWriter->setImage(array( 'uri' => 'http://www.example.com/logo.gif', 'link' => 'http://www.example.com' @@ -428,10 +433,11 @@ public function testImageThrowsExceptionOnMissingTitle() } /** - * @expectedException Zend_Feed_Exception */ public function testImageThrowsExceptionOnMissingUri() { + $this->expectException(\Zend_Feed_Exception::class); + $this->_validWriter->setImage(array( 'link' => 'http://www.example.com', 'title' => 'Image ALT' @@ -441,10 +447,11 @@ public function testImageThrowsExceptionOnMissingUri() } /** - * @expectedException Zend_Feed_Exception */ public function testImageThrowsExceptionIfOptionalDescriptionInvalid() { + $this->expectException(\Zend_Feed_Exception::class); + $this->_validWriter->setImage(array( 'uri' => 'http://www.example.com/logo.gif', 'link' => 'http://www.example.com', @@ -456,10 +463,11 @@ public function testImageThrowsExceptionIfOptionalDescriptionInvalid() } /** - * @expectedException Zend_Feed_Exception */ public function testImageThrowsExceptionIfOptionalDescriptionEmpty() { + $this->expectException(\Zend_Feed_Exception::class); + $this->_validWriter->setImage(array( 'uri' => 'http://www.example.com/logo.gif', 'link' => 'http://www.example.com', @@ -471,10 +479,11 @@ public function testImageThrowsExceptionIfOptionalDescriptionEmpty() } /** - * @expectedException Zend_Feed_Exception */ public function testImageThrowsExceptionIfOptionalHeightNotAnInteger() { + $this->expectException(\Zend_Feed_Exception::class); + $this->_validWriter->setImage(array( 'uri' => 'http://www.example.com/logo.gif', 'link' => 'http://www.example.com', @@ -487,10 +496,11 @@ public function testImageThrowsExceptionIfOptionalHeightNotAnInteger() } /** - * @expectedException Zend_Feed_Exception */ public function testImageThrowsExceptionIfOptionalHeightEmpty() { + $this->expectException(\Zend_Feed_Exception::class); + $this->_validWriter->setImage(array( 'uri' => 'http://www.example.com/logo.gif', 'link' => 'http://www.example.com', @@ -503,10 +513,11 @@ public function testImageThrowsExceptionIfOptionalHeightEmpty() } /** - * @expectedException Zend_Feed_Exception */ public function testImageThrowsExceptionIfOptionalHeightGreaterThan400() { + $this->expectException(\Zend_Feed_Exception::class); + $this->_validWriter->setImage(array( 'uri' => 'http://www.example.com/logo.gif', 'link' => 'http://www.example.com', @@ -519,10 +530,11 @@ public function testImageThrowsExceptionIfOptionalHeightGreaterThan400() } /** - * @expectedException Zend_Feed_Exception */ public function testImageThrowsExceptionIfOptionalWidthNotAnInteger() { + $this->expectException(\Zend_Feed_Exception::class); + $this->_validWriter->setImage(array( 'uri' => 'http://www.example.com/logo.gif', 'link' => 'http://www.example.com', @@ -535,10 +547,11 @@ public function testImageThrowsExceptionIfOptionalWidthNotAnInteger() } /** - * @expectedException Zend_Feed_Exception */ public function testImageThrowsExceptionIfOptionalWidthEmpty() { + $this->expectException(\Zend_Feed_Exception::class); + $this->_validWriter->setImage(array( 'uri' => 'http://www.example.com/logo.gif', 'link' => 'http://www.example.com', @@ -551,10 +564,11 @@ public function testImageThrowsExceptionIfOptionalWidthEmpty() } /** - * @expectedException Zend_Feed_Exception */ public function testImageThrowsExceptionIfOptionalWidthGreaterThan144() { + $this->expectException(\Zend_Feed_Exception::class); + $this->_validWriter->setImage(array( 'uri' => 'http://www.example.com/logo.gif', 'link' => 'http://www.example.com', diff --git a/tests/Zend/File/ClassFileLocatorTest.php b/tests/Zend/File/ClassFileLocatorTest.php index 4d6b20a207..86753c5005 100644 --- a/tests/Zend/File/ClassFileLocatorTest.php +++ b/tests/Zend/File/ClassFileLocatorTest.php @@ -31,19 +31,19 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_File */ -class Zend_File_ClassFileLocatorTest extends PHPUnit_Framework_TestCase +class Zend_File_ClassFileLocatorTest extends PHPUnit\Framework\TestCase { public function testConstructorThrowsInvalidArgumentExceptionForInvalidStringDirectory() { - $this->setExpectedException('InvalidArgumentException'); + $this->expectException('InvalidArgumentException'); $locator = new Zend_File_ClassFileLocator('__foo__'); } public function testConstructorThrowsInvalidArgumentExceptionForNonDirectoryIteratorArgument() { $iterator = new ArrayIterator(array()); - $this->setExpectedException('InvalidArgumentException'); + $this->expectException('InvalidArgumentException'); $locator = new Zend_File_ClassFileLocator($iterator); } diff --git a/tests/Zend/File/Transfer/Adapter/AbstractTest.php b/tests/Zend/File/Transfer/Adapter/AbstractTest.php index b41e3d7486..1612195f65 100644 --- a/tests/Zend/File/Transfer/Adapter/AbstractTest.php +++ b/tests/Zend/File/Transfer/Adapter/AbstractTest.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_File */ -class Zend_File_Transfer_Adapter_AbstractTest extends PHPUnit_Framework_TestCase +class Zend_File_Transfer_Adapter_AbstractTest extends PHPUnit\Framework\TestCase { /** * @var Zend_File_Transfer_Adapter_AbstractTest_MockAdapter @@ -67,10 +67,11 @@ public function tearDown() } /** - * @expectedException Zend_File_Transfer_Exception */ public function testAdapterShouldThrowExceptionWhenRetrievingPluginLoaderOfInvalidType() { + $this->expectException(\Zend_File_Transfer_Exception::class); + $this->adapter->getPluginLoader('bogus'); } @@ -88,10 +89,11 @@ public function testAdapterShouldAllowAddingCustomPluginLoader() } /** - * @expectedException Zend_File_Transfer_Exception */ public function testAddingInvalidPluginLoaderTypeToAdapterShouldRaiseException() { + $this->expectException(\Zend_File_Transfer_Exception::class); + $loader = new Zend_Loader_PluginLoader(); $this->adapter->setPluginLoader($loader, 'bogus'); } @@ -101,7 +103,7 @@ public function testAdapterShouldProxyAddingPluginLoaderPrefixPath() $loader = $this->adapter->getPluginLoader('validate'); $this->adapter->addPrefixPath('Foo_Valid', 'Foo/Valid/', 'validate'); $paths = $loader->getPaths('Foo_Valid'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } public function testPassingNoTypeWhenAddingPrefixPathToAdapterShouldGeneratePathsForAllTypes() @@ -110,16 +112,17 @@ public function testPassingNoTypeWhenAddingPrefixPathToAdapterShouldGeneratePath $validateLoader = $this->adapter->getPluginLoader('validate'); $filterLoader = $this->adapter->getPluginLoader('filter'); $paths = $validateLoader->getPaths('Foo_Validate'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $paths = $filterLoader->getPaths('Foo_Filter'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } /** - * @expectedException Zend_File_Transfer_Exception */ public function testPassingInvalidTypeWhenAddingPrefixPathToAdapterShouldThrowException() { + $this->expectException(\Zend_File_Transfer_Exception::class); + $this->adapter->addPrefixPath('Foo', 'Foo', 'bogus'); } @@ -139,13 +142,13 @@ public function testAdapterShouldProxyAddingMultiplePluginLoaderPrefixPaths() array('type' => 'filter', 'prefix' => 'Bar_Filter', 'path' => 'Bar/Filter/'), )); $paths = $validatorLoader->getPaths('Foo_Valid'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $paths = $filterLoader->getPaths('Foo_Filter'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $paths = $filterLoader->getPaths('Bar_Filter'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $paths = $filterLoader->getPaths('Baz_Filter'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $this->assertEquals(2, count($paths)); } @@ -153,9 +156,9 @@ public function testValidatorPluginLoaderShouldRegisterPathsForBaseAndFileValida { $loader = $this->adapter->getPluginLoader('validate'); $paths = $loader->getPaths('Zend_Validate'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $paths = $loader->getPaths('Zend_Validate_File'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } public function testAdapterShouldAllowAddingValidatorInstance() @@ -174,10 +177,11 @@ public function testAdapterShouldAllowAddingValidatorViaPluginLoader() } /** - * @expectedException Zend_File_Transfer_Exception */ public function testAdapterhShouldRaiseExceptionWhenAddingInvalidValidatorType() { + $this->expectException(\Zend_File_Transfer_Exception::class); + $this->adapter->addValidator(new Zend_Filter_BaseName); } @@ -191,7 +195,7 @@ public function testAdapterShouldAllowAddingMultipleValidatorsAtOnceUsingBothIns ); $this->adapter->addValidators($validators); $test = $this->adapter->getValidators(); - $this->assertTrue(is_array($test)); + $this->assertInternalType('array', $test); $this->assertEquals(4, count($test), var_export($test, 1)); $count = array_shift($test); $this->assertTrue($count instanceof Zend_Validate_File_Count); @@ -249,7 +253,7 @@ public function testAdapterShouldAllowRetrievingAllValidatorsAtOnce() { $this->testAdapterShouldAllowAddingMultipleValidatorsAtOnceUsingBothInstancesAndPluginLoader(); $validators = $this->adapter->getValidators(); - $this->assertTrue(is_array($validators)); + $this->assertInternalType('array', $validators); $this->assertEquals(4, count($validators)); foreach ($validators as $validator) { $this->assertTrue($validator instanceof Zend_Validate_Interface); @@ -288,7 +292,7 @@ public function testAdapterShouldAllowRemovingAllValidatorsAtOnce() $this->testAdapterShouldAllowAddingMultipleValidatorsAtOnceUsingBothInstancesAndPluginLoader(); $this->adapter->clearValidators(); $validators = $this->adapter->getValidators(); - $this->assertTrue(is_array($validators)); + $this->assertInternalType('array', $validators); $this->assertEquals(0, count($validators)); } @@ -317,7 +321,7 @@ public function testValidationShouldThrowExceptionForNonexistentFile() public function testErrorMessagesShouldBeEmptyByDefault() { $messages = $this->adapter->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(0, count($messages)); } @@ -325,14 +329,14 @@ public function testErrorMessagesShouldBePopulatedAfterInvalidTransfer() { $this->testValidationShouldReturnFalseForInvalidTransfer(); $messages = $this->adapter->getMessages(); - $this->assertTrue(is_array($messages)); - $this->assertFalse(empty($messages)); + $this->assertInternalType('array', $messages); + $this->assertNotEmpty($messages); } public function testErrorCodesShouldBeNullByDefault() { $errors = $this->adapter->getErrors(); - $this->assertTrue(is_array($errors)); + $this->assertInternalType('array', $errors); $this->assertEquals(0, count($errors)); } @@ -340,8 +344,8 @@ public function testErrorCodesShouldBePopulatedAfterInvalidTransfer() { $this->testValidationShouldReturnFalseForInvalidTransfer(); $errors = $this->adapter->getErrors(); - $this->assertTrue(is_array($errors)); - $this->assertFalse(empty($errors)); + $this->assertInternalType('array', $errors); + $this->assertNotEmpty($errors); } public function testAdapterShouldHavePluginLoaderForFilters() @@ -354,9 +358,9 @@ public function testFilterPluginLoaderShouldRegisterPathsForBaseAndFileFiltersBy { $loader = $this->adapter->getPluginLoader('filter'); $paths = $loader->getPaths('Zend_Filter'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $paths = $loader->getPaths('Zend_Filter_File'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } public function testAdapterShouldAllowAddingFilterInstance() @@ -375,10 +379,11 @@ public function testAdapterShouldAllowAddingFilterViaPluginLoader() } /** - * @expectedException Zend_File_Transfer_Exception */ public function testAdapterhShouldRaiseExceptionWhenAddingInvalidFilterType() { + $this->expectException(\Zend_File_Transfer_Exception::class); + $this->adapter->addFilter(new Zend_Validate_File_Extension('jpg')); } @@ -391,7 +396,7 @@ public function testAdapterShouldAllowAddingMultipleFiltersAtOnceUsingBothInstan ); $this->adapter->addFilters($filters); $test = $this->adapter->getFilters(); - $this->assertTrue(is_array($test)); + $this->assertInternalType('array', $test); $this->assertEquals(3, count($test), var_export($test, 1)); $count = array_shift($test); $this->assertTrue($count instanceof Zend_Filter_Word_SeparatorToCamelCase); @@ -446,7 +451,7 @@ public function testAdapterShouldAllowRetrievingAllFiltersAtOnce() { $this->testAdapterShouldAllowAddingMultipleFiltersAtOnceUsingBothInstancesAndPluginLoader(); $filters = $this->adapter->getFilters(); - $this->assertTrue(is_array($filters)); + $this->assertInternalType('array', $filters); $this->assertEquals(3, count($filters)); foreach ($filters as $filter) { $this->assertTrue($filter instanceof Zend_Filter_Interface); @@ -485,7 +490,7 @@ public function testAdapterShouldAllowRemovingAllFiltersAtOnce() $this->testAdapterShouldAllowAddingMultipleFiltersAtOnceUsingBothInstancesAndPluginLoader(); $this->adapter->clearFilters(); $filters = $this->adapter->getFilters(); - $this->assertTrue(is_array($filters)); + $this->assertInternalType('array', $filters); $this->assertEquals(0, count($filters)); } @@ -494,7 +499,7 @@ public function testTransferDestinationShouldBeMutable() $directory = dirname(__FILE__); $this->adapter->setDestination($directory); $destinations = $this->adapter->getDestination(); - $this->assertTrue(is_array($destinations)); + $this->assertInternalType('array', $destinations); foreach ($destinations as $file => $destination) { $this->assertEquals($directory, $destination); } @@ -513,7 +518,7 @@ public function testAdapterShouldAllowRetrievingDestinationsForAnArrayOfSpecifie { $this->adapter->setDestination(dirname(__FILE__)); $destinations = $this->adapter->getDestination(array('bar', 'baz')); - $this->assertTrue(is_array($destinations)); + $this->assertInternalType('array', $destinations); $directory = dirname(__FILE__); foreach ($destinations as $file => $destination) { $this->assertTrue(in_array($file, array('bar', 'baz'))); @@ -568,50 +573,56 @@ public function testGetAdditionalFileInfosForSingleFile() } /** - * @expectedException Zend_File_Transfer_Exception */ public function testGetAdditionalFileInfosForUnknownFile() { + $this->expectException(\Zend_File_Transfer_Exception::class); + $files = $this->adapter->getFileInfo('unknown'); } /** - * @expectedException Zend_File_Transfer_Exception */ public function testGetUnknownOption() { + $this->expectException(\Zend_File_Transfer_Exception::class); + $this->adapter->setOptions(array('unknownOption' => 'unknown')); } /** - * @expectedException Zend_File_Transfer_Exception */ public function testGetFileIsNotImplemented() { + $this->expectException(\Zend_File_Transfer_Exception::class); + $this->adapter->getFile(); } /** - * @expectedException Zend_File_Transfer_Exception */ public function testAddFileIsNotImplemented() { + $this->expectException(\Zend_File_Transfer_Exception::class); + $this->adapter->addFile('foo'); } /** - * @expectedException Zend_File_Transfer_Exception */ public function testGetTypeIsNotImplemented() { + $this->expectException(\Zend_File_Transfer_Exception::class); + $this->adapter->getType(); } /** - * @expectedException Zend_File_Transfer_Exception */ public function testAddTypeIsNotImplemented() { + $this->expectException(\Zend_File_Transfer_Exception::class); + $this->adapter->addType('foo'); } @@ -646,7 +657,7 @@ public function testAdapterShouldAllowRetrievingAllFileNames() . DIRECTORY_SEPARATOR . '_files'; $this->adapter->setDestination($path); $files = $this->adapter->getFileName(); - $this->assertTrue(is_array($files)); + $this->assertInternalType('array', $files); $this->assertEquals($path . DIRECTORY_SEPARATOR . 'bar.png', $files['bar']); } @@ -659,7 +670,7 @@ public function testAdapterShouldAllowRetrievingAllFileNamesWithoutPath() . DIRECTORY_SEPARATOR . '_files'; $this->adapter->setDestination($path); $files = $this->adapter->getFileName(null, false); - $this->assertTrue(is_array($files)); + $this->assertInternalType('array', $files); $this->assertEquals('bar.png', $files['bar']); } @@ -683,7 +694,7 @@ public function testIgnoreHashValue() public function testEmptyTempDirectoryDetection() { $this->adapter->_tmpDir = ""; - $this->assertTrue(empty($this->adapter->_tmpDir), "Empty temporary directory"); + $this->assertEmpty($this->adapter->_tmpDir, "Empty temporary directory"); } public function testTempDirectoryDetection() @@ -771,7 +782,7 @@ public function testTransferDestinationAtNonExistingElement() $this->adapter->setDestination($directory, 'nonexisting'); $this->assertEquals($directory, $this->adapter->getDestination('nonexisting')); try { - $this->assertTrue(is_string($this->adapter->getDestination('reallynonexisting'))); + $this->assertInternalType('string', $this->adapter->getDestination('reallynonexisting')); $this->fail(); } catch(Exception $e) { $this->assertContains('not find', $e->getMessage()); diff --git a/tests/Zend/File/Transfer/Adapter/HttpTest.php b/tests/Zend/File/Transfer/Adapter/HttpTest.php index 7d5b00a7a4..d80c15b98f 100644 --- a/tests/Zend/File/Transfer/Adapter/HttpTest.php +++ b/tests/Zend/File/Transfer/Adapter/HttpTest.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_File */ -class Zend_File_Transfer_Adapter_HttpTest extends PHPUnit_Framework_TestCase +class Zend_File_Transfer_Adapter_HttpTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -86,18 +86,20 @@ public function testAutoSetUploadValidator() } /** - * @expectedException Zend_File_Transfer_Exception */ public function testSendingFiles() { + $this->expectException(\Zend_File_Transfer_Exception::class); + $this->adapter->send(); } /** - * @expectedException Zend_File_Transfer_Exception */ public function testFileIsSent() { + $this->expectException(\Zend_File_Transfer_Exception::class); + $this->adapter->isSent(); } @@ -271,22 +273,22 @@ public function testUploadProgressAdapter() $adapter = new Zend_ProgressBar_Adapter_Console(); $status = array('progress' => $adapter, 'session' => 'upload'); $status = Zend_File_Transfer_Adapter_HttpTest_MockAdapter::getProgress($status); - $this->assertTrue(array_key_exists('total', $status)); - $this->assertTrue(array_key_exists('current', $status)); - $this->assertTrue(array_key_exists('rate', $status)); - $this->assertTrue(array_key_exists('id', $status)); - $this->assertTrue(array_key_exists('message', $status)); - $this->assertTrue(array_key_exists('progress', $status)); + $this->assertArrayHasKey('total', $status); + $this->assertArrayHasKey('current', $status); + $this->assertArrayHasKey('rate', $status); + $this->assertArrayHasKey('id', $status); + $this->assertArrayHasKey('message', $status); + $this->assertArrayHasKey('progress', $status); $this->assertTrue($status['progress'] instanceof Zend_ProgressBar); $this->adapter->switchApcToUP(); $status = Zend_File_Transfer_Adapter_HttpTest_MockAdapter::getProgress($status); - $this->assertTrue(array_key_exists('total', $status)); - $this->assertTrue(array_key_exists('current', $status)); - $this->assertTrue(array_key_exists('rate', $status)); - $this->assertTrue(array_key_exists('id', $status)); - $this->assertTrue(array_key_exists('message', $status)); - $this->assertTrue(array_key_exists('progress', $status)); + $this->assertArrayHasKey('total', $status); + $this->assertArrayHasKey('current', $status); + $this->assertArrayHasKey('rate', $status); + $this->assertArrayHasKey('id', $status); + $this->assertArrayHasKey('message', $status); + $this->assertArrayHasKey('progress', $status); $this->assertTrue($status['progress'] instanceof Zend_ProgressBar); } diff --git a/tests/Zend/Filter/AlnumTest.php b/tests/Zend/Filter/AlnumTest.php index 07a0ead3cb..4ac226d4ae 100644 --- a/tests/Zend/Filter/AlnumTest.php +++ b/tests/Zend/Filter/AlnumTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_AlnumTest extends PHPUnit_Framework_TestCase +class Zend_Filter_AlnumTest extends PHPUnit\Framework\TestCase { /** * Zend_Filter_Alnum object diff --git a/tests/Zend/Filter/AlphaTest.php b/tests/Zend/Filter/AlphaTest.php index a6688c2218..f7f0dc28c8 100644 --- a/tests/Zend/Filter/AlphaTest.php +++ b/tests/Zend/Filter/AlphaTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_AlphaTest extends PHPUnit_Framework_TestCase +class Zend_Filter_AlphaTest extends PHPUnit\Framework\TestCase { /** * Zend_Filter_Alpha object diff --git a/tests/Zend/Filter/BaseNameTest.php b/tests/Zend/Filter/BaseNameTest.php index ceb5d42bd8..eebcf234d8 100644 --- a/tests/Zend/Filter/BaseNameTest.php +++ b/tests/Zend/Filter/BaseNameTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_BaseNameTest extends PHPUnit_Framework_TestCase +class Zend_Filter_BaseNameTest extends PHPUnit\Framework\TestCase { /** * Zend_Filter_BaseName object diff --git a/tests/Zend/Filter/BooleanTest.php b/tests/Zend/Filter/BooleanTest.php index 6bf028c4ef..67700e0a16 100644 --- a/tests/Zend/Filter/BooleanTest.php +++ b/tests/Zend/Filter/BooleanTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_BooleanTest extends PHPUnit_Framework_TestCase +class Zend_Filter_BooleanTest extends PHPUnit\Framework\TestCase { /** * Zend_Filter_Boolean object diff --git a/tests/Zend/Filter/CallbackTest.php b/tests/Zend/Filter/CallbackTest.php index 11d6bc5a52..07cb17f676 100644 --- a/tests/Zend/Filter/CallbackTest.php +++ b/tests/Zend/Filter/CallbackTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_CallbackTest extends PHPUnit_Framework_TestCase +class Zend_Filter_CallbackTest extends PHPUnit\Framework\TestCase { public function testObjectCallback() { diff --git a/tests/Zend/Filter/Compress/Bz2Test.php b/tests/Zend/Filter/Compress/Bz2Test.php index ec741900f8..8234906f49 100644 --- a/tests/Zend/Filter/Compress/Bz2Test.php +++ b/tests/Zend/Filter/Compress/Bz2Test.php @@ -33,7 +33,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Filter_Compress_Bz2Test extends PHPUnit_Framework_TestCase +class Zend_Filter_Compress_Bz2Test extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Filter/Compress/GzTest.php b/tests/Zend/Filter/Compress/GzTest.php index 490ecbdf05..df887ec0db 100644 --- a/tests/Zend/Filter/Compress/GzTest.php +++ b/tests/Zend/Filter/Compress/GzTest.php @@ -33,7 +33,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Filter_Compress_GzTest extends PHPUnit_Framework_TestCase +class Zend_Filter_Compress_GzTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Filter/Compress/LzfTest.php b/tests/Zend/Filter/Compress/LzfTest.php index edf2e339ab..677eb2bc6e 100644 --- a/tests/Zend/Filter/Compress/LzfTest.php +++ b/tests/Zend/Filter/Compress/LzfTest.php @@ -33,7 +33,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Filter_Compress_LzfTest extends PHPUnit_Framework_TestCase +class Zend_Filter_Compress_LzfTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Filter/Compress/RarTest.php b/tests/Zend/Filter/Compress/RarTest.php index dbd78990cf..5627cca1ee 100644 --- a/tests/Zend/Filter/Compress/RarTest.php +++ b/tests/Zend/Filter/Compress/RarTest.php @@ -33,7 +33,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Filter_Compress_RarTest extends PHPUnit_Framework_TestCase +class Zend_Filter_Compress_RarTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -291,11 +291,11 @@ public function testRarCompressDirectory() $base = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . '_compress' . DIRECTORY_SEPARATOR . 'Compress' . DIRECTORY_SEPARATOR; - $this->assertTrue(file_exists($base)); - $this->assertTrue(file_exists($base . 'zipextracted.txt')); - $this->assertTrue(file_exists($base . 'First' . DIRECTORY_SEPARATOR . 'zipextracted.txt')); - $this->assertTrue(file_exists($base . 'First' . DIRECTORY_SEPARATOR . - 'Second' . DIRECTORY_SEPARATOR . 'zipextracted.txt')); + $this->assertFileExists($base); + $this->assertFileExists($base . 'zipextracted.txt'); + $this->assertFileExists($base . 'First' . DIRECTORY_SEPARATOR . 'zipextracted.txt'); + $this->assertFileExists($base . 'First' . DIRECTORY_SEPARATOR . + 'Second' . DIRECTORY_SEPARATOR . 'zipextracted.txt'); $content = file_get_contents(dirname(__FILE__) . '/../_files/Compress/zipextracted.txt'); $this->assertEquals('compress me', $content); } diff --git a/tests/Zend/Filter/Compress/TarTest.php b/tests/Zend/Filter/Compress/TarTest.php index 7917a0eee6..cf6ee1d87f 100644 --- a/tests/Zend/Filter/Compress/TarTest.php +++ b/tests/Zend/Filter/Compress/TarTest.php @@ -33,7 +33,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Filter_Compress_TarTest extends PHPUnit_Framework_TestCase +class Zend_Filter_Compress_TarTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Filter/Compress/ZipTest.php b/tests/Zend/Filter/Compress/ZipTest.php index 797d772e4a..1e5dfa49aa 100644 --- a/tests/Zend/Filter/Compress/ZipTest.php +++ b/tests/Zend/Filter/Compress/ZipTest.php @@ -33,7 +33,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Filter_Compress_ZipTest extends PHPUnit_Framework_TestCase +class Zend_Filter_Compress_ZipTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -262,11 +262,11 @@ public function testZipCompressDirectory() $base = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . '_compress' . DIRECTORY_SEPARATOR . 'Compress' . DIRECTORY_SEPARATOR; - $this->assertTrue(file_exists($base)); - $this->assertTrue(file_exists($base . 'zipextracted.txt')); - $this->assertTrue(file_exists($base . 'First' . DIRECTORY_SEPARATOR . 'zipextracted.txt')); - $this->assertTrue(file_exists($base . 'First' . DIRECTORY_SEPARATOR . - 'Second' . DIRECTORY_SEPARATOR . 'zipextracted.txt')); + $this->assertFileExists($base); + $this->assertFileExists($base . 'zipextracted.txt'); + $this->assertFileExists($base . 'First' . DIRECTORY_SEPARATOR . 'zipextracted.txt'); + $this->assertFileExists($base . 'First' . DIRECTORY_SEPARATOR . + 'Second' . DIRECTORY_SEPARATOR . 'zipextracted.txt'); $content = file_get_contents(dirname(__FILE__) . '/../_files/Compress/zipextracted.txt'); $this->assertEquals('compress me', $content); } @@ -284,10 +284,11 @@ public function testZipToString() /** * @group - * @expectedException Zend_Filter_Exception */ public function testDecompressWillThrowExceptionWhenDecompressingWithNoTarget() { + $this->expectException(\Zend_Filter_Exception::class); + $filter = new Zend_Filter_Compress_Zip( array( 'archive' => dirname(__FILE__) . '/../_files/compressed.zip', @@ -312,10 +313,11 @@ public function testDecompressWillThrowExceptionWhenDecompressingWithNoTarget() /** * @group RS - * @expectedException Zend_Filter_Exception */ public function testDecompressWillThrowExceptionWhenDetectingUpwardDirectoryTraversal() { + $this->expectException(\Zend_Filter_Exception::class); + if (version_compare(PHP_VERSION, '5.2.8', '>=')) { $this->markTestSkipped('This test is to run on PHP less than 5.2.8'); return; diff --git a/tests/Zend/Filter/CompressTest.php b/tests/Zend/Filter/CompressTest.php index 6072704912..33e3f294a3 100644 --- a/tests/Zend/Filter/CompressTest.php +++ b/tests/Zend/Filter/CompressTest.php @@ -33,7 +33,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Filter_CompressTest extends PHPUnit_Framework_TestCase +class Zend_Filter_CompressTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Filter/DecompressTest.php b/tests/Zend/Filter/DecompressTest.php index 8af7e64835..cbf8c0eec3 100644 --- a/tests/Zend/Filter/DecompressTest.php +++ b/tests/Zend/Filter/DecompressTest.php @@ -33,7 +33,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Filter_DecompressTest extends PHPUnit_Framework_TestCase +class Zend_Filter_DecompressTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Filter/DecryptTest.php b/tests/Zend/Filter/DecryptTest.php index 90665f2d1b..16da7411dd 100644 --- a/tests/Zend/Filter/DecryptTest.php +++ b/tests/Zend/Filter/DecryptTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_DecryptTest extends PHPUnit_Framework_TestCase +class Zend_Filter_DecryptTest extends PHPUnit\Framework\TestCase { protected $errorReporting; diff --git a/tests/Zend/Filter/DigitsTest.php b/tests/Zend/Filter/DigitsTest.php index 74ab13d29e..3b7bf65e65 100644 --- a/tests/Zend/Filter/DigitsTest.php +++ b/tests/Zend/Filter/DigitsTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_DigitsTest extends PHPUnit_Framework_TestCase +class Zend_Filter_DigitsTest extends PHPUnit\Framework\TestCase { /** * Zend_Filter_Digits object extended for checking whether Unicode PCRE is enabled diff --git a/tests/Zend/Filter/DirTest.php b/tests/Zend/Filter/DirTest.php index 06deab7bb5..e796a7517a 100644 --- a/tests/Zend/Filter/DirTest.php +++ b/tests/Zend/Filter/DirTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_DirTest extends PHPUnit_Framework_TestCase +class Zend_Filter_DirTest extends PHPUnit\Framework\TestCase { /** * Zend_Filter_Dir object diff --git a/tests/Zend/Filter/Encrypt/McryptTest.php b/tests/Zend/Filter/Encrypt/McryptTest.php index de5258f99d..d37ec4445b 100644 --- a/tests/Zend/Filter/Encrypt/McryptTest.php +++ b/tests/Zend/Filter/Encrypt/McryptTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_Encrypt_McryptTest extends PHPUnit_Framework_TestCase +class Zend_Filter_Encrypt_McryptTest extends PHPUnit\Framework\TestCase { protected $errorReporting; diff --git a/tests/Zend/Filter/Encrypt/OpensslTest.php b/tests/Zend/Filter/Encrypt/OpensslTest.php index 056582e494..9d84089798 100644 --- a/tests/Zend/Filter/Encrypt/OpensslTest.php +++ b/tests/Zend/Filter/Encrypt/OpensslTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_Encrypt_OpensslTest extends PHPUnit_Framework_TestCase +class Zend_Filter_Encrypt_OpensslTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -253,7 +253,7 @@ public function testMultipleOptionsAtInitiation() 'passphrase' => $passphrase, 'private' => dirname(__FILE__) . '/../_files/privatekey.pem')); $public = $filter->getPublicKey(); - $this->assertFalse(empty($public)); + $this->assertNotEmpty($public); $this->assertEquals($passphrase, $filter->getPassphrase()); } diff --git a/tests/Zend/Filter/EncryptTest.php b/tests/Zend/Filter/EncryptTest.php index 6fb3ecfcc2..2e66567c66 100644 --- a/tests/Zend/Filter/EncryptTest.php +++ b/tests/Zend/Filter/EncryptTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_EncryptTest extends PHPUnit_Framework_TestCase +class Zend_Filter_EncryptTest extends PHPUnit\Framework\TestCase { protected $errorReporting; diff --git a/tests/Zend/Filter/File/DecryptTest.php b/tests/Zend/Filter/File/DecryptTest.php index 82a9839ed7..cf62c47f06 100644 --- a/tests/Zend/Filter/File/DecryptTest.php +++ b/tests/Zend/Filter/File/DecryptTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_File_DecryptTest extends PHPUnit_Framework_TestCase +class Zend_Filter_File_DecryptTest extends PHPUnit\Framework\TestCase { protected $errorReporting; diff --git a/tests/Zend/Filter/File/EncryptTest.php b/tests/Zend/Filter/File/EncryptTest.php index bc69010e56..ed3d28176d 100644 --- a/tests/Zend/Filter/File/EncryptTest.php +++ b/tests/Zend/Filter/File/EncryptTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_File_EncryptTest extends PHPUnit_Framework_TestCase +class Zend_Filter_File_EncryptTest extends PHPUnit\Framework\TestCase { protected $errorReporting; diff --git a/tests/Zend/Filter/File/LowerCaseTest.php b/tests/Zend/Filter/File/LowerCaseTest.php index 7b454e8923..5ba8858f5e 100644 --- a/tests/Zend/Filter/File/LowerCaseTest.php +++ b/tests/Zend/Filter/File/LowerCaseTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_File_LowerCaseTest extends PHPUnit_Framework_TestCase +class Zend_Filter_File_LowerCaseTest extends PHPUnit\Framework\TestCase { /** * Path to test files @@ -61,21 +61,12 @@ class Zend_Filter_File_LowerCaseTest extends PHPUnit_Framework_TestCase * * @return void */ - public function __construct() + public function setUp() { $this->_filesPath = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR; $this->_origFile = $this->_filesPath . 'testfile2.txt'; $this->_newFile = $this->_filesPath . 'newtestfile2.txt'; - } - - /** - * Sets the path to test files - * - * @return void - */ - public function setUp() - { if (!file_exists($this->_newFile)) { copy($this->_origFile, $this->_newFile); } diff --git a/tests/Zend/Filter/File/RenameTest.php b/tests/Zend/Filter/File/RenameTest.php index e6366aa78f..647f843beb 100644 --- a/tests/Zend/Filter/File/RenameTest.php +++ b/tests/Zend/Filter/File/RenameTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_File_RenameTest extends PHPUnit_Framework_TestCase +class Zend_Filter_File_RenameTest extends PHPUnit\Framework\TestCase { /** * Path to test files @@ -82,7 +82,7 @@ class Zend_Filter_File_RenameTest extends PHPUnit_Framework_TestCase * * @return void */ - public function __construct() + public function setUp() { $this->_filesPath = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR; @@ -91,15 +91,6 @@ public function __construct() $this->_newFile = $this->_filesPath . 'newfile.xml'; $this->_newDir = $this->_filesPath . DIRECTORY_SEPARATOR . '_testDir2'; $this->_newDirFile = $this->_newDir . DIRECTORY_SEPARATOR . 'testfile.txt'; - } - - /** - * Sets the path to test files - * - * @return void - */ - public function setUp() - { if (file_exists($this->_origFile)) { unlink($this->_origFile); } diff --git a/tests/Zend/Filter/File/UpperCaseTest.php b/tests/Zend/Filter/File/UpperCaseTest.php index e99f6cdedb..c1494cb1e4 100644 --- a/tests/Zend/Filter/File/UpperCaseTest.php +++ b/tests/Zend/Filter/File/UpperCaseTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_File_UpperCaseTest extends PHPUnit_Framework_TestCase +class Zend_Filter_File_UpperCaseTest extends PHPUnit\Framework\TestCase { /** * Path to test files @@ -61,21 +61,12 @@ class Zend_Filter_File_UpperCaseTest extends PHPUnit_Framework_TestCase * * @return void */ - public function __construct() + public function setUp() { $this->_filesPath = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR; $this->_origFile = $this->_filesPath . 'testfile2.txt'; $this->_newFile = $this->_filesPath . 'newtestfile2.txt'; - } - - /** - * Sets the path to test files - * - * @return void - */ - public function setUp() - { if (!file_exists($this->_newFile)) { copy($this->_origFile, $this->_newFile); } diff --git a/tests/Zend/Filter/HtmlEntitiesTest.php b/tests/Zend/Filter/HtmlEntitiesTest.php index 697ce04745..a49f1f46b2 100644 --- a/tests/Zend/Filter/HtmlEntitiesTest.php +++ b/tests/Zend/Filter/HtmlEntitiesTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_HtmlEntitiesTest extends PHPUnit_Framework_TestCase +class Zend_Filter_HtmlEntitiesTest extends PHPUnit\Framework\TestCase { /** * Zend_Filter_HtmlEntities object diff --git a/tests/Zend/Filter/InflectorTest.php b/tests/Zend/Filter/InflectorTest.php index 287cc3c398..685d8d157a 100644 --- a/tests/Zend/Filter/InflectorTest.php +++ b/tests/Zend/Filter/InflectorTest.php @@ -41,7 +41,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_InflectorTest extends PHPUnit_Framework_TestCase +class Zend_Filter_InflectorTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -72,7 +72,7 @@ public function testGetPluginLoaderReturnsLoaderByDefault() $this->assertTrue($loader instanceof Zend_Loader_PluginLoader_Interface); $paths = $loader->getPaths(); $this->assertEquals(1, count($paths)); - $this->assertTrue(array_key_exists('Zend_Filter_', $paths)); + $this->assertArrayHasKey('Zend_Filter_', $paths); } public function testSetPluginLoaderAllowsSettingAlternatePluginLoader() @@ -90,7 +90,7 @@ public function testAddFilterPrefixPathAddsPathsToPluginLoader() $this->inflector->addFilterPrefixPath('Foo_Bar', 'Zend/View/'); $loader = $this->inflector->getPluginLoader(); $paths = $loader->getPaths(); - $this->assertTrue(array_key_exists('Foo_Bar_', $paths)); + $this->assertArrayHasKey('Foo_Bar_', $paths); } public function testTargetAccessorsWork() diff --git a/tests/Zend/Filter/InputTest.php b/tests/Zend/Filter/InputTest.php index e9b0cd43aa..5ff287d739 100644 --- a/tests/Zend/Filter/InputTest.php +++ b/tests/Zend/Filter/InputTest.php @@ -39,7 +39,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_InputTest extends PHPUnit_Framework_TestCase +class Zend_Filter_InputTest extends PHPUnit\Framework\TestCase { /** * @group ZF-11267 @@ -241,7 +241,7 @@ public function testNoNestedMessageArrays() $this->assertFalse($input->isValid()); $messages = $input->getMessages(); - $this->assertFalse(is_array($messages['field1']['isEmpty']), 'oh oh, we may have got nested messages'); + $this->assertNotInternalType('array', $messages['field1']['isEmpty'], 'oh oh, we may have got nested messages'); $this->assertTrue(isset($messages['field1']['isEmpty']), 'oh no, we not even got the normally expected messages'); } @@ -386,7 +386,7 @@ public function testFilterMultiValue() $this->assertTrue($input->hasValid(), 'Expected hasValid() to return true'); $f1 = $input->field1; - $this->assertTrue(is_array($f1)); + $this->assertInternalType('array', $f1); $this->assertEquals(array('foo', 'bar', 'baz'), $f1); } @@ -425,15 +425,15 @@ public function testValidatorSingleInvalid() $this->assertFalse($input->hasValid(), 'Expected hasValid() to return false'); $messages = $input->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(array('month'), array_keys($messages)); - $this->assertTrue(is_array($messages['month'])); + $this->assertInternalType('array', $messages['month']); $this->assertEquals("'6abc ' must contain only digits", current($messages['month'])); $errors = $input->getErrors(); - $this->assertTrue(is_array($errors)); + $this->assertInternalType('array', $errors); $this->assertEquals(array('month'), array_keys($errors)); - $this->assertTrue(is_array($errors['month'])); + $this->assertInternalType('array', $errors['month']); $this->assertEquals("notDigits", $errors['month'][0]); } @@ -486,7 +486,7 @@ public function testValidatorDeclareByArray() $this->assertEquals('6', $month); $messages = $input->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(array('month2'), array_keys($messages)); $this->assertEquals("'13' is not between '1' and '12', inclusively", current($messages['month2'])); } @@ -513,10 +513,10 @@ public function testValidatorChain() $this->assertTrue($input->hasValid(), 'Expected hasValid() to return true'); $messages = $input->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(array('field2', 'field3'), array_keys($messages)); - $this->assertTrue(is_array( $messages['field2'])); - $this->assertTrue(is_array($messages['field3'])); + $this->assertInternalType('array', $messages['field2']); + $this->assertInternalType('array', $messages['field3']); $this->assertEquals("'abc123' must contain only digits", current($messages['field2'])); $this->assertEquals("'150' is not between '1' and '100', inclusively", current($messages['field3'])); @@ -546,10 +546,10 @@ public function testValidatorInvalidFieldInMultipleRules() $this->assertFalse($input->hasValid(), 'Expected hasValid() to return false'); $messages = $input->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(array('field2a', 'field2b'), array_keys($messages)); - $this->assertTrue(is_array($messages['field2a'])); - $this->assertTrue(is_array($messages['field2b'])); + $this->assertInternalType('array', $messages['field2a']); + $this->assertInternalType('array', $messages['field2b']); $this->assertEquals("'abc123' must contain only digits", current($messages['field2a'])); $this->assertEquals("'abc123' is not between '1' and '100', inclusively", @@ -595,7 +595,7 @@ public function testValidatorMultiValue() $this->assertTrue($input->hasValid(), 'Expected hasValid() to return true'); $messages = $input->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(array('field2'), array_keys($messages)); $this->assertEquals("'123' contains non alphabetic characters", current($messages['field2'])); @@ -636,7 +636,7 @@ public function testValidatorMultiField() set_include_path($ip); $messages = $input->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(array('rule2'), array_keys($messages)); $this->assertEquals("Not all strings in the argument are equal", current($messages['rule2'])); @@ -688,7 +688,7 @@ public function testValidatorMultiFieldAllowEmptyProcessing() set_include_path($ip); $messages = $input->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(array('rule2', 'rule3'), array_keys($messages)); $this->assertEquals(array('isEmpty' => "You must give a non-empty value for field 'password3'"), $messages['rule2']); @@ -725,7 +725,7 @@ public function testValidatorBreakChain() $this->assertFalse($input->hasValid(), 'Expected hasValid() to return false'); $messages = $input->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(array('field1', 'field2'), array_keys($messages)); $this->assertEquals( $messageUserDefined, @@ -765,7 +765,7 @@ public function testValidatorAllowEmpty() $this->assertNull($input->field1); $this->assertNotNull($input->field2); $messages = $input->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(array('field1'), array_keys($messages)); $this->assertEquals("You must give a non-empty value for field 'field1'", current($messages['field1'])); } @@ -793,7 +793,7 @@ public function testValidatorAllowEmptyWithOtherValidatersProcessing() $this->assertFalse($input->hasValid(), 'Expected hasValid() to return true'); $messages = $input->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(array('field1'), array_keys($messages)); $this->assertEquals("You must give a non-empty value for field 'field1'", current($messages['field1'])); } @@ -866,7 +866,7 @@ public function testValidatorAllowEmptyNoValidatorChain() $this->assertTrue($input->hasValid(), 'Expected hasValid() to return true'); $messages = $input->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(array('nick'), array_keys($messages)); $this->assertEquals(1, count($messages['nick'])); } @@ -896,9 +896,9 @@ public function testValidatorAllowEmptySetNotEmptyMessage() $this->assertNull($input->field1); $messages = $input->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(array('field1Rule'), array_keys($messages)); - $this->assertTrue(is_array($messages['field1Rule'])); + $this->assertInternalType('array', $messages['field1Rule']); $this->assertEquals("You cannot give an empty value for field 'field1', according to rule 'field1Rule'", current($messages['field1Rule'])); } @@ -923,7 +923,7 @@ public function testValidatorDefault() $this->assertTrue($input->hasValid(), 'Expected hasValid() to return true'); $missing = $input->getMissing(); - $this->assertTrue(is_array($missing)); + $this->assertInternalType('array', $missing); // make sure field5 and field7 are not counted as missing $this->assertEquals(array('field1', 'field3'), array_keys($missing)); @@ -956,7 +956,7 @@ public function testValidatorMissingDefaults() $this->assertFalse($input->hasValid(), 'Expected hasValid() to return false'); $missing = $input->getMissing(); - $this->assertTrue(is_array($missing)); + $this->assertInternalType('array', $missing); $this->assertEquals(array('rule1'), array_keys($missing)); $this->assertEquals(array("Field 'field2' is required by rule 'rule1', but the field is missing"), $missing['rule1']); } @@ -1012,9 +1012,9 @@ public function testValidatorNotAllowEmpty() $this->assertTrue($input->hasValid(), 'Expected hasValid() to return true'); $messages = $input->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(array('field2', 'field3'), array_keys($messages)); - $this->assertTrue(is_array($messages['field2'])); + $this->assertInternalType('array', $messages['field2']); $this->assertEquals("You must give a non-empty value for field 'field2'", current($messages['field2'])); } @@ -1036,7 +1036,7 @@ public function testValidatorMessagesSingle() $this->assertFalse($input->hasValid(), 'Expected hasValid() to return false'); $messages = $input->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(array('month'), array_keys($messages)); $this->assertEquals(1, count($messages['month'])); $this->assertEquals($digitsMesg, current($messages['month'])); @@ -1066,7 +1066,7 @@ public function testValidatorMessagesMultiple() $this->assertFalse($input->hasValid(), 'Expected hasValid() to return false'); $messages = $input->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(array('month'), array_keys($messages)); $this->assertEquals(2, count($messages['month'])); $this->assertEquals($digitsMesg, $messages['month']['notDigits']); @@ -1097,7 +1097,7 @@ public function testValidatorMessagesFieldsMultiple() $this->assertFalse($input->hasValid(), 'Expected hasValid() to return false'); $messages = $input->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(array('field1'), array_keys($messages)); $this->assertEquals(3, count($messages['field1'])); $this->assertEquals($digitsMesg, $messages['field1']['notDigits']); @@ -1126,7 +1126,7 @@ public function testValidatorMessagesIntIndex() $this->assertFalse($input->hasValid(), 'Expected hasValid() to return false'); $messages = $input->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(array('month'), array_keys($messages)); $this->assertEquals(2, count($messages['month'])); $this->assertEquals("'13abc' must contain only digits", current($messages['month'])); @@ -1153,7 +1153,7 @@ public function testValidatorMessagesSingleWithKeys() $this->assertFalse($input->hasValid(), 'Expected hasValid() to return false'); $messages = $input->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(array('month'), array_keys($messages)); $this->assertEquals(1, count($messages['month'])); // $this->assertEquals($digitsMesg, $messages['month'][0]); @@ -1183,7 +1183,7 @@ public function testValidatorMessagesMultipleWithKeys() $this->assertFalse($input->hasValid(), 'Expected hasValid() to return false'); $messages = $input->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(array('month'), array_keys($messages)); $this->assertEquals(2, count($messages['month'])); // $this->assertEquals($digitsMesg, $messages['month'][0]); @@ -1214,7 +1214,7 @@ public function testValidatorMessagesMixedWithKeys() $this->assertFalse($input->hasValid(), 'Expected hasValid() to return false'); $messages = $input->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(array('month'), array_keys($messages)); $this->assertEquals(2, count($messages['month'])); // $this->assertEquals($digitsMesg, $messages['month'][0]); @@ -1272,7 +1272,7 @@ public function testValidatorGetMissing() $this->assertFalse($input->hasValid(), 'Expected hasValid() to return false'); $missing = $input->getMissing(); - $this->assertTrue(is_array($missing)); + $this->assertInternalType('array', $missing); $this->assertEquals(array('month'), array_keys($missing)); $this->assertEquals("Field 'month' is required by rule 'month', but the field is missing", $missing['month'][0]); } @@ -1298,7 +1298,7 @@ public function testValidatorSetMissingMessage() $this->assertFalse($input->hasValid(), 'Expected hasValid() to return false'); $missing = $input->getMissing(); - $this->assertTrue(is_array($missing)); + $this->assertInternalType('array', $missing); $this->assertEquals(array('monthRule'), array_keys($missing)); $this->assertEquals("I looked for month but I did not find it; it is required by rule monthRule", $missing['monthRule'][0]); } @@ -1335,7 +1335,7 @@ public function testValidatorGetUnknown() $this->assertFalse($input->hasValid(), 'Expected hasValid() to return false'); $unknown = $input->getUnknown(); - $this->assertTrue(is_array($unknown)); + $this->assertInternalType('array', $unknown); $this->assertThat($unknown, $this->arrayHasKey('unknown')); } @@ -1359,11 +1359,11 @@ public function testValidatorGetInvalid() $invalid = $input->getInvalid(); $missing = $input->getMissing(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(array('month', 'field2'), array_keys($messages)); - $this->assertTrue(is_array($invalid)); + $this->assertInternalType('array', $invalid); $this->assertEquals(array('month'), array_keys($invalid)); - $this->assertTrue(is_array($missing)); + $this->assertInternalType('array', $missing); $this->assertEquals(array('field2'), array_keys($missing)); $this->assertEquals(array_merge($invalid, $missing), $messages); } @@ -1432,7 +1432,7 @@ public function testAddNamespace() $this->assertEquals('123', (string) $input->field3); $messages = $input->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertThat($messages, $this->arrayHasKey('field1')); $this->assertEquals("'abc' must contain only digits", current($messages['field1'])); } @@ -1599,7 +1599,7 @@ public function testOptionBreakChain() $this->assertFalse($input->hasValid(), 'Expected hasValid() to return false'); $messages = $input->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(array('field1'), array_keys($messages)); $this->assertEquals(1, count($messages['field1']), 'Expected rule for field1 to break 1 validator'); $this->assertEquals("'150' is not between '1' and '100', inclusively", @@ -1657,7 +1657,7 @@ public function testOptionNamespace() $this->assertEquals('123', (string) $input->field3); $messages = $input->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertThat($messages, $this->arrayHasKey('field1')); $this->assertEquals("'abc' must contain only digits", current($messages['field1'])); } @@ -1683,7 +1683,7 @@ public function testOptionPresence() $this->assertTrue($input->hasValid(), 'Expected hasValid() to return true'); $missing = $input->getMissing(); - $this->assertTrue(is_array($missing)); + $this->assertInternalType('array', $missing); $this->assertEquals(array('field2'), array_keys($missing)); $this->assertEquals("Field 'field2' is required by rule 'field2', but the field is missing", $missing['field2'][0]); } @@ -1763,7 +1763,7 @@ public function testGetEscapedMultiValue() $this->assertTrue($input->hasValid(), 'Expected hasValid() to return true'); $multi = $input->getEscaped('multiSelect'); - $this->assertTrue(is_array($multi)); + $this->assertInternalType('array', $multi); $this->assertEquals(3, count($multi)); $this->assertEquals(array('C&H', 'B&O', 'AT&T'), $multi); } @@ -2149,7 +2149,7 @@ public function testTranslateNotEmptyMessages() $this->assertTrue($input->hasMissing(), 'Expected hasMissing() to return true'); $missing = $input->getMissing(); - $this->assertTrue(is_array($missing)); + $this->assertInternalType('array', $missing); $this->assertEquals(array('rule1'), array_keys($missing)); $this->assertEquals(array("Still missing"), $missing['rule1']); } @@ -2178,7 +2178,7 @@ public function testTranslateNotEmptyMessagesByUsingRegistry() $this->assertFalse($input->hasValid(), 'Expected hasValid() to return false'); $missing = $input->getMissing(); - $this->assertTrue(is_array($missing)); + $this->assertInternalType('array', $missing); $this->assertEquals(array('rule1'), array_keys($missing)); $this->assertEquals(array("Still missing"), $missing['rule1']); } diff --git a/tests/Zend/Filter/IntTest.php b/tests/Zend/Filter/IntTest.php index 8c45304258..b447a65215 100644 --- a/tests/Zend/Filter/IntTest.php +++ b/tests/Zend/Filter/IntTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_IntTest extends PHPUnit_Framework_TestCase +class Zend_Filter_IntTest extends PHPUnit\Framework\TestCase { /** * Zend_Filter_Int object diff --git a/tests/Zend/Filter/LocalizedToNormalizedTest.php b/tests/Zend/Filter/LocalizedToNormalizedTest.php index fc5b4eff54..29b7393a71 100644 --- a/tests/Zend/Filter/LocalizedToNormalizedTest.php +++ b/tests/Zend/Filter/LocalizedToNormalizedTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_LocalizedToNormalizedTest extends PHPUnit_Framework_TestCase +class Zend_Filter_LocalizedToNormalizedTest extends PHPUnit\Framework\TestCase { /** * Ensures that the filter follows expected behavior diff --git a/tests/Zend/Filter/NormalizedToLocalizedTest.php b/tests/Zend/Filter/NormalizedToLocalizedTest.php index 64d102992d..b53be027e2 100644 --- a/tests/Zend/Filter/NormalizedToLocalizedTest.php +++ b/tests/Zend/Filter/NormalizedToLocalizedTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_NormalizedToLocalizedTest extends PHPUnit_Framework_TestCase +class Zend_Filter_NormalizedToLocalizedTest extends PHPUnit\Framework\TestCase { /** * Ensures that the filter follows expected behavior diff --git a/tests/Zend/Filter/NullTest.php b/tests/Zend/Filter/NullTest.php index 89ffebd4b5..3562679477 100644 --- a/tests/Zend/Filter/NullTest.php +++ b/tests/Zend/Filter/NullTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_NullTest extends PHPUnit_Framework_TestCase +class Zend_Filter_NullTest extends PHPUnit\Framework\TestCase { /** * Zend_Filter_Null object diff --git a/tests/Zend/Filter/PregReplaceTest.php b/tests/Zend/Filter/PregReplaceTest.php index 2da1833c3c..5ea13329f3 100644 --- a/tests/Zend/Filter/PregReplaceTest.php +++ b/tests/Zend/Filter/PregReplaceTest.php @@ -36,7 +36,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_PregReplaceTest extends PHPUnit_Framework_TestCase +class Zend_Filter_PregReplaceTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -78,7 +78,7 @@ public function testMatchPatternAccessorsWork() public function testReplacementInitiallyEmpty() { $replacement = $this->filter->getReplacement(); - $this->assertTrue(empty($replacement)); + $this->assertEmpty($replacement); } public function testReplacementAccessorsWork() diff --git a/tests/Zend/Filter/RealPathTest.php b/tests/Zend/Filter/RealPathTest.php index 0c7c853875..7a95c48d82 100644 --- a/tests/Zend/Filter/RealPathTest.php +++ b/tests/Zend/Filter/RealPathTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_RealPathTest extends PHPUnit_Framework_TestCase +class Zend_Filter_RealPathTest extends PHPUnit\Framework\TestCase { /** * Path to test files @@ -42,16 +42,6 @@ class Zend_Filter_RealPathTest extends PHPUnit_Framework_TestCase */ protected $_filesPath; - /** - * Sets the path to test files - * - * @return void - */ - public function __construct() - { - $this->_filesPath = dirname(__FILE__) . DIRECTORY_SEPARATOR . '_files'; - } - /** * Zend_Filter_Basename object * @@ -66,6 +56,7 @@ public function __construct() */ public function setUp() { + $this->_filesPath = dirname(__FILE__) . DIRECTORY_SEPARATOR . '_files'; $this->_filter = new Zend_Filter_RealPath(); } diff --git a/tests/Zend/Filter/StringToLowerTest.php b/tests/Zend/Filter/StringToLowerTest.php index db15ea7f28..5e412cb666 100644 --- a/tests/Zend/Filter/StringToLowerTest.php +++ b/tests/Zend/Filter/StringToLowerTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_StringToLowerTest extends PHPUnit_Framework_TestCase +class Zend_Filter_StringToLowerTest extends PHPUnit\Framework\TestCase { /** * Zend_Filter_StringToLower object diff --git a/tests/Zend/Filter/StringToUpperTest.php b/tests/Zend/Filter/StringToUpperTest.php index d073cd6fe3..2732430b87 100644 --- a/tests/Zend/Filter/StringToUpperTest.php +++ b/tests/Zend/Filter/StringToUpperTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_StringToUpperTest extends PHPUnit_Framework_TestCase +class Zend_Filter_StringToUpperTest extends PHPUnit\Framework\TestCase { /** * Zend_Filter_StringToLower object diff --git a/tests/Zend/Filter/StringTrimTest.php b/tests/Zend/Filter/StringTrimTest.php index c3b418601c..133d5e97c3 100644 --- a/tests/Zend/Filter/StringTrimTest.php +++ b/tests/Zend/Filter/StringTrimTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_StringTrimTest extends PHPUnit_Framework_TestCase +class Zend_Filter_StringTrimTest extends PHPUnit\Framework\TestCase { /** * Zend_Filter_StringTrim object diff --git a/tests/Zend/Filter/StripNewlinesTest.php b/tests/Zend/Filter/StripNewlinesTest.php index b195ce96c1..5975184d9d 100644 --- a/tests/Zend/Filter/StripNewlinesTest.php +++ b/tests/Zend/Filter/StripNewlinesTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_StripNewlinesTest extends PHPUnit_Framework_TestCase +class Zend_Filter_StripNewlinesTest extends PHPUnit\Framework\TestCase { /** * Zend_Filter_StripNewlines object diff --git a/tests/Zend/Filter/StripTagsTest.php b/tests/Zend/Filter/StripTagsTest.php index d24ebd1f1b..7238bbb068 100644 --- a/tests/Zend/Filter/StripTagsTest.php +++ b/tests/Zend/Filter/StripTagsTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_StripTagsTest extends PHPUnit_Framework_TestCase +class Zend_Filter_StripTagsTest extends PHPUnit\Framework\TestCase { /** * Zend_Filter_StripTags object @@ -513,7 +513,7 @@ public function testFilterIsoChars() $input = 'äöüäöü'; $input = iconv("UTF-8", "ISO-8859-1", $input); $output = $this->_filter->filter($input); - $this->assertFalse(empty($output)); + $this->assertNotEmpty($output); } /** @@ -528,7 +528,7 @@ public function testFilterIsoCharsInComment() $input = 'äöüäöü'; $input = iconv("UTF-8", "ISO-8859-1", $input); $output = $this->_filter->filter($input); - $this->assertFalse(empty($output)); + $this->assertNotEmpty($output); } /** diff --git a/tests/Zend/Filter/Word/CamelCaseToDashTest.php b/tests/Zend/Filter/Word/CamelCaseToDashTest.php index 40d8535f17..e7bf11a970 100644 --- a/tests/Zend/Filter/Word/CamelCaseToDashTest.php +++ b/tests/Zend/Filter/Word/CamelCaseToDashTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_Word_CamelCaseToDashTest extends PHPUnit_Framework_TestCase +class Zend_Filter_Word_CamelCaseToDashTest extends PHPUnit\Framework\TestCase { public function testFilterSeparatesCamelCasedWordsWithDashes() { diff --git a/tests/Zend/Filter/Word/CamelCaseToSeparatorTest.php b/tests/Zend/Filter/Word/CamelCaseToSeparatorTest.php index 571396ee08..104f532355 100644 --- a/tests/Zend/Filter/Word/CamelCaseToSeparatorTest.php +++ b/tests/Zend/Filter/Word/CamelCaseToSeparatorTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_Word_CamelCaseToSeparatorTest extends PHPUnit_Framework_TestCase +class Zend_Filter_Word_CamelCaseToSeparatorTest extends PHPUnit\Framework\TestCase { public function testFilterSeparatesCamelCasedWordsWithSpacesByDefault() { diff --git a/tests/Zend/Filter/Word/CamelCaseToUnderscoreTest.php b/tests/Zend/Filter/Word/CamelCaseToUnderscoreTest.php index a9c3ff8352..d156249372 100644 --- a/tests/Zend/Filter/Word/CamelCaseToUnderscoreTest.php +++ b/tests/Zend/Filter/Word/CamelCaseToUnderscoreTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_Word_CamelCaseToUnderscoreTest extends PHPUnit_Framework_TestCase +class Zend_Filter_Word_CamelCaseToUnderscoreTest extends PHPUnit\Framework\TestCase { public function testFilterSeparatesCamelCasedWordsWithUnderscores() { diff --git a/tests/Zend/Filter/Word/DashToCamelCaseTest.php b/tests/Zend/Filter/Word/DashToCamelCaseTest.php index 3fdf4706e8..a1c0f59db3 100644 --- a/tests/Zend/Filter/Word/DashToCamelCaseTest.php +++ b/tests/Zend/Filter/Word/DashToCamelCaseTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_Word_DashToCamelCaseTest extends PHPUnit_Framework_TestCase +class Zend_Filter_Word_DashToCamelCaseTest extends PHPUnit\Framework\TestCase { public function testFilterSeparatesCamelCasedWordsWithDashes() { diff --git a/tests/Zend/Filter/Word/DashToSeparatorTest.php b/tests/Zend/Filter/Word/DashToSeparatorTest.php index 21bb1490a4..62245eab24 100644 --- a/tests/Zend/Filter/Word/DashToSeparatorTest.php +++ b/tests/Zend/Filter/Word/DashToSeparatorTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_Word_DashToSeparatorTest extends PHPUnit_Framework_TestCase +class Zend_Filter_Word_DashToSeparatorTest extends PHPUnit\Framework\TestCase { public function testFilterSeparatesDashedWordsWithDefaultSpaces() { diff --git a/tests/Zend/Filter/Word/DashToUnderscoreTest.php b/tests/Zend/Filter/Word/DashToUnderscoreTest.php index 6540028aa4..92c21d81b7 100644 --- a/tests/Zend/Filter/Word/DashToUnderscoreTest.php +++ b/tests/Zend/Filter/Word/DashToUnderscoreTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_Word_DashToUnderscoreTest extends PHPUnit_Framework_TestCase +class Zend_Filter_Word_DashToUnderscoreTest extends PHPUnit\Framework\TestCase { public function testFilterSeparatesCamelCasedWordsWithDashes() { diff --git a/tests/Zend/Filter/Word/SeparatorToCamelCaseTest.php b/tests/Zend/Filter/Word/SeparatorToCamelCaseTest.php index 3aa1dcf682..fce3fe479c 100644 --- a/tests/Zend/Filter/Word/SeparatorToCamelCaseTest.php +++ b/tests/Zend/Filter/Word/SeparatorToCamelCaseTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_Word_SeparatorToCamelCaseTest extends PHPUnit_Framework_TestCase +class Zend_Filter_Word_SeparatorToCamelCaseTest extends PHPUnit\Framework\TestCase { public function testFilterSeparatesCamelCasedWordsWithSpacesByDefault() { diff --git a/tests/Zend/Filter/Word/SeparatorToDashTest.php b/tests/Zend/Filter/Word/SeparatorToDashTest.php index 184b1b2f96..7590661af2 100644 --- a/tests/Zend/Filter/Word/SeparatorToDashTest.php +++ b/tests/Zend/Filter/Word/SeparatorToDashTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_Word_SeparatorToDashTest extends PHPUnit_Framework_TestCase +class Zend_Filter_Word_SeparatorToDashTest extends PHPUnit\Framework\TestCase { public function testFilterSeparatesDashedWordsWithDefaultSpaces() { diff --git a/tests/Zend/Filter/Word/SeparatorToSeparatorTest.php b/tests/Zend/Filter/Word/SeparatorToSeparatorTest.php index f3865a438a..340e6b4cd9 100644 --- a/tests/Zend/Filter/Word/SeparatorToSeparatorTest.php +++ b/tests/Zend/Filter/Word/SeparatorToSeparatorTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_Word_SeparatorToSeparatorTest extends PHPUnit_Framework_TestCase +class Zend_Filter_Word_SeparatorToSeparatorTest extends PHPUnit\Framework\TestCase { public function testFilterSeparatesWordsByDefault() { diff --git a/tests/Zend/Filter/Word/UnderscoreToCamelCaseTest.php b/tests/Zend/Filter/Word/UnderscoreToCamelCaseTest.php index 115e85c083..320644014c 100644 --- a/tests/Zend/Filter/Word/UnderscoreToCamelCaseTest.php +++ b/tests/Zend/Filter/Word/UnderscoreToCamelCaseTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_Word_UnderscoreToCamelCaseTest extends PHPUnit_Framework_TestCase +class Zend_Filter_Word_UnderscoreToCamelCaseTest extends PHPUnit\Framework\TestCase { public function testFilterSeparatesCamelCasedWordsWithDashes() { diff --git a/tests/Zend/Filter/Word/UnderscoreToDashTest.php b/tests/Zend/Filter/Word/UnderscoreToDashTest.php index dcdfab4286..864e47e459 100644 --- a/tests/Zend/Filter/Word/UnderscoreToDashTest.php +++ b/tests/Zend/Filter/Word/UnderscoreToDashTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_Word_UnderscoreToDashTest extends PHPUnit_Framework_TestCase +class Zend_Filter_Word_UnderscoreToDashTest extends PHPUnit\Framework\TestCase { public function testFilterSeparatesCamelCasedWordsWithDashes() { diff --git a/tests/Zend/Filter/Word/UnderscoreToSeparatorTest.php b/tests/Zend/Filter/Word/UnderscoreToSeparatorTest.php index c0a6ed7a18..0c4bd21df3 100644 --- a/tests/Zend/Filter/Word/UnderscoreToSeparatorTest.php +++ b/tests/Zend/Filter/Word/UnderscoreToSeparatorTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_Filter_Word_UnderscoreToSeparatorTest extends PHPUnit_Framework_TestCase +class Zend_Filter_Word_UnderscoreToSeparatorTest extends PHPUnit\Framework\TestCase { public function testFilterSeparatesCamelCasedWordsDefaultSeparator() { diff --git a/tests/Zend/FilterTest.php b/tests/Zend/FilterTest.php index 3b8d00b4bc..91169edafb 100644 --- a/tests/Zend/FilterTest.php +++ b/tests/Zend/FilterTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Filter */ -class Zend_FilterTest extends PHPUnit_Framework_TestCase +class Zend_FilterTest extends PHPUnit\Framework\TestCase { /** * Zend_Filter object @@ -138,10 +138,11 @@ public function testStaticFactoryWithConstructorArguments() * * @group ZF-2724 * @return void - * @expectedException Zend_Filter_Exception */ public function testStaticFactoryClassNotFound() { + $this->expectException(\Zend_Filter_Exception::class); + Zend_Filter::filterStatic('1234', 'UnknownFilter'); } diff --git a/tests/Zend/Form/Decorator/AbstractTest.php b/tests/Zend/Form/Decorator/AbstractTest.php index c2cc25d55d..25c83c9630 100644 --- a/tests/Zend/Form/Decorator/AbstractTest.php +++ b/tests/Zend/Form/Decorator/AbstractTest.php @@ -40,7 +40,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Decorator_AbstractTest extends PHPUnit_Framework_TestCase +class Zend_Form_Decorator_AbstractTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/Decorator/CallbackTest.php b/tests/Zend/Form/Decorator/CallbackTest.php index fffda30361..849320169d 100644 --- a/tests/Zend/Form/Decorator/CallbackTest.php +++ b/tests/Zend/Form/Decorator/CallbackTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Decorator_CallbackTest extends PHPUnit_Framework_TestCase +class Zend_Form_Decorator_CallbackTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/Decorator/DescriptionTest.php b/tests/Zend/Form/Decorator/DescriptionTest.php index 50e280e125..2afa560668 100644 --- a/tests/Zend/Form/Decorator/DescriptionTest.php +++ b/tests/Zend/Form/Decorator/DescriptionTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Decorator_DescriptionTest extends PHPUnit_Framework_TestCase +class Zend_Form_Decorator_DescriptionTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/Decorator/ErrorsTest.php b/tests/Zend/Form/Decorator/ErrorsTest.php index 8747ed1f5a..22564ee84b 100644 --- a/tests/Zend/Form/Decorator/ErrorsTest.php +++ b/tests/Zend/Form/Decorator/ErrorsTest.php @@ -36,7 +36,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Decorator_ErrorsTest extends PHPUnit_Framework_TestCase +class Zend_Form_Decorator_ErrorsTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/Decorator/FieldsetTest.php b/tests/Zend/Form/Decorator/FieldsetTest.php index baf53ab35f..c8363fd095 100644 --- a/tests/Zend/Form/Decorator/FieldsetTest.php +++ b/tests/Zend/Form/Decorator/FieldsetTest.php @@ -36,7 +36,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Decorator_FieldsetTest extends PHPUnit_Framework_TestCase +class Zend_Form_Decorator_FieldsetTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/Decorator/FileTest.php b/tests/Zend/Form/Decorator/FileTest.php index 62e3bbf122..96017986a9 100644 --- a/tests/Zend/Form/Decorator/FileTest.php +++ b/tests/Zend/Form/Decorator/FileTest.php @@ -36,7 +36,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Decorator_FileTest extends PHPUnit_Framework_TestCase +class Zend_Form_Decorator_FileTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/Decorator/FormErrorsTest.php b/tests/Zend/Form/Decorator/FormErrorsTest.php index 3f8e98b452..5179ccc8b7 100644 --- a/tests/Zend/Form/Decorator/FormErrorsTest.php +++ b/tests/Zend/Form/Decorator/FormErrorsTest.php @@ -36,7 +36,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Decorator_FormErrorsTest extends PHPUnit_Framework_TestCase +class Zend_Form_Decorator_FormErrorsTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/Decorator/FormTest.php b/tests/Zend/Form/Decorator/FormTest.php index a39723e94f..86ebb08aca 100644 --- a/tests/Zend/Form/Decorator/FormTest.php +++ b/tests/Zend/Form/Decorator/FormTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Decorator_FormTest extends PHPUnit_Framework_TestCase +class Zend_Form_Decorator_FormTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/Decorator/HtmlTagTest.php b/tests/Zend/Form/Decorator/HtmlTagTest.php index 70154ca70b..db3276844f 100644 --- a/tests/Zend/Form/Decorator/HtmlTagTest.php +++ b/tests/Zend/Form/Decorator/HtmlTagTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Decorator_HtmlTagTest extends PHPUnit_Framework_TestCase +class Zend_Form_Decorator_HtmlTagTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/Decorator/ImageTest.php b/tests/Zend/Form/Decorator/ImageTest.php index f0e77c2774..23b89e12fc 100644 --- a/tests/Zend/Form/Decorator/ImageTest.php +++ b/tests/Zend/Form/Decorator/ImageTest.php @@ -37,7 +37,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Decorator_ImageTest extends PHPUnit_Framework_TestCase +class Zend_Form_Decorator_ImageTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/Decorator/LabelTest.php b/tests/Zend/Form/Decorator/LabelTest.php index 71a02efc47..4298b08bf6 100644 --- a/tests/Zend/Form/Decorator/LabelTest.php +++ b/tests/Zend/Form/Decorator/LabelTest.php @@ -36,7 +36,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Decorator_LabelTest extends PHPUnit_Framework_TestCase +class Zend_Form_Decorator_LabelTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -276,7 +276,7 @@ public function testSettingTagToEmptyValueShouldDisableTag() $this->decorator->setElement($element) ->setTag(''); $content = $this->decorator->render(''); - $this->assertTrue(empty($content), $content); + $this->assertEmpty($content, $content); } /** diff --git a/tests/Zend/Form/Decorator/PrepareElementsTest.php b/tests/Zend/Form/Decorator/PrepareElementsTest.php index d7df4b0285..e1f8eae2a4 100644 --- a/tests/Zend/Form/Decorator/PrepareElementsTest.php +++ b/tests/Zend/Form/Decorator/PrepareElementsTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Decorator_PrepareElementsTest extends PHPUnit_Framework_TestCase +class Zend_Form_Decorator_PrepareElementsTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/Decorator/ReCaptchaTest.php b/tests/Zend/Form/Decorator/ReCaptchaTest.php index f7f14b9cfc..adbd0143c9 100644 --- a/tests/Zend/Form/Decorator/ReCaptchaTest.php +++ b/tests/Zend/Form/Decorator/ReCaptchaTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Decorator_ReCaptchaTest extends PHPUnit_Framework_TestCase +class Zend_Form_Decorator_ReCaptchaTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/Decorator/ViewHelperTest.php b/tests/Zend/Form/Decorator/ViewHelperTest.php index 30fee4fec2..f42ee8778b 100644 --- a/tests/Zend/Form/Decorator/ViewHelperTest.php +++ b/tests/Zend/Form/Decorator/ViewHelperTest.php @@ -36,7 +36,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Decorator_ViewHelperTest extends PHPUnit_Framework_TestCase +class Zend_Form_Decorator_ViewHelperTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/Decorator/ViewScriptTest.php b/tests/Zend/Form/Decorator/ViewScriptTest.php index 7b57818387..5cb58f9bdc 100644 --- a/tests/Zend/Form/Decorator/ViewScriptTest.php +++ b/tests/Zend/Form/Decorator/ViewScriptTest.php @@ -36,7 +36,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Decorator_ViewScriptTest extends PHPUnit_Framework_TestCase +class Zend_Form_Decorator_ViewScriptTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/DisplayGroupTest.php b/tests/Zend/Form/DisplayGroupTest.php index afbde2f282..31bfced297 100644 --- a/tests/Zend/Form/DisplayGroupTest.php +++ b/tests/Zend/Form/DisplayGroupTest.php @@ -42,7 +42,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_DisplayGroupTest extends PHPUnit_Framework_TestCase +class Zend_Form_DisplayGroupTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -186,8 +186,8 @@ public function testCanRemoveAllElements() $this->testCanAddMultipleElements(); $this->group->clearElements(); $elements = $this->group->getElements(); - $this->assertTrue(is_array($elements)); - $this->assertTrue(empty($elements)); + $this->assertInternalType('array', $elements); + $this->assertEmpty($elements); } // Plugin loader @@ -313,12 +313,12 @@ public function testRemovingNamedDecoratorsShouldWork() array(array('div2' => 'HtmlTag'), array('tag' => 'div')), )); $decorators = $this->group->getDecorators(); - $this->assertTrue(array_key_exists('div', $decorators)); - $this->assertTrue(array_key_exists('div2', $decorators)); + $this->assertArrayHasKey('div', $decorators); + $this->assertArrayHasKey('div2', $decorators); $this->group->removeDecorator('div'); $decorators = $this->group->getDecorators(); - $this->assertFalse(array_key_exists('div', $decorators)); - $this->assertTrue(array_key_exists('div2', $decorators)); + $this->assertArrayNotHasKey('div', $decorators); + $this->assertArrayHasKey('div2', $decorators); } @@ -433,7 +433,7 @@ public function testToStringRaisesErrorWhenExceptionCaught() restore_error_handler(); - $this->assertTrue(empty($text)); + $this->assertEmpty($text); $this->assertTrue(isset($this->error)); $this->assertEquals('Raising exception in decorator callback', $this->error); } @@ -719,7 +719,7 @@ public function testInitCalledBeforeLoadDecorators() $this->loader ); $decorators = $group->getDecorators(); - $this->assertTrue(empty($decorators)); + $this->assertEmpty($decorators); } /** @@ -747,10 +747,11 @@ public function testGroupShouldOverloadToRenderDecorators() /** * @group ZF-3217 - * @expectedException Zend_Form_Exception */ public function testOverloadingToInvalidMethodsShouldThrowAnException() { + $this->expectException(\Zend_Form_Exception::class); + $html = $this->group->bogusMethodCall(); } diff --git a/tests/Zend/Form/Element/ButtonTest.php b/tests/Zend/Form/Element/ButtonTest.php index fc5f80a219..ca7b5fcfc8 100644 --- a/tests/Zend/Form/Element/ButtonTest.php +++ b/tests/Zend/Form/Element/ButtonTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Element_ButtonTest extends PHPUnit_Framework_TestCase +class Zend_Form_Element_ButtonTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Form_Element_Button diff --git a/tests/Zend/Form/Element/CaptchaTest.php b/tests/Zend/Form/Element/CaptchaTest.php index 26df39851a..1c11e10deb 100644 --- a/tests/Zend/Form/Element/CaptchaTest.php +++ b/tests/Zend/Form/Element/CaptchaTest.php @@ -37,7 +37,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Element_CaptchaTest extends PHPUnit_Framework_TestCase +class Zend_Form_Element_CaptchaTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -61,10 +61,11 @@ public function getCaptcha() } /** - * @expectedException Zend_Form_Exception */ public function testConstructionShouldRequireCaptchaDetails() { + $this->expectException(\Zend_Form_Exception::class); + $this->element = new Zend_Form_Element_Captcha('foo'); } @@ -81,7 +82,7 @@ public function testShouldAllowAddingCaptchaPrefixPath() $this->element->addPrefixPath('My_Captcha', 'My/Captcha/', 'captcha'); $loader = $this->element->getPluginLoader('captcha'); $paths = $loader->getPaths('My_Captcha'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } public function testAddingNullPrefixPathShouldAddCaptchaPrefixPath() @@ -89,7 +90,7 @@ public function testAddingNullPrefixPathShouldAddCaptchaPrefixPath() $this->element->addPrefixPath('My', 'My'); $loader = $this->element->getPluginLoader('captcha'); $paths = $loader->getPaths('My_Captcha'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } /** @@ -158,11 +159,11 @@ public function testCaptchaShouldValidateUsingFullyQualifiedElementName() public function testDefaultDecoratorsShouldIncludeErrorsDescriptionHtmlTagAndLabel() { $decorators = $this->element->getDecorators(); - $this->assertTrue(is_array($decorators)); - $this->assertTrue(array_key_exists('Zend_Form_Decorator_Errors', $decorators), 'Missing Errors decorator' . var_export(array_keys($decorators), 1)); - $this->assertTrue(array_key_exists('Zend_Form_Decorator_Description', $decorators), 'Missing Description decorator' . var_export(array_keys($decorators), 1)); - $this->assertTrue(array_key_exists('Zend_Form_Decorator_HtmlTag', $decorators), 'Missing HtmlTag decorator' . var_export(array_keys($decorators), 1)); - $this->assertTrue(array_key_exists('Zend_Form_Decorator_Label', $decorators), 'Missing Label decorator' . var_export(array_keys($decorators), 1)); + $this->assertInternalType('array', $decorators); + $this->assertArrayHasKey('Zend_Form_Decorator_Errors', $decorators, 'Missing Errors decorator' . var_export(array_keys($decorators), 1)); + $this->assertArrayHasKey('Zend_Form_Decorator_Description', $decorators, 'Missing Description decorator' . var_export(array_keys($decorators), 1)); + $this->assertArrayHasKey('Zend_Form_Decorator_HtmlTag', $decorators, 'Missing HtmlTag decorator' . var_export(array_keys($decorators), 1)); + $this->assertArrayHasKey('Zend_Form_Decorator_Label', $decorators, 'Missing Label decorator' . var_export(array_keys($decorators), 1)); } /** @@ -171,7 +172,7 @@ public function testDefaultDecoratorsShouldIncludeErrorsDescriptionHtmlTagAndLab public function testHelperDoesNotShowUpInAttribs() { require_once 'Zend/View.php'; - $this->assertFalse(array_key_exists('helper', $this->element->getAttribs())); + $this->assertArrayNotHasKey('helper', $this->element->getAttribs()); } /** @@ -287,13 +288,13 @@ public function testDefaultDecoratorsBeforeAndAfterRenderingWhenDefaultDecorator // Before rendering $decorators = $element->getDecorators(); - $this->assertTrue(empty($decorators)); + $this->assertEmpty($decorators); $element->render(); // After rendering $decorators = $element->getDecorators(); - $this->assertTrue(empty($decorators)); + $this->assertEmpty($decorators); } /** @@ -411,7 +412,7 @@ public function testShouldAllowAddingCaptchaPrefixPathWithBackslash() $this->element->addPrefixPath('My\Captcha', 'My/Captcha/', 'captcha'); $loader = $this->element->getPluginLoader('captcha'); $paths = $loader->getPaths('My\Captcha'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } /** @@ -426,7 +427,7 @@ public function testAddingCaptchaPrefixPathWithBackslash() $this->element->addPrefixPath('My\\', 'My/'); $loader = $this->element->getPluginLoader('captcha'); $paths = $loader->getPaths('My\Captcha'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } } diff --git a/tests/Zend/Form/Element/CheckboxTest.php b/tests/Zend/Form/Element/CheckboxTest.php index cdcf0cf3d7..81b0cab7cd 100644 --- a/tests/Zend/Form/Element/CheckboxTest.php +++ b/tests/Zend/Form/Element/CheckboxTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Element_CheckboxTest extends PHPUnit_Framework_TestCase +class Zend_Form_Element_CheckboxTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/Element/FileTest.php b/tests/Zend/Form/Element/FileTest.php index 1270ac21db..f6de1a1190 100644 --- a/tests/Zend/Form/Element/FileTest.php +++ b/tests/Zend/Form/Element/FileTest.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Element_FileTest extends PHPUnit_Framework_TestCase +class Zend_Form_Element_FileTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Form_Element_File @@ -77,7 +77,7 @@ public function testElementShouldProxyToParentForDecoratorPluginLoader() { $loader = $this->element->getPluginLoader('decorator'); $paths = $loader->getPaths('Zend_Form_Decorator'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $loader = new Zend_Loader_PluginLoader; $this->element->setPluginLoader($loader, 'decorator'); @@ -90,7 +90,7 @@ public function testElementShouldProxyToParentWhenSettingDecoratorPrefixPaths() $this->element->addPrefixPath('Foo_Decorator', 'Foo/Decorator/', 'decorator'); $loader = $this->element->getPluginLoader('decorator'); $paths = $loader->getPaths('Foo_Decorator'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } public function testElementShouldAddToAllPluginLoadersWhenAddingNullPrefixPath() @@ -103,7 +103,7 @@ public function testElementShouldAddToAllPluginLoadersWhenAddingNullPrefixPath() $string = str_replace(' ', '_', $string); $prefix = 'Foo_' . $string; $paths = $loader->getPaths($prefix); - $this->assertTrue(is_array($paths), "Failed asserting paths found for prefix $prefix"); + $this->assertInternalType('array', $paths, "Failed asserting paths found for prefix $prefix"); } } @@ -122,10 +122,11 @@ public function testElementShouldAllowSpecifyingAdapterUsingConcreteInstance() } /** - * @expectedException Zend_Form_Element_Exception */ public function testElementShouldThrowExceptionWhenAddingAdapterOfInvalidType() { + $this->expectException(\Zend_Form_Element_Exception::class); + $this->element->setTransferAdapter(new stdClass); } @@ -134,7 +135,7 @@ public function testShouldRegisterPluginLoaderWithFileTransferAdapterPathByDefau $loader = $this->element->getPluginLoader('transfer_adapter'); $this->assertTrue($loader instanceof Zend_Loader_PluginLoader_Interface); $paths = $loader->getPaths('Zend_File_Transfer_Adapter'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); } public function testElementShouldAllowSpecifyingAdapterUsingPluginLoader() @@ -156,7 +157,7 @@ public function testValidatorAccessAndMutationShouldProxyToAdapter() $validators = $this->element->getValidators(); $test = $this->element->getTransferAdapter()->getValidators(); $this->assertEquals($validators, $test); - $this->assertTrue(is_array($test)); + $this->assertInternalType('array', $test); $this->assertEquals(3, count($test)); $validator = $this->element->getValidator('count'); @@ -175,12 +176,12 @@ public function testValidatorAccessAndMutationShouldProxyToAdapter() $validators = $this->element->getValidators(); $test = $this->element->getTransferAdapter()->getValidators(); $this->assertSame($validators, $test); - $this->assertTrue(is_array($test)); + $this->assertInternalType('array', $test); $this->assertEquals(3, count($test), var_export($test, 1)); $this->element->clearValidators(); $validators = $this->element->getValidators(); - $this->assertTrue(is_array($validators)); + $this->assertInternalType('array', $validators); $this->assertEquals(0, count($validators)); $test = $this->element->getTransferAdapter()->getValidators(); $this->assertSame($validators, $test); diff --git a/tests/Zend/Form/Element/HashTest.php b/tests/Zend/Form/Element/HashTest.php index 7fff1cba0a..a1792aff50 100644 --- a/tests/Zend/Form/Element/HashTest.php +++ b/tests/Zend/Form/Element/HashTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Element_HashTest extends PHPUnit_Framework_TestCase +class Zend_Form_Element_HashTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -77,7 +77,7 @@ public function testHashElementInstanceOfBaseElement() public function testSaltPopulatedByDefault() { $salt = $this->element->getSalt(); - $this->assertFalse(empty($salt)); + $this->assertNotEmpty($salt); } public function testCanSetSalt() @@ -91,8 +91,8 @@ public function testCanSetSalt() public function testTimeoutPopulatedByDefault() { $ttl = $this->element->getTimeout(); - $this->assertFalse(empty($ttl)); - $this->assertTrue(is_int($ttl)); + $this->assertNotEmpty($ttl); + $this->assertInternalType('int', $ttl); } public function testCanSetTimeout() @@ -106,8 +106,8 @@ public function testCanSetTimeout() public function testGetHashReturnsHashValue() { $hash = $this->element->getHash(); - $this->assertFalse(empty($hash)); - $this->assertTrue(is_string($hash)); + $this->assertNotEmpty($hash); + $this->assertInternalType('string', $hash); $this->hash = $hash; } diff --git a/tests/Zend/Form/Element/HiddenTest.php b/tests/Zend/Form/Element/HiddenTest.php index ce5b0c2d77..8a62aff161 100644 --- a/tests/Zend/Form/Element/HiddenTest.php +++ b/tests/Zend/Form/Element/HiddenTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Element_HiddenTest extends PHPUnit_Framework_TestCase +class Zend_Form_Element_HiddenTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/Element/ImageTest.php b/tests/Zend/Form/Element/ImageTest.php index 1f3f596683..acaa98f91e 100644 --- a/tests/Zend/Form/Element/ImageTest.php +++ b/tests/Zend/Form/Element/ImageTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Element_ImageTest extends PHPUnit_Framework_TestCase +class Zend_Form_Element_ImageTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/Element/MultiCheckboxTest.php b/tests/Zend/Form/Element/MultiCheckboxTest.php index 0a824d34b7..12914e9ebb 100644 --- a/tests/Zend/Form/Element/MultiCheckboxTest.php +++ b/tests/Zend/Form/Element/MultiCheckboxTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Element_MultiCheckboxTest extends PHPUnit_Framework_TestCase +class Zend_Form_Element_MultiCheckboxTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -290,7 +290,7 @@ public function testValidateShouldNotAcceptEmptyArray() // Empty value + AllowEmpty=false = notInArray error message $messages = $this->element->getMessages(); - $this->assertTrue(is_array($messages), 'Expected error message'); + $this->assertInternalType('array', $messages, 'Expected error message'); $this->assertArrayHasKey('notInArray', $messages, 'Expected \'notInArray\' error message'); $this->element->setRequired(true)->setAllowEmpty(false); @@ -298,7 +298,7 @@ public function testValidateShouldNotAcceptEmptyArray() // Empty value + Required=true + AllowEmpty=false = isEmpty error message $messages = $this->element->getMessages(); - $this->assertTrue(is_array($messages), 'Expected error message'); + $this->assertInternalType('array', $messages, 'Expected error message'); $this->assertArrayHasKey('isEmpty', $messages, 'Expected \'isEmpty\' error message'); } diff --git a/tests/Zend/Form/Element/MultiselectTest.php b/tests/Zend/Form/Element/MultiselectTest.php index 56a03b2c90..258ca15685 100644 --- a/tests/Zend/Form/Element/MultiselectTest.php +++ b/tests/Zend/Form/Element/MultiselectTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Element_MultiselectTest extends PHPUnit_Framework_TestCase +class Zend_Form_Element_MultiselectTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Form_Element_Multiselect @@ -121,8 +121,8 @@ public function testCanSetSeparator() public function testMultiOptionsEmptyByDefault() { $options = $this->element->getMultiOptions(); - $this->assertTrue(is_array($options)); - $this->assertTrue(empty($options)); + $this->assertInternalType('array', $options); + $this->assertEmpty($options); } public function testCanSetMultiOptions() diff --git a/tests/Zend/Form/Element/NoteTest.php b/tests/Zend/Form/Element/NoteTest.php index 98f84e6f9a..822bbcd8a8 100644 --- a/tests/Zend/Form/Element/NoteTest.php +++ b/tests/Zend/Form/Element/NoteTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Element_NoteTest extends PHPUnit_Framework_TestCase +class Zend_Form_Element_NoteTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/Element/PasswordTest.php b/tests/Zend/Form/Element/PasswordTest.php index 87e1432a3d..6a4ca084cd 100644 --- a/tests/Zend/Form/Element/PasswordTest.php +++ b/tests/Zend/Form/Element/PasswordTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Element_PasswordTest extends PHPUnit_Framework_TestCase +class Zend_Form_Element_PasswordTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -115,7 +115,7 @@ public function testGetMessagesReturnsEmptyArrayWhenNoMessagesRegistered() $messages = $this->element->getMessages(); restore_error_handler(); $this->assertSame(array(), $messages); - $this->assertTrue(empty($this->errors)); + $this->assertEmpty($this->errors); } /** diff --git a/tests/Zend/Form/Element/RadioTest.php b/tests/Zend/Form/Element/RadioTest.php index 1fb9d727f5..c2766fc430 100644 --- a/tests/Zend/Form/Element/RadioTest.php +++ b/tests/Zend/Form/Element/RadioTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Element_RadioTest extends PHPUnit_Framework_TestCase +class Zend_Form_Element_RadioTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/Element/ResetTest.php b/tests/Zend/Form/Element/ResetTest.php index 586fd24b63..685ab4a511 100644 --- a/tests/Zend/Form/Element/ResetTest.php +++ b/tests/Zend/Form/Element/ResetTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Element_ResetTest extends PHPUnit_Framework_TestCase +class Zend_Form_Element_ResetTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/Element/SelectTest.php b/tests/Zend/Form/Element/SelectTest.php index 138e20fe93..4f3bf2c3cf 100644 --- a/tests/Zend/Form/Element/SelectTest.php +++ b/tests/Zend/Form/Element/SelectTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Element_SelectTest extends PHPUnit_Framework_TestCase +class Zend_Form_Element_SelectTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/Element/SubmitTest.php b/tests/Zend/Form/Element/SubmitTest.php index fc20364093..81ddd6263e 100644 --- a/tests/Zend/Form/Element/SubmitTest.php +++ b/tests/Zend/Form/Element/SubmitTest.php @@ -36,7 +36,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Element_SubmitTest extends PHPUnit_Framework_TestCase +class Zend_Form_Element_SubmitTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/Element/TextTest.php b/tests/Zend/Form/Element/TextTest.php index f2500b1e0b..9b94816fb0 100644 --- a/tests/Zend/Form/Element/TextTest.php +++ b/tests/Zend/Form/Element/TextTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Element_TextTest extends PHPUnit_Framework_TestCase +class Zend_Form_Element_TextTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/Element/TextareaTest.php b/tests/Zend/Form/Element/TextareaTest.php index af534de53d..f546f48a78 100644 --- a/tests/Zend/Form/Element/TextareaTest.php +++ b/tests/Zend/Form/Element/TextareaTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_Element_TextareaTest extends PHPUnit_Framework_TestCase +class Zend_Form_Element_TextareaTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Form/ElementTest.php b/tests/Zend/Form/ElementTest.php index e42e9b3cdd..f9feaf6078 100644 --- a/tests/Zend/Form/ElementTest.php +++ b/tests/Zend/Form/ElementTest.php @@ -42,7 +42,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_ElementTest extends PHPUnit_Framework_TestCase +class Zend_Form_ElementTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -222,7 +222,7 @@ public function testRetrievingArrayValueFiltersAllArrayValues() ->setIsArray(true) ->addFilter('StringToUpper'); $test = $this->element->getValue(); - $this->assertTrue(is_array($test)); + $this->assertInternalType('array', $test); array_walk_recursive($test, array($this, 'checkFilterValues')); } @@ -239,7 +239,7 @@ public function testRetrievingArrayValueDoesNotFilterAllValuesWhenNotIsArray() $this->element->setValue($values) ->addFilter(new Zend_Form_ElementTest_ArrayFilter()); $test = $this->element->getValue(); - $this->assertTrue(is_array($test)); + $this->assertInternalType('array', $test); require_once 'Zend/Json.php'; $test = Zend_Json::encode($test); $this->assertNotContains('foo', $test); @@ -464,7 +464,7 @@ public function testHelperDoesNotShowUpInAttribs() ); $this->element->setAttribs($attribs); - $this->assertFalse(array_key_exists('helper', $this->element->getAttribs())); + $this->assertArrayNotHasKey('helper', $this->element->getAttribs()); } public function testPassingNullValuesToSetAttribsUnsetsAttribs() @@ -495,7 +495,7 @@ public function testGetPluginLoaderRetrievesDefaultValidatorPluginLoader() $loader = $this->element->getPluginLoader('validate'); $this->assertTrue($loader instanceof Zend_Loader_PluginLoader); $paths = $loader->getPaths('Zend_Validate'); - $this->assertTrue(is_array($paths), var_export($loader, 1)); + $this->assertInternalType('array', $paths, var_export($loader, 1)); $this->assertTrue(0 < count($paths)); $this->assertContains('Validate', $paths[0]); } @@ -505,7 +505,7 @@ public function testGetPluginLoaderRetrievesDefaultFilterPluginLoader() $loader = $this->element->getPluginLoader('filter'); $this->assertTrue($loader instanceof Zend_Loader_PluginLoader); $paths = $loader->getPaths('Zend_Filter'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $this->assertTrue(0 < count($paths)); $this->assertContains('Filter', $paths[0]); } @@ -515,7 +515,7 @@ public function testGetPluginLoaderRetrievesDefaultDecoratorPluginLoader() $loader = $this->element->getPluginLoader('decorator'); $this->assertTrue($loader instanceof Zend_Loader_PluginLoader); $paths = $loader->getPaths('Zend_Form_Decorator'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $this->assertTrue(0 < count($paths)); $this->assertContains('Decorator', $paths[0]); } @@ -580,7 +580,7 @@ public function testCanAddValidatorPluginLoaderPrefixPath() $loader = $this->element->getPluginLoader('validate'); $this->element->addPrefixPath('Zend_Form', 'Zend/Form/', 'validate'); $paths = $loader->getPaths('Zend_Form'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $this->assertContains('Form', $paths[0]); } @@ -599,7 +599,7 @@ public function testCanAddFilterPluginLoaderPrefixPath() $loader = $this->element->getPluginLoader('validate'); $this->element->addPrefixPath('Zend_Form', 'Zend/Form/', 'validate'); $paths = $loader->getPaths('Zend_Form'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $this->assertContains('Form', $paths[0]); } @@ -618,7 +618,7 @@ public function testCanAddDecoratorPluginLoaderPrefixPath() $loader = $this->element->getPluginLoader('decorator'); $this->element->addPrefixPath('Zend_Foo', 'Zend/Foo/', 'decorator'); $paths = $loader->getPaths('Zend_Foo'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $this->assertContains('Foo', $paths[0]); } @@ -643,15 +643,15 @@ public function testCanAddAllPluginLoaderPrefixPathsSimultaneously() ->addPrefixPath('Zend', 'Zend/'); $paths = $filterLoader->getPaths('Zend_Filter'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $this->assertContains('Filter', $paths[0]); $paths = $validatorLoader->getPaths('Zend_Validate'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $this->assertContains('Validate', $paths[0]); $paths = $decoratorLoader->getPaths('Zend_Decorator'); - $this->assertTrue(is_array($paths), var_export($paths, 1)); + $this->assertInternalType('array', $paths, var_export($paths, 1)); $this->assertContains('Decorator', $paths[0]); } @@ -898,7 +898,7 @@ public function testCustomErrorMessageStackShouldBeClearable() $this->testCustomErrorMessagesShouldBeManagedInAStack(); $this->element->clearErrorMessages(); $messages = $this->element->getErrorMessages(); - $this->assertTrue(empty($messages)); + $this->assertEmpty($messages); } public function testCustomErrorMessagesShouldBeTranslated() @@ -1027,7 +1027,7 @@ public function testCanClearAllValidators() $this->element->clearValidators(); $test = $this->element->getValidators(); $this->assertNotEquals($validators, $test); - $this->assertTrue(empty($test)); + $this->assertEmpty($test); foreach (array_keys($validators) as $validator) { $this->assertFalse($this->element->getValidator($validator)); } @@ -1073,7 +1073,7 @@ public function testErrorsPopulatedFollowingFailedIsValidCheck() $this->fail('Invalid data should fail validations'); } $errors = $this->element->getErrors(); - $this->assertTrue(is_array($errors)); + $this->assertInternalType('array', $errors); $this->assertTrue(0 < count($errors)); } @@ -1089,7 +1089,7 @@ public function testMessagesPopulatedFollowingFailedIsValidCheck() $this->fail('Invalid data should fail validations'); } $messages = $this->element->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertTrue(0 < count($messages)); } @@ -1102,8 +1102,8 @@ public function testOptionalElementDoesNotPerformValidationsOnEmptyValuesByDefau $this->fail('Empty data should not fail validations'); } $errors = $this->element->getErrors(); - $this->assertTrue(is_array($errors)); - $this->assertTrue(empty($errors)); + $this->assertInternalType('array', $errors); + $this->assertEmpty($errors); } public function testOptionalElementDoesPerformValidationsWhenAllowEmptyIsFalse() @@ -1116,7 +1116,7 @@ public function testOptionalElementDoesPerformValidationsWhenAllowEmptyIsFalse() $this->fail('Empty data should fail validations when AllowEmpty is false'); } $errors = $this->element->getErrors(); - $this->assertTrue(is_array($errors)); + $this->assertInternalType('array', $errors); $this->assertTrue(0 < count($errors)); } @@ -1254,7 +1254,7 @@ public function testCanClearAllFilters() $this->element->clearFilters(); $test = $this->element->getFilters(); $this->assertNotEquals($filters, $test); - $this->assertTrue(empty($test)); + $this->assertEmpty($test); foreach (array_keys($filters) as $filter) { $this->assertFalse($this->element->getFilter($filter)); } @@ -1312,9 +1312,9 @@ public function testDescriptionDecoratorRegisteredByDefault() $decorator = $this->element->getDecorator('description'); $this->assertTrue($decorator instanceof Zend_Form_Decorator_Description); $options = $decorator->getOptions(); - $this->assertTrue(array_key_exists('tag', $options)); + $this->assertArrayHasKey('tag', $options); $this->assertEquals('p', $options['tag']); - $this->assertTrue(array_key_exists('class', $options)); + $this->assertArrayHasKey('class', $options); $this->assertEquals('description', $options['class']); } @@ -1461,12 +1461,12 @@ public function testRemovingNamedDecoratorsShouldWork() array(array('div2' => 'HtmlTag'), array('tag' => 'div')), )); $decorators = $this->element->getDecorators(); - $this->assertTrue(array_key_exists('div', $decorators)); - $this->assertTrue(array_key_exists('div2', $decorators)); + $this->assertArrayHasKey('div', $decorators); + $this->assertArrayHasKey('div2', $decorators); $this->element->removeDecorator('div'); $decorators = $this->element->getDecorators(); - $this->assertFalse(array_key_exists('div', $decorators)); - $this->assertTrue(array_key_exists('div2', $decorators)); + $this->assertArrayNotHasKey('div', $decorators); + $this->assertArrayHasKey('div2', $decorators); } public function testCanClearAllDecorators() @@ -1537,8 +1537,8 @@ public function testRenderElementReturnsMarkup() { $this->element->setName('foo'); $html = $this->element->render($this->getView()); - $this->assertTrue(is_string($html)); - $this->assertFalse(empty($html)); + $this->assertInternalType('string', $html); + $this->assertNotEmpty($html); $this->assertContains('assertContains('"foo"', $html); } @@ -1549,8 +1549,8 @@ public function testRenderElementRendersLabelWhenProvided() $this->element->setName('foo') ->setLabel('Foo'); $html = $this->element->render(); - $this->assertTrue(is_string($html)); - $this->assertFalse(empty($html)); + $this->assertInternalType('string', $html); + $this->assertNotEmpty($html); $this->assertContains('assertContains('Foo', $html); $this->assertContains('', $html); @@ -1562,8 +1562,8 @@ public function testRenderElementRendersValueWhenProvided() $this->element->setName('foo') ->setValue('bar'); $html = $this->element->render(); - $this->assertTrue(is_string($html)); - $this->assertFalse(empty($html)); + $this->assertInternalType('string', $html); + $this->assertNotEmpty($html); $this->assertContains('assertContains('"foo"', $html); $this->assertContains('"bar"', $html); @@ -1580,8 +1580,8 @@ public function testRenderElementRendersErrorsWhenProvided() $this->element->isValid(''); $html = $this->element->render(); - $this->assertTrue(is_string($html)); - $this->assertFalse(empty($html)); + $this->assertInternalType('string', $html); + $this->assertNotEmpty($html); $this->assertContains('error', $html); $this->assertRegexp('/empty/i', $html); } @@ -1591,8 +1591,8 @@ public function testToStringProxiesToRender() $this->element->setView($this->getView()); $this->element->setName('foo'); $html = $this->element->__toString(); - $this->assertTrue(is_string($html)); - $this->assertFalse(empty($html)); + $this->assertInternalType('string', $html); + $this->assertNotEmpty($html); $this->assertContains('assertContains('"foo"', $html); } @@ -1621,7 +1621,7 @@ public function testToStringRaisesErrorWhenExceptionCaught() restore_error_handler(); - $this->assertTrue(empty($text)); + $this->assertEmpty($text); $this->assertTrue(isset($this->error)); $this->assertEquals('Raising exception in decorator callback', $this->error); } @@ -1863,8 +1863,8 @@ public function testSetOptionsSetsGlobalPrefixPaths() foreach (array('validate', 'filter', 'decorator') as $type) { $loader = $this->element->getPluginLoader($type); $paths = $loader->getPaths('Zend_Foo_' . ucfirst($type)); - $this->assertTrue(is_array($paths), "Failed for type $type: " . var_export($paths, 1)); - $this->assertFalse(empty($paths)); + $this->assertInternalType('array', $paths, "Failed for type $type: " . var_export($paths, 1)); + $this->assertNotEmpty($paths); $this->assertContains('Foo', $paths[0]); } } @@ -1879,8 +1879,8 @@ public function testSetOptionsSetsIndividualPrefixPathsFromKeyedArrays() $loader = $this->element->getPluginLoader('filter'); $paths = $loader->getPaths('Zend_Foo'); - $this->assertTrue(is_array($paths)); - $this->assertFalse(empty($paths)); + $this->assertInternalType('array', $paths); + $this->assertNotEmpty($paths); $this->assertContains('Foo', $paths[0]); } @@ -1894,8 +1894,8 @@ public function testSetOptionsSetsIndividualPrefixPathsFromUnKeyedArrays() $loader = $this->element->getPluginLoader('decorator'); $paths = $loader->getPaths('Zend_Foo'); - $this->assertTrue(is_array($paths)); - $this->assertFalse(empty($paths)); + $this->assertInternalType('array', $paths); + $this->assertNotEmpty($paths); $this->assertContains('Foo', $paths[0]); } @@ -1954,7 +1954,7 @@ public function testInitCalledBeforeLoadDecorators() { $element = new Zend_Form_ElementTest_Element('test'); $decorators = $element->getDecorators(); - $this->assertTrue(empty($decorators)); + $this->assertEmpty($decorators); } /** @@ -1978,10 +1978,11 @@ public function testElementShouldOverloadToRenderDecorators() /** * @group ZF-3217 - * @expectedException Zend_Form_Element_Exception */ public function testOverloadingToInvalidMethodsShouldThrowAnException() { + $this->expectException(\Zend_Form_Element_Exception::class); + $html = $this->element->bogusMethodCall(); } @@ -2211,15 +2212,15 @@ public function testCanAddPluginLoaderPrefixPathsWithBackslashes() ->addPrefixPath('Zf\Foo', 'Zf/Foo'); $paths = $filterLoader->getPaths('Zf\Foo\Filter'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $this->assertContains('Filter', $paths[0]); $paths = $validatorLoader->getPaths('Zf\Foo\Validate'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $this->assertContains('Validate', $paths[0]); $paths = $decoratorLoader->getPaths('Zf\Foo\Decorator'); - $this->assertTrue(is_array($paths), var_export($paths, 1)); + $this->assertInternalType('array', $paths, var_export($paths, 1)); $this->assertContains('Decorator', $paths[0]); } diff --git a/tests/Zend/Form/FormTest.php b/tests/Zend/Form/FormTest.php index d00a239eca..b13dd4b5f6 100644 --- a/tests/Zend/Form/FormTest.php +++ b/tests/Zend/Form/FormTest.php @@ -43,7 +43,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_FormTest extends PHPUnit_Framework_TestCase +class Zend_Form_FormTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Form @@ -291,8 +291,8 @@ public function testSetOptionsSetsGlobalPrefixPaths() foreach (array('element', 'decorator') as $type) { $loader = $this->form->getPluginLoader($type); $paths = $loader->getPaths('Zend_Foo_' . ucfirst($type)); - $this->assertTrue(is_array($paths), "Failed for type $type: " . var_export($paths, 1)); - $this->assertFalse(empty($paths)); + $this->assertInternalType('array', $paths, "Failed for type $type: " . var_export($paths, 1)); + $this->assertNotEmpty($paths); $this->assertContains('Foo', $paths[0]); } } @@ -307,8 +307,8 @@ public function testSetOptionsSetsIndividualPrefixPathsFromKeyedArrays() $loader = $this->form->getPluginLoader('element'); $paths = $loader->getPaths('Zend_Foo'); - $this->assertTrue(is_array($paths)); - $this->assertFalse(empty($paths)); + $this->assertInternalType('array', $paths); + $this->assertNotEmpty($paths); $this->assertContains('Foo', $paths[0]); } @@ -322,8 +322,8 @@ public function testSetOptionsSetsIndividualPrefixPathsFromUnKeyedArrays() $loader = $this->form->getPluginLoader('decorator'); $paths = $loader->getPaths('Zend_Foo'); - $this->assertTrue(is_array($paths)); - $this->assertFalse(empty($paths)); + $this->assertInternalType('array', $paths); + $this->assertNotEmpty($paths); $this->assertContains('Foo', $paths[0]); } @@ -454,8 +454,8 @@ public function testCanSetObjectStateByPassingConfigObjectToConstructor() public function testAttribsArrayInitiallyEmpty() { $attribs = $this->form->getAttribs(); - $this->assertTrue(is_array($attribs)); - $this->assertTrue(empty($attribs)); + $this->assertInternalType('array', $attribs); + $this->assertEmpty($attribs); } public function testRetrievingUndefinedAttribReturnsNull() @@ -514,8 +514,8 @@ public function testCanClearAllAttribs() $this->testCanAddAndRetrieveMultipleAttribs(); $this->form->clearAttribs(); $attribs = $this->form->getAttribs(); - $this->assertTrue(is_array($attribs)); - $this->assertTrue(empty($attribs)); + $this->assertInternalType('array', $attribs); + $this->assertEmpty($attribs); } public function testNameIsInitiallyNull() @@ -650,7 +650,7 @@ public function testGetPluginLoaderRetrievesDefaultDecoratorPluginLoader() $loader = $this->form->getPluginLoader('decorator'); $this->assertTrue($loader instanceof Zend_Loader_PluginLoader); $paths = $loader->getPaths('Zend_Form_Decorator'); - $this->assertTrue(is_array($paths), var_export($loader, 1)); + $this->assertInternalType('array', $paths, var_export($loader, 1)); $this->assertTrue(0 < count($paths)); $this->assertContains('Form', $paths[0]); $this->assertContains('Decorator', $paths[0]); @@ -700,7 +700,7 @@ public function testCanAddDecoratorPluginLoaderPrefixPath() $loader = $this->form->getPluginLoader('decorator'); $this->form->addPrefixPath('Zend_Foo', 'Zend/Foo/', 'decorator'); $paths = $loader->getPaths('Zend_Foo'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $this->assertContains('Foo', $paths[0]); } @@ -712,14 +712,14 @@ public function testUpdatedDecoratorPrefixPathUsedForNewElements() $this->form->addElement($foo); $loader = $foo->getPluginLoader('decorator'); $paths = $loader->getPaths('Zend_Foo'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $this->assertContains('Foo', $paths[0]); $this->form->addElement('text', 'bar'); $bar = $this->form->bar; $loader = $bar->getPluginLoader('decorator'); $paths = $loader->getPaths('Zend_Foo'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $this->assertContains('Foo', $paths[0]); } @@ -731,7 +731,7 @@ public function testUpdatedDecoratorPrefixPathUsedForNewDisplayGroups() $foo = $this->form->foo; $loader = $foo->getPluginLoader('decorator'); $paths = $loader->getPaths('Zend_Foo'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $this->assertContains('Foo', $paths[0]); } @@ -742,7 +742,7 @@ public function testUpdatedPrefixPathUsedForNewSubForms() $this->setupSubForm(); $loader = $this->form->sub->getPluginLoader('decorator'); $paths = $loader->getPaths('Zend_Foo'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $this->assertContains('Foo', $paths[0]); } @@ -751,7 +751,7 @@ public function testGetPluginLoaderRetrievesDefaultElementPluginLoader() $loader = $this->form->getPluginLoader('element'); $this->assertTrue($loader instanceof Zend_Loader_PluginLoader); $paths = $loader->getPaths('Zend_Form_Element'); - $this->assertTrue(is_array($paths), var_export($loader, 1)); + $this->assertInternalType('array', $paths, var_export($loader, 1)); $this->assertTrue(0 < count($paths)); $this->assertContains('Form', $paths[0]); $this->assertContains('Element', $paths[0]); @@ -770,7 +770,7 @@ public function testCanAddElementPluginLoaderPrefixPath() $loader = $this->form->getPluginLoader('element'); $this->form->addPrefixPath('Zend_Foo', 'Zend/Foo/', 'element'); $paths = $loader->getPaths('Zend_Foo'); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $this->assertContains('Foo', $paths[0]); } @@ -783,11 +783,11 @@ public function testAddAllPluginLoaderPrefixPathsSimultaneously() ->addPrefixPath('Zend', 'Zend/'); $paths = $decoratorLoader->getPaths('Zend_Decorator'); - $this->assertTrue(is_array($paths), var_export($paths, 1)); + $this->assertInternalType('array', $paths, var_export($paths, 1)); $this->assertContains('Decorator', $paths[0]); $paths = $elementLoader->getPaths('Zend_Element'); - $this->assertTrue(is_array($paths), var_export($paths, 1)); + $this->assertInternalType('array', $paths, var_export($paths, 1)); $this->assertContains('Element', $paths[0]); } @@ -887,8 +887,8 @@ public function testCanClearAllElements() $this->testCanAddAndRetrieveMultipleElements(); $this->form->clearElements(); $elements = $this->form->getElements(); - $this->assertTrue(is_array($elements)); - $this->assertTrue(empty($elements)); + $this->assertInternalType('array', $elements); + $this->assertEmpty($elements); } public function testGetValueReturnsNullForUndefinedElements() @@ -965,9 +965,9 @@ public function testRetrievingAllElementValuesSkipsThoseFlaggedAsIgnore() )); $this->form->bar->setIgnore(true); $test = $this->form->getValues(); - $this->assertFalse(array_key_exists('bar', $test)); - $this->assertTrue(array_key_exists('foo', $test)); - $this->assertTrue(array_key_exists('baz', $test)); + $this->assertArrayNotHasKey('bar', $test); + $this->assertArrayHasKey('foo', $test); + $this->assertArrayHasKey('baz', $test); } public function testCanRetrieveSingleUnfilteredElementValue() @@ -1270,8 +1270,8 @@ public function testCanClearAllSubForms() $this->testCanAddAndRetrieveMultipleSubForms(); $this->form->clearSubForms(); $subforms = $this->form->getSubForms(); - $this->assertTrue(is_array($subforms)); - $this->assertTrue(empty($subforms)); + $this->assertInternalType('array', $subforms); + $this->assertEmpty($subforms); } public function testOverloadingSubForms() @@ -1888,8 +1888,8 @@ public function testCanClearAllDisplayGroups() $this->testCanAddAndRetrieveMultipleDisplayGroups(); $this->form->clearDisplayGroups(); $groups = $this->form->getDisplayGroups(); - $this->assertTrue(is_array($groups)); - $this->assertTrue(empty($groups)); + $this->assertInternalType('array', $groups); + $this->assertEmpty($groups); } public function testOverloadingDisplayGroups() @@ -1948,8 +1948,8 @@ public function testAddingDisplayGroupShouldPassOptions() $group = $this->form->getDisplayGroup('barbat'); $this->assertTrue($group instanceof Zend_Form_DisplayGroup); $decorators = $group->getDecorators(); - $this->assertTrue(is_array($decorators)); - $this->assertTrue(empty($decorators)); + $this->assertInternalType('array', $decorators); + $this->assertEmpty($decorators); } // Processing @@ -2292,9 +2292,9 @@ public function testCanValidatePartialNestedFormsWithElementsBelongingToArrays() $firstName = $form->firstName->getValue(); $email = $form->sub->email->getValue(); $home = $form->sub->subSub->home->getValue(); - $this->assertTrue(empty($firstName)); - $this->assertTrue(empty($email)); - $this->assertTrue(empty($home)); + $this->assertEmpty($firstName); + $this->assertEmpty($email); + $this->assertEmpty($home); $form->sub->subSub->home->addValidator('StringLength', false, array(4, 6)); $data['foobar']['baz'] = array('bat' => array('home' => 'ab')); @@ -2302,7 +2302,7 @@ public function testCanValidatePartialNestedFormsWithElementsBelongingToArrays() $this->assertFalse($form->isValidPartial($data), var_export($data, 1)); $this->assertEquals('0', $form->sub->subSub->home->getValue()); $messages = $form->getMessages(); - $this->assertFalse(empty($messages)); + $this->assertNotEmpty($messages); $this->assertTrue(isset($messages['foobar']['baz']['bat']['home']), var_export($messages, 1)); $this->assertTrue(isset($messages['foobar']['baz']['bat']['home']['notInArray']), var_export($messages, 1)); } @@ -2352,9 +2352,9 @@ public function testCanValidatePartialNestedFormsWithMultiLevelElementsBelonging $firstName = $form->firstName->getValue(); $email = $form->sub->email->getValue(); $home = $form->sub->subSub->home->getValue(); - $this->assertTrue(empty($firstName)); - $this->assertTrue(empty($email)); - $this->assertTrue(empty($home)); + $this->assertEmpty($firstName); + $this->assertEmpty($email); + $this->assertEmpty($home); $form->sub->subSub->home->addValidator('StringLength', false, array(4, 6)); $data['foo']['bar']['baz'] = array('bat' => array('quux' => array('home' => 'ab'))); @@ -2411,7 +2411,7 @@ public function testCanGetMessagesOfNestedFormsWithMultiLevelElementsBelongingTo $form->isValidPartial($data); $messages = $form->getMessages(); - $this->assertFalse(empty($messages)); + $this->assertNotEmpty($messages); $this->assertTrue(isset($messages['foo']['bar']['baz']['bat']['quux']['home']), var_export($messages, 1)); $this->assertTrue(isset($messages['foo']['bar']['baz']['bat']['quux']['home']['notInArray']), var_export($messages, 1)); } @@ -2462,7 +2462,7 @@ public function testProcessAjaxReturnsJsonWithAllErrorMessagesForInvalidForm() $this->setupElements(); $data = array('foo' => '123456', 'bar' => 'abcdef', 'baz' => 'abc-123'); $return = Zend_Json::decode($this->form->processAjax($data)); - $this->assertTrue(is_array($return)); + $this->assertInternalType('array', $return); $this->assertEquals(array_keys($data), array_keys($return)); } @@ -2471,7 +2471,7 @@ public function testProcessAjaxReturnsJsonWithAllErrorMessagesForInvalidPartialF $this->setupElements(); $data = array('baz' => 'abc-123'); $return = Zend_Json::decode($this->form->processAjax($data)); - $this->assertTrue(is_array($return)); + $this->assertInternalType('array', $return); $this->assertEquals(array_keys($data), array_keys($return), var_export($return, 1)); } @@ -2546,8 +2546,8 @@ public function testErrorCodesFromSubFormReturnedInSeparateArray() $this->testFullDataArrayUsedToValidateSubFormByDefault(); $codes = $this->form->getErrors(); - $this->assertTrue(array_key_exists('sub', $codes)); - $this->assertTrue(is_array($codes['sub'])); + $this->assertArrayHasKey('sub', $codes); + $this->assertInternalType('array', $codes['sub']); $keys = array('subfoo', 'subbar', 'subbaz'); $this->assertEquals($keys, array_keys($codes['sub'])); } @@ -2558,8 +2558,8 @@ public function testCanRetrieveErrorCodesFromSingleSubFormAfterFailedValidation( $this->testFullDataArrayUsedToValidateSubFormByDefault(); $codes = $this->form->getErrors('sub'); - $this->assertTrue(is_array($codes)); - $this->assertFalse(empty($codes)); + $this->assertInternalType('array', $codes); + $this->assertNotEmpty($codes); $keys = array('subfoo', 'subbar', 'subbaz'); $this->assertEquals($keys, array_keys($codes)); } @@ -2583,7 +2583,7 @@ public function testGetErrorsHonorsElementsBelongTo() $this->form->isValid($data); $codes = $this->form->getErrors(); - $this->assertFalse(empty($codes['foo']['bar']['test'])); + $this->assertNotEmpty($codes['foo']['bar']['test']); } public function testErrorMessagesFromSubFormReturnedInSeparateArray() @@ -2602,8 +2602,8 @@ public function testErrorMessagesFromSubFormReturnedInSeparateArray() $this->assertFalse($this->form->isValid($data)); $codes = $this->form->getMessages(); - $this->assertTrue(array_key_exists('sub', $codes)); - $this->assertTrue(is_array($codes['sub'])); + $this->assertArrayHasKey('sub', $codes); + $this->assertInternalType('array', $codes['sub']); $keys = array('subfoo', 'subbar', 'subbaz'); $this->assertEquals($keys, array_keys($codes['sub'])); } @@ -2624,8 +2624,8 @@ public function testCanRetrieveErrorMessagesFromSingleSubFormAfterFailedValidati $this->assertFalse($this->form->isValid($data)); $codes = $this->form->getMessages('sub'); - $this->assertTrue(is_array($codes)); - $this->assertFalse(empty($codes)); + $this->assertInternalType('array', $codes); + $this->assertNotEmpty($codes); $keys = array('subfoo', 'subbar', 'subbaz'); $this->assertEquals($keys, array_keys($codes), var_export($codes, 1)); } @@ -2761,7 +2761,7 @@ public function testErrorMessagesFromProcessAjaxAreLocalizedWhenTranslateAdapter ); $return = $this->form->processAjax($data); $messages = Zend_Json::decode($return); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertTrue(isset($messages['foo'])); $this->assertFalse(isset($messages['bar'])); @@ -2866,7 +2866,7 @@ public function testCustomErrorMessageStackShouldBeClearable() $this->testCustomErrorMessagesShouldBeManagedInAStack(); $this->form->clearErrorMessages(); $messages = $this->form->getErrorMessages(); - $this->assertTrue(empty($messages)); + $this->assertEmpty($messages); } public function testCustomErrorMessagesShouldBeTranslated() @@ -3048,12 +3048,12 @@ public function testRemovingNamedDecoratorShouldWork() array(array('fieldset' => 'HtmlTag'), array('tag' => 'fieldset')), )); $decorators = $this->form->getDecorators(); - $this->assertTrue(array_key_exists('div', $decorators)); - $this->assertTrue(array_key_exists('fieldset', $decorators)); + $this->assertArrayHasKey('div', $decorators); + $this->assertArrayHasKey('fieldset', $decorators); $this->form->removeDecorator('div'); $decorators = $this->form->getDecorators(); - $this->assertFalse(array_key_exists('div', $decorators)); - $this->assertTrue(array_key_exists('fieldset', $decorators)); + $this->assertArrayNotHasKey('div', $decorators); + $this->assertArrayHasKey('fieldset', $decorators); } public function testCanClearAllDecorators() @@ -3108,7 +3108,7 @@ public function testRetrievingNamedDecoratorShouldNotReorderDecorators() public function checkMarkup($html) { - $this->assertFalse(empty($html)); + $this->assertNotEmpty($html); $this->assertContains('assertRegexp('/]+action="' . $this->form->getAction() . '"/', $html); $this->assertRegexp('/]+method="' . $this->form->getMethod() . '"/i', $html); @@ -3128,8 +3128,8 @@ public function testRenderReturnsMarkupRepresentingAllElements() $this->testRenderReturnsMarkup(); $html = $this->form->render(); foreach ($this->form->getElements() as $key => $element) { - $this->assertFalse(empty($key)); - $this->assertFalse(is_numeric($key)); + $this->assertNotEmpty($key); + $this->assertNotInternalType('numeric', $key); $this->assertContains('assertRegexp('/assertRegexp('/
assertContains('
', $html); foreach ($this->form->sub as $key => $item) { - $this->assertFalse(empty($key)); - $this->assertFalse(is_numeric($key)); + $this->assertNotEmpty($key); + $this->assertNotInternalType('numeric', $key); $this->assertContains('assertRegexp($pattern, $html, 'Pattern: ' . $pattern . "\nHTML:\n" . $html); @@ -3287,7 +3287,7 @@ public function testToStringRaisesErrorWhenExceptionCaught() restore_error_handler(); - $this->assertTrue(empty($text)); + $this->assertEmpty($text); $this->assertTrue(isset($this->error)); $this->assertContains('Raising exception in decorator callback', $this->error); } @@ -3736,17 +3736,17 @@ public function testCanSetGlobalElementPrefixPath() foreach ($this->form->getElements() as $element) { $loader = $element->getPluginLoader('validate'); $paths = $loader->getPaths('Zend_Foo_Validate'); - $this->assertFalse(empty($paths), $element->getName() . ':' . var_export($loader->getPaths(), 1)); + $this->assertNotEmpty($paths, $element->getName() . ':' . var_export($loader->getPaths(), 1)); $this->assertContains('Foo', $paths[0]); $this->assertContains('Validate', $paths[0]); $paths = $element->getPluginLoader('filter')->getPaths('Zend_Foo_Filter'); - $this->assertFalse(empty($paths)); + $this->assertNotEmpty($paths); $this->assertContains('Foo', $paths[0]); $this->assertContains('Filter', $paths[0]); $paths = $element->getPluginLoader('decorator')->getPaths('Zend_Foo_Decorator'); - $this->assertFalse(empty($paths)); + $this->assertNotEmpty($paths); $this->assertContains('Foo', $paths[0]); $this->assertContains('Decorator', $paths[0]); } @@ -3774,7 +3774,7 @@ public function testSettingElementPrefixPathPropagatesToAttachedSubForms() $this->form->addElementPrefixPath('Zend_Foo', 'Zend/Foo/'); $loader = $this->form->subForm->foo->getPluginLoader('decorator'); $paths = $loader->getPaths('Zend_Foo_Decorator'); - $this->assertFalse(empty($paths)); + $this->assertNotEmpty($paths); $this->assertContains('Foo', $paths[0]); $this->assertContains('Decorator', $paths[0]); } @@ -3787,7 +3787,7 @@ public function testCanSetElementValidatorPrefixPath() foreach ($this->form->getElements() as $element) { $loader = $element->getPluginLoader('validate'); $paths = $loader->getPaths('Zend_Foo'); - $this->assertFalse(empty($paths)); + $this->assertNotEmpty($paths); $this->assertContains('Foo', $paths[0]); $this->assertNotContains('Validate', $paths[0]); } @@ -3801,7 +3801,7 @@ public function testCanSetElementFilterPrefixPath() foreach ($this->form->getElements() as $element) { $loader = $element->getPluginLoader('filter'); $paths = $loader->getPaths('Zend_Foo'); - $this->assertFalse(empty($paths)); + $this->assertNotEmpty($paths); $this->assertContains('Foo', $paths[0]); $this->assertNotContains('Filter', $paths[0]); } @@ -3815,7 +3815,7 @@ public function testCanSetElementDecoratorPrefixPath() foreach ($this->form->getElements() as $element) { $loader = $element->getPluginLoader('decorator'); $paths = $loader->getPaths('Zend_Foo'); - $this->assertFalse(empty($paths)); + $this->assertNotEmpty($paths); $this->assertContains('Foo', $paths[0]); $this->assertNotContains('Decorator', $paths[0]); } @@ -3863,7 +3863,7 @@ public function testCanSetDisplayGroupPrefixPath() foreach ($this->form->getDisplayGroups() as $group) { $loader = $group->getPluginLoader(); $paths = $loader->getPaths('Zend_Foo'); - $this->assertFalse(empty($paths)); + $this->assertNotEmpty($paths); $this->assertContains('Foo', $paths[0]); } } @@ -3908,7 +3908,7 @@ public function testInitCalledPriorToLoadingDefaultDecorators() { $form = new Zend_Form_FormTest_FormExtension(); $decorators = $form->getDecorators(); - $this->assertTrue(empty($decorators)); + $this->assertEmpty($decorators); } // Clone @@ -4006,10 +4006,11 @@ public function testFormShouldOverloadToRenderDecorators() /** * @group ZF-3217 - * @expectedException Zend_Form_Exception */ public function testOverloadingToInvalidMethodsShouldThrowAnException() { + $this->expectException(\Zend_Form_Exception::class); + $html = $this->form->bogusMethodCall(); } @@ -4072,7 +4073,7 @@ public function testEnctypeDefaultsToMultipartWhenFileElementIsAttachedToForm() $this->form->addElement($file); $html = $this->form->render($this->getView()); - $this->assertFalse(empty($html)); + $this->assertNotEmpty($html); $this->assertRegexp('#]+enctype="multipart/form-data"#', $html); } @@ -4610,10 +4611,11 @@ public function testAddErrorOnElementMakesFormInvalidAndReturnsCustomError() /** * @group ZF-10865 - * @expectedException Zend_Form_Exception */ public function testExceptionThrownWhenAddElementsIsGivenNullValue() { + $this->expectException(\Zend_Form_Exception::class); + $form = new Zend_Form(); $form->addElement(null); } @@ -4705,8 +4707,8 @@ public function testAddingPrefixPathsWithBackslashWillLoadNamespacedPlugins() foreach (array('element', 'decorator') as $type) { $loader = $form->getPluginLoader($type); $paths = $loader->getPaths('Zf\Foo\\' . ucfirst($type)); - $this->assertTrue(is_array($paths), "Failed for type $type: " . var_export($paths, 1)); - $this->assertFalse(empty($paths)); + $this->assertInternalType('array', $paths, "Failed for type $type: " . var_export($paths, 1)); + $this->assertNotEmpty($paths); $this->assertContains('Foo', $paths[0]); } } diff --git a/tests/Zend/Form/SubFormTest.php b/tests/Zend/Form/SubFormTest.php index ebbf7d1240..fa505fe909 100644 --- a/tests/Zend/Form/SubFormTest.php +++ b/tests/Zend/Form/SubFormTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Form */ -class Zend_Form_SubFormTest extends PHPUnit_Framework_TestCase +class Zend_Form_SubFormTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -51,10 +51,10 @@ public function tearDown() public function testSubFormUtilizesDefaultDecorators() { $decorators = $this->form->getDecorators(); - $this->assertTrue(array_key_exists('Zend_Form_Decorator_FormElements', $decorators)); - $this->assertTrue(array_key_exists('Zend_Form_Decorator_HtmlTag', $decorators)); - $this->assertTrue(array_key_exists('Zend_Form_Decorator_Fieldset', $decorators)); - $this->assertTrue(array_key_exists('Zend_Form_Decorator_DtDdWrapper', $decorators)); + $this->assertArrayHasKey('Zend_Form_Decorator_FormElements', $decorators); + $this->assertArrayHasKey('Zend_Form_Decorator_HtmlTag', $decorators); + $this->assertArrayHasKey('Zend_Form_Decorator_Fieldset', $decorators); + $this->assertArrayHasKey('Zend_Form_Decorator_DtDdWrapper', $decorators); $htmlTag = $decorators['Zend_Form_Decorator_HtmlTag']; $tag = $htmlTag->getOption('tag'); @@ -79,7 +79,7 @@ public function testInitCalledBeforeLoadDecorators() { $form = new Zend_Form_SubFormTest_SubForm(); $decorators = $form->getDecorators(); - $this->assertTrue(empty($decorators)); + $this->assertEmpty($decorators); } // Bugfixes diff --git a/tests/Zend/Gdata/Analytics/AccountFeedTest.php b/tests/Zend/Gdata/Analytics/AccountFeedTest.php index 18d24bf0aa..46be4de0a4 100755 --- a/tests/Zend/Gdata/Analytics/AccountFeedTest.php +++ b/tests/Zend/Gdata/Analytics/AccountFeedTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Analytics */ -class Zend_Gdata_Analytics_AccountFeedTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Analytics_AccountFeedTest extends PHPUnit\Framework\TestCase { /** @var AccountFeed */ public $accountFeed; diff --git a/tests/Zend/Gdata/Analytics/AccountQueryTest.php b/tests/Zend/Gdata/Analytics/AccountQueryTest.php index 9354de2cc9..865ec3e19c 100644 --- a/tests/Zend/Gdata/Analytics/AccountQueryTest.php +++ b/tests/Zend/Gdata/Analytics/AccountQueryTest.php @@ -31,7 +31,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Analytics */ -class Zend_GData_Analytics_AccountQueryTest extends PHPUnit_Framework_TestCase +class Zend_GData_Analytics_AccountQueryTest extends PHPUnit\Framework\TestCase { /** * @var Zend_GData_Analytics_AccountQuery diff --git a/tests/Zend/Gdata/Analytics/DataFeedTest.php b/tests/Zend/Gdata/Analytics/DataFeedTest.php index fc37899faf..9772c1f042 100644 --- a/tests/Zend/Gdata/Analytics/DataFeedTest.php +++ b/tests/Zend/Gdata/Analytics/DataFeedTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Analytics */ -class Zend_Gdata_Analytics_DataFeedTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Analytics_DataFeedTest extends PHPUnit\Framework\TestCase { public $testData = array( 'foobarbaz.de' => 12, diff --git a/tests/Zend/Gdata/Analytics/DataQueryTest.php b/tests/Zend/Gdata/Analytics/DataQueryTest.php index a5be3baaba..22f6cc898d 100644 --- a/tests/Zend/Gdata/Analytics/DataQueryTest.php +++ b/tests/Zend/Gdata/Analytics/DataQueryTest.php @@ -31,7 +31,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Analytics */ -class Zend_GData_Analytics_DataQueryTest extends PHPUnit_Framework_TestCase +class Zend_GData_Analytics_DataQueryTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Gdata/App/AuthorTest.php b/tests/Zend/Gdata/App/AuthorTest.php index dee63acd7c..52154d3685 100644 --- a/tests/Zend/Gdata/App/AuthorTest.php +++ b/tests/Zend/Gdata/App/AuthorTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_App */ -class Zend_Gdata_App_AuthorTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_App_AuthorTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -43,7 +43,7 @@ public function setUp() { } public function testEmptyAuthorShouldHaveEmptyExtensionsList() { - $this->assertTrue(is_array($this->author->extensionElements)); + $this->assertInternalType('array', $this->author->extensionElements); $this->assertTrue(count($this->author->extensionElements) == 0); } diff --git a/tests/Zend/Gdata/App/BaseTest.php b/tests/Zend/Gdata/App/BaseTest.php index e5b0e9dff5..6938376b4e 100644 --- a/tests/Zend/Gdata/App/BaseTest.php +++ b/tests/Zend/Gdata/App/BaseTest.php @@ -31,7 +31,7 @@ * @group Zend_Gdata * @group Zend_Gdata_App */ -class Zend_Gdata_App_BaseTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_App_BaseTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Gdata/App/CaptchaRequiredExceptionTest.php b/tests/Zend/Gdata/App/CaptchaRequiredExceptionTest.php index 69ccd2fd68..1f673eef34 100644 --- a/tests/Zend/Gdata/App/CaptchaRequiredExceptionTest.php +++ b/tests/Zend/Gdata/App/CaptchaRequiredExceptionTest.php @@ -31,7 +31,7 @@ * @group Zend_Gdata * @group Zend_Gdata_App */ -class Zend_Gdata_App_CaptchaRequiredExceptionTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_App_CaptchaRequiredExceptionTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Gdata/App/CategoryTest.php b/tests/Zend/Gdata/App/CategoryTest.php index 3f531614fc..e942ca7ac3 100644 --- a/tests/Zend/Gdata/App/CategoryTest.php +++ b/tests/Zend/Gdata/App/CategoryTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_App */ -class Zend_Gdata_App_CategoryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_App_CategoryTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -43,7 +43,7 @@ public function setUp() { } public function testEmptyCategoryShouldHaveEmptyExtensionsList() { - $this->assertTrue(is_array($this->category->extensionElements)); + $this->assertInternalType('array', $this->category->extensionElements); $this->assertTrue(count($this->category->extensionElements) == 0); } diff --git a/tests/Zend/Gdata/App/ContentTest.php b/tests/Zend/Gdata/App/ContentTest.php index f9d6ecd9bc..b6404fa881 100644 --- a/tests/Zend/Gdata/App/ContentTest.php +++ b/tests/Zend/Gdata/App/ContentTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_App */ -class Zend_Gdata_App_ContentTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_App_ContentTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -46,7 +46,7 @@ public function setUp() { } public function testEmptyContentShouldHaveEmptyExtensionsList() { - $this->assertTrue(is_array($this->content->extensionElements)); + $this->assertInternalType('array', $this->content->extensionElements); $this->assertTrue(count($this->content->extensionElements) == 0); } diff --git a/tests/Zend/Gdata/App/ControlTest.php b/tests/Zend/Gdata/App/ControlTest.php index faf66be6fb..31ba52a73b 100644 --- a/tests/Zend/Gdata/App/ControlTest.php +++ b/tests/Zend/Gdata/App/ControlTest.php @@ -33,7 +33,7 @@ * @group Zend_Gdata * @group Zend_Gdata_App */ -class Zend_Gdata_App_ControlTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_App_ControlTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -44,7 +44,7 @@ public function setUp() { } public function testEmptyControlShouldHaveEmptyExtensionsList() { - $this->assertTrue(is_array($this->control->extensionElements)); + $this->assertInternalType('array', $this->control->extensionElements); $this->assertTrue(count($this->control->extensionElements) == 0); } diff --git a/tests/Zend/Gdata/App/EntryTest.php b/tests/Zend/Gdata/App/EntryTest.php index e1d1bccee3..cbd621a7d3 100644 --- a/tests/Zend/Gdata/App/EntryTest.php +++ b/tests/Zend/Gdata/App/EntryTest.php @@ -34,7 +34,7 @@ * @group Zend_Gdata * @group Zend_Gdata_App */ -class Zend_Gdata_App_EntryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_App_EntryTest extends PHPUnit\Framework\TestCase { public function setUp() @@ -66,7 +66,7 @@ public function loadResponse($filename) public function testEmptyEntryShouldHaveEmptyExtensionsList() { - $this->assertTrue(is_array($this->enry->extensionElements)); + $this->assertInternalType('array', $this->enry->extensionElements); $this->assertTrue(count($this->enry->extensionElements) == 0); } @@ -501,7 +501,7 @@ public function testMajorProtocolVersionCannotBeZero() { $expectedVersion = 0; $entry = $this->service->newEntry(); - $this->setExpectedException('Zend_Gdata_App_InvalidArgumentException'); + $this->expectException('Zend_Gdata_App_InvalidArgumentException'); $entry->setMajorProtocolVersion($expectedVersion); } @@ -509,7 +509,7 @@ public function testMajorProtocolVersionCannotBeNegative() { $expectedVersion = -1; $entry = $this->service->newEntry(); - $this->setExpectedException('Zend_Gdata_App_InvalidArgumentException'); + $this->expectException('Zend_Gdata_App_InvalidArgumentException'); $entry->setMajorProtocolVersion($expectedVersion); } @@ -535,7 +535,7 @@ public function testMinorProtocolVersionCannotBeNegative() { $expectedVersion = -1; $entry = $this->service->newEntry(); - $this->setExpectedException('Zend_Gdata_App_InvalidArgumentException'); + $this->expectException('Zend_Gdata_App_InvalidArgumentException'); $entry->setMinorProtocolVersion($expectedVersion); } diff --git a/tests/Zend/Gdata/App/FeedTest.php b/tests/Zend/Gdata/App/FeedTest.php index 02a800ffc7..9f0cfb8282 100644 --- a/tests/Zend/Gdata/App/FeedTest.php +++ b/tests/Zend/Gdata/App/FeedTest.php @@ -33,7 +33,7 @@ * @group Zend_Gdata * @group Zend_Gdata_App */ -class Zend_Gdata_App_FeedTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_App_FeedTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -44,7 +44,7 @@ public function setUp() { } public function testEmptyFeedShouldHaveEmptyExtensionsList() { - $this->assertTrue(is_array($this->feed->extensionElements)); + $this->assertInternalType('array', $this->feed->extensionElements); $this->assertTrue(count($this->feed->extensionElements) == 0); } @@ -147,10 +147,10 @@ public function testSetServicePropagatesToChildren() { // Set null service instance and test for propagation $s = null; $this->feed->setService($s); - $this->assertFalse(is_object($this->feed->getService())); + $this->assertNotInternalType('object', $this->feed->getService()); foreach ($entries as $entry) { $service = $entry->getService(); - $this->assertFalse(is_object($service)); + $this->assertNotInternalType('object', $service); } } diff --git a/tests/Zend/Gdata/App/GeneratorTest.php b/tests/Zend/Gdata/App/GeneratorTest.php index f38141d748..9ed9995461 100644 --- a/tests/Zend/Gdata/App/GeneratorTest.php +++ b/tests/Zend/Gdata/App/GeneratorTest.php @@ -33,7 +33,7 @@ * @group Zend_Gdata * @group Zend_Gdata_App */ -class Zend_Gdata_App_GeneratorTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_App_GeneratorTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -44,7 +44,7 @@ public function setUp() { } public function testEmptyGeneratorShouldHaveEmptyExtensionsList() { - $this->assertTrue(is_array($this->generator->extensionElements)); + $this->assertInternalType('array', $this->generator->extensionElements); $this->assertTrue(count($this->generator->extensionElements) == 0); } diff --git a/tests/Zend/Gdata/App/HttpExceptionTest.php b/tests/Zend/Gdata/App/HttpExceptionTest.php index a9b916e372..0d186672ef 100755 --- a/tests/Zend/Gdata/App/HttpExceptionTest.php +++ b/tests/Zend/Gdata/App/HttpExceptionTest.php @@ -34,7 +34,7 @@ * @group Zend_Gdata * @group Zend_Gdata_App */ -class Zend_Gdata_App_HttpExceptionTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_App_HttpExceptionTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/App/UtilTest.php b/tests/Zend/Gdata/App/UtilTest.php index 76c5009292..c1abb63748 100644 --- a/tests/Zend/Gdata/App/UtilTest.php +++ b/tests/Zend/Gdata/App/UtilTest.php @@ -33,7 +33,7 @@ * @group Zend_Gdata * @group Zend_Gdata_App */ -class Zend_Gdata_App_UtilTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_App_UtilTest extends PHPUnit\Framework\TestCase { public function testFormatTimestampFromString() diff --git a/tests/Zend/Gdata/AppTest.php b/tests/Zend/Gdata/AppTest.php index 0d0d2a133d..8c721c1329 100644 --- a/tests/Zend/Gdata/AppTest.php +++ b/tests/Zend/Gdata/AppTest.php @@ -33,7 +33,7 @@ * @group Zend_Gdata * @group Zend_Gdata_App */ -class Zend_Gdata_AppTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_AppTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Gdata/AttendeeStatusTest.php b/tests/Zend/Gdata/AttendeeStatusTest.php index 4a18527229..46b612e797 100644 --- a/tests/Zend/Gdata/AttendeeStatusTest.php +++ b/tests/Zend/Gdata/AttendeeStatusTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Gdata */ -class Zend_Gdata_AttendeeStatusTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_AttendeeStatusTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -42,24 +42,24 @@ public function setUp() { } public function testEmptyAttendeeStatusShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->attendeeStatus->extensionElements)); + $this->assertInternalType('array', $this->attendeeStatus->extensionElements); $this->assertTrue(count($this->attendeeStatus->extensionElements) == 0); } public function testEmptyAttendeeStatusShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->attendeeStatus->extensionAttributes)); + $this->assertInternalType('array', $this->attendeeStatus->extensionAttributes); $this->assertTrue(count($this->attendeeStatus->extensionAttributes) == 0); } public function testSampleAttendeeStatusShouldHaveNoExtensionElements() { $this->attendeeStatus->transferFromXML($this->attendeeStatusText); - $this->assertTrue(is_array($this->attendeeStatus->extensionElements)); + $this->assertInternalType('array', $this->attendeeStatus->extensionElements); $this->assertTrue(count($this->attendeeStatus->extensionElements) == 0); } public function testSampleAttendeeStatusShouldHaveNoExtensionAttributes() { $this->attendeeStatus->transferFromXML($this->attendeeStatusText); - $this->assertTrue(is_array($this->attendeeStatus->extensionAttributes)); + $this->assertInternalType('array', $this->attendeeStatus->extensionAttributes); $this->assertTrue(count($this->attendeeStatus->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/AttendeeTypeTest.php b/tests/Zend/Gdata/AttendeeTypeTest.php index 1adbc68ae0..21bf66650d 100644 --- a/tests/Zend/Gdata/AttendeeTypeTest.php +++ b/tests/Zend/Gdata/AttendeeTypeTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Gdata */ -class Zend_Gdata_AttendeeTypeTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_AttendeeTypeTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -42,24 +42,24 @@ public function setUp() { } public function testEmptyAttendeeTypeShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->attendeeType->extensionElements)); + $this->assertInternalType('array', $this->attendeeType->extensionElements); $this->assertTrue(count($this->attendeeType->extensionElements) == 0); } public function testEmptyAttendeeTypeShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->attendeeType->extensionAttributes)); + $this->assertInternalType('array', $this->attendeeType->extensionAttributes); $this->assertTrue(count($this->attendeeType->extensionAttributes) == 0); } public function testSampleAttendeeTypeShouldHaveNoExtensionElements() { $this->attendeeType->transferFromXML($this->attendeeTypeText); - $this->assertTrue(is_array($this->attendeeType->extensionElements)); + $this->assertInternalType('array', $this->attendeeType->extensionElements); $this->assertTrue(count($this->attendeeType->extensionElements) == 0); } public function testSampleAttendeeTypeShouldHaveNoExtensionAttributes() { $this->attendeeType->transferFromXML($this->attendeeTypeText); - $this->assertTrue(is_array($this->attendeeType->extensionAttributes)); + $this->assertInternalType('array', $this->attendeeType->extensionAttributes); $this->assertTrue(count($this->attendeeType->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/AuthSubTest.php b/tests/Zend/Gdata/AuthSubTest.php index b44a19ef5e..20c8d52447 100755 --- a/tests/Zend/Gdata/AuthSubTest.php +++ b/tests/Zend/Gdata/AuthSubTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_AuthSub */ -class Zend_Gdata_AuthSubTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_AuthSubTest extends PHPUnit\Framework\TestCase { /** * Dummy token used during testing @@ -124,7 +124,7 @@ public function testSecureAuthSubSigning() public function testPrivateKeyNotFound() { - $this->setExpectedException('Zend_Gdata_App_InvalidArgumentException'); + $this->expectException('Zend_Gdata_App_InvalidArgumentException'); if (!extension_loaded('openssl')) { $this->markTestSkipped('The openssl extension is not available'); @@ -148,10 +148,11 @@ public function testAuthSubSessionTokenReceivesSuccessfulResult() } /** - * @expectedException Zend_Gdata_App_AuthException */ public function testAuthSubSessionTokenCatchesFailedResult() - { + { + $this->expectException(\Zend_Gdata_App_AuthException::class); + $adapter = new Zend_Http_Client_Adapter_Test(); $adapter->setResponse("HTTP/1.1 500 Internal Server Error\r\n\r\nInternal Server Error"); @@ -163,10 +164,11 @@ public function testAuthSubSessionTokenCatchesFailedResult() } /** - * @expectedException Zend_Gdata_App_HttpException */ public function testAuthSubSessionTokenCatchesHttpClientException() - { + { + $this->expectException(\Zend_Gdata_App_HttpException::class); + $adapter = new Zend_Http_Client_Adapter_Test(); $adapter->setNextRequestWillFail(true); @@ -204,10 +206,11 @@ public function testAuthSubRevokeTokenCatchesFailedResult() } /** - * @expectedException Zend_Gdata_App_HttpException */ public function testAuthSubRevokeTokenCatchesHttpClientException() { + $this->expectException(\Zend_Gdata_App_HttpException::class); + $adapter = new Zend_Http_Client_Adapter_Test(); $adapter->setNextRequestWillFail(true); @@ -236,10 +239,11 @@ public function testGetAuthSubTokenInfoReceivesSuccessfulResult() } /** - * @expectedException Zend_Gdata_App_HttpException */ public function testGetAuthSubTokenInfoCatchesHttpClientException() { + $this->expectException(\Zend_Gdata_App_HttpException::class); + $adapter = new Zend_Http_Client_Adapter_Test(); $adapter->setNextRequestWillFail(true); @@ -259,10 +263,11 @@ public function testGetHttpClientProvidesNewClientWhenNullPassed() /** * @group ZF-11351 - * @expectedException Zend_Gdata_App_HttpException */ public function testAuthSubGetHttpClientShouldThrowExceptionOnVanillaHttpClient() { + $this->expectException(\Zend_Gdata_App_HttpException::class); + $client = new Zend_Http_Client(); $client->setUri('http://example.com/AuthSub'); $gdclient = Zend_Gdata_AuthSub::getHttpClient('FakeToken', $client); diff --git a/tests/Zend/Gdata/Books/CollectionEntryTest.php b/tests/Zend/Gdata/Books/CollectionEntryTest.php index 6a4b9d4e3a..461a22fe7e 100644 --- a/tests/Zend/Gdata/Books/CollectionEntryTest.php +++ b/tests/Zend/Gdata/Books/CollectionEntryTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Books */ -class Zend_Gdata_Books_CollectionEntryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Books_CollectionEntryTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Books/CollectionFeedTest.php b/tests/Zend/Gdata/Books/CollectionFeedTest.php index 902f7f7078..a623cefd23 100644 --- a/tests/Zend/Gdata/Books/CollectionFeedTest.php +++ b/tests/Zend/Gdata/Books/CollectionFeedTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Books */ -class Zend_Gdata_Books_CollectionFeedTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Books_CollectionFeedTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Books/VolumeEntryTest.php b/tests/Zend/Gdata/Books/VolumeEntryTest.php index 566f466d14..fc083ece6d 100644 --- a/tests/Zend/Gdata/Books/VolumeEntryTest.php +++ b/tests/Zend/Gdata/Books/VolumeEntryTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Books */ -class Zend_Gdata_Books_VolumeEntryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Books_VolumeEntryTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -78,24 +78,24 @@ private function verifySamplePropertiesAreCorrect ($volumeEntry) { } public function testEmptyEntryShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->entry->extensionElements)); + $this->assertInternalType('array', $this->entry->extensionElements); $this->assertEquals(0, count($this->entry->extensionElements)); } public function testEmptyEntryShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->entry->extensionAttributes)); + $this->assertInternalType('array', $this->entry->extensionAttributes); $this->assertEquals(0, count($this->entry->extensionAttributes)); } public function testSampleEntryShouldHaveNoExtensionElements() { $this->entry->transferFromXML($this->entryText); - $this->assertTrue(is_array($this->entry->extensionElements)); + $this->assertInternalType('array', $this->entry->extensionElements); $this->assertEquals(0, count($this->entry->extensionElements)); } public function testSampleEntryShouldHaveNoExtensionAttributes() { $this->entry->transferFromXML($this->entryText); - $this->assertTrue(is_array($this->entry->extensionAttributes)); + $this->assertInternalType('array', $this->entry->extensionAttributes); $this->assertEquals(0, count($this->entry->extensionAttributes)); } diff --git a/tests/Zend/Gdata/Books/VolumeFeedTest.php b/tests/Zend/Gdata/Books/VolumeFeedTest.php index 6d6ba7ef7a..0e2991f7e7 100644 --- a/tests/Zend/Gdata/Books/VolumeFeedTest.php +++ b/tests/Zend/Gdata/Books/VolumeFeedTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Books */ -class Zend_Gdata_Books_VolumeFeedTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Books_VolumeFeedTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -61,24 +61,24 @@ private function verifyAllSamplePropertiesAreCorrect ($volumeFeed) { } public function testEmptyEntryShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->feed->extensionElements)); + $this->assertInternalType('array', $this->feed->extensionElements); $this->assertEquals(0, count($this->feed->extensionElements)); } public function testEmptyEntryShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->feed->extensionAttributes)); + $this->assertInternalType('array', $this->feed->extensionAttributes); $this->assertEquals(0, count($this->feed->extensionAttributes)); } public function testSampleEntryShouldHaveNoExtensionElements() { $this->feed->transferFromXML($this->feedText); - $this->assertTrue(is_array($this->feed->extensionElements)); + $this->assertInternalType('array', $this->feed->extensionElements); $this->assertEquals(0, count($this->feed->extensionElements)); } public function testSampleEntryShouldHaveNoExtensionAttributes() { $this->feed->transferFromXML($this->feedText); - $this->assertTrue(is_array($this->feed->extensionAttributes)); + $this->assertInternalType('array', $this->feed->extensionAttributes); $this->assertEquals(0, count($this->feed->extensionAttributes)); } diff --git a/tests/Zend/Gdata/BooksOnlineTest.php b/tests/Zend/Gdata/BooksOnlineTest.php index 3955be04be..661339aea6 100644 --- a/tests/Zend/Gdata/BooksOnlineTest.php +++ b/tests/Zend/Gdata/BooksOnlineTest.php @@ -33,7 +33,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Books */ -class Zend_Gdata_BooksOnlineTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_BooksOnlineTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/BooksTest.php b/tests/Zend/Gdata/BooksTest.php index d14c3b8359..d0ed834dd7 100644 --- a/tests/Zend/Gdata/BooksTest.php +++ b/tests/Zend/Gdata/BooksTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Books */ -class Zend_Gdata_BooksTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_BooksTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Calendar/AccessLevelTest.php b/tests/Zend/Gdata/Calendar/AccessLevelTest.php index b7fbc01b8c..ca3158f4b1 100644 --- a/tests/Zend/Gdata/Calendar/AccessLevelTest.php +++ b/tests/Zend/Gdata/Calendar/AccessLevelTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Calendar */ -class Zend_Gdata_Calendar_AccessLevelTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Calendar_AccessLevelTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -43,24 +43,24 @@ public function setUp() { } public function testEmptyAccessLevelShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->accessLevel->extensionElements)); + $this->assertInternalType('array', $this->accessLevel->extensionElements); $this->assertTrue(count($this->accessLevel->extensionElements) == 0); } public function testEmptyAccessLevelShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->accessLevel->extensionAttributes)); + $this->assertInternalType('array', $this->accessLevel->extensionAttributes); $this->assertTrue(count($this->accessLevel->extensionAttributes) == 0); } public function testSampleAccessLevelShouldHaveNoExtensionElements() { $this->accessLevel->transferFromXML($this->accessLevelText); - $this->assertTrue(is_array($this->accessLevel->extensionElements)); + $this->assertInternalType('array', $this->accessLevel->extensionElements); $this->assertTrue(count($this->accessLevel->extensionElements) == 0); } public function testSampleAccessLevelShouldHaveNoExtensionAttributes() { $this->accessLevel->transferFromXML($this->accessLevelText); - $this->assertTrue(is_array($this->accessLevel->extensionAttributes)); + $this->assertInternalType('array', $this->accessLevel->extensionAttributes); $this->assertTrue(count($this->accessLevel->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Calendar/ColorTest.php b/tests/Zend/Gdata/Calendar/ColorTest.php index 9bb00aa60e..a9efdd46e0 100644 --- a/tests/Zend/Gdata/Calendar/ColorTest.php +++ b/tests/Zend/Gdata/Calendar/ColorTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Calendar */ -class Zend_Gdata_Calendar_ColorTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Calendar_ColorTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -43,24 +43,24 @@ public function setUp() { } public function testEmptyColorShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->color->extensionElements)); + $this->assertInternalType('array', $this->color->extensionElements); $this->assertTrue(count($this->color->extensionElements) == 0); } public function testEmptyColorShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->color->extensionAttributes)); + $this->assertInternalType('array', $this->color->extensionAttributes); $this->assertTrue(count($this->color->extensionAttributes) == 0); } public function testSampleColorShouldHaveNoExtensionElements() { $this->color->transferFromXML($this->colorText); - $this->assertTrue(is_array($this->color->extensionElements)); + $this->assertInternalType('array', $this->color->extensionElements); $this->assertTrue(count($this->color->extensionElements) == 0); } public function testSampleColorShouldHaveNoExtensionAttributes() { $this->color->transferFromXML($this->colorText); - $this->assertTrue(is_array($this->color->extensionAttributes)); + $this->assertInternalType('array', $this->color->extensionAttributes); $this->assertTrue(count($this->color->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Calendar/EventEntryTest.php b/tests/Zend/Gdata/Calendar/EventEntryTest.php index b646332d73..7e8d3ada07 100644 --- a/tests/Zend/Gdata/Calendar/EventEntryTest.php +++ b/tests/Zend/Gdata/Calendar/EventEntryTest.php @@ -33,7 +33,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Calendar */ -class Zend_Gdata_Calendar_EventEntryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Calendar_EventEntryTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -55,24 +55,24 @@ public function testSetters() { } public function testEmptyEntryShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->entry->extensionElements)); + $this->assertInternalType('array', $this->entry->extensionElements); $this->assertTrue(count($this->entry->extensionElements) == 0); } public function testEmptyEntryShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->entry->extensionAttributes)); + $this->assertInternalType('array', $this->entry->extensionAttributes); $this->assertTrue(count($this->entry->extensionAttributes) == 0); } public function testSampleEntryShouldHaveNoExtensionElements() { $this->entry->transferFromXML($this->entryText); - $this->assertTrue(is_array($this->entry->extensionElements)); + $this->assertInternalType('array', $this->entry->extensionElements); $this->assertTrue(count($this->entry->extensionElements) == 0); } public function testSampleEntryShouldHaveNoExtensionAttributes() { $this->entry->transferFromXML($this->entryText); - $this->assertTrue(is_array($this->entry->extensionAttributes)); + $this->assertInternalType('array', $this->entry->extensionAttributes); $this->assertTrue(count($this->entry->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Calendar/EventQueryExceptionTest.php b/tests/Zend/Gdata/Calendar/EventQueryExceptionTest.php index 2694403933..f86f34fde1 100644 --- a/tests/Zend/Gdata/Calendar/EventQueryExceptionTest.php +++ b/tests/Zend/Gdata/Calendar/EventQueryExceptionTest.php @@ -33,7 +33,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Calendar */ -class Zend_Gdata_Calendar_EventQueryExceptionTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Calendar_EventQueryExceptionTest extends PHPUnit\Framework\TestCase { const GOOGLE_DEVELOPER_CALENDAR = 'developer-calendar@google.com'; @@ -44,10 +44,11 @@ public function setUp() } /** - * @expectedException Zend_Gdata_App_Exception */ public function testSingleEventsThrowsExceptionOnSetInvalidValue() { + $this->expectException(\Zend_Gdata_App_Exception::class); + $this->query->resetParameters(); $singleEvents = 'puppy'; $this->query->setUser(self::GOOGLE_DEVELOPER_CALENDAR); @@ -55,10 +56,11 @@ public function testSingleEventsThrowsExceptionOnSetInvalidValue() } /** - * @expectedException Zend_Gdata_App_Exception */ public function testFutureEventsThrowsExceptionOnSetInvalidValue() { + $this->expectException(\Zend_Gdata_App_Exception::class); + $this->query->resetParameters(); $futureEvents = 'puppy'; $this->query->setUser(self::GOOGLE_DEVELOPER_CALENDAR); diff --git a/tests/Zend/Gdata/Calendar/EventQueryTest.php b/tests/Zend/Gdata/Calendar/EventQueryTest.php index a4f14aa50c..dcd2e1d0a3 100644 --- a/tests/Zend/Gdata/Calendar/EventQueryTest.php +++ b/tests/Zend/Gdata/Calendar/EventQueryTest.php @@ -33,7 +33,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Calendar */ -class Zend_Gdata_Calendar_EventQueryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Calendar_EventQueryTest extends PHPUnit\Framework\TestCase { const GOOGLE_DEVELOPER_CALENDAR = 'developer-calendar@google.com'; diff --git a/tests/Zend/Gdata/Calendar/HiddenTest.php b/tests/Zend/Gdata/Calendar/HiddenTest.php index 0e465ec108..b4b5f1afd7 100644 --- a/tests/Zend/Gdata/Calendar/HiddenTest.php +++ b/tests/Zend/Gdata/Calendar/HiddenTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Calendar */ -class Zend_Gdata_Calendar_HiddenTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Calendar_HiddenTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -43,24 +43,24 @@ public function setUp() { } public function testEmptyHiddenShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->hidden->extensionElements)); + $this->assertInternalType('array', $this->hidden->extensionElements); $this->assertTrue(count($this->hidden->extensionElements) == 0); } public function testEmptyHiddenShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->hidden->extensionAttributes)); + $this->assertInternalType('array', $this->hidden->extensionAttributes); $this->assertTrue(count($this->hidden->extensionAttributes) == 0); } public function testSampleHiddenShouldHaveNoExtensionElements() { $this->hidden->transferFromXML($this->hiddenText); - $this->assertTrue(is_array($this->hidden->extensionElements)); + $this->assertInternalType('array', $this->hidden->extensionElements); $this->assertTrue(count($this->hidden->extensionElements) == 0); } public function testSampleHiddenShouldHaveNoExtensionAttributes() { $this->hidden->transferFromXML($this->hiddenText); - $this->assertTrue(is_array($this->hidden->extensionAttributes)); + $this->assertInternalType('array', $this->hidden->extensionAttributes); $this->assertTrue(count($this->hidden->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Calendar/LinkTest.php b/tests/Zend/Gdata/Calendar/LinkTest.php index 40f58c2e8f..7cccdb1af2 100644 --- a/tests/Zend/Gdata/Calendar/LinkTest.php +++ b/tests/Zend/Gdata/Calendar/LinkTest.php @@ -33,7 +33,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Calendar */ -class Zend_Gdata_Calendar_LinkTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Calendar_LinkTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -44,24 +44,24 @@ public function setUp() { } public function testEmptyLinkShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->link->extensionElements)); + $this->assertInternalType('array', $this->link->extensionElements); $this->assertTrue(count($this->link->extensionElements) == 0); } public function testEmptyLinkShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->link->extensionAttributes)); + $this->assertInternalType('array', $this->link->extensionAttributes); $this->assertTrue(count($this->link->extensionAttributes) == 0); } public function testSampleLinkShouldHaveNoExtensionElements() { $this->link->transferFromXML($this->linkText); - $this->assertTrue(is_array($this->link->extensionElements)); + $this->assertInternalType('array', $this->link->extensionElements); $this->assertTrue(count($this->link->extensionElements) == 0); } public function testSampleLinkShouldHaveNoExtensionAttributes() { $this->link->transferFromXML($this->linkText); - $this->assertTrue(is_array($this->link->extensionAttributes)); + $this->assertInternalType('array', $this->link->extensionAttributes); $this->assertTrue(count($this->link->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Calendar/QuickAddTest.php b/tests/Zend/Gdata/Calendar/QuickAddTest.php index b55109af94..1eb12ff0fa 100644 --- a/tests/Zend/Gdata/Calendar/QuickAddTest.php +++ b/tests/Zend/Gdata/Calendar/QuickAddTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Calendar */ -class Zend_Gdata_Calendar_QuickAddTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Calendar_QuickAddTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -43,24 +43,24 @@ public function setUp() { } public function testEmptyQuickAddShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->quickAdd->extensionElements)); + $this->assertInternalType('array', $this->quickAdd->extensionElements); $this->assertTrue(count($this->quickAdd->extensionElements) == 0); } public function testEmptyQuickAddShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->quickAdd->extensionAttributes)); + $this->assertInternalType('array', $this->quickAdd->extensionAttributes); $this->assertTrue(count($this->quickAdd->extensionAttributes) == 0); } public function testSampleQuickAddShouldHaveNoExtensionElements() { $this->quickAdd->transferFromXML($this->quickAddText); - $this->assertTrue(is_array($this->quickAdd->extensionElements)); + $this->assertInternalType('array', $this->quickAdd->extensionElements); $this->assertTrue(count($this->quickAdd->extensionElements) == 0); } public function testSampleQuickAddShouldHaveNoExtensionAttributes() { $this->quickAdd->transferFromXML($this->quickAddText); - $this->assertTrue(is_array($this->quickAdd->extensionAttributes)); + $this->assertInternalType('array', $this->quickAdd->extensionAttributes); $this->assertTrue(count($this->quickAdd->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Calendar/SelectedTest.php b/tests/Zend/Gdata/Calendar/SelectedTest.php index ae4510b668..f5a15d2bd3 100644 --- a/tests/Zend/Gdata/Calendar/SelectedTest.php +++ b/tests/Zend/Gdata/Calendar/SelectedTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Calendar */ -class Zend_Gdata_Calendar_SelectedTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Calendar_SelectedTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -43,24 +43,24 @@ public function setUp() { } public function testEmptySelectedShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->selected->extensionElements)); + $this->assertInternalType('array', $this->selected->extensionElements); $this->assertTrue(count($this->selected->extensionElements) == 0); } public function testEmptySelectedShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->selected->extensionAttributes)); + $this->assertInternalType('array', $this->selected->extensionAttributes); $this->assertTrue(count($this->selected->extensionAttributes) == 0); } public function testSampleSelectedShouldHaveNoExtensionElements() { $this->selected->transferFromXML($this->selectedText); - $this->assertTrue(is_array($this->selected->extensionElements)); + $this->assertInternalType('array', $this->selected->extensionElements); $this->assertTrue(count($this->selected->extensionElements) == 0); } public function testSampleSelectedShouldHaveNoExtensionAttributes() { $this->selected->transferFromXML($this->selectedText); - $this->assertTrue(is_array($this->selected->extensionAttributes)); + $this->assertInternalType('array', $this->selected->extensionAttributes); $this->assertTrue(count($this->selected->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Calendar/SendEventNotificationsTest.php b/tests/Zend/Gdata/Calendar/SendEventNotificationsTest.php index 328a840e26..1cc45b4380 100644 --- a/tests/Zend/Gdata/Calendar/SendEventNotificationsTest.php +++ b/tests/Zend/Gdata/Calendar/SendEventNotificationsTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Calendar */ -class Zend_Gdata_Calendar_SendEventNotificationsTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Calendar_SendEventNotificationsTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -43,24 +43,24 @@ public function setUp() { } public function testEmptySendEventNotificationsShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->sendEventNotifications->extensionElements)); + $this->assertInternalType('array', $this->sendEventNotifications->extensionElements); $this->assertTrue(count($this->sendEventNotifications->extensionElements) == 0); } public function testEmptySendEventNotificationsShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->sendEventNotifications->extensionAttributes)); + $this->assertInternalType('array', $this->sendEventNotifications->extensionAttributes); $this->assertTrue(count($this->sendEventNotifications->extensionAttributes) == 0); } public function testSampleSendEventNotificationsShouldHaveNoExtensionElements() { $this->sendEventNotifications->transferFromXML($this->sendEventNotificationsText); - $this->assertTrue(is_array($this->sendEventNotifications->extensionElements)); + $this->assertInternalType('array', $this->sendEventNotifications->extensionElements); $this->assertTrue(count($this->sendEventNotifications->extensionElements) == 0); } public function testSampleSendEventNotificationsShouldHaveNoExtensionAttributes() { $this->sendEventNotifications->transferFromXML($this->sendEventNotificationsText); - $this->assertTrue(is_array($this->sendEventNotifications->extensionAttributes)); + $this->assertInternalType('array', $this->sendEventNotifications->extensionAttributes); $this->assertTrue(count($this->sendEventNotifications->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Calendar/TimezoneTest.php b/tests/Zend/Gdata/Calendar/TimezoneTest.php index 17be4e7296..e1024d11d6 100644 --- a/tests/Zend/Gdata/Calendar/TimezoneTest.php +++ b/tests/Zend/Gdata/Calendar/TimezoneTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Calendar */ -class Zend_Gdata_Calendar_TimezoneTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Calendar_TimezoneTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -43,24 +43,24 @@ public function setUp() { } public function testEmptyTimezoneShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->timezone->extensionElements)); + $this->assertInternalType('array', $this->timezone->extensionElements); $this->assertTrue(count($this->timezone->extensionElements) == 0); } public function testEmptyTimezoneShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->timezone->extensionAttributes)); + $this->assertInternalType('array', $this->timezone->extensionAttributes); $this->assertTrue(count($this->timezone->extensionAttributes) == 0); } public function testSampleTimezoneShouldHaveNoExtensionElements() { $this->timezone->transferFromXML($this->timezoneText); - $this->assertTrue(is_array($this->timezone->extensionElements)); + $this->assertInternalType('array', $this->timezone->extensionElements); $this->assertTrue(count($this->timezone->extensionElements) == 0); } public function testSampleTimezoneShouldHaveNoExtensionAttributes() { $this->timezone->transferFromXML($this->timezoneText); - $this->assertTrue(is_array($this->timezone->extensionAttributes)); + $this->assertInternalType('array', $this->timezone->extensionAttributes); $this->assertTrue(count($this->timezone->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Calendar/WebContentTest.php b/tests/Zend/Gdata/Calendar/WebContentTest.php index d1149bf69b..9695c1130c 100644 --- a/tests/Zend/Gdata/Calendar/WebContentTest.php +++ b/tests/Zend/Gdata/Calendar/WebContentTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Calendar */ -class Zend_Gdata_Calendar_WebContentTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Calendar_WebContentTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -43,24 +43,24 @@ public function setUp() { } public function testEmptyWebContentShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->webContent->extensionElements)); + $this->assertInternalType('array', $this->webContent->extensionElements); $this->assertTrue(count($this->webContent->extensionElements) == 0); } public function testEmptyWebContentShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->webContent->extensionAttributes)); + $this->assertInternalType('array', $this->webContent->extensionAttributes); $this->assertTrue(count($this->webContent->extensionAttributes) == 0); } public function testSampleWebContentShouldHaveNoExtensionElements() { $this->webContent->transferFromXML($this->webContentText); - $this->assertTrue(is_array($this->webContent->extensionElements)); + $this->assertInternalType('array', $this->webContent->extensionElements); $this->assertTrue(count($this->webContent->extensionElements) == 0); } public function testSampleWebContentShouldHaveNoExtensionAttributes() { $this->webContent->transferFromXML($this->webContentText); - $this->assertTrue(is_array($this->webContent->extensionAttributes)); + $this->assertInternalType('array', $this->webContent->extensionAttributes); $this->assertTrue(count($this->webContent->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/CalendarEventTest.php b/tests/Zend/Gdata/CalendarEventTest.php index c63feedd9d..875b1199d6 100644 --- a/tests/Zend/Gdata/CalendarEventTest.php +++ b/tests/Zend/Gdata/CalendarEventTest.php @@ -34,7 +34,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Calendar */ -class Zend_Gdata_CalendarEventTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_CalendarEventTest extends PHPUnit\Framework\TestCase { protected $eventFeed = null; diff --git a/tests/Zend/Gdata/CalendarFeedCompositeTest.php b/tests/Zend/Gdata/CalendarFeedCompositeTest.php index 859b274dbf..526144d563 100644 --- a/tests/Zend/Gdata/CalendarFeedCompositeTest.php +++ b/tests/Zend/Gdata/CalendarFeedCompositeTest.php @@ -34,7 +34,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Calendar */ -class Zend_Gdata_CalendarFeedCompositeTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_CalendarFeedCompositeTest extends PHPUnit\Framework\TestCase { protected $eventFeed = null; diff --git a/tests/Zend/Gdata/CalendarFeedTest.php b/tests/Zend/Gdata/CalendarFeedTest.php index b7f12b949a..8c98fe2578 100644 --- a/tests/Zend/Gdata/CalendarFeedTest.php +++ b/tests/Zend/Gdata/CalendarFeedTest.php @@ -34,7 +34,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Calendar */ -class Zend_Gdata_CalendarFeedTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_CalendarFeedTest extends PHPUnit\Framework\TestCase { protected $listFeed = null; diff --git a/tests/Zend/Gdata/CalendarOnlineTest.php b/tests/Zend/Gdata/CalendarOnlineTest.php index b3f60c0861..4bc71c1199 100644 --- a/tests/Zend/Gdata/CalendarOnlineTest.php +++ b/tests/Zend/Gdata/CalendarOnlineTest.php @@ -34,7 +34,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Calendar */ -class Zend_Gdata_CalendarOnlineTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_CalendarOnlineTest extends PHPUnit\Framework\TestCase { const GOOGLE_DEVELOPER_CALENDAR = 'developer-calendar@google.com'; diff --git a/tests/Zend/Gdata/CalendarTest.php b/tests/Zend/Gdata/CalendarTest.php index 452460625c..eef0963a11 100644 --- a/tests/Zend/Gdata/CalendarTest.php +++ b/tests/Zend/Gdata/CalendarTest.php @@ -34,7 +34,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Calendar */ -class Zend_Gdata_CalendarTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_CalendarTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -45,24 +45,24 @@ public function setUp() } public function testEmptyEventFeedShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->eventFeed->extensionElements)); + $this->assertInternalType('array', $this->eventFeed->extensionElements); $this->assertTrue(count($this->eventFeed->extensionElements) == 0); } public function testEmptyEventFeedShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->eventFeed->extensionAttributes)); + $this->assertInternalType('array', $this->eventFeed->extensionAttributes); $this->assertTrue(count($this->eventFeed->extensionAttributes) == 0); } public function testSampleEventFeedShouldHaveNoExtensionElements() { $this->eventFeed->transferFromXML($this->eventFeedText); - $this->assertTrue(is_array($this->eventFeed->extensionElements)); + $this->assertInternalType('array', $this->eventFeed->extensionElements); $this->assertTrue(count($this->eventFeed->extensionElements) == 0); } public function testSampleEventFeedShouldHaveNoExtensionAttributes() { $this->eventFeed->transferFromXML($this->eventFeedText); - $this->assertTrue(is_array($this->eventFeed->extensionAttributes)); + $this->assertInternalType('array', $this->eventFeed->extensionAttributes); $this->assertTrue(count($this->eventFeed->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/CommentsTest.php b/tests/Zend/Gdata/CommentsTest.php index 057a736077..97fac87b4f 100644 --- a/tests/Zend/Gdata/CommentsTest.php +++ b/tests/Zend/Gdata/CommentsTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Gdata */ -class Zend_Gdata_CommentsTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_CommentsTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -42,24 +42,24 @@ public function setUp() { } public function testEmptyCommentsShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->comments->extensionElements)); + $this->assertInternalType('array', $this->comments->extensionElements); $this->assertTrue(count($this->comments->extensionElements) == 0); } public function testEmptyCommentsShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->comments->extensionAttributes)); + $this->assertInternalType('array', $this->comments->extensionAttributes); $this->assertTrue(count($this->comments->extensionAttributes) == 0); } public function testSampleCommentsShouldHaveNoExtensionElements() { $this->comments->transferFromXML($this->commentsText); - $this->assertTrue(is_array($this->comments->extensionElements)); + $this->assertInternalType('array', $this->comments->extensionElements); $this->assertTrue(count($this->comments->extensionElements) == 0); } public function testSampleCommentsShouldHaveNoExtensionAttributes() { $this->comments->transferFromXML($this->commentsText); - $this->assertTrue(is_array($this->comments->extensionAttributes)); + $this->assertInternalType('array', $this->comments->extensionAttributes); $this->assertTrue(count($this->comments->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Docs/DocumentListEntryTest.php b/tests/Zend/Gdata/Docs/DocumentListEntryTest.php index df29d34d40..8684e58097 100755 --- a/tests/Zend/Gdata/Docs/DocumentListEntryTest.php +++ b/tests/Zend/Gdata/Docs/DocumentListEntryTest.php @@ -33,7 +33,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Docsj */ -class Zend_Gdata_Docs_DocumentListEntryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Docs_DocumentListEntryTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Docs/DocumentListFeedTest.php b/tests/Zend/Gdata/Docs/DocumentListFeedTest.php index b5a96d6512..c96b350f08 100755 --- a/tests/Zend/Gdata/Docs/DocumentListFeedTest.php +++ b/tests/Zend/Gdata/Docs/DocumentListFeedTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Docs */ -class Zend_Gdata_Docs_DocumentListFeedTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Docs_DocumentListFeedTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Docs/QueryTest.php b/tests/Zend/Gdata/Docs/QueryTest.php index 5b7b1a227f..c0596bd4fa 100755 --- a/tests/Zend/Gdata/Docs/QueryTest.php +++ b/tests/Zend/Gdata/Docs/QueryTest.php @@ -33,7 +33,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Docs */ -class Zend_Gdata_Docs_QueryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Docs_QueryTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/DocsOnlineTest.php b/tests/Zend/Gdata/DocsOnlineTest.php index 244101f1b5..2e207a633b 100755 --- a/tests/Zend/Gdata/DocsOnlineTest.php +++ b/tests/Zend/Gdata/DocsOnlineTest.php @@ -33,7 +33,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Docs */ -class Zend_Gdata_DocsOnlineTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_DocsOnlineTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/DocsTest.php b/tests/Zend/Gdata/DocsTest.php index a94bba786e..13f4891145 100755 --- a/tests/Zend/Gdata/DocsTest.php +++ b/tests/Zend/Gdata/DocsTest.php @@ -33,7 +33,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Docs */ -class Zend_Gdata_DocsTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_DocsTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/EntryLinkTest.php b/tests/Zend/Gdata/EntryLinkTest.php index 54be806d8e..dd136ac60e 100644 --- a/tests/Zend/Gdata/EntryLinkTest.php +++ b/tests/Zend/Gdata/EntryLinkTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Gdata */ -class Zend_Gdata_EntryLinkTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_EntryLinkTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -42,24 +42,24 @@ public function setUp() { } public function testEmptyEntryLinkShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->entryLink->extensionElements)); + $this->assertInternalType('array', $this->entryLink->extensionElements); $this->assertTrue(count($this->entryLink->extensionElements) == 0); } public function testEmptyEntryLinkShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->entryLink->extensionAttributes)); + $this->assertInternalType('array', $this->entryLink->extensionAttributes); $this->assertTrue(count($this->entryLink->extensionAttributes) == 0); } public function testSampleEntryLinkShouldHaveNoExtensionElements() { $this->entryLink->transferFromXML($this->entryLinkText); - $this->assertTrue(is_array($this->entryLink->extensionElements)); + $this->assertInternalType('array', $this->entryLink->extensionElements); $this->assertTrue(count($this->entryLink->extensionElements) == 0); } public function testSampleEntryLinkShouldHaveNoExtensionAttributes() { $this->entryLink->transferFromXML($this->entryLinkText); - $this->assertTrue(is_array($this->entryLink->extensionAttributes)); + $this->assertInternalType('array', $this->entryLink->extensionAttributes); $this->assertTrue(count($this->entryLink->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/EntryTest.php b/tests/Zend/Gdata/EntryTest.php index 954c617b13..2a62f7e280 100644 --- a/tests/Zend/Gdata/EntryTest.php +++ b/tests/Zend/Gdata/EntryTest.php @@ -30,7 +30,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Gdata */ -class Zend_Gdata_EntryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_EntryTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Gdata/EventStatusTest.php b/tests/Zend/Gdata/EventStatusTest.php index 8af3955687..7fbc2d37b4 100644 --- a/tests/Zend/Gdata/EventStatusTest.php +++ b/tests/Zend/Gdata/EventStatusTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Gdata */ -class Zend_Gdata_EventStatusTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_EventStatusTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -42,24 +42,24 @@ public function setUp() { } public function testEmptyEventStatusShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->eventStatus->extensionElements)); + $this->assertInternalType('array', $this->eventStatus->extensionElements); $this->assertTrue(count($this->eventStatus->extensionElements) == 0); } public function testEmptyEventStatusShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->eventStatus->extensionAttributes)); + $this->assertInternalType('array', $this->eventStatus->extensionAttributes); $this->assertTrue(count($this->eventStatus->extensionAttributes) == 0); } public function testSampleEventStatusShouldHaveNoExtensionElements() { $this->eventStatus->transferFromXML($this->eventStatusText); - $this->assertTrue(is_array($this->eventStatus->extensionElements)); + $this->assertInternalType('array', $this->eventStatus->extensionElements); $this->assertTrue(count($this->eventStatus->extensionElements) == 0); } public function testSampleEventStatusShouldHaveNoExtensionAttributes() { $this->eventStatus->transferFromXML($this->eventStatusText); - $this->assertTrue(is_array($this->eventStatus->extensionAttributes)); + $this->assertInternalType('array', $this->eventStatus->extensionAttributes); $this->assertTrue(count($this->eventStatus->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/ExtendedPropertyTest.php b/tests/Zend/Gdata/ExtendedPropertyTest.php index abe2504bc3..5ed391238a 100644 --- a/tests/Zend/Gdata/ExtendedPropertyTest.php +++ b/tests/Zend/Gdata/ExtendedPropertyTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Gdata */ -class Zend_Gdata_ExtendedPropertyTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_ExtendedPropertyTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -42,24 +42,24 @@ public function setUp() { } public function testEmptyExtendedPropertyShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->extendedProperty->extensionElements)); + $this->assertInternalType('array', $this->extendedProperty->extensionElements); $this->assertTrue(count($this->extendedProperty->extensionElements) == 0); } public function testEmptyExtendedPropertyShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->extendedProperty->extensionAttributes)); + $this->assertInternalType('array', $this->extendedProperty->extensionAttributes); $this->assertTrue(count($this->extendedProperty->extensionAttributes) == 0); } public function testSampleExtendedPropertyShouldHaveNoExtensionElements() { $this->extendedProperty->transferFromXML($this->extendedPropertyText); - $this->assertTrue(is_array($this->extendedProperty->extensionElements)); + $this->assertInternalType('array', $this->extendedProperty->extensionElements); $this->assertTrue(count($this->extendedProperty->extensionElements) == 0); } public function testSampleExtendedPropertyShouldHaveNoExtensionAttributes() { $this->extendedProperty->transferFromXML($this->extendedPropertyText); - $this->assertTrue(is_array($this->extendedProperty->extensionAttributes)); + $this->assertInternalType('array', $this->extendedProperty->extensionAttributes); $this->assertTrue(count($this->extendedProperty->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/FeedLinkTest.php b/tests/Zend/Gdata/FeedLinkTest.php index 274ef25ace..c8d6185250 100644 --- a/tests/Zend/Gdata/FeedLinkTest.php +++ b/tests/Zend/Gdata/FeedLinkTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Gdata */ -class Zend_Gdata_FeedLinkTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_FeedLinkTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -42,24 +42,24 @@ public function setUp() { } public function testEmptyFeedLinkShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->feedLink->extensionElements)); + $this->assertInternalType('array', $this->feedLink->extensionElements); $this->assertTrue(count($this->feedLink->extensionElements) == 0); } public function testEmptyFeedLinkShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->feedLink->extensionAttributes)); + $this->assertInternalType('array', $this->feedLink->extensionAttributes); $this->assertTrue(count($this->feedLink->extensionAttributes) == 0); } public function testSampleFeedLinkShouldHaveNoExtensionElements() { $this->feedLink->transferFromXML($this->feedLinkText); - $this->assertTrue(is_array($this->feedLink->extensionElements)); + $this->assertInternalType('array', $this->feedLink->extensionElements); $this->assertTrue(count($this->feedLink->extensionElements) == 0); } public function testSampleFeedLinkShouldHaveNoExtensionAttributes() { $this->feedLink->transferFromXML($this->feedLinkText); - $this->assertTrue(is_array($this->feedLink->extensionAttributes)); + $this->assertInternalType('array', $this->feedLink->extensionAttributes); $this->assertTrue(count($this->feedLink->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/FeedTest.php b/tests/Zend/Gdata/FeedTest.php index e418e862bd..fb036830f0 100644 --- a/tests/Zend/Gdata/FeedTest.php +++ b/tests/Zend/Gdata/FeedTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Gdata */ -class Zend_Gdata_FeedTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_FeedTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Gdata/Gapps/EmailListEntryTest.php b/tests/Zend/Gdata/Gapps/EmailListEntryTest.php index 812bb4bcf7..2250abb34a 100644 --- a/tests/Zend/Gdata/Gapps/EmailListEntryTest.php +++ b/tests/Zend/Gdata/Gapps/EmailListEntryTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_EmailListEntryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_EmailListEntryTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -62,24 +62,24 @@ private function verifyAllSamplePropertiesAreCorrect ($emailListEntry) { } public function testEmptyEntryShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->entry->extensionElements)); + $this->assertInternalType('array', $this->entry->extensionElements); $this->assertTrue(count($this->entry->extensionElements) == 0); } public function testEmptyEntryShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->entry->extensionAttributes)); + $this->assertInternalType('array', $this->entry->extensionAttributes); $this->assertTrue(count($this->entry->extensionAttributes) == 0); } public function testSampleEntryShouldHaveNoExtensionElements() { $this->entry->transferFromXML($this->entryText); - $this->assertTrue(is_array($this->entry->extensionElements)); + $this->assertInternalType('array', $this->entry->extensionElements); $this->assertTrue(count($this->entry->extensionElements) == 0); } public function testSampleEntryShouldHaveNoExtensionAttributes() { $this->entry->transferFromXML($this->entryText); - $this->assertTrue(is_array($this->entry->extensionAttributes)); + $this->assertInternalType('array', $this->entry->extensionAttributes); $this->assertTrue(count($this->entry->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Gapps/EmailListFeedTest.php b/tests/Zend/Gdata/Gapps/EmailListFeedTest.php index 157d89ae26..8051c9fb2a 100644 --- a/tests/Zend/Gdata/Gapps/EmailListFeedTest.php +++ b/tests/Zend/Gdata/Gapps/EmailListFeedTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_EmailListFeedTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_EmailListFeedTest extends PHPUnit\Framework\TestCase { protected $emailListFeed = null; @@ -49,22 +49,22 @@ public function setUp() } public function testEmptyFeedShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->emptyEmailListFeed->extensionElements)); + $this->assertInternalType('array', $this->emptyEmailListFeed->extensionElements); $this->assertTrue(count($this->emptyEmailListFeed->extensionElements) == 0); } public function testEmptyFeedShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->emptyEmailListFeed->extensionAttributes)); + $this->assertInternalType('array', $this->emptyEmailListFeed->extensionAttributes); $this->assertTrue(count($this->emptyEmailListFeed->extensionAttributes) == 0); } public function testSampleFeedShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->emailListFeed->extensionElements)); + $this->assertInternalType('array', $this->emailListFeed->extensionElements); $this->assertTrue(count($this->emailListFeed->extensionElements) == 0); } public function testSampleFeedShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->emailListFeed->extensionAttributes)); + $this->assertInternalType('array', $this->emailListFeed->extensionAttributes); $this->assertTrue(count($this->emailListFeed->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Gapps/EmailListQueryTest.php b/tests/Zend/Gdata/Gapps/EmailListQueryTest.php index fff1d36be6..add7f57db6 100644 --- a/tests/Zend/Gdata/Gapps/EmailListQueryTest.php +++ b/tests/Zend/Gdata/Gapps/EmailListQueryTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_EmailListQueryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_EmailListQueryTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Gapps/EmailListRecipientEntryTest.php b/tests/Zend/Gdata/Gapps/EmailListRecipientEntryTest.php index 89570f2ce5..e429315bd6 100644 --- a/tests/Zend/Gdata/Gapps/EmailListRecipientEntryTest.php +++ b/tests/Zend/Gdata/Gapps/EmailListRecipientEntryTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_EmailListRecipientEntryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_EmailListRecipientEntryTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -60,24 +60,24 @@ private function verifyAllSamplePropertiesAreCorrect ($emailListRecipientEntry) } public function testEmptyEntryShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->entry->extensionElements)); + $this->assertInternalType('array', $this->entry->extensionElements); $this->assertTrue(count($this->entry->extensionElements) == 0); } public function testEmptyEntryShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->entry->extensionAttributes)); + $this->assertInternalType('array', $this->entry->extensionAttributes); $this->assertTrue(count($this->entry->extensionAttributes) == 0); } public function testSampleEntryShouldHaveNoExtensionElements() { $this->entry->transferFromXML($this->entryText); - $this->assertTrue(is_array($this->entry->extensionElements)); + $this->assertInternalType('array', $this->entry->extensionElements); $this->assertTrue(count($this->entry->extensionElements) == 0); } public function testSampleEntryShouldHaveNoExtensionAttributes() { $this->entry->transferFromXML($this->entryText); - $this->assertTrue(is_array($this->entry->extensionAttributes)); + $this->assertInternalType('array', $this->entry->extensionAttributes); $this->assertTrue(count($this->entry->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Gapps/EmailListRecipientFeedTest.php b/tests/Zend/Gdata/Gapps/EmailListRecipientFeedTest.php index 9166ee206c..6fea7ddf42 100644 --- a/tests/Zend/Gdata/Gapps/EmailListRecipientFeedTest.php +++ b/tests/Zend/Gdata/Gapps/EmailListRecipientFeedTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_EmailListRecipientFeedTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_EmailListRecipientFeedTest extends PHPUnit\Framework\TestCase { protected $emailListRecipientFeed = null; @@ -49,22 +49,22 @@ public function setUp() } public function testEmptyFeedShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->emptyEmailListRecipientFeed->extensionElements)); + $this->assertInternalType('array', $this->emptyEmailListRecipientFeed->extensionElements); $this->assertTrue(count($this->emptyEmailListRecipientFeed->extensionElements) == 0); } public function testEmptyFeedShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->emptyEmailListRecipientFeed->extensionAttributes)); + $this->assertInternalType('array', $this->emptyEmailListRecipientFeed->extensionAttributes); $this->assertTrue(count($this->emptyEmailListRecipientFeed->extensionAttributes) == 0); } public function testSampleFeedShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->emailListRecipientFeed->extensionElements)); + $this->assertInternalType('array', $this->emailListRecipientFeed->extensionElements); $this->assertTrue(count($this->emailListRecipientFeed->extensionElements) == 0); } public function testSampleFeedShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->emailListRecipientFeed->extensionAttributes)); + $this->assertInternalType('array', $this->emailListRecipientFeed->extensionAttributes); $this->assertTrue(count($this->emailListRecipientFeed->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Gapps/EmailListRecipientQueryTest.php b/tests/Zend/Gdata/Gapps/EmailListRecipientQueryTest.php index dd64f02b37..3cf37f7b6b 100644 --- a/tests/Zend/Gdata/Gapps/EmailListRecipientQueryTest.php +++ b/tests/Zend/Gdata/Gapps/EmailListRecipientQueryTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_EmailListRecipientQueryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_EmailListRecipientQueryTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Gapps/EmailListTest.php b/tests/Zend/Gdata/Gapps/EmailListTest.php index 7810db33d1..81ab098d79 100644 --- a/tests/Zend/Gdata/Gapps/EmailListTest.php +++ b/tests/Zend/Gdata/Gapps/EmailListTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_EmailListTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_EmailListTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -43,24 +43,24 @@ public function setUp() { } public function testEmptyEmailListShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->emailList->extensionElements)); + $this->assertInternalType('array', $this->emailList->extensionElements); $this->assertTrue(count($this->emailList->extensionElements) == 0); } public function testEmptyEmailListShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->emailList->extensionAttributes)); + $this->assertInternalType('array', $this->emailList->extensionAttributes); $this->assertTrue(count($this->emailList->extensionAttributes) == 0); } public function testSampleEmailListShouldHaveNoExtensionElements() { $this->emailList->transferFromXML($this->emailListText); - $this->assertTrue(is_array($this->emailList->extensionElements)); + $this->assertInternalType('array', $this->emailList->extensionElements); $this->assertTrue(count($this->emailList->extensionElements) == 0); } public function testSampleEmailListShouldHaveNoExtensionAttributes() { $this->emailList->transferFromXML($this->emailListText); - $this->assertTrue(is_array($this->emailList->extensionAttributes)); + $this->assertInternalType('array', $this->emailList->extensionAttributes); $this->assertTrue(count($this->emailList->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Gapps/ErrorTest.php b/tests/Zend/Gdata/Gapps/ErrorTest.php index d6737823f9..3fe3e94322 100644 --- a/tests/Zend/Gdata/Gapps/ErrorTest.php +++ b/tests/Zend/Gdata/Gapps/ErrorTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_ErrorTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_ErrorTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Gdata/Gapps/GroupEntryTest.php b/tests/Zend/Gdata/Gapps/GroupEntryTest.php index 3f86618c02..d676292e8d 100644 --- a/tests/Zend/Gdata/Gapps/GroupEntryTest.php +++ b/tests/Zend/Gdata/Gapps/GroupEntryTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_GroupEntryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_GroupEntryTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -63,24 +63,24 @@ private function verifyAllSamplePropertiesAreCorrect ($groupEntry) { } public function testEmptyEntryShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->entry->extensionElements)); + $this->assertInternalType('array', $this->entry->extensionElements); $this->assertTrue(count($this->entry->extensionElements) == 0); } public function testEmptyEntryShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->entry->extensionAttributes)); + $this->assertInternalType('array', $this->entry->extensionAttributes); $this->assertTrue(count($this->entry->extensionAttributes) == 0); } public function testSampleEntryShouldHaveNoExtensionElements() { $this->entry->transferFromXML($this->entryText); - $this->assertTrue(is_array($this->entry->extensionElements)); + $this->assertInternalType('array', $this->entry->extensionElements); $this->assertTrue(count($this->entry->extensionElements) == 0); } public function testSampleEntryShouldHaveNoExtensionAttributes() { $this->entry->transferFromXML($this->entryText); - $this->assertTrue(is_array($this->entry->extensionAttributes)); + $this->assertInternalType('array', $this->entry->extensionAttributes); $this->assertTrue(count($this->entry->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Gapps/GroupFeedTest.php b/tests/Zend/Gdata/Gapps/GroupFeedTest.php index a95a23338b..ae16263a74 100644 --- a/tests/Zend/Gdata/Gapps/GroupFeedTest.php +++ b/tests/Zend/Gdata/Gapps/GroupFeedTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_GroupFeedTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_GroupFeedTest extends PHPUnit\Framework\TestCase { protected $groupFeed = null; @@ -49,22 +49,22 @@ public function setUp() } public function testEmptyFeedShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->emptyGroupFeed->extensionElements)); + $this->assertInternalType('array', $this->emptyGroupFeed->extensionElements); $this->assertTrue(count($this->emptyGroupFeed->extensionElements) == 0); } public function testEmptyFeedShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->emptyGroupFeed->extensionAttributes)); + $this->assertInternalType('array', $this->emptyGroupFeed->extensionAttributes); $this->assertTrue(count($this->emptyGroupFeed->extensionAttributes) == 0); } public function testSampleFeedShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->groupFeed->extensionElements)); + $this->assertInternalType('array', $this->groupFeed->extensionElements); $this->assertTrue(count($this->groupFeed->extensionElements) == 0); } public function testSampleFeedShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->groupFeed->extensionAttributes)); + $this->assertInternalType('array', $this->groupFeed->extensionAttributes); $this->assertTrue(count($this->groupFeed->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Gapps/GroupQueryTest.php b/tests/Zend/Gdata/Gapps/GroupQueryTest.php index 9da58b4a68..cc905944a6 100644 --- a/tests/Zend/Gdata/Gapps/GroupQueryTest.php +++ b/tests/Zend/Gdata/Gapps/GroupQueryTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_GroupQueryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_GroupQueryTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Gapps/LoginTest.php b/tests/Zend/Gdata/Gapps/LoginTest.php index 97d26200ec..49ad1a3bd5 100644 --- a/tests/Zend/Gdata/Gapps/LoginTest.php +++ b/tests/Zend/Gdata/Gapps/LoginTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_LoginTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_LoginTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -43,24 +43,24 @@ public function setUp() { } public function testEmptyLoginShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->login->extensionElements)); + $this->assertInternalType('array', $this->login->extensionElements); $this->assertTrue(count($this->login->extensionElements) == 0); } public function testEmptyLoginShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->login->extensionAttributes)); + $this->assertInternalType('array', $this->login->extensionAttributes); $this->assertTrue(count($this->login->extensionAttributes) == 0); } public function testSampleLoginShouldHaveNoExtensionElements() { $this->login->transferFromXML($this->loginText); - $this->assertTrue(is_array($this->login->extensionElements)); + $this->assertInternalType('array', $this->login->extensionElements); $this->assertTrue(count($this->login->extensionElements) == 0); } public function testSampleLoginShouldHaveNoExtensionAttributes() { $this->login->transferFromXML($this->loginText); - $this->assertTrue(is_array($this->login->extensionAttributes)); + $this->assertInternalType('array', $this->login->extensionAttributes); $this->assertTrue(count($this->login->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Gapps/MemberEntryTest.php b/tests/Zend/Gdata/Gapps/MemberEntryTest.php index 22f82454a0..cee72b7ff5 100644 --- a/tests/Zend/Gdata/Gapps/MemberEntryTest.php +++ b/tests/Zend/Gdata/Gapps/MemberEntryTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_MemberEntryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_MemberEntryTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -61,24 +61,24 @@ private function verifyAllSamplePropertiesAreCorrect ($memberEntry) { } public function testEmptyEntryShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->entry->extensionElements)); + $this->assertInternalType('array', $this->entry->extensionElements); $this->assertTrue(count($this->entry->extensionElements) == 0); } public function testEmptyEntryShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->entry->extensionAttributes)); + $this->assertInternalType('array', $this->entry->extensionAttributes); $this->assertTrue(count($this->entry->extensionAttributes) == 0); } public function testSampleEntryShouldHaveNoExtensionElements() { $this->entry->transferFromXML($this->entryText); - $this->assertTrue(is_array($this->entry->extensionElements)); + $this->assertInternalType('array', $this->entry->extensionElements); $this->assertTrue(count($this->entry->extensionElements) == 0); } public function testSampleEntryShouldHaveNoExtensionAttributes() { $this->entry->transferFromXML($this->entryText); - $this->assertTrue(is_array($this->entry->extensionAttributes)); + $this->assertInternalType('array', $this->entry->extensionAttributes); $this->assertTrue(count($this->entry->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Gapps/MemberFeedTest.php b/tests/Zend/Gdata/Gapps/MemberFeedTest.php index a4633d6790..1d400880ce 100644 --- a/tests/Zend/Gdata/Gapps/MemberFeedTest.php +++ b/tests/Zend/Gdata/Gapps/MemberFeedTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_MemberFeedTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_MemberFeedTest extends PHPUnit\Framework\TestCase { protected $memberFeed = null; @@ -49,22 +49,22 @@ public function setUp() } public function testEmptyFeedShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->emptyMemberFeed->extensionElements)); + $this->assertInternalType('array', $this->emptyMemberFeed->extensionElements); $this->assertTrue(count($this->emptyMemberFeed->extensionElements) == 0); } public function testEmptyFeedShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->emptyMemberFeed->extensionAttributes)); + $this->assertInternalType('array', $this->emptyMemberFeed->extensionAttributes); $this->assertTrue(count($this->emptyMemberFeed->extensionAttributes) == 0); } public function testSampleFeedShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->memberFeed->extensionElements)); + $this->assertInternalType('array', $this->memberFeed->extensionElements); $this->assertTrue(count($this->memberFeed->extensionElements) == 0); } public function testSampleFeedShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->memberFeed->extensionAttributes)); + $this->assertInternalType('array', $this->memberFeed->extensionAttributes); $this->assertTrue(count($this->memberFeed->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Gapps/MemberQueryTest.php b/tests/Zend/Gdata/Gapps/MemberQueryTest.php index b884a023a6..160da58c15 100644 --- a/tests/Zend/Gdata/Gapps/MemberQueryTest.php +++ b/tests/Zend/Gdata/Gapps/MemberQueryTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_MemberQueryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_MemberQueryTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Gapps/NameTest.php b/tests/Zend/Gdata/Gapps/NameTest.php index 04ff04e87e..60a202171a 100644 --- a/tests/Zend/Gdata/Gapps/NameTest.php +++ b/tests/Zend/Gdata/Gapps/NameTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_NameTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_NameTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -43,24 +43,24 @@ public function setUp() { } public function testEmptyNameShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->theName->extensionElements)); + $this->assertInternalType('array', $this->theName->extensionElements); $this->assertTrue(count($this->theName->extensionElements) == 0); } public function testEmptyNameShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->theName->extensionAttributes)); + $this->assertInternalType('array', $this->theName->extensionAttributes); $this->assertTrue(count($this->theName->extensionAttributes) == 0); } public function testSampleNameShouldHaveNoExtensionElements() { $this->theName->transferFromXML($this->theNameText); - $this->assertTrue(is_array($this->theName->extensionElements)); + $this->assertInternalType('array', $this->theName->extensionElements); $this->assertTrue(count($this->theName->extensionElements) == 0); } public function testSampleNameShouldHaveNoExtensionAttributes() { $this->theName->transferFromXML($this->theNameText); - $this->assertTrue(is_array($this->theName->extensionAttributes)); + $this->assertInternalType('array', $this->theName->extensionAttributes); $this->assertTrue(count($this->theName->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Gapps/NicknameEntryTest.php b/tests/Zend/Gdata/Gapps/NicknameEntryTest.php index e4850f6e3e..8d78bae4a7 100644 --- a/tests/Zend/Gdata/Gapps/NicknameEntryTest.php +++ b/tests/Zend/Gdata/Gapps/NicknameEntryTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_NicknameEntryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_NicknameEntryTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -65,24 +65,24 @@ private function verifyAllSamplePropertiesAreCorrect ($nicknameEntry) { } public function testEmptyEntryShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->entry->extensionElements)); + $this->assertInternalType('array', $this->entry->extensionElements); $this->assertTrue(count($this->entry->extensionElements) == 0); } public function testEmptyEntryShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->entry->extensionAttributes)); + $this->assertInternalType('array', $this->entry->extensionAttributes); $this->assertTrue(count($this->entry->extensionAttributes) == 0); } public function testSampleEntryShouldHaveNoExtensionElements() { $this->entry->transferFromXML($this->entryText); - $this->assertTrue(is_array($this->entry->extensionElements)); + $this->assertInternalType('array', $this->entry->extensionElements); $this->assertTrue(count($this->entry->extensionElements) == 0); } public function testSampleEntryShouldHaveNoExtensionAttributes() { $this->entry->transferFromXML($this->entryText); - $this->assertTrue(is_array($this->entry->extensionAttributes)); + $this->assertInternalType('array', $this->entry->extensionAttributes); $this->assertTrue(count($this->entry->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Gapps/NicknameFeedTest.php b/tests/Zend/Gdata/Gapps/NicknameFeedTest.php index 331fdd0c61..d8e341a8b5 100644 --- a/tests/Zend/Gdata/Gapps/NicknameFeedTest.php +++ b/tests/Zend/Gdata/Gapps/NicknameFeedTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_NicknameFeedTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_NicknameFeedTest extends PHPUnit\Framework\TestCase { protected $nicknameFeed = null; @@ -49,22 +49,22 @@ public function setUp() } public function testEmptyFeedShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->emptyNicknameFeed->extensionElements)); + $this->assertInternalType('array', $this->emptyNicknameFeed->extensionElements); $this->assertTrue(count($this->emptyNicknameFeed->extensionElements) == 0); } public function testEmptyFeedShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->emptyNicknameFeed->extensionAttributes)); + $this->assertInternalType('array', $this->emptyNicknameFeed->extensionAttributes); $this->assertTrue(count($this->emptyNicknameFeed->extensionAttributes) == 0); } public function testSampleFeedShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->nicknameFeed->extensionElements)); + $this->assertInternalType('array', $this->nicknameFeed->extensionElements); $this->assertTrue(count($this->nicknameFeed->extensionElements) == 0); } public function testSampleFeedShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->nicknameFeed->extensionAttributes)); + $this->assertInternalType('array', $this->nicknameFeed->extensionAttributes); $this->assertTrue(count($this->nicknameFeed->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Gapps/NicknameQueryTest.php b/tests/Zend/Gdata/Gapps/NicknameQueryTest.php index 5e38000098..62f23ca773 100644 --- a/tests/Zend/Gdata/Gapps/NicknameQueryTest.php +++ b/tests/Zend/Gdata/Gapps/NicknameQueryTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_NicknameQueryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_NicknameQueryTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Gapps/NicknameTest.php b/tests/Zend/Gdata/Gapps/NicknameTest.php index 37d1f11feb..06bd9a862c 100644 --- a/tests/Zend/Gdata/Gapps/NicknameTest.php +++ b/tests/Zend/Gdata/Gapps/NicknameTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_NicknameTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_NicknameTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -43,24 +43,24 @@ public function setUp() { } public function testEmptyNicknameShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->nickname->extensionElements)); + $this->assertInternalType('array', $this->nickname->extensionElements); $this->assertTrue(count($this->nickname->extensionElements) == 0); } public function testEmptyNicknameShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->nickname->extensionAttributes)); + $this->assertInternalType('array', $this->nickname->extensionAttributes); $this->assertTrue(count($this->nickname->extensionAttributes) == 0); } public function testSampleNicknameShouldHaveNoExtensionElements() { $this->nickname->transferFromXML($this->nicknameText); - $this->assertTrue(is_array($this->nickname->extensionElements)); + $this->assertInternalType('array', $this->nickname->extensionElements); $this->assertTrue(count($this->nickname->extensionElements) == 0); } public function testSampleNicknameShouldHaveNoExtensionAttributes() { $this->nickname->transferFromXML($this->nicknameText); - $this->assertTrue(is_array($this->nickname->extensionAttributes)); + $this->assertInternalType('array', $this->nickname->extensionAttributes); $this->assertTrue(count($this->nickname->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Gapps/OwnerEntryTest.php b/tests/Zend/Gdata/Gapps/OwnerEntryTest.php index f3b7eed6b8..00606b1b9a 100644 --- a/tests/Zend/Gdata/Gapps/OwnerEntryTest.php +++ b/tests/Zend/Gdata/Gapps/OwnerEntryTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_OwnerEntryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_OwnerEntryTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -57,24 +57,24 @@ private function verifyAllSamplePropertiesAreCorrect ($ownerEntry) { } public function testEmptyEntryShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->entry->extensionElements)); + $this->assertInternalType('array', $this->entry->extensionElements); $this->assertTrue(count($this->entry->extensionElements) == 0); } public function testEmptyEntryShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->entry->extensionAttributes)); + $this->assertInternalType('array', $this->entry->extensionAttributes); $this->assertTrue(count($this->entry->extensionAttributes) == 0); } public function testSampleEntryShouldHaveNoExtensionElements() { $this->entry->transferFromXML($this->entryText); - $this->assertTrue(is_array($this->entry->extensionElements)); + $this->assertInternalType('array', $this->entry->extensionElements); $this->assertTrue(count($this->entry->extensionElements) == 0); } public function testSampleEntryShouldHaveNoExtensionAttributes() { $this->entry->transferFromXML($this->entryText); - $this->assertTrue(is_array($this->entry->extensionAttributes)); + $this->assertInternalType('array', $this->entry->extensionAttributes); $this->assertTrue(count($this->entry->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Gapps/OwnerFeedTest.php b/tests/Zend/Gdata/Gapps/OwnerFeedTest.php index c628c364c7..cd51f8f5a8 100644 --- a/tests/Zend/Gdata/Gapps/OwnerFeedTest.php +++ b/tests/Zend/Gdata/Gapps/OwnerFeedTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_OwnerFeedTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_OwnerFeedTest extends PHPUnit\Framework\TestCase { protected $ownerFeed = null; @@ -49,22 +49,22 @@ public function setUp() } public function testEmptyFeedShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->emptyOwnerFeed->extensionElements)); + $this->assertInternalType('array', $this->emptyOwnerFeed->extensionElements); $this->assertTrue(count($this->emptyOwnerFeed->extensionElements) == 0); } public function testEmptyFeedShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->emptyOwnerFeed->extensionAttributes)); + $this->assertInternalType('array', $this->emptyOwnerFeed->extensionAttributes); $this->assertTrue(count($this->emptyOwnerFeed->extensionAttributes) == 0); } public function testSampleFeedShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->ownerFeed->extensionElements)); + $this->assertInternalType('array', $this->ownerFeed->extensionElements); $this->assertTrue(count($this->ownerFeed->extensionElements) == 0); } public function testSampleFeedShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->ownerFeed->extensionAttributes)); + $this->assertInternalType('array', $this->ownerFeed->extensionAttributes); $this->assertTrue(count($this->ownerFeed->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Gapps/OwnerQueryTest.php b/tests/Zend/Gdata/Gapps/OwnerQueryTest.php index 0db3b886ab..721a5d6717 100644 --- a/tests/Zend/Gdata/Gapps/OwnerQueryTest.php +++ b/tests/Zend/Gdata/Gapps/OwnerQueryTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_OwnerQueryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_OwnerQueryTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Gapps/PropertyTest.php b/tests/Zend/Gdata/Gapps/PropertyTest.php index 63458a7933..4ee488f284 100644 --- a/tests/Zend/Gdata/Gapps/PropertyTest.php +++ b/tests/Zend/Gdata/Gapps/PropertyTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_PropertyTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_PropertyTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -43,24 +43,24 @@ public function setUp() { } public function testEmptyPropertyShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->theProperty->extensionElements)); + $this->assertInternalType('array', $this->theProperty->extensionElements); $this->assertTrue(count($this->theProperty->extensionElements) == 0); } public function testEmptyPropertyShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->theProperty->extensionAttributes)); + $this->assertInternalType('array', $this->theProperty->extensionAttributes); $this->assertTrue(count($this->theProperty->extensionAttributes) == 0); } public function testSamplePropertyShouldHaveNoExtensionElements() { $this->theProperty->transferFromXML($this->thePropertyText); - $this->assertTrue(is_array($this->theProperty->extensionElements)); + $this->assertInternalType('array', $this->theProperty->extensionElements); $this->assertTrue(count($this->theProperty->extensionElements) == 0); } public function testSamplePropertyShouldHaveNoExtensionAttributes() { $this->theProperty->transferFromXML($this->thePropertyText); - $this->assertTrue(is_array($this->theProperty->extensionAttributes)); + $this->assertInternalType('array', $this->theProperty->extensionAttributes); $this->assertTrue(count($this->theProperty->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Gapps/QuotaTest.php b/tests/Zend/Gdata/Gapps/QuotaTest.php index 1378dd71b9..4b0c166098 100644 --- a/tests/Zend/Gdata/Gapps/QuotaTest.php +++ b/tests/Zend/Gdata/Gapps/QuotaTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_QuotaTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_QuotaTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -43,24 +43,24 @@ public function setUp() { } public function testEmptyQuotaShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->quota->extensionElements)); + $this->assertInternalType('array', $this->quota->extensionElements); $this->assertTrue(count($this->quota->extensionElements) == 0); } public function testEmptyQuotaShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->quota->extensionAttributes)); + $this->assertInternalType('array', $this->quota->extensionAttributes); $this->assertTrue(count($this->quota->extensionAttributes) == 0); } public function testSampleQuotaShouldHaveNoExtensionElements() { $this->quota->transferFromXML($this->quotaText); - $this->assertTrue(is_array($this->quota->extensionElements)); + $this->assertInternalType('array', $this->quota->extensionElements); $this->assertTrue(count($this->quota->extensionElements) == 0); } public function testSampleQuotaShouldHaveNoExtensionAttributes() { $this->quota->transferFromXML($this->quotaText); - $this->assertTrue(is_array($this->quota->extensionAttributes)); + $this->assertInternalType('array', $this->quota->extensionAttributes); $this->assertTrue(count($this->quota->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Gapps/ServiceExceptionTest.php b/tests/Zend/Gdata/Gapps/ServiceExceptionTest.php index 8f06e45b3c..2de3743d54 100644 --- a/tests/Zend/Gdata/Gapps/ServiceExceptionTest.php +++ b/tests/Zend/Gdata/Gapps/ServiceExceptionTest.php @@ -33,7 +33,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_ServiceExceptionTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_ServiceExceptionTest extends PHPUnit\Framework\TestCase { protected $fixture; protected $data; @@ -50,16 +50,17 @@ public function setUp() { } /** - * @expectedException Zend_Gdata_Gapps_ServiceException */ public function testCanThrowServiceException() { + $this->expectException(\Zend_Gdata_Gapps_ServiceException::class); + throw $this->fixture; } public function testCanSetAndGetErrorArray() { $this->fixture->setErrors($this->data); $incoming = $this->fixture->getErrors(); - $this->assertTrue(is_array($incoming)); + $this->assertInternalType('array', $incoming); $this->assertEquals(count($this->data), count($incoming)); foreach ($this->data as $i) { $this->assertEquals($i, $incoming[$i->getErrorCode()]); @@ -77,7 +78,7 @@ public function testCanInsertSingleError() { public function testCanSetPropertiesViaConstructor() { $this->fixture = new Zend_Gdata_Gapps_ServiceException($this->data); $incoming = $this->fixture->getErrors(); - $this->assertTrue(is_array($incoming)); + $this->assertInternalType('array', $incoming); $this->assertEquals(count($this->data), count($incoming)); foreach($this->data as $i) { $this->assertEquals($i, $incoming[$i->getErrorCode()]); @@ -105,7 +106,7 @@ public function testCanCheckIfAKeyExists() { public function testCanConvertFromXML() { $this->fixture->importFromString($this->xmlSample); $incoming = $this->fixture->getErrors(); - $this->assertTrue(is_array($incoming)); + $this->assertInternalType('array', $incoming); $this->assertEquals(3, count($incoming)); $this->assertEquals("9925", $incoming[9925]->errorCode); $this->assertEquals("Foo", $incoming[9925]->invalidInput); diff --git a/tests/Zend/Gdata/Gapps/UserEntryTest.php b/tests/Zend/Gdata/Gapps/UserEntryTest.php index a2f12d3f51..bd786ca3ca 100644 --- a/tests/Zend/Gdata/Gapps/UserEntryTest.php +++ b/tests/Zend/Gdata/Gapps/UserEntryTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_UserEntryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_UserEntryTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -67,24 +67,24 @@ private function verifyAllSamplePropertiesAreCorrect ($userEntry) { } public function testEmptyEntryShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->entry->extensionElements)); + $this->assertInternalType('array', $this->entry->extensionElements); $this->assertTrue(count($this->entry->extensionElements) == 0); } public function testEmptyEntryShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->entry->extensionAttributes)); + $this->assertInternalType('array', $this->entry->extensionAttributes); $this->assertTrue(count($this->entry->extensionAttributes) == 0); } public function testSampleEntryShouldHaveNoExtensionElements() { $this->entry->transferFromXML($this->entryText); - $this->assertTrue(is_array($this->entry->extensionElements)); + $this->assertInternalType('array', $this->entry->extensionElements); $this->assertTrue(count($this->entry->extensionElements) == 0); } public function testSampleEntryShouldHaveNoExtensionAttributes() { $this->entry->transferFromXML($this->entryText); - $this->assertTrue(is_array($this->entry->extensionAttributes)); + $this->assertInternalType('array', $this->entry->extensionAttributes); $this->assertTrue(count($this->entry->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Gapps/UserFeedTest.php b/tests/Zend/Gdata/Gapps/UserFeedTest.php index da227bde45..4633f4a290 100644 --- a/tests/Zend/Gdata/Gapps/UserFeedTest.php +++ b/tests/Zend/Gdata/Gapps/UserFeedTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_UserFeedTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_UserFeedTest extends PHPUnit\Framework\TestCase { protected $userFeed = null; @@ -49,22 +49,22 @@ public function setUp() } public function testEmptyFeedShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->emptyUserFeed->extensionElements)); + $this->assertInternalType('array', $this->emptyUserFeed->extensionElements); $this->assertTrue(count($this->emptyUserFeed->extensionElements) == 0); } public function testEmptyFeedShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->emptyUserFeed->extensionAttributes)); + $this->assertInternalType('array', $this->emptyUserFeed->extensionAttributes); $this->assertTrue(count($this->emptyUserFeed->extensionAttributes) == 0); } public function testSampleFeedShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->userFeed->extensionElements)); + $this->assertInternalType('array', $this->userFeed->extensionElements); $this->assertTrue(count($this->userFeed->extensionElements) == 0); } public function testSampleFeedShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->userFeed->extensionAttributes)); + $this->assertInternalType('array', $this->userFeed->extensionAttributes); $this->assertTrue(count($this->userFeed->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Gapps/UserQueryTest.php b/tests/Zend/Gdata/Gapps/UserQueryTest.php index 2bfe72dc9a..1458451217 100644 --- a/tests/Zend/Gdata/Gapps/UserQueryTest.php +++ b/tests/Zend/Gdata/Gapps/UserQueryTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_Gapps_UserQueryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Gapps_UserQueryTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/GappsOnlineTest.php b/tests/Zend/Gdata/GappsOnlineTest.php index deda37d0de..12d14aa0ce 100644 --- a/tests/Zend/Gdata/GappsOnlineTest.php +++ b/tests/Zend/Gdata/GappsOnlineTest.php @@ -35,7 +35,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_GappsOnlineTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_GappsOnlineTest extends PHPUnit\Framework\TestCase { const GIVEN_NAME = 'Zend_Gdata'; diff --git a/tests/Zend/Gdata/GappsTest.php b/tests/Zend/Gdata/GappsTest.php index 19b9cb152c..6dbc32ec6c 100644 --- a/tests/Zend/Gdata/GappsTest.php +++ b/tests/Zend/Gdata/GappsTest.php @@ -34,7 +34,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Gapps */ -class Zend_Gdata_GappsTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_GappsTest extends PHPUnit\Framework\TestCase { const TEST_DOMAIN = 'nowhere.invalid'; diff --git a/tests/Zend/Gdata/GdataOnlineTest.php b/tests/Zend/Gdata/GdataOnlineTest.php index a11a80c175..22c13b0d59 100644 --- a/tests/Zend/Gdata/GdataOnlineTest.php +++ b/tests/Zend/Gdata/GdataOnlineTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Gdata */ -class Zend_Gdata_GdataOnlineTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_GdataOnlineTest extends PHPUnit\Framework\TestCase { private $blog = null; // blog ID from config diff --git a/tests/Zend/Gdata/GdataTest.php b/tests/Zend/Gdata/GdataTest.php index dcaac7b700..ffed4f6ab9 100644 --- a/tests/Zend/Gdata/GdataTest.php +++ b/tests/Zend/Gdata/GdataTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Gdata */ -class Zend_Gdata_GdataTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_GdataTest extends PHPUnit\Framework\TestCase { public function testDefaultHttpClient() diff --git a/tests/Zend/Gdata/MediaMimeStreamTest.php b/tests/Zend/Gdata/MediaMimeStreamTest.php index 61901de57d..7807d2ab82 100644 --- a/tests/Zend/Gdata/MediaMimeStreamTest.php +++ b/tests/Zend/Gdata/MediaMimeStreamTest.php @@ -30,7 +30,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Gdata */ -class Zend_Gdata_MediaMimeStreamTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_MediaMimeStreamTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/OpenSearchItemsPerPageTest.php b/tests/Zend/Gdata/OpenSearchItemsPerPageTest.php index 7207efe868..625aab8f6f 100644 --- a/tests/Zend/Gdata/OpenSearchItemsPerPageTest.php +++ b/tests/Zend/Gdata/OpenSearchItemsPerPageTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_OpenSearch */ -class Zend_Gdata_OpenSearchItemsPerPageTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_OpenSearchItemsPerPageTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -43,24 +43,24 @@ public function setUp() { } public function testEmptyOpenSearchItemsPerPageShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->openSearchItemsPerPage->extensionElements)); + $this->assertInternalType('array', $this->openSearchItemsPerPage->extensionElements); $this->assertTrue(count($this->openSearchItemsPerPage->extensionElements) == 0); } public function testEmptyOpenSearchItemsPerPageShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->openSearchItemsPerPage->extensionAttributes)); + $this->assertInternalType('array', $this->openSearchItemsPerPage->extensionAttributes); $this->assertTrue(count($this->openSearchItemsPerPage->extensionAttributes) == 0); } public function testSampleOpenSearchItemsPerPageShouldHaveNoExtensionElements() { $this->openSearchItemsPerPage->transferFromXML($this->openSearchItemsPerPageText); - $this->assertTrue(is_array($this->openSearchItemsPerPage->extensionElements)); + $this->assertInternalType('array', $this->openSearchItemsPerPage->extensionElements); $this->assertTrue(count($this->openSearchItemsPerPage->extensionElements) == 0); } public function testSampleOpenSearchItemsPerPageShouldHaveNoExtensionAttributes() { $this->openSearchItemsPerPage->transferFromXML($this->openSearchItemsPerPageText); - $this->assertTrue(is_array($this->openSearchItemsPerPage->extensionAttributes)); + $this->assertInternalType('array', $this->openSearchItemsPerPage->extensionAttributes); $this->assertTrue(count($this->openSearchItemsPerPage->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/OpenSearchStartIndexTest.php b/tests/Zend/Gdata/OpenSearchStartIndexTest.php index 32f6ca6f2b..8e0f7657fa 100644 --- a/tests/Zend/Gdata/OpenSearchStartIndexTest.php +++ b/tests/Zend/Gdata/OpenSearchStartIndexTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_OpenSearch */ -class Zend_Gdata_OpenSearchStartIndexTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_OpenSearchStartIndexTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -43,24 +43,24 @@ public function setUp() { } public function testEmptyOpenSearchStartIndexShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->openSearchStartIndex->extensionElements)); + $this->assertInternalType('array', $this->openSearchStartIndex->extensionElements); $this->assertTrue(count($this->openSearchStartIndex->extensionElements) == 0); } public function testEmptyOpenSearchStartIndexShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->openSearchStartIndex->extensionAttributes)); + $this->assertInternalType('array', $this->openSearchStartIndex->extensionAttributes); $this->assertTrue(count($this->openSearchStartIndex->extensionAttributes) == 0); } public function testSampleOpenSearchStartIndexShouldHaveNoExtensionElements() { $this->openSearchStartIndex->transferFromXML($this->openSearchStartIndexText); - $this->assertTrue(is_array($this->openSearchStartIndex->extensionElements)); + $this->assertInternalType('array', $this->openSearchStartIndex->extensionElements); $this->assertTrue(count($this->openSearchStartIndex->extensionElements) == 0); } public function testSampleOpenSearchStartIndexShouldHaveNoExtensionAttributes() { $this->openSearchStartIndex->transferFromXML($this->openSearchStartIndexText); - $this->assertTrue(is_array($this->openSearchStartIndex->extensionAttributes)); + $this->assertInternalType('array', $this->openSearchStartIndex->extensionAttributes); $this->assertTrue(count($this->openSearchStartIndex->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/OpenSearchTotalResultsTest.php b/tests/Zend/Gdata/OpenSearchTotalResultsTest.php index c762b86447..e0db7fa128 100644 --- a/tests/Zend/Gdata/OpenSearchTotalResultsTest.php +++ b/tests/Zend/Gdata/OpenSearchTotalResultsTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_OpenSearch */ -class Zend_Gdata_OpenSearchTotalResultsTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_OpenSearchTotalResultsTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -43,24 +43,24 @@ public function setUp() { } public function testEmptyOpenSearchTotalResultsShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->openSearchTotalResults->extensionElements)); + $this->assertInternalType('array', $this->openSearchTotalResults->extensionElements); $this->assertTrue(count($this->openSearchTotalResults->extensionElements) == 0); } public function testEmptyOpenSearchTotalResultsShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->openSearchTotalResults->extensionAttributes)); + $this->assertInternalType('array', $this->openSearchTotalResults->extensionAttributes); $this->assertTrue(count($this->openSearchTotalResults->extensionAttributes) == 0); } public function testSampleOpenSearchTotalResultsShouldHaveNoExtensionElements() { $this->openSearchTotalResults->transferFromXML($this->openSearchTotalResultsText); - $this->assertTrue(is_array($this->openSearchTotalResults->extensionElements)); + $this->assertInternalType('array', $this->openSearchTotalResults->extensionElements); $this->assertTrue(count($this->openSearchTotalResults->extensionElements) == 0); } public function testSampleOpenSearchTotalResultsShouldHaveNoExtensionAttributes() { $this->openSearchTotalResults->transferFromXML($this->openSearchTotalResultsText); - $this->assertTrue(is_array($this->openSearchTotalResults->extensionAttributes)); + $this->assertInternalType('array', $this->openSearchTotalResults->extensionAttributes); $this->assertTrue(count($this->openSearchTotalResults->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/OriginalEventTest.php b/tests/Zend/Gdata/OriginalEventTest.php index b2523d9053..8bb0af2cda 100644 --- a/tests/Zend/Gdata/OriginalEventTest.php +++ b/tests/Zend/Gdata/OriginalEventTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Gdata */ -class Zend_Gdata_OriginalEventTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_OriginalEventTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -42,24 +42,24 @@ public function setUp() { } public function testEmptyOriginalEventShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->originalEvent->extensionElements)); + $this->assertInternalType('array', $this->originalEvent->extensionElements); $this->assertTrue(count($this->originalEvent->extensionElements) == 0); } public function testEmptyOriginalEventShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->originalEvent->extensionAttributes)); + $this->assertInternalType('array', $this->originalEvent->extensionAttributes); $this->assertTrue(count($this->originalEvent->extensionAttributes) == 0); } public function testSampleOriginalEventShouldHaveNoExtensionElements() { $this->originalEvent->transferFromXML($this->originalEventText); - $this->assertTrue(is_array($this->originalEvent->extensionElements)); + $this->assertInternalType('array', $this->originalEvent->extensionElements); $this->assertTrue(count($this->originalEvent->extensionElements) == 0); } public function testSampleOriginalEventShouldHaveNoExtensionAttributes() { $this->originalEvent->transferFromXML($this->originalEventText); - $this->assertTrue(is_array($this->originalEvent->extensionAttributes)); + $this->assertInternalType('array', $this->originalEvent->extensionAttributes); $this->assertTrue(count($this->originalEvent->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Photos/PhotosAlbumEntryTest.php b/tests/Zend/Gdata/Photos/PhotosAlbumEntryTest.php index c588767d76..d24d1bb593 100755 --- a/tests/Zend/Gdata/Photos/PhotosAlbumEntryTest.php +++ b/tests/Zend/Gdata/Photos/PhotosAlbumEntryTest.php @@ -34,7 +34,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Photos */ -class Zend_Gdata_Photos_PhotosAlbumEntryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Photos_PhotosAlbumEntryTest extends PHPUnit\Framework\TestCase { protected $albumEntry = null; diff --git a/tests/Zend/Gdata/Photos/PhotosAlbumFeedTest.php b/tests/Zend/Gdata/Photos/PhotosAlbumFeedTest.php index c97de89229..54b8949001 100755 --- a/tests/Zend/Gdata/Photos/PhotosAlbumFeedTest.php +++ b/tests/Zend/Gdata/Photos/PhotosAlbumFeedTest.php @@ -34,7 +34,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Photos */ -class Zend_Gdata_Photos_PhotosAlbumFeedTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Photos_PhotosAlbumFeedTest extends PHPUnit\Framework\TestCase { protected $albumFeed = null; diff --git a/tests/Zend/Gdata/Photos/PhotosAlbumQueryTest.php b/tests/Zend/Gdata/Photos/PhotosAlbumQueryTest.php index afe5d5eb95..0396a1959a 100755 --- a/tests/Zend/Gdata/Photos/PhotosAlbumQueryTest.php +++ b/tests/Zend/Gdata/Photos/PhotosAlbumQueryTest.php @@ -34,7 +34,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Photos */ -class Zend_Gdata_Photos_PhotosAlbumQueryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Photos_PhotosAlbumQueryTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Gdata/Photos/PhotosCommentEntryTest.php b/tests/Zend/Gdata/Photos/PhotosCommentEntryTest.php index cc6a1aa365..5386dcc892 100755 --- a/tests/Zend/Gdata/Photos/PhotosCommentEntryTest.php +++ b/tests/Zend/Gdata/Photos/PhotosCommentEntryTest.php @@ -34,7 +34,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Photos */ -class Zend_Gdata_Photos_PhotosCommentEntryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Photos_PhotosCommentEntryTest extends PHPUnit\Framework\TestCase { protected $commentEntry = null; diff --git a/tests/Zend/Gdata/Photos/PhotosPhotoEntryTest.php b/tests/Zend/Gdata/Photos/PhotosPhotoEntryTest.php index 36ad35688e..120ce24a7f 100755 --- a/tests/Zend/Gdata/Photos/PhotosPhotoEntryTest.php +++ b/tests/Zend/Gdata/Photos/PhotosPhotoEntryTest.php @@ -34,7 +34,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Photos */ -class Zend_Gdata_Photos_PhotosPhotoEntryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Photos_PhotosPhotoEntryTest extends PHPUnit\Framework\TestCase { protected $photoEntry = null; diff --git a/tests/Zend/Gdata/Photos/PhotosPhotoFeedTest.php b/tests/Zend/Gdata/Photos/PhotosPhotoFeedTest.php index e6162f6346..bdb32e0596 100755 --- a/tests/Zend/Gdata/Photos/PhotosPhotoFeedTest.php +++ b/tests/Zend/Gdata/Photos/PhotosPhotoFeedTest.php @@ -34,7 +34,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Photos */ -class Zend_Gdata_Photos_PhotosPhotoFeedTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Photos_PhotosPhotoFeedTest extends PHPUnit\Framework\TestCase { protected $photoFeed = null; diff --git a/tests/Zend/Gdata/Photos/PhotosPhotoQueryTest.php b/tests/Zend/Gdata/Photos/PhotosPhotoQueryTest.php index 13c57b4312..ac624107a3 100755 --- a/tests/Zend/Gdata/Photos/PhotosPhotoQueryTest.php +++ b/tests/Zend/Gdata/Photos/PhotosPhotoQueryTest.php @@ -34,7 +34,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Photos */ -class Zend_Gdata_Photos_PhotosPhotoQueryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Photos_PhotosPhotoQueryTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Gdata/Photos/PhotosTagEntryTest.php b/tests/Zend/Gdata/Photos/PhotosTagEntryTest.php index fa01fdb26d..a7b208f5c3 100755 --- a/tests/Zend/Gdata/Photos/PhotosTagEntryTest.php +++ b/tests/Zend/Gdata/Photos/PhotosTagEntryTest.php @@ -34,7 +34,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Photos */ -class Zend_Gdata_Photos_PhotosTagEntryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Photos_PhotosTagEntryTest extends PHPUnit\Framework\TestCase { protected $tagEntry = null; diff --git a/tests/Zend/Gdata/Photos/PhotosUserEntryTest.php b/tests/Zend/Gdata/Photos/PhotosUserEntryTest.php index ab6b9791a0..231ccc8bc2 100755 --- a/tests/Zend/Gdata/Photos/PhotosUserEntryTest.php +++ b/tests/Zend/Gdata/Photos/PhotosUserEntryTest.php @@ -34,7 +34,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Photos */ -class Zend_Gdata_Photos_PhotosUserEntryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Photos_PhotosUserEntryTest extends PHPUnit\Framework\TestCase { protected $userEntry = null; diff --git a/tests/Zend/Gdata/Photos/PhotosUserFeedTest.php b/tests/Zend/Gdata/Photos/PhotosUserFeedTest.php index a05cdbc938..de9553a585 100755 --- a/tests/Zend/Gdata/Photos/PhotosUserFeedTest.php +++ b/tests/Zend/Gdata/Photos/PhotosUserFeedTest.php @@ -34,7 +34,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Photos */ -class Zend_Gdata_Photos_PhotosUserFeedTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Photos_PhotosUserFeedTest extends PHPUnit\Framework\TestCase { protected $userFeed = null; diff --git a/tests/Zend/Gdata/Photos/PhotosUserQueryTest.php b/tests/Zend/Gdata/Photos/PhotosUserQueryTest.php index 77759541f2..2c900a662d 100755 --- a/tests/Zend/Gdata/Photos/PhotosUserQueryTest.php +++ b/tests/Zend/Gdata/Photos/PhotosUserQueryTest.php @@ -34,7 +34,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Photos */ -class Zend_Gdata_Photos_PhotosUserQueryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Photos_PhotosUserQueryTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Gdata/PhotosOnlineTest.php b/tests/Zend/Gdata/PhotosOnlineTest.php index 38ce2edcd8..846d0f085d 100755 --- a/tests/Zend/Gdata/PhotosOnlineTest.php +++ b/tests/Zend/Gdata/PhotosOnlineTest.php @@ -35,7 +35,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Photos */ -class Zend_Gdata_PhotosOnlineTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_PhotosOnlineTest extends PHPUnit\Framework\TestCase { protected $photos = null; diff --git a/tests/Zend/Gdata/QueryTest.php b/tests/Zend/Gdata/QueryTest.php index be77f93301..0b07c1bf79 100644 --- a/tests/Zend/Gdata/QueryTest.php +++ b/tests/Zend/Gdata/QueryTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Gdata */ -class Zend_Gdata_QueryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_QueryTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Gdata/RecurrenceExceptionTest.php b/tests/Zend/Gdata/RecurrenceExceptionTest.php index d5a15e5e5c..9b9427cef4 100644 --- a/tests/Zend/Gdata/RecurrenceExceptionTest.php +++ b/tests/Zend/Gdata/RecurrenceExceptionTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Gdata */ -class Zend_Gdata_RecurrenceExceptionTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_RecurrenceExceptionTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -42,24 +42,24 @@ public function setUp() { } public function testEmptyRecurrenceExceptionShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->recurrenceException->extensionElements)); + $this->assertInternalType('array', $this->recurrenceException->extensionElements); $this->assertTrue(count($this->recurrenceException->extensionElements) == 0); } public function testEmptyRecurrenceExceptionShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->recurrenceException->extensionAttributes)); + $this->assertInternalType('array', $this->recurrenceException->extensionAttributes); $this->assertTrue(count($this->recurrenceException->extensionAttributes) == 0); } public function testSampleRecurrenceExceptionShouldHaveNoExtensionElements() { $this->recurrenceException->transferFromXML($this->recurrenceExceptionText); - $this->assertTrue(is_array($this->recurrenceException->extensionElements)); + $this->assertInternalType('array', $this->recurrenceException->extensionElements); $this->assertTrue(count($this->recurrenceException->extensionElements) == 0); } public function testSampleRecurrenceExceptionShouldHaveNoExtensionAttributes() { $this->recurrenceException->transferFromXML($this->recurrenceExceptionText); - $this->assertTrue(is_array($this->recurrenceException->extensionAttributes)); + $this->assertInternalType('array', $this->recurrenceException->extensionAttributes); $this->assertTrue(count($this->recurrenceException->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/RecurrenceTest.php b/tests/Zend/Gdata/RecurrenceTest.php index e03f02a932..3569663cb7 100644 --- a/tests/Zend/Gdata/RecurrenceTest.php +++ b/tests/Zend/Gdata/RecurrenceTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Gdata */ -class Zend_Gdata_RecurrenceTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_RecurrenceTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -42,24 +42,24 @@ public function setUp() { } public function testEmptyRecurrenceShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->recurrence->extensionElements)); + $this->assertInternalType('array', $this->recurrence->extensionElements); $this->assertTrue(count($this->recurrence->extensionElements) == 0); } public function testEmptyRecurrenceShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->recurrence->extensionAttributes)); + $this->assertInternalType('array', $this->recurrence->extensionAttributes); $this->assertTrue(count($this->recurrence->extensionAttributes) == 0); } public function testSampleRecurrenceShouldHaveNoExtensionElements() { $this->recurrence->transferFromXML($this->recurrenceText); - $this->assertTrue(is_array($this->recurrence->extensionElements)); + $this->assertInternalType('array', $this->recurrence->extensionElements); $this->assertTrue(count($this->recurrence->extensionElements) == 0); } public function testSampleRecurrenceShouldHaveNoExtensionAttributes() { $this->recurrence->transferFromXML($this->recurrenceText); - $this->assertTrue(is_array($this->recurrence->extensionAttributes)); + $this->assertInternalType('array', $this->recurrence->extensionAttributes); $this->assertTrue(count($this->recurrence->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/ReminderTest.php b/tests/Zend/Gdata/ReminderTest.php index c7031b4a50..c3aeda5dde 100644 --- a/tests/Zend/Gdata/ReminderTest.php +++ b/tests/Zend/Gdata/ReminderTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Gdata */ -class Zend_Gdata_ReminderTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_ReminderTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -42,24 +42,24 @@ public function setUp() { } public function testEmptyReminderShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->reminder->extensionElements)); + $this->assertInternalType('array', $this->reminder->extensionElements); $this->assertTrue(count($this->reminder->extensionElements) == 0); } public function testEmptyReminderShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->reminder->extensionAttributes)); + $this->assertInternalType('array', $this->reminder->extensionAttributes); $this->assertTrue(count($this->reminder->extensionAttributes) == 0); } public function testSampleReminderShouldHaveNoExtensionElements() { $this->reminder->transferFromXML($this->reminderText); - $this->assertTrue(is_array($this->reminder->extensionElements)); + $this->assertInternalType('array', $this->reminder->extensionElements); $this->assertTrue(count($this->reminder->extensionElements) == 0); } public function testSampleReminderShouldHaveNoExtensionAttributes() { $this->reminder->transferFromXML($this->reminderText); - $this->assertTrue(is_array($this->reminder->extensionAttributes)); + $this->assertInternalType('array', $this->reminder->extensionAttributes); $this->assertTrue(count($this->reminder->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/Spreadsheets/CellEntryTest.php b/tests/Zend/Gdata/Spreadsheets/CellEntryTest.php index 11188230cb..95335c4a37 100644 --- a/tests/Zend/Gdata/Spreadsheets/CellEntryTest.php +++ b/tests/Zend/Gdata/Spreadsheets/CellEntryTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Spreadsheets */ -class Zend_Gdata_Spreadsheets_CellEntryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Spreadsheets_CellEntryTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Spreadsheets/CellFeedTest.php b/tests/Zend/Gdata/Spreadsheets/CellFeedTest.php index a0d7f41bdb..878c1a3f07 100644 --- a/tests/Zend/Gdata/Spreadsheets/CellFeedTest.php +++ b/tests/Zend/Gdata/Spreadsheets/CellFeedTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Spreadsheets */ -class Zend_Gdata_Spreadsheets_CellFeedTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Spreadsheets_CellFeedTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Spreadsheets/CellQueryTest.php b/tests/Zend/Gdata/Spreadsheets/CellQueryTest.php index 8529538a85..3ff5acc514 100644 --- a/tests/Zend/Gdata/Spreadsheets/CellQueryTest.php +++ b/tests/Zend/Gdata/Spreadsheets/CellQueryTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Spreadsheets */ -class Zend_Gdata_Spreadsheets_CellQueryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Spreadsheets_CellQueryTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Spreadsheets/CellTest.php b/tests/Zend/Gdata/Spreadsheets/CellTest.php index c3c78367e7..dc17e7657b 100644 --- a/tests/Zend/Gdata/Spreadsheets/CellTest.php +++ b/tests/Zend/Gdata/Spreadsheets/CellTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Spreadsheets */ -class Zend_Gdata_Spreadsheets_CellTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Spreadsheets_CellTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Spreadsheets/ColCountTest.php b/tests/Zend/Gdata/Spreadsheets/ColCountTest.php index 0a37969e56..568f71504b 100644 --- a/tests/Zend/Gdata/Spreadsheets/ColCountTest.php +++ b/tests/Zend/Gdata/Spreadsheets/ColCountTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Spreadsheets */ -class Zend_Gdata_Spreadsheets_ColCountTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Spreadsheets_ColCountTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Spreadsheets/CustomTest.php b/tests/Zend/Gdata/Spreadsheets/CustomTest.php index bee1ed08cc..b52dd79bf0 100644 --- a/tests/Zend/Gdata/Spreadsheets/CustomTest.php +++ b/tests/Zend/Gdata/Spreadsheets/CustomTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Spreadsheets */ -class Zend_Gdata_Spreadsheets_CustomTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Spreadsheets_CustomTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Spreadsheets/DocumentQueryTest.php b/tests/Zend/Gdata/Spreadsheets/DocumentQueryTest.php index dfc668863a..2d8167c611 100644 --- a/tests/Zend/Gdata/Spreadsheets/DocumentQueryTest.php +++ b/tests/Zend/Gdata/Spreadsheets/DocumentQueryTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Spreadsheets */ -class Zend_Gdata_Spreadsheets_DocumentQueryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Spreadsheets_DocumentQueryTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Spreadsheets/ListEntryTest.php b/tests/Zend/Gdata/Spreadsheets/ListEntryTest.php index efba7181c3..8c14ea61b4 100644 --- a/tests/Zend/Gdata/Spreadsheets/ListEntryTest.php +++ b/tests/Zend/Gdata/Spreadsheets/ListEntryTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Spreadsheets */ -class Zend_Gdata_Spreadsheets_ListEntryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Spreadsheets_ListEntryTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Spreadsheets/ListFeedTest.php b/tests/Zend/Gdata/Spreadsheets/ListFeedTest.php index 5aea35235f..f38929cb09 100644 --- a/tests/Zend/Gdata/Spreadsheets/ListFeedTest.php +++ b/tests/Zend/Gdata/Spreadsheets/ListFeedTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Spreadsheets */ -class Zend_Gdata_Spreadsheets_ListFeedTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Spreadsheets_ListFeedTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Spreadsheets/ListQueryTest.php b/tests/Zend/Gdata/Spreadsheets/ListQueryTest.php index 394612e74d..e1ca42477d 100644 --- a/tests/Zend/Gdata/Spreadsheets/ListQueryTest.php +++ b/tests/Zend/Gdata/Spreadsheets/ListQueryTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Spreadsheets */ -class Zend_Gdata_Spreadsheets_ListQueryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Spreadsheets_ListQueryTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Spreadsheets/RowCountTest.php b/tests/Zend/Gdata/Spreadsheets/RowCountTest.php index e1f2b98b7e..417d8997e2 100644 --- a/tests/Zend/Gdata/Spreadsheets/RowCountTest.php +++ b/tests/Zend/Gdata/Spreadsheets/RowCountTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Spreadsheets */ -class Zend_Gdata_Spreadsheets_RowCountTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Spreadsheets_RowCountTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Spreadsheets/SpreadsheetFeedTest.php b/tests/Zend/Gdata/Spreadsheets/SpreadsheetFeedTest.php index 6337769e19..e88af70c0c 100644 --- a/tests/Zend/Gdata/Spreadsheets/SpreadsheetFeedTest.php +++ b/tests/Zend/Gdata/Spreadsheets/SpreadsheetFeedTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Spreadsheets */ -class Zend_Gdata_Spreadsheets_SpreadsheetFeedTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Spreadsheets_SpreadsheetFeedTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Spreadsheets/WorksheetEntryTest.php b/tests/Zend/Gdata/Spreadsheets/WorksheetEntryTest.php index ee8c89b206..9d944154d1 100644 --- a/tests/Zend/Gdata/Spreadsheets/WorksheetEntryTest.php +++ b/tests/Zend/Gdata/Spreadsheets/WorksheetEntryTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Spreadsheets */ -class Zend_Gdata_Spreadsheets_WorksheetEntryTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Spreadsheets_WorksheetEntryTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/Spreadsheets/WorksheetFeedTest.php b/tests/Zend/Gdata/Spreadsheets/WorksheetFeedTest.php index 7f1fa6c2c7..62193b7c73 100644 --- a/tests/Zend/Gdata/Spreadsheets/WorksheetFeedTest.php +++ b/tests/Zend/Gdata/Spreadsheets/WorksheetFeedTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Spreadsheets */ -class Zend_Gdata_Spreadsheets_WorksheetFeedTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_Spreadsheets_WorksheetFeedTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/SpreadsheetsOnlineTest.php b/tests/Zend/Gdata/SpreadsheetsOnlineTest.php index 425c0d4e2a..9a7fcf3732 100644 --- a/tests/Zend/Gdata/SpreadsheetsOnlineTest.php +++ b/tests/Zend/Gdata/SpreadsheetsOnlineTest.php @@ -33,7 +33,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Spreadsheets */ -class Zend_Gdata_SpreadsheetsOnlineTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_SpreadsheetsOnlineTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/SpreadsheetsTest.php b/tests/Zend/Gdata/SpreadsheetsTest.php index 358980d492..1cdc68c086 100644 --- a/tests/Zend/Gdata/SpreadsheetsTest.php +++ b/tests/Zend/Gdata/SpreadsheetsTest.php @@ -32,7 +32,7 @@ * @group Zend_Gdata * @group Zend_Gdata_Spreadsheets */ -class Zend_Gdata_SpreadsheetsTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_SpreadsheetsTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Gdata/TransparencyTest.php b/tests/Zend/Gdata/TransparencyTest.php index a58daee2f6..825e674709 100644 --- a/tests/Zend/Gdata/TransparencyTest.php +++ b/tests/Zend/Gdata/TransparencyTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Gdata */ -class Zend_Gdata_TransparencyTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_TransparencyTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -42,24 +42,24 @@ public function setUp() { } public function testEmptyTransparencyShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->transparency->extensionElements)); + $this->assertInternalType('array', $this->transparency->extensionElements); $this->assertTrue(count($this->transparency->extensionElements) == 0); } public function testEmptyTransparencyShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->transparency->extensionAttributes)); + $this->assertInternalType('array', $this->transparency->extensionAttributes); $this->assertTrue(count($this->transparency->extensionAttributes) == 0); } public function testSampleTransparencyShouldHaveNoExtensionElements() { $this->transparency->transferFromXML($this->transparencyText); - $this->assertTrue(is_array($this->transparency->extensionElements)); + $this->assertInternalType('array', $this->transparency->extensionElements); $this->assertTrue(count($this->transparency->extensionElements) == 0); } public function testSampleTransparencyShouldHaveNoExtensionAttributes() { $this->transparency->transferFromXML($this->transparencyText); - $this->assertTrue(is_array($this->transparency->extensionAttributes)); + $this->assertInternalType('array', $this->transparency->extensionAttributes); $this->assertTrue(count($this->transparency->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/VisibilityTest.php b/tests/Zend/Gdata/VisibilityTest.php index a00a1e0a74..ab3107a820 100644 --- a/tests/Zend/Gdata/VisibilityTest.php +++ b/tests/Zend/Gdata/VisibilityTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Gdata */ -class Zend_Gdata_VisibilityTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_VisibilityTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -42,24 +42,24 @@ public function setUp() { } public function testEmptyVisibilityShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->visibility->extensionElements)); + $this->assertInternalType('array', $this->visibility->extensionElements); $this->assertTrue(count($this->visibility->extensionElements) == 0); } public function testEmptyVisibilityShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->visibility->extensionAttributes)); + $this->assertInternalType('array', $this->visibility->extensionAttributes); $this->assertTrue(count($this->visibility->extensionAttributes) == 0); } public function testSampleVisibilityShouldHaveNoExtensionElements() { $this->visibility->transferFromXML($this->visibilityText); - $this->assertTrue(is_array($this->visibility->extensionElements)); + $this->assertInternalType('array', $this->visibility->extensionElements); $this->assertTrue(count($this->visibility->extensionElements) == 0); } public function testSampleVisibilityShouldHaveNoExtensionAttributes() { $this->visibility->transferFromXML($this->visibilityText); - $this->assertTrue(is_array($this->visibility->extensionAttributes)); + $this->assertInternalType('array', $this->visibility->extensionAttributes); $this->assertTrue(count($this->visibility->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/WhenTest.php b/tests/Zend/Gdata/WhenTest.php index 862732b864..f95b9eea94 100644 --- a/tests/Zend/Gdata/WhenTest.php +++ b/tests/Zend/Gdata/WhenTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Gdata */ -class Zend_Gdata_WhenTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_WhenTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -42,24 +42,24 @@ public function setUp() { } public function testEmptyWhenShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->when->extensionElements)); + $this->assertInternalType('array', $this->when->extensionElements); $this->assertTrue(count($this->when->extensionElements) == 0); } public function testEmptyWhenShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->when->extensionAttributes)); + $this->assertInternalType('array', $this->when->extensionAttributes); $this->assertTrue(count($this->when->extensionAttributes) == 0); } public function testSampleWhenShouldHaveNoExtensionElements() { $this->when->transferFromXML($this->whenText); - $this->assertTrue(is_array($this->when->extensionElements)); + $this->assertInternalType('array', $this->when->extensionElements); $this->assertTrue(count($this->when->extensionElements) == 0); } public function testSampleWhenShouldHaveNoExtensionAttributes() { $this->when->transferFromXML($this->whenText); - $this->assertTrue(is_array($this->when->extensionAttributes)); + $this->assertInternalType('array', $this->when->extensionAttributes); $this->assertTrue(count($this->when->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/WhereTest.php b/tests/Zend/Gdata/WhereTest.php index 6dc573b225..d403c84cd2 100644 --- a/tests/Zend/Gdata/WhereTest.php +++ b/tests/Zend/Gdata/WhereTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Gdata */ -class Zend_Gdata_WhereTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_WhereTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -42,24 +42,24 @@ public function setUp() { } public function testEmptyWhereShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->where->extensionElements)); + $this->assertInternalType('array', $this->where->extensionElements); $this->assertTrue(count($this->where->extensionElements) == 0); } public function testEmptyWhereShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->where->extensionAttributes)); + $this->assertInternalType('array', $this->where->extensionAttributes); $this->assertTrue(count($this->where->extensionAttributes) == 0); } public function testSampleWhereShouldHaveNoExtensionElements() { $this->where->transferFromXML($this->whereText); - $this->assertTrue(is_array($this->where->extensionElements)); + $this->assertInternalType('array', $this->where->extensionElements); $this->assertTrue(count($this->where->extensionElements) == 0); } public function testSampleWhereShouldHaveNoExtensionAttributes() { $this->where->transferFromXML($this->whereText); - $this->assertTrue(is_array($this->where->extensionAttributes)); + $this->assertInternalType('array', $this->where->extensionAttributes); $this->assertTrue(count($this->where->extensionAttributes) == 0); } diff --git a/tests/Zend/Gdata/WhoTest.php b/tests/Zend/Gdata/WhoTest.php index 7b17b0265c..ef5be14e4e 100644 --- a/tests/Zend/Gdata/WhoTest.php +++ b/tests/Zend/Gdata/WhoTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Gdata */ -class Zend_Gdata_WhoTest extends PHPUnit_Framework_TestCase +class Zend_Gdata_WhoTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -42,24 +42,24 @@ public function setUp() { } public function testEmptyWhoShouldHaveNoExtensionElements() { - $this->assertTrue(is_array($this->who->extensionElements)); + $this->assertInternalType('array', $this->who->extensionElements); $this->assertTrue(count($this->who->extensionElements) == 0); } public function testEmptyWhoShouldHaveNoExtensionAttributes() { - $this->assertTrue(is_array($this->who->extensionAttributes)); + $this->assertInternalType('array', $this->who->extensionAttributes); $this->assertTrue(count($this->who->extensionAttributes) == 0); } public function testSampleWhoShouldHaveNoExtensionElements() { $this->who->transferFromXML($this->whoText); - $this->assertTrue(is_array($this->who->extensionElements)); + $this->assertInternalType('array', $this->who->extensionElements); $this->assertTrue(count($this->who->extensionElements) == 0); } public function testSampleWhoShouldHaveNoExtensionAttributes() { $this->who->transferFromXML($this->whoText); - $this->assertTrue(is_array($this->who->extensionAttributes)); + $this->assertInternalType('array', $this->who->extensionAttributes); $this->assertTrue(count($this->who->extensionAttributes) == 0); } diff --git a/tests/Zend/Http/Client/ClientTest.php b/tests/Zend/Http/Client/ClientTest.php index 5e9698c005..ad35e4c981 100644 --- a/tests/Zend/Http/Client/ClientTest.php +++ b/tests/Zend/Http/Client/ClientTest.php @@ -31,7 +31,7 @@ * @group Zend_Http * @group Zend_Http_Client */ -class Zend_Http_Client_ClientTest extends PHPUnit_Framework_TestCase +class Zend_Http_Client_ClientTest extends PHPUnit\Framework\TestCase { /** * Set up the test case @@ -63,7 +63,7 @@ public function invalidHeaders() */ public function testHeadersContainingCRLFInjectionRaiseAnException($name, $value) { - $this->setExpectedException('Zend_Http_Exception'); + $this->expectException('Zend_Http_Exception'); $this->client->setHeaders(array( $name => $value, )); diff --git a/tests/Zend/Http/Client/CommonHttpTests.php b/tests/Zend/Http/Client/CommonHttpTests.php index b55ae62011..f1f21c3215 100644 --- a/tests/Zend/Http/Client/CommonHttpTests.php +++ b/tests/Zend/Http/Client/CommonHttpTests.php @@ -52,7 +52,7 @@ * @group Zend_Http * @group Zend_Http_Client */ -abstract class Zend_Http_Client_CommonHttpTests extends PHPUnit_Framework_TestCase +abstract class Zend_Http_Client_CommonHttpTests extends PHPUnit\Framework\TestCase { /** * The bast URI for this test, containing all files in the _files directory @@ -1148,7 +1148,7 @@ public function testStreamResponse() $response = $this->client->request(); $this->assertTrue($response instanceof Zend_Http_Response_Stream, 'Request did not return stream response!'); - $this->assertTrue(is_resource($response->getStream()), 'Request does not contain stream!'); + $this->assertInternalType('resource', $response->getStream(), 'Request does not contain stream!'); $stream_name = $response->getStreamName(); @@ -1173,7 +1173,7 @@ public function testStreamResponseBody() $response = $this->client->request(); $this->assertTrue($response instanceof Zend_Http_Response_Stream, 'Request did not return stream response!'); - $this->assertTrue(is_resource($response->getStream()), 'Request does not contain stream!'); + $this->assertInternalType('resource', $response->getStream(), 'Request does not contain stream!'); $body = $response->getBody(); @@ -1194,7 +1194,7 @@ public function testStreamResponseNamed() $response = $this->client->request(); $this->assertTrue($response instanceof Zend_Http_Response_Stream, 'Request did not return stream response!'); - $this->assertTrue(is_resource($response->getStream()), 'Request does not contain stream!'); + $this->assertInternalType('resource', $response->getStream(), 'Request does not contain stream!'); $this->assertEquals($outfile, $response->getStreamName()); diff --git a/tests/Zend/Http/Client/CurlTest.php b/tests/Zend/Http/Client/CurlTest.php index 26f208c026..20e53524fd 100644 --- a/tests/Zend/Http/Client/CurlTest.php +++ b/tests/Zend/Http/Client/CurlTest.php @@ -113,11 +113,12 @@ public function testConfigSetAsZendConfig() /** * Check that an exception is thrown when trying to set invalid config * - * @expectedException Zend_Http_Client_Adapter_Exception * @dataProvider invalidConfigProvider */ public function testSetConfigInvalidConfig($config) { + $this->expectException(\Zend_Http_Client_Adapter_Exception::class); + $this->_adapter->setConfig($config); } @@ -127,10 +128,11 @@ public function testSetConfigInvalidConfig($config) * * This should throw an exception. * - * @expectedException Zend_Http_Exception */ public function testSettingInvalidCurlOption() { + $this->expectException(\Zend_Http_Exception::class); + $config = array( 'adapter' => 'Zend_Http_Client_Adapter_Curl', 'curloptions' => array(CURLOPT_CLOSEPOLICY => true), @@ -166,10 +168,11 @@ public function testRedirectWithGetOnly() * Set CURLOPT_FOLLOWLOCATION = false for this type of request and let the Zend_Http_Client handle redirects * in his own loop. * - * @expectedException Zend_Http_Client_Exception */ public function testRedirectPostToGetWithCurlFollowLocationOptionLeadsToTimeout() { + $this->expectException(\Zend_Http_Client_Exception::class); + $adapter = new Zend_Http_Client_Adapter_Curl(); $this->client->setAdapter($adapter); $adapter->setConfig(array( @@ -230,7 +233,8 @@ public function testPutFileHandleWithHttpClient() public function testWritingAndNotConnectedWithCurlHandleThrowsException() { - $this->setExpectedException("Zend_Http_Client_Adapter_Exception", "Trying to write but we are not connected"); + $this->expectException("Zend_Http_Client_Adapter_Exception"); + $this->expectExceptionMessage("Trying to write but we are not connected"); $adapter = new Zend_Http_Client_Adapter_Curl(); $adapter->write("GET", "someUri"); @@ -238,7 +242,7 @@ public function testWritingAndNotConnectedWithCurlHandleThrowsException() public function testSetConfigIsNotArray() { - $this->setExpectedException("Zend_Http_Client_Adapter_Exception"); + $this->expectException("Zend_Http_Client_Adapter_Exception"); $adapter = new Zend_Http_Client_Adapter_Curl(); $adapter->setConfig("foo"); @@ -289,7 +293,7 @@ public function testGetCurlHandle() $adapter->setConfig(array('timeout' => 2, 'maxredirects' => 1)); $adapter->connect("http://framework.zend.com"); - $this->assertTrue(is_resource($adapter->getHandle())); + $this->assertInternalType('resource', $adapter->getHandle()); } /** diff --git a/tests/Zend/Http/Client/SocketTest.php b/tests/Zend/Http/Client/SocketTest.php index 562076b674..7d0d03cad6 100644 --- a/tests/Zend/Http/Client/SocketTest.php +++ b/tests/Zend/Http/Client/SocketTest.php @@ -113,11 +113,12 @@ public function testConfigSetAsZendConfig() /** * Check that an exception is thrown when trying to set invalid config * - * @expectedException Zend_Http_Client_Adapter_Exception * @dataProvider invalidConfigProvider */ public function testSetConfigInvalidConfig($config) { + $this->expectException(\Zend_Http_Client_Adapter_Exception::class); + $this->_adapter->setConfig($config); } @@ -165,10 +166,11 @@ public function testSetNewStreamContextOptions() * Test that setting invalid options / context causes an exception * * @dataProvider invalidContextProvider - * @expectedException Zend_Http_Client_Adapter_Exception */ public function testSetInvalidContextOptions($invalid) { + $this->expectException(\Zend_Http_Client_Adapter_Exception::class); + $adapter = new $this->config['adapter']; $adapter->setStreamContext($invalid); } diff --git a/tests/Zend/Http/Client/StaticTest.php b/tests/Zend/Http/Client/StaticTest.php index 5b714caeed..b62d225e62 100644 --- a/tests/Zend/Http/Client/StaticTest.php +++ b/tests/Zend/Http/Client/StaticTest.php @@ -38,7 +38,7 @@ * @group Zend_Http * @group Zend_Http_Client */ -class Zend_Http_Client_StaticTest extends PHPUnit_Framework_TestCase +class Zend_Http_Client_StaticTest extends PHPUnit\Framework\TestCase { /** * Common HTTP client @@ -84,7 +84,7 @@ public function testSetGetUriString() $this->assertEquals($uri->__toString(), $uristr, 'Returned Uri object does not hold the expected URI'); $uri = $this->_client->getUri(true); - $this->assertTrue(is_string($uri), 'Returned value expected to be a string, ' . gettype($uri) . ' returned'); + $this->assertInternalType('string', $uri, 'Returned value expected to be a string, ' . gettype($uri) . ' returned'); $this->assertEquals($uri, $uristr, 'Returned string is not the expected URI'); } @@ -106,10 +106,11 @@ public function testSetGetUriObject() /** * Test that passing an invalid URI string throws an exception * - * @expectedException Zend_Uri_Exception */ public function testInvalidUriStringException() { + $this->expectException(\Zend_Uri_Exception::class); + $this->_client->setUri('httpp://__invalid__.com'); } @@ -155,10 +156,11 @@ public function testDoubleGetParameter() /** * Make sure an exception is thrown if an invalid header name is used * - * @expectedException Zend_Http_Client_Exception */ public function testInvalidHeaderExcept() { + $this->expectException(\Zend_Http_Client_Exception::class); + $this->_client->setHeaders('Ina_lid* Hea%der', 'is not good'); } @@ -208,10 +210,11 @@ public function testUnsetHeader() * Test setAuth (dynamic method) fails when trying to use an unsupported * authentication scheme * - * @expectedException Zend_Http_Client_Exception */ public function testExceptUnsupportedAuthDynamic() { + $this->expectException(\Zend_Http_Client_Exception::class); + $this->_client->setAuth('shahar', '1234', 'SuperStrongAlgo'); } @@ -219,10 +222,11 @@ public function testExceptUnsupportedAuthDynamic() * Test encodeAuthHeader (static method) fails when trying to use an * unsupported authentication scheme * - * @expectedException Zend_Http_Client_Exception */ public function testExceptUnsupportedAuthStatic() { + $this->expectException(\Zend_Http_Client_Exception::class); + Zend_Http_Client::encodeAuthHeader('shahar', '1234', 'SuperStrongAlgo'); } @@ -283,10 +287,11 @@ public function testUnsetCookieJar() /** * Make sure using an invalid cookie jar object throws an exception * - * @expectedException Zend_Http_Client_Exception */ public function testSetInvalidCookieJar() { + $this->expectException(\Zend_Http_Client_Exception::class); + $this->_client->setCookieJar('cookiejar'); } @@ -384,10 +389,11 @@ public function testConfigSetAsZendConfig() * Test that passing invalid variables to setConfig() causes an exception * * @dataProvider invalidConfigProvider - * @expectedException Zend_Http_Client_Exception */ public function testConfigSetInvalid($config) { + $this->expectException(\Zend_Http_Client_Exception::class); + $this->_client->setConfig($config); } @@ -457,10 +463,11 @@ public function testGetLastResponseWhenNotStoring() * Check we get an exception when trying to send a POST request with an * invalid content-type header * - * @expectedException Zend_Http_Client_Exception */ public function testInvalidPostContentType() { + $this->expectException(\Zend_Http_Client_Exception::class); + $this->_client->setEncType('x-foo/something-fake'); $this->_client->setParameterPost('parameter', 'value'); @@ -471,10 +478,11 @@ public function testInvalidPostContentType() /** * Check we get an exception if there's an error in the socket * - * @expectedException Zend_Http_Client_Adapter_Exception */ public function testSocketErrorException() { + $this->expectException(\Zend_Http_Client_Adapter_Exception::class); + // Try to connect to an invalid host $this->_client->setUri('http://255.255.255.255'); @@ -504,10 +512,11 @@ public function testSettingExtendedMethod($method) * the request method. * * @dataProvider invalidMethodProvider - * @expectedException Zend_Http_Client_Exception */ public function testSettingInvalidMethodThrowsException($method) { + $this->expectException(\Zend_Http_Client_Exception::class); + $this->_client->setMethod($method); } diff --git a/tests/Zend/Http/Client/TestAdapterTest.php b/tests/Zend/Http/Client/TestAdapterTest.php index 75ab7d90f1..dde08cfc70 100644 --- a/tests/Zend/Http/Client/TestAdapterTest.php +++ b/tests/Zend/Http/Client/TestAdapterTest.php @@ -34,7 +34,7 @@ * @group Zend_Http * @group Zend_Http_Client */ -class Zend_Http_Client_TestAdapterTest extends PHPUnit_Framework_TestCase +class Zend_Http_Client_TestAdapterTest extends PHPUnit\Framework\TestCase { /** * Test adapter @@ -64,10 +64,11 @@ public function tearDown() /** * Make sure an exception is thrown on invalid cofiguration * - * @expectedException Zend_Http_Client_Adapter_Exception */ public function testSetConfigThrowsOnInvalidConfig() { + $this->expectException(\Zend_Http_Client_Adapter_Exception::class); + $this->adapter->setConfig('foo'); } diff --git a/tests/Zend/Http/CookieJarTest.php b/tests/Zend/Http/CookieJarTest.php index 732ffc6528..a980037918 100644 --- a/tests/Zend/Http/CookieJarTest.php +++ b/tests/Zend/Http/CookieJarTest.php @@ -33,7 +33,7 @@ * @group Zend_Http * @group Zend_Http_CookieJar */ -class Zend_Http_CookieJarTest extends PHPUnit_Framework_TestCase +class Zend_Http_CookieJarTest extends PHPUnit\Framework\TestCase { public function loadResponse($filename) { @@ -110,10 +110,11 @@ public function testAddCookiesFromResponse() * Test we get an exception in case of invalid response objects * * @dataProvider invalidResponseProvider - * @expectedException Zend_Http_Exception */ public function testExceptAddCookiesInvalidResponse($resp) { + $this->expectException(\Zend_Http_Exception::class); + $jar = new Zend_Http_Cookiejar(); $jar->addCookiesFromResponse($resp, 'http://www.example.com'); } @@ -412,16 +413,16 @@ public function testGetMatchingCookiesAsStrings() $this->assertEquals(8, count($jar->getAllCookies()), 'Cookie count is expected to be 8'); $cookies = $jar->getMatchingCookies('http://www.foo.com/path/file.txt', true, Zend_Http_CookieJar::COOKIE_STRING_ARRAY); - $this->assertTrue(is_array($cookies), '$cookies is expected to be an array, but it is not'); - $this->assertTrue(is_string($cookies[0]), '$cookies[0] is expected to be a string');; + $this->assertInternalType('array', $cookies, '$cookies is expected to be an array, but it is not'); + $this->assertInternalType('string', $cookies[0], '$cookies[0] is expected to be a string');; $cookies = $jar->getMatchingCookies('http://www.foo.com/path/file.txt', true, Zend_Http_CookieJar::COOKIE_STRING_CONCAT); - $this->assertTrue(is_string($cookies), '$cookies is expected to be a string'); + $this->assertInternalType('string', $cookies, '$cookies is expected to be a string'); $expected = 'foo1=bar1;foo2=bar2;foo4=bar4;foo7=bar7;'; $this->assertEquals($expected, $cookies, 'Concatenated string is not as expected'); $cookies = $jar->getMatchingCookies('http://www.foo.com/path/file.txt', true, Zend_Http_CookieJar::COOKIE_STRING_CONCAT_STRICT); - $this->assertTrue(is_string($cookies), '$cookies is expected to be a string'); + $this->assertInternalType('string', $cookies, '$cookies is expected to be a string'); $expected = 'foo1=bar1; foo2=bar2; foo4=bar4; foo7=bar7'; $this->assertEquals($expected, $cookies, 'Concatenated string is not as expected'); } @@ -494,7 +495,7 @@ public function testMatchPathWithTrailingSlash() foreach ($cookies as $cookie) $jar->addCookie($cookie); $cookies = $jar->getMatchingCookies('http://www.example.com/a/b/file.txt'); - $this->assertTrue(is_array($cookies)); + $this->assertInternalType('array', $cookies); $this->assertEquals(2, count($cookies)); } diff --git a/tests/Zend/Http/CookieTest.php b/tests/Zend/Http/CookieTest.php index 527f928b2d..9b7622d960 100644 --- a/tests/Zend/Http/CookieTest.php +++ b/tests/Zend/Http/CookieTest.php @@ -33,7 +33,7 @@ * @group Zend_Http * @group Zend_Http_Cookie */ -class Zend_Http_CookieTest extends PHPUnit_Framework_TestCase +class Zend_Http_CookieTest extends PHPUnit\Framework\TestCase { /** * Cookie creation and data accessors tests @@ -43,10 +43,11 @@ class Zend_Http_CookieTest extends PHPUnit_Framework_TestCase * Make sure we can't set invalid names * * @dataProvider invalidCookieNameCharProvider - * @expectedException Zend_Http_Exception */ public function testSetInvalidName($char) { + $this->expectException(\Zend_Http_Exception::class); + $cookie = new Zend_Http_Cookie("cookie_$char", 'foo', 'example.com'); } diff --git a/tests/Zend/Http/Header/HeaderValueTest.php b/tests/Zend/Http/Header/HeaderValueTest.php index 1de9eb400c..0ab8aafed7 100644 --- a/tests/Zend/Http/Header/HeaderValueTest.php +++ b/tests/Zend/Http/Header/HeaderValueTest.php @@ -31,7 +31,7 @@ * @group Zend_Http * @group Zend_Http_Header */ -class Zend_Http_Header_HeaderValueTest extends PHPUnit_Framework_TestCase +class Zend_Http_Header_HeaderValueTest extends PHPUnit\Framework\TestCase { /** * Data for filter value @@ -110,7 +110,7 @@ public function assertValues() */ public function testAssertValidRaisesExceptionForInvalidValue($value) { - $this->setExpectedException('Zend_Http_Header_Exception_InvalidArgumentException'); + $this->expectException('Zend_Http_Header_Exception_InvalidArgumentException'); Zend_Http_Header_HeaderValue::assertValid($value); } } diff --git a/tests/Zend/Http/Header/SetCookieTest.php b/tests/Zend/Http/Header/SetCookieTest.php index acd6c11814..8e3b03d40c 100644 --- a/tests/Zend/Http/Header/SetCookieTest.php +++ b/tests/Zend/Http/Header/SetCookieTest.php @@ -43,7 +43,7 @@ * @group Zend_Http_Header * @group ZF-4520 */ -class Zend_Http_Header_SetCookieTest extends PHPUnit_Framework_TestCase +class Zend_Http_Header_SetCookieTest extends PHPUnit\Framework\TestCase { /** @@ -100,7 +100,7 @@ public function testSetCookieFromStringCanCreateMultipleHeaders() . 'someothername=someothervalue; Domain=docs.foo.com; Path=/accounts;' . 'Expires=Wed, 13-Jan-2021 22:23:01 GMT; Secure; HttpOnly' ); - $this->assertTrue(is_array($setCookieHeaders)); + $this->assertInternalType('array', $setCookieHeaders); $setCookieHeader = $setCookieHeaders[0]; $this->assertTrue($setCookieHeader instanceof Zend_Http_Header_SetCookie); @@ -389,7 +389,7 @@ public function invalidCookieComponentValues() public function testDoesNotAllowCRLFAttackVectorsViaSetters($setter, $value) { $cookie = new Zend_Http_Header_SetCookie(); - $this->setExpectedException('Zend_Http_Header_Exception_InvalidArgumentException'); + $this->expectException('Zend_Http_Header_Exception_InvalidArgumentException'); $cookie->{$setter}($value); } } diff --git a/tests/Zend/Http/ResponseTest.php b/tests/Zend/Http/ResponseTest.php index 6a073422f4..594dbb483c 100644 --- a/tests/Zend/Http/ResponseTest.php +++ b/tests/Zend/Http/ResponseTest.php @@ -36,7 +36,7 @@ * @group Zend_Http * @group Zend_Http_Response */ -class Zend_Http_ResponseTest extends PHPUnit_Framework_TestCase +class Zend_Http_ResponseTest extends PHPUnit\Framework\TestCase { public function setUp() { } @@ -246,7 +246,7 @@ public function testResponseCodeAsText() // Check we get an array if no code is passed $codes = Zend_Http_Response::responseCodeAsText(); - $this->assertTrue(is_array($codes)); + $this->assertInternalType('array', $codes); $this->assertEquals('OK', $codes[200]); } @@ -412,7 +412,8 @@ public function invalidResponseHeaders() */ public function testExtractHeadersRaisesExceptionWhenDetectingCRLFInjection($message) { - $this->setExpectedException('Zend_Http_Exception', 'Invalid'); + $this->expectException('Zend_Http_Exception'); + $this->expectExceptionMessage('Invalid'); Zend_Http_Response::extractHeaders($message); } diff --git a/tests/Zend/Http/UserAgent/AbstractDeviceTest.php b/tests/Zend/Http/UserAgent/AbstractDeviceTest.php index 542c1d45c2..4ae879e52b 100644 --- a/tests/Zend/Http/UserAgent/AbstractDeviceTest.php +++ b/tests/Zend/Http/UserAgent/AbstractDeviceTest.php @@ -44,7 +44,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Http_UserAgent_AbstractDeviceTest extends PHPUnit_Framework_TestCase +class Zend_Http_UserAgent_AbstractDeviceTest extends PHPUnit\Framework\TestCase { public function testUserAgentSafari() { diff --git a/tests/Zend/Http/UserAgent/Features/Adapter/BrowscapTest.php b/tests/Zend/Http/UserAgent/Features/Adapter/BrowscapTest.php index b0dd70e4c1..2dbc426b27 100644 --- a/tests/Zend/Http/UserAgent/Features/Adapter/BrowscapTest.php +++ b/tests/Zend/Http/UserAgent/Features/Adapter/BrowscapTest.php @@ -28,7 +28,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Http_UserAgent_Features_Adapter_BrowscapTest extends PHPUnit_Framework_TestCase +class Zend_Http_UserAgent_Features_Adapter_BrowscapTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Http/UserAgent/Features/Adapter/DeviceAtlasTest.php b/tests/Zend/Http/UserAgent/Features/Adapter/DeviceAtlasTest.php index 611f49629d..78ec3ec2a5 100644 --- a/tests/Zend/Http/UserAgent/Features/Adapter/DeviceAtlasTest.php +++ b/tests/Zend/Http/UserAgent/Features/Adapter/DeviceAtlasTest.php @@ -28,7 +28,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Http_UserAgent_Features_Adapter_DeviceAtlasTest extends PHPUnit_Framework_TestCase +class Zend_Http_UserAgent_Features_Adapter_DeviceAtlasTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Http/UserAgent/Features/Adapter/TeraWurflTest.php b/tests/Zend/Http/UserAgent/Features/Adapter/TeraWurflTest.php index e6b48a550c..a52358c6fb 100644 --- a/tests/Zend/Http/UserAgent/Features/Adapter/TeraWurflTest.php +++ b/tests/Zend/Http/UserAgent/Features/Adapter/TeraWurflTest.php @@ -32,7 +32,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Http_UserAgent_Features_Adapter_TeraWurflTest extends PHPUnit_Framework_TestCase +class Zend_Http_UserAgent_Features_Adapter_TeraWurflTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Http/UserAgentTest.php b/tests/Zend/Http/UserAgentTest.php index 071e2e7f6b..2679ae6554 100644 --- a/tests/Zend/Http/UserAgentTest.php +++ b/tests/Zend/Http/UserAgentTest.php @@ -39,7 +39,7 @@ * @group Zend_Http * @group Zend_Http_UserAgent */ -class Zend_Http_UserAgentTest extends PHPUnit_Framework_TestCase +class Zend_Http_UserAgentTest extends PHPUnit\Framework\TestCase { public function setUp() @@ -292,7 +292,8 @@ public function invalidConfigs() */ public function testSettingConfigWithInvalidTypeRaisesException($arg) { - $this->setExpectedException('Zend_Http_UserAgent_Exception', 'expected array'); + $this->expectException('Zend_Http_UserAgent_Exception'); + $this->expectExceptionMessage('expected array'); $ua = new Zend_Http_UserAgent($arg); } @@ -315,7 +316,8 @@ public function testAllowsSettingServerWithTraversableObject() */ public function testSettingServerWithInvalidTypeRaisesException($arg) { - $this->setExpectedException('Zend_Http_UserAgent_Exception', 'array or object implementing Traversable'); + $this->expectException('Zend_Http_UserAgent_Exception'); + $this->expectExceptionMessage('array or object implementing Traversable'); $ua = new Zend_Http_UserAgent(array('server' => $arg)); } @@ -332,7 +334,8 @@ public function testAllowsSettingPluginLoaderUsingClassname() public function testSpecifyingInvalidPluginLoaderClassNameRaisesException() { $ua = new Zend_Http_UserAgent(); - $this->setExpectedException('Zend_Http_UserAgent_Exception', 'extending Zend_Loader_PluginLoader'); + $this->expectException('Zend_Http_UserAgent_Exception'); + $this->expectExceptionMessage('extending Zend_Loader_PluginLoader'); $ua->setPluginLoader('device', 'Zend_Http_TestAsset_InvalidPluginLoader'); } @@ -352,21 +355,24 @@ public function invalidLoaders() public function testSpecifyingInvalidTypeToPluginLoaderRaisesException($arg) { $ua = new Zend_Http_UserAgent(); - $this->setExpectedException('Zend_Http_UserAgent_Exception', 'class or object'); + $this->expectException('Zend_Http_UserAgent_Exception'); + $this->expectExceptionMessage('class or object'); $ua->setPluginLoader('device', $arg); } public function testSpecifyingNonPluginLoaderObjectRaisesException() { $ua = new Zend_Http_UserAgent(); - $this->setExpectedException('Zend_Http_UserAgent_Exception', 'extending Zend_Loader_PluginLoader'); + $this->expectException('Zend_Http_UserAgent_Exception'); + $this->expectExceptionMessage('extending Zend_Loader_PluginLoader'); $ua->setPluginLoader('device', $this); } public function testSpecifyingInvalidTypeWhenSettingPluginLoaderRaisesException() { $ua = new Zend_Http_UserAgent(); - $this->setExpectedException('Zend_Http_UserAgent_Exception', 'plugin loader type'); + $this->expectException('Zend_Http_UserAgent_Exception'); + $this->expectExceptionMessage('plugin loader type'); $ua->setPluginLoader('__bogus__', new Zend_Loader_PluginLoader()); } @@ -425,7 +431,8 @@ public function testShouldRaiseExceptionOnInvalidDeviceClass() $this->config['user_agent'] = 'desktop'; $ua = new Zend_Http_UserAgent($this->config); - $this->setExpectedException('Zend_Http_UserAgent_Exception', 'Zend_Http_UserAgent_Device'); + $this->expectException('Zend_Http_UserAgent_Exception'); + $this->expectExceptionMessage('Zend_Http_UserAgent_Device'); $ua->getDevice(); } @@ -495,7 +502,8 @@ public function testServerIsImmutableOnceDeviceRetrieved() $userAgent = new Zend_Http_UserAgent($config); $device = $userAgent->getDevice(); - $this->setExpectedException('Zend_Http_UserAgent_Exception', 'immutable'); + $this->expectException('Zend_Http_UserAgent_Exception'); + $this->expectExceptionMessage('immutable'); $userAgent->setServerValue('HTTP_ACCEPT', 'application/json'); } @@ -505,7 +513,8 @@ public function testBrowserTypeIsImmutableOnceDeviceRetrieved() $userAgent = new Zend_Http_UserAgent($config); $device = $userAgent->getDevice(); - $this->setExpectedException('Zend_Http_UserAgent_Exception', 'immutable'); + $this->expectException('Zend_Http_UserAgent_Exception'); + $this->expectExceptionMessage('immutable'); $userAgent->setBrowserType('mobile'); } @@ -515,7 +524,8 @@ public function testHttpAcceptIsImmutableOnceDeviceRetrieved() $userAgent = new Zend_Http_UserAgent($config); $device = $userAgent->getDevice(); - $this->setExpectedException('Zend_Http_UserAgent_Exception', 'immutable'); + $this->expectException('Zend_Http_UserAgent_Exception'); + $this->expectExceptionMessage('immutable'); $userAgent->setHttpAccept('application/json'); } @@ -525,7 +535,8 @@ public function testUserAgentIsImmutableOnceDeviceIsRetrieved() $userAgent = new Zend_Http_UserAgent($config); $device = $userAgent->getDevice(); - $this->setExpectedException('Zend_Http_UserAgent_Exception', 'immutable'); + $this->expectException('Zend_Http_UserAgent_Exception'); + $this->expectExceptionMessage('immutable'); $userAgent->setUserAgent('userAgentTest'); } @@ -535,7 +546,8 @@ public function testStorageIsImmutableOnceDeviceIsRetrieved() $userAgent = new Zend_Http_UserAgent($config); $device = $userAgent->getDevice(); - $this->setExpectedException('Zend_Http_UserAgent_Exception', 'immutable'); + $this->expectException('Zend_Http_UserAgent_Exception'); + $this->expectExceptionMessage('immutable'); $userAgent->setStorage(new Zend_Http_UserAgent_Storage_NonPersistent()); } diff --git a/tests/Zend/Json/JsonXMLTest.php b/tests/Zend/Json/JsonXMLTest.php index db418e0153..9c26ebc418 100644 --- a/tests/Zend/Json/JsonXMLTest.php +++ b/tests/Zend/Json/JsonXMLTest.php @@ -36,7 +36,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Json */ -class Zend_Json_JsonXMLTest extends PHPUnit_Framework_TestCase +class Zend_Json_JsonXMLTest extends PHPUnit\Framework\TestCase { /** * xml2json Test 1 @@ -588,11 +588,12 @@ public function testUsingXML8() { /** * @group ZF-11385 - * @expectedException Zend_Json_Exception * @dataProvider providerNestingDepthIsHandledProperly */ public function testNestingDepthIsHandledProperlyWhenNestingDepthExceedsMaximum($xmlStringContents) - { + { + $this->expectException(\Zend_Json_Exception::class); + Zend_Json::$maxRecursionDepthAllowed = 1; Zend_Json::fromXml($xmlStringContents, true); } diff --git a/tests/Zend/Json/Server/CacheTest.php b/tests/Zend/Json/Server/CacheTest.php index 379d15cd19..f401c5bfff 100644 --- a/tests/Zend/Json/Server/CacheTest.php +++ b/tests/Zend/Json/Server/CacheTest.php @@ -34,7 +34,7 @@ * @group Zend_Json * @group Zend_Json_Server */ -class Zend_Json_Server_CacheTest extends PHPUnit_Framework_TestCase +class Zend_Json_Server_CacheTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Json/Server/ErrorTest.php b/tests/Zend/Json/Server/ErrorTest.php index f01dcd1d09..153ebc7466 100644 --- a/tests/Zend/Json/Server/ErrorTest.php +++ b/tests/Zend/Json/Server/ErrorTest.php @@ -34,7 +34,7 @@ * @group Zend_Json * @group Zend_Json_Server */ -class Zend_Json_Server_ErrorTest extends PHPUnit_Framework_TestCase +class Zend_Json_Server_ErrorTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -148,14 +148,14 @@ public function setupError() public function validateArray($error) { - $this->assertTrue(is_array($error)); - $this->assertTrue(array_key_exists('code', $error)); - $this->assertTrue(array_key_exists('message', $error)); - $this->assertTrue(array_key_exists('data', $error)); + $this->assertInternalType('array', $error); + $this->assertArrayHasKey('code', $error); + $this->assertArrayHasKey('message', $error); + $this->assertArrayHasKey('data', $error); - $this->assertTrue(is_int($error['code'])); - $this->assertTrue(is_string($error['message'])); - $this->assertTrue(is_array($error['data'])); + $this->assertInternalType('int', $error['code']); + $this->assertInternalType('string', $error['message']); + $this->assertInternalType('array', $error['data']); $this->assertEquals($this->error->getCode(), $error['code']); $this->assertEquals($this->error->getMessage(), $error['message']); diff --git a/tests/Zend/Json/Server/RequestTest.php b/tests/Zend/Json/Server/RequestTest.php index 8af4e8990f..cbd346ff8d 100644 --- a/tests/Zend/Json/Server/RequestTest.php +++ b/tests/Zend/Json/Server/RequestTest.php @@ -32,7 +32,7 @@ * @group Zend_Json * @group Zend_Json_Server */ -class Zend_Json_Server_RequestTest extends PHPUnit_Framework_TestCase +class Zend_Json_Server_RequestTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -58,7 +58,7 @@ public function tearDown() public function testShouldHaveNoParamsByDefault() { $params = $this->request->getParams(); - $this->assertTrue(empty($params)); + $this->assertEmpty($params); } public function testShouldBeAbleToAddAParamAsValueOnly() @@ -75,7 +75,7 @@ public function testShouldBeAbleToAddAParamAsKeyValuePair() $this->request->addParam('bar', 'foo'); $params = $this->request->getParams(); $this->assertEquals(1, count($params)); - $this->assertTrue(array_key_exists('foo', $params)); + $this->assertArrayHasKey('foo', $params); $this->assertEquals('bar', $params['foo']); } @@ -125,8 +125,8 @@ public function testShouldBeAbleToAddMixedIndexedAndNamedParamsAtOnce() $this->request->addParams($params); $test = $this->request->getParams(); $this->assertEquals(array_values($params), array_values($test)); - $this->assertTrue(array_key_exists('foo', $test)); - $this->assertTrue(array_key_exists('baz', $test)); + $this->assertArrayHasKey('foo', $test); + $this->assertArrayHasKey('baz', $test); $this->assertTrue(in_array('baz', $test)); } @@ -262,15 +262,15 @@ public function getOptions() public function validateJson($json, array $options) { $test = Zend_Json::decode($json); - $this->assertTrue(is_array($test), var_export($json, 1)); + $this->assertInternalType('array', $test, var_export($json, 1)); - $this->assertTrue(array_key_exists('id', $test)); - $this->assertTrue(array_key_exists('method', $test)); - $this->assertTrue(array_key_exists('params', $test)); + $this->assertArrayHasKey('id', $test); + $this->assertArrayHasKey('method', $test); + $this->assertArrayHasKey('params', $test); - $this->assertTrue(is_string($test['id'])); - $this->assertTrue(is_string($test['method'])); - $this->assertTrue(is_array($test['params'])); + $this->assertInternalType('string', $test['id']); + $this->assertInternalType('string', $test['method']); + $this->assertInternalType('array', $test['params']); $this->assertEquals($options['id'], $test['id']); $this->assertEquals($options['method'], $test['method']); diff --git a/tests/Zend/Json/Server/ResponseTest.php b/tests/Zend/Json/Server/ResponseTest.php index 6f53b10ba0..0336d21b52 100644 --- a/tests/Zend/Json/Server/ResponseTest.php +++ b/tests/Zend/Json/Server/ResponseTest.php @@ -35,7 +35,7 @@ * @group Zend_Json * @group Zend_Json_Server */ -class Zend_Json_Server_ResponseTest extends PHPUnit_Framework_TestCase +class Zend_Json_Server_ResponseTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -124,12 +124,12 @@ public function testResponseShouldBeAbleToCastToJson() $json = $this->response->toJson(); $test = Zend_Json::decode($json); - $this->assertTrue(is_array($test)); - $this->assertTrue(array_key_exists('result', $test)); + $this->assertInternalType('array', $test); + $this->assertArrayHasKey('result', $test); // assertion changed to false, because 'error' may not coexist with 'result' - $this->assertFalse(array_key_exists('error', $test), "'error' may not coexist with 'result'"); - $this->assertTrue(array_key_exists('id', $test)); - $this->assertTrue(array_key_exists('jsonrpc', $test)); + $this->assertArrayNotHasKey('error', $test, "'error' may not coexist with 'result'"); + $this->assertArrayHasKey('id', $test); + $this->assertArrayHasKey('jsonrpc', $test); $this->assertTrue($test['result']); $this->assertEquals($this->response->getId(), $test['id']); @@ -147,10 +147,10 @@ public function testResponseShouldCastErrorToJsonIfIsError() $json = $this->response->toJson(); $test = Zend_Json::decode($json); - $this->assertTrue(is_array($test)); - $this->assertFalse(array_key_exists('result', $test), "'result' may not coexist with 'error'"); - $this->assertTrue(array_key_exists('id', $test)); - $this->assertFalse(array_key_exists('jsonrpc', $test)); + $this->assertInternalType('array', $test); + $this->assertArrayNotHasKey('result', $test, "'result' may not coexist with 'error'"); + $this->assertArrayHasKey('id', $test); + $this->assertArrayNotHasKey('jsonrpc', $test); $this->assertEquals($this->response->getId(), $test['id']); $this->assertEquals($error->getCode(), $test['error']['code']); @@ -164,11 +164,11 @@ public function testCastToStringShouldCastToJson() $json = $this->response->__toString(); $test = Zend_Json::decode($json); - $this->assertTrue(is_array($test)); - $this->assertTrue(array_key_exists('result', $test)); - $this->assertFalse(array_key_exists('error', $test), "'error' may not coexist with 'result'"); - $this->assertTrue(array_key_exists('id', $test)); - $this->assertFalse(array_key_exists('jsonrpc', $test)); + $this->assertInternalType('array', $test); + $this->assertArrayHasKey('result', $test); + $this->assertArrayNotHasKey('error', $test, "'error' may not coexist with 'result'"); + $this->assertArrayHasKey('id', $test); + $this->assertArrayNotHasKey('jsonrpc', $test); $this->assertTrue($test['result']); $this->assertEquals($this->response->getId(), $test['id']); diff --git a/tests/Zend/Json/Server/Smd/ServiceTest.php b/tests/Zend/Json/Server/Smd/ServiceTest.php index 6d0aba2266..e20a4e6dc6 100644 --- a/tests/Zend/Json/Server/Smd/ServiceTest.php +++ b/tests/Zend/Json/Server/Smd/ServiceTest.php @@ -35,7 +35,7 @@ * @group Zend_Json * @group Zend_Json_Server */ -class Zend_Json_Server_Smd_ServiceTest extends PHPUnit_Framework_TestCase +class Zend_Json_Server_Smd_ServiceTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -142,7 +142,7 @@ public function testTargetAccessorsShouldNormalizeToString() $this->testTargetShouldBeNullInitially(); $this->service->setTarget(123); $value = $this->service->getTarget(); - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); $this->assertEquals((string) 123, $value); } @@ -169,7 +169,7 @@ public function testEnvelopeShouldOnlyComplyWithJsonRpc1And2() public function testShouldHaveNoParamsByDefault() { $params = $this->service->getParams(); - $this->assertTrue(empty($params)); + $this->assertEmpty($params); } public function testShouldBeAbleToAddParamsByTypeOnly() @@ -188,7 +188,7 @@ public function testParamsShouldAcceptArrayOfTypes() $params = $this->service->getParams(); $param = array_shift($params); $test = $param['type']; - $this->assertTrue(is_array($test)); + $this->assertInternalType('array', $test); $this->assertEquals($type, $test); } @@ -317,8 +317,8 @@ public function testTojsonShouldEmitJson() $json = $this->service->toJson(); $smd = Zend_Json::decode($json); - $this->assertTrue(array_key_exists('foo', $smd)); - $this->assertTrue(is_array($smd['foo'])); + $this->assertArrayHasKey('foo', $smd); + $this->assertInternalType('array', $smd['foo']); $this->validateSmdArray($smd['foo']); } @@ -337,13 +337,13 @@ public function setupSmdValidationObject() public function validateSmdArray(array $smd) { - $this->assertTrue(array_key_exists('transport', $smd)); + $this->assertArrayHasKey('transport', $smd); $this->assertEquals('POST', $smd['transport']); - $this->assertTrue(array_key_exists('envelope', $smd)); + $this->assertArrayHasKey('envelope', $smd); $this->assertEquals(Zend_Json_Server_Smd::ENV_JSONRPC_2, $smd['envelope']); - $this->assertTrue(array_key_exists('parameters', $smd)); + $this->assertArrayHasKey('parameters', $smd); $params = $smd['parameters']; $this->assertEquals(3, count($params)); $param = array_shift($params); @@ -353,7 +353,7 @@ public function validateSmdArray(array $smd) $param = array_shift($params); $this->assertEquals('object', $param['type']); - $this->assertTrue(array_key_exists('returns', $smd)); + $this->assertArrayHasKey('returns', $smd); $this->assertEquals('boolean', $smd['returns']); } } diff --git a/tests/Zend/Json/Server/SmdTest.php b/tests/Zend/Json/Server/SmdTest.php index 73fea05f0c..ed07d3e07e 100644 --- a/tests/Zend/Json/Server/SmdTest.php +++ b/tests/Zend/Json/Server/SmdTest.php @@ -35,7 +35,7 @@ * @group Zend_Json * @group Zend_Json_Server */ -class Zend_Json_Server_SmdTest extends PHPUnit_Framework_TestCase +class Zend_Json_Server_SmdTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -185,8 +185,8 @@ public function testDojoCompatibilityFlagShouldBeMutable() public function testServicesShouldBeEmptyByDefault() { $services = $this->smd->getServices(); - $this->assertTrue(is_array($services)); - $this->assertTrue(empty($services)); + $this->assertInternalType('array', $services); + $this->assertEmpty($services); } public function testShouldBeAbleToUseServiceObjectToAddService() @@ -310,11 +310,11 @@ public function testShouldBeAbleToCastToDojoArray() $this->smd->setOptions($options); $smd = $this->smd->toDojoArray(); - $this->assertTrue(is_array($smd)); + $this->assertInternalType('array', $smd); - $this->assertTrue(array_key_exists('SMDVersion', $smd)); - $this->assertTrue(array_key_exists('serviceType', $smd)); - $this->assertTrue(array_key_exists('methods', $smd)); + $this->assertArrayHasKey('SMDVersion', $smd); + $this->assertArrayHasKey('serviceType', $smd); + $this->assertArrayHasKey('methods', $smd); $this->assertEquals('.1', $smd['SMDVersion']); $this->assertEquals('JSON-RPC', $smd['serviceType']); @@ -322,21 +322,21 @@ public function testShouldBeAbleToCastToDojoArray() $this->assertEquals(2, count($methods)); $foo = array_shift($methods); - $this->assertTrue(array_key_exists('name', $foo)); - $this->assertTrue(array_key_exists('serviceURL', $foo)); - $this->assertTrue(array_key_exists('parameters', $foo)); + $this->assertArrayHasKey('name', $foo); + $this->assertArrayHasKey('serviceURL', $foo); + $this->assertArrayHasKey('parameters', $foo); $this->assertEquals('foo', $foo['name']); $this->assertEquals($this->smd->getTarget(), $foo['serviceURL']); - $this->assertTrue(is_array($foo['parameters'])); + $this->assertInternalType('array', $foo['parameters']); $this->assertEquals(1, count($foo['parameters'])); $bar = array_shift($methods); - $this->assertTrue(array_key_exists('name', $bar)); - $this->assertTrue(array_key_exists('serviceURL', $bar)); - $this->assertTrue(array_key_exists('parameters', $bar)); + $this->assertArrayHasKey('name', $bar); + $this->assertArrayHasKey('serviceURL', $bar); + $this->assertArrayHasKey('parameters', $bar); $this->assertEquals('bar', $bar['name']); $this->assertEquals($this->smd->getTarget(), $bar['serviceURL']); - $this->assertTrue(is_array($bar['parameters'])); + $this->assertInternalType('array', $bar['parameters']); $this->assertEquals(1, count($bar['parameters'])); } @@ -384,15 +384,15 @@ public function getOptions() public function validateServiceArray(array $smd, array $options) { - $this->assertTrue(is_array($smd)); + $this->assertInternalType('array', $smd); - $this->assertTrue(array_key_exists('SMDVersion', $smd)); - $this->assertTrue(array_key_exists('target', $smd)); - $this->assertTrue(array_key_exists('id', $smd)); - $this->assertTrue(array_key_exists('transport', $smd)); - $this->assertTrue(array_key_exists('envelope', $smd)); - $this->assertTrue(array_key_exists('contentType', $smd)); - $this->assertTrue(array_key_exists('services', $smd)); + $this->assertArrayHasKey('SMDVersion', $smd); + $this->assertArrayHasKey('target', $smd); + $this->assertArrayHasKey('id', $smd); + $this->assertArrayHasKey('transport', $smd); + $this->assertArrayHasKey('envelope', $smd); + $this->assertArrayHasKey('contentType', $smd); + $this->assertArrayHasKey('services', $smd); $this->assertEquals(Zend_Json_Server_Smd::SMD_VERSION, $smd['SMDVersion']); $this->assertEquals($options['target'], $smd['target']); @@ -402,7 +402,7 @@ public function validateServiceArray(array $smd, array $options) $this->assertEquals($this->smd->getContentType(), $smd['contentType']); $services = $smd['services']; $this->assertEquals(2, count($services)); - $this->assertTrue(array_key_exists('foo', $services)); - $this->assertTrue(array_key_exists('bar', $services)); + $this->assertArrayHasKey('foo', $services); + $this->assertArrayHasKey('bar', $services); } } diff --git a/tests/Zend/Json/ServerTest.php b/tests/Zend/Json/ServerTest.php index 7942b51262..394d799edc 100644 --- a/tests/Zend/Json/ServerTest.php +++ b/tests/Zend/Json/ServerTest.php @@ -37,7 +37,7 @@ * @group Zend_Json * @group Zend_Json_Server */ -class Zend_Json_ServerTest extends PHPUnit_Framework_TestCase +class Zend_Json_ServerTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -241,15 +241,15 @@ public function testSmdObjectRetrievedFromServerShouldReflectServerState() $this->assertEquals('This is a test service', $this->server->getDescription()); $services = $smd->getServices(); - $this->assertTrue(is_array($services)); + $this->assertInternalType('array', $services); $this->assertTrue(0 < count($services)); - $this->assertTrue(array_key_exists('strtolower', $services)); + $this->assertArrayHasKey('strtolower', $services); $methods = get_class_methods('Zend_Json_Server'); foreach ($methods as $method) { if ('_' == $method[0]) { continue; } - $this->assertTrue(array_key_exists($method, $services)); + $this->assertArrayHasKey($method, $services); } } @@ -286,7 +286,7 @@ public function testHandleValidMethodWithTooFewParamsShouldPassDefaultsOrNullsFo $this->assertTrue($response instanceof Zend_Json_Server_Response); $this->assertFalse($response->isError()); $result = $response->getResult(); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertTrue(3 == count($result)); $this->assertEquals('two', $result[1], var_export($result, 1)); $this->assertNull($result[2]); @@ -320,7 +320,7 @@ public function testHandleValidMethodWithTooManyParamsShouldWork() $this->assertTrue($response instanceof Zend_Json_Server_Response); $this->assertFalse($response->isError()); $result = $response->getResult(); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertTrue(3 == count($result)); $this->assertEquals('foo', $result[1]); $this->assertEquals('bar', $result[2]); @@ -341,7 +341,7 @@ public function testHandleShouldAllowNamedParamsInAnyOrder1() $response = $this->server->handle(); $result = $response->getResult(); - $this->assertTrue( is_array( $result ) ); + $this->assertInternalType( 'array', $result ); $this->assertEquals( 1, $result[0] ); $this->assertEquals( 2, $result[1] ); $this->assertEquals( 3, $result[2] ); @@ -362,7 +362,7 @@ public function testHandleShouldAllowNamedParamsInAnyOrder2() $response = $this->server->handle(); $result = $response->getResult(); - $this->assertTrue( is_array( $result ) ); + $this->assertInternalType( 'array', $result ); $this->assertEquals( 1, $result[0] ); $this->assertEquals( 2, $result[1] ); $this->assertEquals( 3, $result[2] ); @@ -417,9 +417,9 @@ public function testHandleShouldEmitResponseByDefault() $buffer = ob_get_clean(); $decoded = Zend_Json::decode($buffer); - $this->assertTrue(is_array($decoded)); - $this->assertTrue(array_key_exists('result', $decoded)); - $this->assertTrue(array_key_exists('id', $decoded)); + $this->assertInternalType('array', $decoded); + $this->assertArrayHasKey('result', $decoded); + $this->assertArrayHasKey('id', $decoded); $response = $this->server->getResponse(); $this->assertEquals($response->getResult(), $decoded['result']); @@ -436,7 +436,7 @@ public function testResponseShouldBeEmptyWhenRequestHasNoId() $this->server->handle(); $buffer = ob_get_clean(); - $this->assertTrue(empty($buffer)); + $this->assertEmpty($buffer); } public function testLoadFunctionsShouldLoadResultOfGetFunctions() diff --git a/tests/Zend/JsonTest.php b/tests/Zend/JsonTest.php index 711bc65223..9763f1a4c3 100644 --- a/tests/Zend/JsonTest.php +++ b/tests/Zend/JsonTest.php @@ -48,7 +48,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Json */ -class Zend_JsonTest extends PHPUnit_Framework_TestCase +class Zend_JsonTest extends PHPUnit\Framework\TestCase { private $_originalUseBuiltinEncoderDecoderValue; @@ -285,7 +285,7 @@ public function testObjectAsObject() $encoded = Zend_Json_Encoder::encode($value); $decoded = Zend_Json_Decoder::decode($encoded, Zend_Json::TYPE_OBJECT); - $this->assertTrue(is_object($decoded), 'Not decoded as an object'); + $this->assertInternalType('object', $decoded, 'Not decoded as an object'); $this->assertTrue($decoded instanceof StdClass, 'Not a StdClass object'); $this->assertTrue(isset($decoded->one), 'Expected property not set'); $this->assertEquals($value->one, $decoded->one, 'Unexpected value'); @@ -805,10 +805,11 @@ public function testBuiltinJsonEncoderWillProperlyEncodeSolidusInStringValues() /** * @group ZF-8918 - * @expectedException Zend_Json_Exception */ public function testDecodingInvalidJsonShouldRaiseAnException() { + $this->expectException(\Zend_Json_Exception::class); + Zend_Json::decode(' some string '); } diff --git a/tests/Zend/Layout/HelperTest.php b/tests/Zend/Layout/HelperTest.php index 684feba2cf..45c3c243c2 100644 --- a/tests/Zend/Layout/HelperTest.php +++ b/tests/Zend/Layout/HelperTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Layout */ -class Zend_Layout_HelperTest extends PHPUnit_Framework_TestCase +class Zend_Layout_HelperTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Layout/LayoutTest.php b/tests/Zend/Layout/LayoutTest.php index 307c6605b8..f0070abbd4 100644 --- a/tests/Zend/Layout/LayoutTest.php +++ b/tests/Zend/Layout/LayoutTest.php @@ -39,7 +39,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Layout */ -class Zend_Layout_LayoutTest extends PHPUnit_Framework_TestCase +class Zend_Layout_LayoutTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Layout/PluginTest.php b/tests/Zend/Layout/PluginTest.php index ef2992f5b3..10da175d9c 100644 --- a/tests/Zend/Layout/PluginTest.php +++ b/tests/Zend/Layout/PluginTest.php @@ -37,7 +37,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Layout */ -class Zend_Layout_PluginTest extends PHPUnit_Framework_TestCase +class Zend_Layout_PluginTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Ldap/AttributeTest.php b/tests/Zend/Ldap/AttributeTest.php index 0482d37ad1..8e9fc9cdd3 100644 --- a/tests/Zend/Ldap/AttributeTest.php +++ b/tests/Zend/Ldap/AttributeTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Ldap */ -class Zend_Ldap_AttributeTest extends PHPUnit_Framework_TestCase +class Zend_Ldap_AttributeTest extends PHPUnit\Framework\TestCase { protected function _assertLocalDateTimeString($timestamp, $value) { @@ -76,7 +76,7 @@ public function testGetNonExistentAttribute() $value=Zend_Ldap_Attribute::getAttribute($data, 'uid2', 0); $this->assertNull($value); $array=Zend_Ldap_Attribute::getAttribute($data, 'uid2'); - $this->assertTrue(is_array($array)); + $this->assertInternalType('array', $array); $this->assertEquals(0, count($array)); } @@ -93,7 +93,7 @@ public function testGetAttributeArray() { $data=array('uid' => array('value')); $value=Zend_Ldap_Attribute::getAttribute($data, 'uid'); - $this->assertTrue(is_array($value)); + $this->assertInternalType('array', $value); $this->assertEquals(1, count($value)); $this->assertContains('value', $value); } @@ -103,7 +103,7 @@ public function testSimpleSetAttribute() $data=array(); Zend_Ldap_Attribute::setAttribute($data, 'uid', 'new', false); $this->assertArrayHasKey('uid', $data); - $this->assertTrue(is_array($data['uid'])); + $this->assertInternalType('array', $data['uid']); $this->assertEquals(1, count($data['uid'])); $this->assertContains('new', $data['uid']); } @@ -113,7 +113,7 @@ public function testSimpleOverwriteAttribute() $data=array('uid' => array('old')); Zend_Ldap_Attribute::setAttribute($data, 'uid', 'new', false); $this->assertArrayHasKey('uid', $data); - $this->assertTrue(is_array($data['uid'])); + $this->assertInternalType('array', $data['uid']); $this->assertEquals(1, count($data['uid'])); $this->assertContains('new', $data['uid']); } @@ -123,7 +123,7 @@ public function testSimpleAppendAttribute() $data=array('uid' => array('old')); Zend_Ldap_Attribute::setAttribute($data, 'uid', 'new', true); $this->assertArrayHasKey('uid', $data); - $this->assertTrue(is_array($data['uid'])); + $this->assertInternalType('array', $data['uid']); $this->assertEquals(2, count($data['uid'])); $this->assertContains('old', $data['uid']); $this->assertContains('new', $data['uid']); @@ -150,7 +150,7 @@ public function testArraySetAttribute() $data=array(); Zend_Ldap_Attribute::setAttribute($data, 'uid', array('new1', 'new2'), false); $this->assertArrayHasKey('uid', $data); - $this->assertTrue(is_array($data['uid'])); + $this->assertInternalType('array', $data['uid']); $this->assertEquals(2, count($data['uid'])); $this->assertContains('new1', $data['uid']); $this->assertContains('new2', $data['uid']); @@ -163,7 +163,7 @@ public function testArrayOverwriteAttribute() $data=array('uid' => array('old')); Zend_Ldap_Attribute::setAttribute($data, 'uid', array('new1', 'new2'), false); $this->assertArrayHasKey('uid', $data); - $this->assertTrue(is_array($data['uid'])); + $this->assertInternalType('array', $data['uid']); $this->assertEquals(2, count($data['uid'])); $this->assertContains('new1', $data['uid']); $this->assertContains('new2', $data['uid']); @@ -176,7 +176,7 @@ public function testArrayAppendAttribute() $data=array('uid' => array('old')); Zend_Ldap_Attribute::setAttribute($data, 'uid', array('new1', 'new2'), true); $this->assertArrayHasKey('uid', $data); - $this->assertTrue(is_array($data['uid'])); + $this->assertInternalType('array', $data['uid']); $this->assertEquals(3, count($data['uid'])); $this->assertContains('old', $data['uid']); $this->assertContains('new1', $data['uid']); @@ -336,7 +336,7 @@ public function testRemoveAttributeValueSimple() $data=array('test' => array('value1', 'value2', 'value3', 'value3')); Zend_Ldap_Attribute::removeFromAttribute($data, 'test', 'value2'); $this->assertArrayHasKey('test', $data); - $this->assertTrue(is_array($data['test'])); + $this->assertInternalType('array', $data['test']); $this->assertEquals(3, count($data['test'])); $this->assertContains('value1', $data['test']); $this->assertContains('value3', $data['test']); @@ -348,7 +348,7 @@ public function testRemoveAttributeValueArray() $data=array('test' => array('value1', 'value2', 'value3', 'value3')); Zend_Ldap_Attribute::removeFromAttribute($data, 'test', array('value1', 'value2')); $this->assertArrayHasKey('test', $data); - $this->assertTrue(is_array($data['test'])); + $this->assertInternalType('array', $data['test']); $this->assertEquals(2, count($data['test'])); $this->assertContains('value3', $data['test']); $this->assertNotContains('value1', $data['test']); @@ -360,7 +360,7 @@ public function testRemoveAttributeMultipleValueSimple() $data=array('test' => array('value1', 'value2', 'value3', 'value3')); Zend_Ldap_Attribute::removeFromAttribute($data, 'test', 'value3'); $this->assertArrayHasKey('test', $data); - $this->assertTrue(is_array($data['test'])); + $this->assertInternalType('array', $data['test']); $this->assertEquals(2, count($data['test'])); $this->assertContains('value1', $data['test']); $this->assertContains('value2', $data['test']); @@ -372,7 +372,7 @@ public function testRemoveAttributeMultipleValueArray() $data=array('test' => array('value1', 'value2', 'value3', 'value3')); Zend_Ldap_Attribute::removeFromAttribute($data, 'test', array('value1', 'value3')); $this->assertArrayHasKey('test', $data); - $this->assertTrue(is_array($data['test'])); + $this->assertInternalType('array', $data['test']); $this->assertEquals(1, count($data['test'])); $this->assertContains('value2', $data['test']); $this->assertNotContains('value1', $data['test']); @@ -384,7 +384,7 @@ public function testRemoveAttributeValueBoolean() $data=array('test' => array('TRUE', 'FALSE', 'TRUE', 'FALSE')); Zend_Ldap_Attribute::removeFromAttribute($data, 'test', false); $this->assertArrayHasKey('test', $data); - $this->assertTrue(is_array($data['test'])); + $this->assertInternalType('array', $data['test']); $this->assertEquals(2, count($data['test'])); $this->assertContains('TRUE', $data['test']); $this->assertNotContains('FALSE', $data['test']); @@ -395,7 +395,7 @@ public function testRemoveAttributeValueInteger() $data=array('test' => array('1', '2', '3', '4')); Zend_Ldap_Attribute::removeFromAttribute($data, 'test', array(2, 4)); $this->assertArrayHasKey('test', $data); - $this->assertTrue(is_array($data['test'])); + $this->assertInternalType('array', $data['test']); $this->assertEquals(2, count($data['test'])); $this->assertContains('1', $data['test']); $this->assertContains('3', $data['test']); diff --git a/tests/Zend/Ldap/BindTest.php b/tests/Zend/Ldap/BindTest.php index a24e947069..eb6b8c0023 100644 --- a/tests/Zend/Ldap/BindTest.php +++ b/tests/Zend/Ldap/BindTest.php @@ -39,7 +39,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Ldap */ -class Zend_Ldap_BindTest extends PHPUnit_Framework_TestCase +class Zend_Ldap_BindTest extends PHPUnit\Framework\TestCase { protected $_options = null; protected $_principalName = TESTS_ZEND_LDAP_PRINCIPAL_NAME; @@ -263,7 +263,7 @@ public function testResourceIsAlwaysReturned() { $ldap = new Zend_Ldap($this->_options); $this->assertNotNull($ldap->getResource()); - $this->assertTrue(is_resource($ldap->getResource())); + $this->assertInternalType('resource', $ldap->getResource()); $this->assertEquals(TESTS_ZEND_LDAP_USERNAME, $ldap->getBoundUser()); } @@ -273,7 +273,8 @@ public function testResourceIsAlwaysReturned() public function testBindWithNullPassword() { $ldap = new Zend_Ldap($this->_options); - $this->setExpectedException('Zend_Ldap_Exception', 'Invalid credentials'); + $this->expectException('Zend_Ldap_Exception'); + $this->expectExceptionMessage('Invalid credentials'); $ldap->bind($this->_altUsername, "\0invalidpassword"); } } diff --git a/tests/Zend/Ldap/CanonTest.php b/tests/Zend/Ldap/CanonTest.php index 7646c5c736..74c6f4c1a8 100644 --- a/tests/Zend/Ldap/CanonTest.php +++ b/tests/Zend/Ldap/CanonTest.php @@ -39,7 +39,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Ldap */ -class Zend_Ldap_CanonTest extends PHPUnit_Framework_TestCase +class Zend_Ldap_CanonTest extends PHPUnit\Framework\TestCase { protected $_options = null; diff --git a/tests/Zend/Ldap/ConnectTest.php b/tests/Zend/Ldap/ConnectTest.php index c93e0320bf..df7bda65ec 100644 --- a/tests/Zend/Ldap/ConnectTest.php +++ b/tests/Zend/Ldap/ConnectTest.php @@ -39,7 +39,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Ldap */ -class Zend_Ldap_ConnectTest extends PHPUnit_Framework_TestCase +class Zend_Ldap_ConnectTest extends PHPUnit\Framework\TestCase { protected $_options = null; diff --git a/tests/Zend/Ldap/ConverterTest.php b/tests/Zend/Ldap/ConverterTest.php index 61b515decc..9e54b08a1c 100644 --- a/tests/Zend/Ldap/ConverterTest.php +++ b/tests/Zend/Ldap/ConverterTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Ldap */ -class Zend_Ldap_ConverterTest extends PHPUnit_Framework_TestCase +class Zend_Ldap_ConverterTest extends PHPUnit\Framework\TestCase { public function testAsc2hex32() { @@ -175,7 +175,7 @@ public function testFromLdapUnserialize ($expect, $convert) public function testFromLdapUnserializeThrowsException () { - $this->setExpectedException('UnexpectedValueException'); + $this->expectException('UnexpectedValueException'); Zend_Ldap_Converter::fromLdapUnserialize('--'); } @@ -191,7 +191,7 @@ public function testFromLdapBoolean() { $this->assertTrue(Zend_Ldap_Converter::fromLdapBoolean('TRUE')); $this->assertFalse(Zend_Ldap_Converter::fromLdapBoolean('FALSE')); - $this->setExpectedException('InvalidArgumentException'); + $this->expectException('InvalidArgumentException'); Zend_Ldap_Converter::fromLdapBoolean('test'); } @@ -222,11 +222,12 @@ public function fromLdapDateTimeProvider () } /** - * @expectedException InvalidArgumentException * @dataProvider fromLdapDateTimeException */ public function testFromLdapDateTimeThrowsException ($value) { + $this->expectException(\InvalidArgumentException::class); + Zend_Ldap_Converter::fromLdapDatetime($value); } diff --git a/tests/Zend/Ldap/CopyRenameTest.php b/tests/Zend/Ldap/CopyRenameTest.php index 488655b774..5134e529e3 100644 --- a/tests/Zend/Ldap/CopyRenameTest.php +++ b/tests/Zend/Ldap/CopyRenameTest.php @@ -146,50 +146,56 @@ public function testSimpleLeafMoveToSubtree() } /** - * @expectedException Zend_Ldap_Exception */ public function testRenameSourceNotExists() { + $this->expectException(\Zend_Ldap_Exception::class); + $this->_getLdap()->rename($this->_createDn('ou=DoesNotExist,'), $this->_newDn, false); } /** - * @expectedException Zend_Ldap_Exception */ public function testRenameTargetExists() { + $this->expectException(\Zend_Ldap_Exception::class); + $this->_getLdap()->rename($this->_orgDn, $this->_createDn('ou=Test1,'), false); } /** - * @expectedException Zend_Ldap_Exception */ public function testRenameTargetParentNotExists() { + $this->expectException(\Zend_Ldap_Exception::class); + $this->_getLdap()->rename($this->_orgDn, $this->_createDn('ou=Test1,ou=ParentDoesNotExist,'), false); } /** - * @expectedException Zend_Ldap_Exception */ public function testRenameEmulationSourceNotExists() { + $this->expectException(\Zend_Ldap_Exception::class); + $this->_getLdap()->rename($this->_createDn('ou=DoesNotExist,'), $this->_newDn, false, true); } /** - * @expectedException Zend_Ldap_Exception */ public function testRenameEmulationTargetExists() { + $this->expectException(\Zend_Ldap_Exception::class); + $this->_getLdap()->rename($this->_orgDn, $this->_createDn('ou=Test1,'), false, true); } /** - * @expectedException Zend_Ldap_Exception */ public function testRenameEmulationTargetParentNotExists() { + $this->expectException(\Zend_Ldap_Exception::class); + $this->_getLdap()->rename($this->_orgDn, $this->_createDn('ou=Test1,ou=ParentDoesNotExist,'), false, true); } diff --git a/tests/Zend/Ldap/CrudTest.php b/tests/Zend/Ldap/CrudTest.php index 3b7257900d..fa55f79c02 100644 --- a/tests/Zend/Ldap/CrudTest.php +++ b/tests/Zend/Ldap/CrudTest.php @@ -86,10 +86,11 @@ public function testUpdate() } /** - * @expectedException Zend_Ldap_Exception */ public function testIllegalAdd() { + $this->expectException(\Zend_Ldap_Exception::class); + $dn=$this->_createDn('ou=TestCreated,ou=Node2,'); $data=array( 'ou' => 'TestCreated', @@ -127,10 +128,11 @@ public function testIllegalUpdate() } /** - * @expectedException Zend_Ldap_Exception */ public function testIllegalDelete() { + $this->expectException(\Zend_Ldap_Exception::class); + $dn=$this->_createDn('ou=TestCreated,'); $this->_getLdap()->delete($dn); } @@ -245,20 +247,22 @@ public function testZeroValueMakesItThroughSanitationProcess() } /** - * @expectedException InvalidArgumentException */ public function testPrepareLdapEntryArrayArrayData() { + $this->expectException(\InvalidArgumentException::class); + $data=array( 'a1' => array(array('account'))); Zend_Ldap::prepareLdapEntryArray($data); } /** - * @expectedException InvalidArgumentException */ public function testPrepareLdapEntryArrayObjectData() { + $this->expectException(\InvalidArgumentException::class); + $class=new stdClass(); $class->a='b'; $data=array( diff --git a/tests/Zend/Ldap/Dn/CreationTest.php b/tests/Zend/Ldap/Dn/CreationTest.php index 627c9b0869..509ef72c36 100644 --- a/tests/Zend/Ldap/Dn/CreationTest.php +++ b/tests/Zend/Ldap/Dn/CreationTest.php @@ -34,7 +34,7 @@ * @group Zend_Ldap * @group Zend_Ldap_Dn */ -class Zend_Ldap_Dn_CreationTest extends PHPUnit_Framework_TestCase +class Zend_Ldap_Dn_CreationTest extends PHPUnit\Framework\TestCase { public function testDnCreation() { diff --git a/tests/Zend/Ldap/Dn/EscapingTest.php b/tests/Zend/Ldap/Dn/EscapingTest.php index 3ce9f8cf82..051308f52a 100644 --- a/tests/Zend/Ldap/Dn/EscapingTest.php +++ b/tests/Zend/Ldap/Dn/EscapingTest.php @@ -34,7 +34,7 @@ * @group Zend_Ldap * @group Zend_Ldap_Dn */ -class Zend_Ldap_Dn_EscapingTest extends PHPUnit_Framework_TestCase +class Zend_Ldap_Dn_EscapingTest extends PHPUnit\Framework\TestCase { public function testEscapeValues() { diff --git a/tests/Zend/Ldap/Dn/ExplodingTest.php b/tests/Zend/Ldap/Dn/ExplodingTest.php index 312a806f59..133d73e32c 100644 --- a/tests/Zend/Ldap/Dn/ExplodingTest.php +++ b/tests/Zend/Ldap/Dn/ExplodingTest.php @@ -34,7 +34,7 @@ * @group Zend_Ldap * @group Zend_Ldap_Dn */ -class Zend_Ldap_Dn_ExplodingTest extends PHPUnit_Framework_TestCase +class Zend_Ldap_Dn_ExplodingTest extends PHPUnit\Framework\TestCase { public static function explodeDnOperationProvider() { @@ -209,10 +209,11 @@ public function testExplodeDnWithMultiValuedRdn2() } /** - * @expectedException Zend_Ldap_Exception */ public function testCreateDnArrayIllegalDn() { + $this->expectException(\Zend_Ldap_Exception::class); + $dn='name1,cn=name2,dc=example,dc=org'; $dnArray=Zend_Ldap_Dn::explodeDn($dn); } diff --git a/tests/Zend/Ldap/Dn/ImplodingTest.php b/tests/Zend/Ldap/Dn/ImplodingTest.php index 8528203748..9ca44ed9ab 100644 --- a/tests/Zend/Ldap/Dn/ImplodingTest.php +++ b/tests/Zend/Ldap/Dn/ImplodingTest.php @@ -34,7 +34,7 @@ * @group Zend_Ldap * @group Zend_Ldap_Dn */ -class Zend_Ldap_Dn_ImplodingTest extends PHPUnit_Framework_TestCase +class Zend_Ldap_Dn_ImplodingTest extends PHPUnit\Framework\TestCase { public function testDnWithMultiValuedRdnRoundTrip() { @@ -118,19 +118,21 @@ public function testImplodeRdnMultiValuedRdnCaseFold() } /** - * @expectedException Zend_Ldap_Exception */ public function testImplodeRdnInvalidOne() { + $this->expectException(\Zend_Ldap_Exception::class); + $a=array('cn'); Zend_Ldap_Dn::implodeRdn($a); } /** - * @expectedException Zend_Ldap_Exception */ public function testImplodeRdnInvalidThree() { + $this->expectException(\Zend_Ldap_Exception::class); + $a=array('cn' => 'value', 'ou'); Zend_Ldap_Dn::implodeRdn($a); } diff --git a/tests/Zend/Ldap/Dn/MiscTest.php b/tests/Zend/Ldap/Dn/MiscTest.php index 9b3491f39d..210b51efcf 100644 --- a/tests/Zend/Ldap/Dn/MiscTest.php +++ b/tests/Zend/Ldap/Dn/MiscTest.php @@ -34,7 +34,7 @@ * @group Zend_Ldap * @group Zend_Ldap_Dn */ -class Zend_Ldap_Dn_MiscTest extends PHPUnit_Framework_TestCase +class Zend_Ldap_Dn_MiscTest extends PHPUnit\Framework\TestCase { public function testIsChildOfIllegalDn1() { diff --git a/tests/Zend/Ldap/Dn/ModificationTest.php b/tests/Zend/Ldap/Dn/ModificationTest.php index 9545b6d5e3..6aa054ac63 100644 --- a/tests/Zend/Ldap/Dn/ModificationTest.php +++ b/tests/Zend/Ldap/Dn/ModificationTest.php @@ -34,7 +34,7 @@ * @group Zend_Ldap * @group Zend_Ldap_Dn */ -class Zend_Ldap_Dn_ModificationTest extends PHPUnit_Framework_TestCase +class Zend_Ldap_Dn_ModificationTest extends PHPUnit\Framework\TestCase { public function testDnManipulationGet() { diff --git a/tests/Zend/Ldap/FilterTest.php b/tests/Zend/Ldap/FilterTest.php index c80f0464c0..b64dd8586c 100644 --- a/tests/Zend/Ldap/FilterTest.php +++ b/tests/Zend/Ldap/FilterTest.php @@ -41,7 +41,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Ldap */ -class Zend_Ldap_FilterTest extends PHPUnit_Framework_TestCase +class Zend_Ldap_FilterTest extends PHPUnit\Framework\TestCase { public function testFilterEscapeBasicOperation() { @@ -123,10 +123,11 @@ public function testNegate() } /** - * @expectedException Zend_Ldap_Filter_Exception */ public function testIllegalGroupingFilter() { + $this->expectException(\Zend_Ldap_Filter_Exception::class); + $data=array('a', 'b', 5); $f=new Zend_Ldap_Filter_And($data); } diff --git a/tests/Zend/Ldap/Node/OfflineTest.php b/tests/Zend/Ldap/Node/OfflineTest.php index 3c3816c55a..7c42821b50 100644 --- a/tests/Zend/Ldap/Node/OfflineTest.php +++ b/tests/Zend/Ldap/Node/OfflineTest.php @@ -73,30 +73,33 @@ public function testCreateFromArrayObjectDn() } /** - * @expectedException Zend_Ldap_Exception */ public function testCreateFromArrayMissingDn() { + $this->expectException(\Zend_Ldap_Exception::class); + $data=$this->_createTestArrayData(); unset($data['dn']); $node=Zend_Ldap_Node::fromArray($data); } /** - * @expectedException Zend_Ldap_Exception */ public function testCreateFromArrayIllegalDn() { + $this->expectException(\Zend_Ldap_Exception::class); + $data=$this->_createTestArrayData(); $data['dn']=5; $node=Zend_Ldap_Node::fromArray($data); } /** - * @expectedException Zend_Ldap_Exception */ public function testCreateFromArrayMalformedDn() { + $this->expectException(\Zend_Ldap_Exception::class); + $data=$this->_createTestArrayData(); $data['dn']='name1,cn=name2,dc=example,dc=org'; $node=Zend_Ldap_Node::fromArray($data); @@ -331,19 +334,21 @@ public function testOverloading() } /** - * @expectedException Zend_Ldap_Exception */ public function testIllegalAttributeAccessRdnAttributeSet() { + $this->expectException(\Zend_Ldap_Exception::class); + $node=$this->_createTestNode(); $node->cn='test'; } /** - * @expectedException Zend_Ldap_Exception */ public function testIllegalAttributeAccessDnSet() { + $this->expectException(\Zend_Ldap_Exception::class); + $node=$this->_createTestNode(); $node->dn='test'; } @@ -351,7 +356,7 @@ public function testIllegalAttributeAccessDnSet() public function testAttributeAccessDnGet() { $node=$this->_createTestNode(); - $this->assertTrue(is_string($node->dn)); + $this->assertInternalType('string', $node->dn); $this->assertEquals($node->getDn()->toString(), $node->dn); } @@ -621,7 +626,7 @@ public function testRdnAttributesHandleMultiValuedAttribute() $node = Zend_Ldap_Node::fromArray($data, true); $changedData = $node->getChangedData(); - $this->assertTrue(empty($changedData)); + $this->assertEmpty($changedData); } /** diff --git a/tests/Zend/Ldap/Node/OnlineTest.php b/tests/Zend/Ldap/Node/OnlineTest.php index e35d79c86d..0f20fe4289 100644 --- a/tests/Zend/Ldap/Node/OnlineTest.php +++ b/tests/Zend/Ldap/Node/OnlineTest.php @@ -104,10 +104,11 @@ public function testChangeReadOnlySystemAttributes() } /** - * @expectedException Zend_Ldap_Exception */ public function testLoadFromLdapIllegalEntry() { + $this->expectException(\Zend_Ldap_Exception::class); + $dn=$this->_createDn('ou=Test99,'); $node=Zend_Ldap_Node::fromLdap($dn, $this->_getLdap()); } @@ -136,10 +137,11 @@ public function testSerialize() } /** - * @expectedException Zend_Ldap_Exception */ public function testAttachToInvalidLdap() { + $this->expectException(\Zend_Ldap_Exception::class); + $data=array( 'dn' => 'ou=name,dc=example,dc=org', 'ou' => array('name'), @@ -199,10 +201,11 @@ public function testGetNode() } /** - * @expectedException Zend_Ldap_Exception */ public function testGetIllegalNode() { + $this->expectException(\Zend_Ldap_Exception::class); + $dn=$this->_createDn('ou=Test99,'); $node=$this->_getLdap()->getNode($dn); } @@ -277,10 +280,11 @@ public function testGetParent() } /** - * @expectedException Zend_Ldap_Exception */ public function testGetNonexistantParent() { + $this->expectException(\Zend_Ldap_Exception::class); + $node=$this->_getLdap()->getNode(TESTS_ZEND_LDAP_WRITEABLE_SUBTREE); $pnode=$node->getParent(); } diff --git a/tests/Zend/Ldap/Node/RootDseTest.php b/tests/Zend/Ldap/Node/RootDseTest.php index 0a1d020ebd..aa680152dc 100644 --- a/tests/Zend/Ldap/Node/RootDseTest.php +++ b/tests/Zend/Ldap/Node/RootDseTest.php @@ -49,39 +49,39 @@ public function testSupportCheckMethods() { $root=$this->_getLdap()->getRootDse(); - $this->assertTrue(is_bool($root->supportsSaslMechanism('GSSAPI'))); - $this->assertTrue(is_bool($root->supportsSaslMechanism(array('GSSAPI', 'DIGEST-MD5')))); - $this->assertTrue(is_bool($root->supportsVersion('3'))); - $this->assertTrue(is_bool($root->supportsVersion(3))); - $this->assertTrue(is_bool($root->supportsVersion(array('3', '2')))); - $this->assertTrue(is_bool($root->supportsVersion(array(3, 2)))); + $this->assertInternalType('bool', $root->supportsSaslMechanism('GSSAPI')); + $this->assertInternalType('bool', $root->supportsSaslMechanism(array('GSSAPI', 'DIGEST-MD5'))); + $this->assertInternalType('bool', $root->supportsVersion('3')); + $this->assertInternalType('bool', $root->supportsVersion(3)); + $this->assertInternalType('bool', $root->supportsVersion(array('3', '2'))); + $this->assertInternalType('bool', $root->supportsVersion(array(3, 2))); switch ($root->getServerType()) { case Zend_Ldap_Node_RootDse::SERVER_TYPE_ACTIVEDIRECTORY: - $this->assertTrue(is_bool($root->supportsControl('1.2.840.113556.1.4.319'))); - $this->assertTrue(is_bool($root->supportsControl(array('1.2.840.113556.1.4.319', - '1.2.840.113556.1.4.473')))); - $this->assertTrue(is_bool($root->supportsCapability('1.3.6.1.4.1.4203.1.9.1.1'))); - $this->assertTrue(is_bool($root->supportsCapability(array('1.3.6.1.4.1.4203.1.9.1.1', - '2.16.840.1.113730.3.4.18')))); - $this->assertTrue(is_bool($root->supportsPolicy('unknown'))); - $this->assertTrue(is_bool($root->supportsPolicy(array('unknown', 'unknown')))); + $this->assertInternalType('bool', $root->supportsControl('1.2.840.113556.1.4.319')); + $this->assertInternalType('bool', $root->supportsControl(array('1.2.840.113556.1.4.319', + '1.2.840.113556.1.4.473'))); + $this->assertInternalType('bool', $root->supportsCapability('1.3.6.1.4.1.4203.1.9.1.1')); + $this->assertInternalType('bool', $root->supportsCapability(array('1.3.6.1.4.1.4203.1.9.1.1', + '2.16.840.1.113730.3.4.18'))); + $this->assertInternalType('bool', $root->supportsPolicy('unknown')); + $this->assertInternalType('bool', $root->supportsPolicy(array('unknown', 'unknown'))); break; case Zend_Ldap_Node_RootDse::SERVER_TYPE_EDIRECTORY: - $this->assertTrue(is_bool($root->supportsExtension('1.3.6.1.4.1.1466.20037'))); - $this->assertTrue(is_bool($root->supportsExtension(array('1.3.6.1.4.1.1466.20037', - '1.3.6.1.4.1.4203.1.11.1')))); + $this->assertInternalType('bool', $root->supportsExtension('1.3.6.1.4.1.1466.20037')); + $this->assertInternalType('bool', $root->supportsExtension(array('1.3.6.1.4.1.1466.20037', + '1.3.6.1.4.1.4203.1.11.1'))); break; case Zend_Ldap_Node_RootDse::SERVER_TYPE_OPENLDAP: - $this->assertTrue(is_bool($root->supportsControl('1.3.6.1.4.1.4203.1.9.1.1'))); - $this->assertTrue(is_bool($root->supportsControl(array('1.3.6.1.4.1.4203.1.9.1.1', - '2.16.840.1.113730.3.4.18')))); - $this->assertTrue(is_bool($root->supportsExtension('1.3.6.1.4.1.1466.20037'))); - $this->assertTrue(is_bool($root->supportsExtension(array('1.3.6.1.4.1.1466.20037', - '1.3.6.1.4.1.4203.1.11.1')))); - $this->assertTrue(is_bool($root->supportsFeature('1.3.6.1.1.14'))); - $this->assertTrue(is_bool($root->supportsFeature(array('1.3.6.1.1.14', - '1.3.6.1.4.1.4203.1.5.1')))); + $this->assertInternalType('bool', $root->supportsControl('1.3.6.1.4.1.4203.1.9.1.1')); + $this->assertInternalType('bool', $root->supportsControl(array('1.3.6.1.4.1.4203.1.9.1.1', + '2.16.840.1.113730.3.4.18'))); + $this->assertInternalType('bool', $root->supportsExtension('1.3.6.1.4.1.1466.20037')); + $this->assertInternalType('bool', $root->supportsExtension(array('1.3.6.1.4.1.1466.20037', + '1.3.6.1.4.1.4203.1.11.1'))); + $this->assertInternalType('bool', $root->supportsFeature('1.3.6.1.1.14')); + $this->assertInternalType('bool', $root->supportsFeature(array('1.3.6.1.1.14', + '1.3.6.1.4.1.4203.1.5.1'))); break; } } @@ -90,38 +90,38 @@ public function testGetters() { $root=$this->_getLdap()->getRootDse(); - $this->assertTrue(is_array($root->getNamingContexts())); - $this->assertTrue(is_array($root->getSubschemaSubentry())); + $this->assertInternalType('array', $root->getNamingContexts()); + $this->assertInternalType('array', $root->getSubschemaSubentry()); switch ($root->getServerType()) { case Zend_Ldap_Node_RootDse::SERVER_TYPE_ACTIVEDIRECTORY: - $this->assertTrue(is_string($root->getConfigurationNamingContext())); - $this->assertTrue(is_string($root->getCurrentTime())); - $this->assertTrue(is_string($root->getDefaultNamingContext())); - $this->assertTrue(is_string($root->getDnsHostName())); - $this->assertTrue(is_string($root->getDomainControllerFunctionality())); - $this->assertTrue(is_string($root->getDomainFunctionality())); - $this->assertTrue(is_string($root->getDsServiceName())); - $this->assertTrue(is_string($root->getForestFunctionality())); - $this->assertTrue(is_string($root->getHighestCommittedUSN())); - $this->assertTrue(is_bool($root->getIsGlobalCatalogReady())); - $this->assertTrue(is_bool($root->getIsSynchronized())); - $this->assertTrue(is_string($root->getLdapServiceName())); - $this->assertTrue(is_string($root->getRootDomainNamingContext())); - $this->assertTrue(is_string($root->getSchemaNamingContext())); - $this->assertTrue(is_string($root->getServerName())); + $this->assertInternalType('string', $root->getConfigurationNamingContext()); + $this->assertInternalType('string', $root->getCurrentTime()); + $this->assertInternalType('string', $root->getDefaultNamingContext()); + $this->assertInternalType('string', $root->getDnsHostName()); + $this->assertInternalType('string', $root->getDomainControllerFunctionality()); + $this->assertInternalType('string', $root->getDomainFunctionality()); + $this->assertInternalType('string', $root->getDsServiceName()); + $this->assertInternalType('string', $root->getForestFunctionality()); + $this->assertInternalType('string', $root->getHighestCommittedUSN()); + $this->assertInternalType('bool', $root->getIsGlobalCatalogReady()); + $this->assertInternalType('bool', $root->getIsSynchronized()); + $this->assertInternalType('string', $root->getLdapServiceName()); + $this->assertInternalType('string', $root->getRootDomainNamingContext()); + $this->assertInternalType('string', $root->getSchemaNamingContext()); + $this->assertInternalType('string', $root->getServerName()); break; case Zend_Ldap_Node_RootDse::SERVER_TYPE_EDIRECTORY: - $this->assertTrue(is_string($root->getVendorName())); - $this->assertTrue(is_string($root->getVendorVersion())); - $this->assertTrue(is_string($root->getDsaName())); - $this->assertTrue(is_string($root->getStatisticsErrors())); - $this->assertTrue(is_string($root->getStatisticsSecurityErrors())); - $this->assertTrue(is_string($root->getStatisticsChainings())); - $this->assertTrue(is_string($root->getStatisticsReferralsReturned())); - $this->assertTrue(is_string($root->getStatisticsExtendedOps())); - $this->assertTrue(is_string($root->getStatisticsAbandonOps())); - $this->assertTrue(is_string($root->getStatisticsWholeSubtreeSearchOps())); + $this->assertInternalType('string', $root->getVendorName()); + $this->assertInternalType('string', $root->getVendorVersion()); + $this->assertInternalType('string', $root->getDsaName()); + $this->assertInternalType('string', $root->getStatisticsErrors()); + $this->assertInternalType('string', $root->getStatisticsSecurityErrors()); + $this->assertInternalType('string', $root->getStatisticsChainings()); + $this->assertInternalType('string', $root->getStatisticsReferralsReturned()); + $this->assertInternalType('string', $root->getStatisticsExtendedOps()); + $this->assertInternalType('string', $root->getStatisticsAbandonOps()); + $this->assertInternalType('string', $root->getStatisticsWholeSubtreeSearchOps()); break; case Zend_Ldap_Node_RootDse::SERVER_TYPE_OPENLDAP: $this->_assertNullOrString($root->getConfigContext()); @@ -135,42 +135,46 @@ protected function _assertNullOrString($value) if ($value===null) { $this->assertNull($value); } else { - $this->assertTrue(is_string($value)); + $this->assertInternalType('string', $value); } } /** - * @expectedException BadMethodCallException */ public function testSetterWillThrowException() { + $this->expectException(\BadMethodCallException::class); + $root=$this->_getLdap()->getRootDse(); $root->objectClass='illegal'; } /** - * @expectedException BadMethodCallException */ public function testOffsetSetWillThrowException() { + $this->expectException(\BadMethodCallException::class); + $root=$this->_getLdap()->getRootDse(); $root['objectClass']='illegal'; } /** - * @expectedException BadMethodCallException */ public function testUnsetterWillThrowException() { + $this->expectException(\BadMethodCallException::class); + $root=$this->_getLdap()->getRootDse(); unset($root->objectClass); } /** - * @expectedException BadMethodCallException */ public function testOffsetUnsetWillThrowException() { + $this->expectException(\BadMethodCallException::class); + $root=$this->_getLdap()->getRootDse(); unset($root['objectClass']); } diff --git a/tests/Zend/Ldap/Node/SchemaTest.php b/tests/Zend/Ldap/Node/SchemaTest.php index d6cb613d36..d1d99c3252 100644 --- a/tests/Zend/Ldap/Node/SchemaTest.php +++ b/tests/Zend/Ldap/Node/SchemaTest.php @@ -62,8 +62,8 @@ public function testSchemaNode() public function testGetters() { - $this->assertTrue(is_array($this->_schema->getAttributeTypes())); - $this->assertTrue(is_array($this->_schema->getObjectClasses())); + $this->assertInternalType('array', $this->_schema->getAttributeTypes()); + $this->assertInternalType('array', $this->_schema->getObjectClasses()); switch ($this->_getLdap()->getRootDse()->getServerType()) { case Zend_Ldap_Node_RootDse::SERVER_TYPE_ACTIVEDIRECTORY: @@ -71,42 +71,46 @@ public function testGetters() case Zend_Ldap_Node_RootDse::SERVER_TYPE_EDIRECTORY: break; case Zend_Ldap_Node_RootDse::SERVER_TYPE_OPENLDAP: - $this->assertTrue(is_array($this->_schema->getLdapSyntaxes())); - $this->assertTrue(is_array($this->_schema->getMatchingRules())); - $this->assertTrue(is_array($this->_schema->getMatchingRuleUse())); + $this->assertInternalType('array', $this->_schema->getLdapSyntaxes()); + $this->assertInternalType('array', $this->_schema->getMatchingRules()); + $this->assertInternalType('array', $this->_schema->getMatchingRuleUse()); break; } } /** - * @expectedException BadMethodCallException */ public function testSetterWillThrowException() { + $this->expectException(\BadMethodCallException::class); + $this->_schema->objectClass='illegal'; } /** - * @expectedException BadMethodCallException */ public function testOffsetSetWillThrowException() { + $this->expectException(\BadMethodCallException::class); + $this->_schema['objectClass']='illegal'; } /** - * @expectedException BadMethodCallException */ public function testUnsetterWillThrowException() { + $this->expectException(\BadMethodCallException::class); + unset($this->_schema->objectClass); } /** - * @expectedException BadMethodCallException */ public function testOffsetUnsetWillThrowException() { + $this->expectException(\BadMethodCallException::class); + unset($this->_schema['objectClass']); } diff --git a/tests/Zend/Ldap/OfflineTest.php b/tests/Zend/Ldap/OfflineTest.php index 16e5248a97..88de71c020 100644 --- a/tests/Zend/Ldap/OfflineTest.php +++ b/tests/Zend/Ldap/OfflineTest.php @@ -39,7 +39,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Ldap */ -class Zend_Ldap_OfflineTest extends PHPUnit_Framework_TestCase +class Zend_Ldap_OfflineTest extends PHPUnit\Framework\TestCase { /** * Zend_Ldap instance diff --git a/tests/Zend/Ldap/SearchTest.php b/tests/Zend/Ldap/SearchTest.php index 3169be4109..6c79ec6a13 100644 --- a/tests/Zend/Ldap/SearchTest.php +++ b/tests/Zend/Ldap/SearchTest.php @@ -74,10 +74,11 @@ public function testGetSingleIllegalEntry() } /** - * @expectedException Zend_Ldap_Exception */ public function testGetSingleIllegalEntryWithException() { + $this->expectException(\Zend_Ldap_Exception::class); + $dn=$this->_createDn('ou=Test99,'); $entry=$this->_getLdap()->getEntry($dn, array(), true); } @@ -139,15 +140,16 @@ public function testSearchEntriesShortcut() { $entries=$this->_getLdap()->searchEntries('(objectClass=organizationalUnit)', TESTS_ZEND_LDAP_WRITEABLE_SUBTREE, Zend_Ldap::SEARCH_SCOPE_SUB); - $this->assertTrue(is_array($entries)); + $this->assertInternalType('array', $entries); $this->assertEquals(9, count($entries)); } /** - * @expectedException Zend_Ldap_Exception */ public function testIllegalSearch() { + $this->expectException(\Zend_Ldap_Exception::class); + $dn=$this->_createDn('ou=Node2,'); $items=$this->_getLdap()->search('(objectClass=account)', $dn, Zend_Ldap::SEARCH_SCOPE_SUB); } @@ -238,7 +240,7 @@ public function testSearchEntriesShortcutWithDnObjectAndFilterObject() $filter=Zend_Ldap_Filter::equals('objectClass', 'organizationalUnit'); $entries=$this->_getLdap()->searchEntries($filter, $dn, Zend_Ldap::SEARCH_SCOPE_SUB); - $this->assertTrue(is_array($entries)); + $this->assertInternalType('array', $entries); $this->assertEquals(9, count($entries)); } @@ -457,7 +459,7 @@ public function testCallingCurrentOnIteratorReturnsFirstElement() TESTS_ZEND_LDAP_WRITEABLE_SUBTREE, Zend_Ldap::SEARCH_SCOPE_SUB); $this->assertEquals(TESTS_ZEND_LDAP_WRITEABLE_SUBTREE, $items->getInnerIterator()->key()); $current = $items->getInnerIterator()->current(); - $this->assertTrue(is_array($current)); + $this->assertInternalType('array', $current); $this->assertEquals(TESTS_ZEND_LDAP_WRITEABLE_SUBTREE, $current['dn']); } @@ -471,7 +473,7 @@ public function testCallingCurrentOnCollectionReturnsFirstElement() $this->assertEquals(0, $items->key()); $this->assertEquals(TESTS_ZEND_LDAP_WRITEABLE_SUBTREE, $items->dn()); $current = $items->current(); - $this->assertTrue(is_array($current)); + $this->assertInternalType('array', $current); $this->assertEquals(TESTS_ZEND_LDAP_WRITEABLE_SUBTREE, $current['dn']); } @@ -508,7 +510,7 @@ public function testResultIterationAfterCallingCurrent() $this->assertEquals(9, $items->count()); $this->assertEquals(TESTS_ZEND_LDAP_WRITEABLE_SUBTREE, $items->getInnerIterator()->key()); $current = $items->current(); - $this->assertTrue(is_array($current)); + $this->assertInternalType('array', $current); $this->assertEquals(TESTS_ZEND_LDAP_WRITEABLE_SUBTREE, $current['dn']); $i=0; diff --git a/tests/Zend/Ldap/TestCase.php b/tests/Zend/Ldap/TestCase.php index 7b08830329..0fcc0f0e58 100644 --- a/tests/Zend/Ldap/TestCase.php +++ b/tests/Zend/Ldap/TestCase.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Ldap */ -abstract class Zend_Ldap_TestCase extends PHPUnit_Framework_TestCase +abstract class Zend_Ldap_TestCase extends PHPUnit\Framework\TestCase { /** * @return array diff --git a/tests/Zend/Loader/Autoloader/ResourceTest.php b/tests/Zend/Loader/Autoloader/ResourceTest.php index d07ff4fa11..49a843f0a7 100644 --- a/tests/Zend/Loader/Autoloader/ResourceTest.php +++ b/tests/Zend/Loader/Autoloader/ResourceTest.php @@ -46,7 +46,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Loader */ -class Zend_Loader_Autoloader_ResourceTest extends PHPUnit_Framework_TestCase +class Zend_Loader_Autoloader_ResourceTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -93,26 +93,29 @@ public function tearDown() } /** - * @expectedException Zend_Loader_Exception */ public function testAutoloaderInstantiationShouldRaiseExceptionWithoutNamespace() { + $this->expectException(\Zend_Loader_Exception::class); + $loader = new Zend_Loader_Autoloader_Resource(array('basePath' => dirname(__FILE__))); } /** - * @expectedException Zend_Loader_Exception */ public function testAutoloaderInstantiationShouldRaiseExceptionWithoutBasePath() { + $this->expectException(\Zend_Loader_Exception::class); + $loader = new Zend_Loader_Autoloader_Resource(array('namespace' => 'Foo')); } /** - * @expectedException Zend_Loader_Exception */ public function testAutoloaderInstantiationShouldRaiseExceptionWhenInvalidOptionsTypeProvided() { + $this->expectException(\Zend_Loader_Exception::class); + $loader = new Zend_Loader_Autoloader_Resource('foo'); } @@ -135,23 +138,25 @@ public function testAutoloaderShouldAllowRetrievingBasePath() public function testNoResourceTypesShouldBeRegisteredByDefault() { $resourceTypes = $this->loader->getResourceTypes(); - $this->assertTrue(is_array($resourceTypes)); - $this->assertTrue(empty($resourceTypes)); + $this->assertInternalType('array', $resourceTypes); + $this->assertEmpty($resourceTypes); } /** - * @expectedException Zend_Loader_Exception */ public function testInitialResourceTypeDefinitionShouldRequireNamespace() { + $this->expectException(\Zend_Loader_Exception::class); + $this->loader->addResourceType('foo', 'foo'); } /** - * @expectedException Zend_Loader_Exception */ public function testPassingNonStringPathWhenAddingResourceTypeShouldRaiseAnException() { + $this->expectException(\Zend_Loader_Exception::class); + $this->loader->addResourceType('foo', array('foo'), 'Foo'); } @@ -159,7 +164,7 @@ public function testAutoloaderShouldAllowAddingArbitraryResourceTypes() { $this->loader->addResourceType('models', 'models', 'Model'); $resources = $this->loader->getResourceTypes(); - $this->assertTrue(array_key_exists('models', $resources)); + $this->assertArrayHasKey('models', $resources); $this->assertEquals($this->loader->getNamespace() . '_Model', $resources['models']['namespace']); $this->assertContains('/models', $resources['models']['path']); } @@ -185,18 +190,20 @@ public function testAutoloaderShouldSupportAddingMultipleResourceTypesAtOnce() } /** - * @expectedException Zend_Loader_Exception */ public function testAddingMultipleResourceTypesShouldRaiseExceptionWhenReceivingNonArrayItem() { + $this->expectException(\Zend_Loader_Exception::class); + $this->loader->addResourceTypes(array('foo' => 'bar')); } /** - * @expectedException Zend_Loader_Exception */ public function testAddingMultipleResourceTypesShouldRaiseExceptionWhenMissingResourcePath() { + $this->expectException(\Zend_Loader_Exception::class); + $this->loader->addResourceTypes(array('model' => array('namespace' => 'Model'))); } @@ -261,18 +268,20 @@ public function testSettingDefaultResourceTypeToUndefinedTypeShouldHaveNoEffect( } /** - * @expectedException Zend_Loader_Exception */ public function testLoadShouldRaiseExceptionWhenNotTypePassedAndNoDefaultSpecified() { + $this->expectException(\Zend_Loader_Exception::class); + $this->loader->load('Foo'); } /** - * @expectedException Zend_Loader_Exception */ public function testLoadShouldRaiseExceptionWhenResourceTypeDoesNotExist() { + $this->expectException(\Zend_Loader_Exception::class); + $this->loader->load('Foo', 'model'); } @@ -325,26 +334,29 @@ public function testPassingClassWithUnmatchedResourceTypeToAutoloadShouldReturnF } /** - * @expectedException Zend_Loader_Exception */ public function testMethodOverloadingShouldRaiseExceptionForNonGetterMethodCalls() { + $this->expectException(\Zend_Loader_Exception::class); + $this->loader->lalalalala(); } /** - * @expectedException Zend_Loader_Exception */ public function testMethodOverloadingShouldRaiseExceptionWhenRequestedResourceDoesNotExist() { + $this->expectException(\Zend_Loader_Exception::class); + $this->loader->getModel('Foo'); } /** - * @expectedException Zend_Loader_Exception */ public function testMethodOverloadingShouldRaiseExceptionWhenNoArgumentPassed() { + $this->expectException(\Zend_Loader_Exception::class); + $this->loader->addResourceTypes(array( 'model' => array('path' => 'models', 'namespace' => 'Model'), )); @@ -367,9 +379,9 @@ public function testAutoloaderShouldReceiveNamespaceWithTrailingUnderscore() { $al = Zend_Loader_Autoloader::getInstance(); $loaders = $al->getNamespaceAutoloaders('FooBar'); - $this->assertTrue(empty($loaders)); + $this->assertEmpty($loaders); $loaders = $al->getNamespaceAutoloaders('FooBar_'); - $this->assertFalse(empty($loaders)); + $this->assertNotEmpty($loaders); $loader = array_shift($loaders); $this->assertSame($this->loader, $loader); } diff --git a/tests/Zend/Loader/AutoloaderFactoryClassMapLoaderTest.php b/tests/Zend/Loader/AutoloaderFactoryClassMapLoaderTest.php index 2f9f90ee02..ada007df28 100644 --- a/tests/Zend/Loader/AutoloaderFactoryClassMapLoaderTest.php +++ b/tests/Zend/Loader/AutoloaderFactoryClassMapLoaderTest.php @@ -28,7 +28,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Loader */ -class Zend_Loader_AutoloaderFactoryClassMapLoaderTest extends PHPUnit_Framework_TestCase +class Zend_Loader_AutoloaderFactoryClassMapLoaderTest extends PHPUnit\Framework\TestCase { /** @@ -93,7 +93,7 @@ public function testAutoincluding() 'Zend_Loader_ClassMapAutoloader' ); $map = $loader->getAutoloadMap(); - $this->assertTrue(is_array($map)); + $this->assertInternalType('array', $map); $this->assertEquals(2, count($map)); } } diff --git a/tests/Zend/Loader/AutoloaderFactoryTest.php b/tests/Zend/Loader/AutoloaderFactoryTest.php index 1b405a11dc..ccb4925f61 100644 --- a/tests/Zend/Loader/AutoloaderFactoryTest.php +++ b/tests/Zend/Loader/AutoloaderFactoryTest.php @@ -27,11 +27,12 @@ require_once 'Zend/Loader/ClassMapAutoloader.php'; require_once 'Zend/Loader/StandardAutoloader.php'; // Trigger autoloader for these -class_exists('PHPUnit_Framework_Constraint_IsNull'); -class_exists('PHPUnit_Framework_Constraint_IsTrue'); +class_exists('PHPUnit\Framework\Constraint\IsNull'); +class_exists('PHPUnit\Framework\Constraint\IsTrue'); +class_exists('PHPUnit\Framework\Constraint\IsType'); class_exists('SebastianBergmann\Exporter\Exporter'); -class_exists('PHPUnit_Framework_Constraint_IsEqual'); -class_exists('PHPUnit_Framework_Constraint_Exception'); +class_exists('PHPUnit\Framework\Constraint\IsEqual'); +class_exists('PHPUnit\Framework\Constraint\Exception'); /** * @package Zend_Loader @@ -40,7 +41,7 @@ class_exists('PHPUnit_Framework_Constraint_Exception'); * @license http://framework.zend.com/license/new-bsd New BSD License * @group Loader */ -class Zend_Loader_AutoloaderFactoryTest extends PHPUnit_Framework_TestCase +class Zend_Loader_AutoloaderFactoryTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -90,17 +91,18 @@ public function testRegisteringValidMapFilePopulatesAutoloader() )); $loader = Zend_Loader_AutoloaderFactory::getRegisteredAutoloader('Zend_Loader_ClassMapAutoloader'); $map = $loader->getAutoloadMap(); - $this->assertTrue(is_array($map)); + $this->assertInternalType('array', $map); $this->assertEquals(2, count($map)); } /** * This tests checks if invalid autoloaders cause exceptions * - * @expectedException Zend_Loader_Exception_InvalidArgumentException */ public function testFactoryCatchesInvalidClasses() { + $this->expectException(\Zend_Loader_Exception_InvalidArgumentException::class); + if (!version_compare(PHP_VERSION, '5.3.7', '>=')) { $this->markTestSkipped('Cannot test invalid interface loader with versions less than 5.3.7'); } @@ -181,19 +183,19 @@ public function testDefaultAutoloader() public function testGetInvalidAutoloaderThrowsException() { - $this->setExpectedException('Zend_Loader_Exception_InvalidArgumentException'); + $this->expectException('Zend_Loader_Exception_InvalidArgumentException'); $loader = Zend_Loader_AutoloaderFactory::getRegisteredAutoloader('InvalidAutoloader'); } public function testFactoryWithInvalidArgumentThrowsException() { - $this->setExpectedException('Zend_Loader_Exception_InvalidArgumentException'); + $this->expectException('Zend_Loader_Exception_InvalidArgumentException'); Zend_Loader_AutoloaderFactory::factory('InvalidArgument'); } public function testFactoryWithInvalidAutoloaderClassThrowsException() { - $this->setExpectedException('Zend_Loader_Exception_InvalidArgumentException'); + $this->expectException('Zend_Loader_Exception_InvalidArgumentException'); Zend_Loader_AutoloaderFactory::factory(array('InvalidAutoloader' => array())); } diff --git a/tests/Zend/Loader/AutoloaderMultiVersionTest.php b/tests/Zend/Loader/AutoloaderMultiVersionTest.php index 26e119ca7d..16da1e68fb 100644 --- a/tests/Zend/Loader/AutoloaderMultiVersionTest.php +++ b/tests/Zend/Loader/AutoloaderMultiVersionTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Loader */ -class Zend_Loader_AutoloaderMultiVersionTest extends PHPUnit_Framework_TestCase +class Zend_Loader_AutoloaderMultiVersionTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -86,26 +86,29 @@ public function testZfPathIsNullByDefault() } /** - * @expectedException Zend_Loader_Exception */ public function testSettingZfPathFailsOnInvalidVersionString() { + $this->expectException(\Zend_Loader_Exception::class); + $this->autoloader->setZfPath($this->path, 'foo.bar.baz.bat'); } /** - * @expectedException Zend_Loader_Exception */ public function testSettingZfPathFailsWhenBasePathDoesNotExist() { + $this->expectException(\Zend_Loader_Exception::class); + $this->autoloader->setZfPath('foo.bar.baz.bat', 'latest'); } /** - * @expectedException Zend_Loader_Exception */ public function testSettingZfVersionFailsWhenNoValidInstallsDiscovered() { + $this->expectException(\Zend_Loader_Exception::class); + $this->autoloader->setZfPath(dirname(__FILE__), 'latest'); } diff --git a/tests/Zend/Loader/AutoloaderTest.php b/tests/Zend/Loader/AutoloaderTest.php index 522210f84e..06fb0c38e3 100644 --- a/tests/Zend/Loader/AutoloaderTest.php +++ b/tests/Zend/Loader/AutoloaderTest.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Loader */ -class Zend_Loader_AutoloaderTest extends PHPUnit_Framework_TestCase +class Zend_Loader_AutoloaderTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -119,10 +119,11 @@ public function testDefaultAutoloaderShouldBeMutable() } /** - * @expectedException Zend_Loader_Exception */ public function testSpecifyingInvalidDefaultAutoloaderShouldRaiseException() { + $this->expectException(\Zend_Loader_Exception::class); + $this->autoloader->setDefaultAutoloader(uniqid()); } @@ -149,10 +150,11 @@ public function testAutoloaderShouldAllowRegisteringMultipleNamespacesAtOnce() } /** - * @expectedException Zend_Loader_Exception */ public function testRegisteringInvalidNamespaceSpecShouldRaiseException() { + $this->expectException(\Zend_Loader_Exception::class); + $o = new stdClass; $this->autoloader->registerNamespace($o); } @@ -173,10 +175,11 @@ public function testAutoloaderShouldAllowUnregisteringMultipleNamespacesAtOnce() } /** - * @expectedException Zend_Loader_Exception */ public function testUnregisteringInvalidNamespaceSpecShouldRaiseException() { + $this->expectException(\Zend_Loader_Exception::class); + $o = new stdClass; $this->autoloader->unregisterNamespace($o); } @@ -294,9 +297,9 @@ public function testRemovingAutoloaderShouldAlsoRemoveAutoloaderFromNamespacedAu ->pushAutoloader('include'); $this->autoloader->removeAutoloader('require'); $test = $this->autoloader->getNamespaceAutoloaders('Foo'); - $this->assertTrue(empty($test)); + $this->assertEmpty($test); $test = $this->autoloader->getNamespaceAutoloaders('Bar'); - $this->assertTrue(empty($test)); + $this->assertEmpty($test); } public function testAutoloaderShouldAllowRemovingCallbackFromSpecifiedNamespaces() @@ -305,9 +308,9 @@ public function testAutoloaderShouldAllowRemovingCallbackFromSpecifiedNamespaces ->pushAutoloader('include'); $this->autoloader->removeAutoloader('require', 'Foo'); $test = $this->autoloader->getNamespaceAutoloaders('Foo'); - $this->assertTrue(empty($test)); + $this->assertEmpty($test); $test = $this->autoloader->getNamespaceAutoloaders('Bar'); - $this->assertFalse(empty($test)); + $this->assertNotEmpty($test); } public function testAutoloadShouldReturnFalseWhenNamespaceIsNotRegistered() diff --git a/tests/Zend/Loader/ClassMapAutoloaderTest.php b/tests/Zend/Loader/ClassMapAutoloaderTest.php index cdf1a794d8..e8754da96f 100644 --- a/tests/Zend/Loader/ClassMapAutoloaderTest.php +++ b/tests/Zend/Loader/ClassMapAutoloaderTest.php @@ -30,7 +30,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Loader */ -class Zend_Loader_ClassMapAutoloaderTest extends PHPUnit_Framework_TestCase +class Zend_Loader_ClassMapAutoloaderTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -69,13 +69,13 @@ public function tearDown() public function testRegisteringNonExistentAutoloadMapRaisesInvalidArgumentException() { $dir = dirname(__FILE__) . '__foobar__'; - $this->setExpectedException('Zend_Loader_Exception_InvalidArgumentException'); + $this->expectException('Zend_Loader_Exception_InvalidArgumentException'); $this->loader->registerAutoloadMap($dir); } public function testValidMapFileNotReturningMapRaisesInvalidArgumentException() { - $this->setExpectedException('Zend_Loader_Exception_InvalidArgumentException'); + $this->expectException('Zend_Loader_Exception_InvalidArgumentException'); $this->loader->registerAutoloadMap(dirname(__FILE__) . '/_files/badmap.php'); } @@ -103,13 +103,13 @@ public function testRegisteringValidMapFilePopulatesAutoloader() { $this->loader->registerAutoloadMap(dirname(__FILE__) . '/_files/goodmap.php'); $map = $this->loader->getAutoloadMap(); - $this->assertTrue(is_array($map)); + $this->assertInternalType('array', $map); $this->assertEquals(2, count($map)); // Just to make sure nothing changes after loading the same map again // (loadMapFromFile should just return) $this->loader->registerAutoloadMap(dirname(__FILE__) . '/_files/goodmap.php'); $map = $this->loader->getAutoloadMap(); - $this->assertTrue(is_array($map)); + $this->assertInternalType('array', $map); $this->assertEquals(2, count($map)); } @@ -123,7 +123,7 @@ public function testRegisteringMultipleMapsMergesThem() $this->loader->registerAutoloadMap(dirname(__FILE__) . '/_files/goodmap.php'); $test = $this->loader->getAutoloadMap(); - $this->assertTrue(is_array($test)); + $this->assertInternalType('array', $test); $this->assertEquals(3, count($test)); $this->assertNotEquals($map['Zend_Loader_StandardAutoloaderTest'], $test['Zend_Loader_StandardAutoloaderTest']); } @@ -137,7 +137,7 @@ public function testCanRegisterMultipleMapsAtOnce() $maps = array($map, dirname(__FILE__) . '/_files/goodmap.php'); $this->loader->registerAutoloadMaps($maps); $test = $this->loader->getAutoloadMap(); - $this->assertTrue(is_array($test)); + $this->assertInternalType('array', $test); $this->assertEquals(3, count($test)); } diff --git a/tests/Zend/Loader/PluginLoaderTest.php b/tests/Zend/Loader/PluginLoaderTest.php index e1634b6f5a..c8241fb1ba 100644 --- a/tests/Zend/Loader/PluginLoaderTest.php +++ b/tests/Zend/Loader/PluginLoaderTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Loader */ -class Zend_Loader_PluginLoaderTest extends PHPUnit_Framework_TestCase +class Zend_Loader_PluginLoaderTest extends PHPUnit\Framework\TestCase { protected $_includeCache; @@ -84,8 +84,8 @@ public function testAddPrefixPathNonStatically() ->addPrefixPath('Zend_Loader', $this->libPath . '/Zend'); $paths = $loader->getPaths(); $this->assertEquals(2, count($paths)); - $this->assertTrue(array_key_exists('Zend_View_', $paths)); - $this->assertTrue(array_key_exists('Zend_Loader_', $paths)); + $this->assertArrayHasKey('Zend_View_', $paths); + $this->assertArrayHasKey('Zend_Loader_', $paths); $this->assertEquals(1, count($paths['Zend_View_'])); $this->assertEquals(2, count($paths['Zend_Loader_'])); } @@ -97,7 +97,7 @@ public function testAddPrefixPathMultipleTimes() ->addPrefixPath('Zend_Loader', $this->libPath . '/Zend/Loader'); $paths = $loader->getPaths(); - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); $this->assertEquals(1, count($paths['Zend_Loader_'])); } @@ -110,8 +110,8 @@ public function testAddPrefixPathStatically() ->addPrefixPath('Zend_Loader', $this->libPath . '/Zend'); $paths = $loader->getPaths(); $this->assertEquals(2, count($paths)); - $this->assertTrue(array_key_exists('Zend_View_', $paths)); - $this->assertTrue(array_key_exists('Zend_Loader_', $paths)); + $this->assertArrayHasKey('Zend_View_', $paths); + $this->assertArrayHasKey('Zend_Loader_', $paths); $this->assertEquals(1, count($paths['Zend_View_'])); $this->assertEquals(2, count($paths['Zend_Loader_'])); } @@ -388,10 +388,11 @@ public function testPluginLoaderShouldAllowSpecifyingIncludeFileCache() /** * @group ZF-4670 - * @expectedException Zend_Loader_PluginLoader_Exception */ public function testPluginLoaderShouldThrowExceptionWhenPathDoesNotExist() { + $this->expectException(\Zend_Loader_PluginLoader_Exception::class); + $cacheFile = dirname(__FILE__) . '/_filesDoNotExist/includeCache.inc.php'; $this->testIncludeCacheShouldBeNullByDefault(); Zend_Loader_PluginLoader::setIncludeFileCache($cacheFile); @@ -414,7 +415,7 @@ public function testPluginLoaderShouldAppendIncludeCacheWhenClassIsFound() $paths = $loader->getPaths(); $this->fail(sprintf("Failed loading helper; paths: %s", var_export($paths, 1))); } - $this->assertTrue(file_exists($cacheFile)); + $this->assertFileExists($cacheFile); $cache = file_get_contents($cacheFile); $this->assertContains('CacheTest.php', $cache); } diff --git a/tests/Zend/Loader/StandardAutoloaderTest.php b/tests/Zend/Loader/StandardAutoloaderTest.php index d2d0ab64a4..54902b4d78 100644 --- a/tests/Zend/Loader/StandardAutoloaderTest.php +++ b/tests/Zend/Loader/StandardAutoloaderTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Loader */ -class Zend_Loader_StandardAutoloaderTest extends PHPUnit_Framework_TestCase +class Zend_Loader_StandardAutoloaderTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/LoaderTest.php b/tests/Zend/LoaderTest.php index a6d254ca20..1b120d3477 100644 --- a/tests/Zend/LoaderTest.php +++ b/tests/Zend/LoaderTest.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Loader */ -class Zend_LoaderTest extends PHPUnit_Framework_TestCase +class Zend_LoaderTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Locale/DataTest.php b/tests/Zend/Locale/DataTest.php index b354bcd6f6..89c7102318 100644 --- a/tests/Zend/Locale/DataTest.php +++ b/tests/Zend/Locale/DataTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Locale */ -class Zend_Locale_DataTest extends PHPUnit_Framework_TestCase +class Zend_Locale_DataTest extends PHPUnit\Framework\TestCase { private $_cache = null; @@ -74,7 +74,7 @@ public function testAliases() */ public function testNoLocale() { - $this->assertTrue(is_array(Zend_Locale_Data::getList(null, 'language'))); + $this->assertInternalType('array', Zend_Locale_Data::getList(null, 'language')); try { $value = Zend_Locale_Data::getList('nolocale','language'); @@ -84,7 +84,7 @@ public function testNoLocale() } $locale = new Zend_Locale('de'); - $this->assertTrue(is_array(Zend_Locale_Data::getList($locale, 'language'))); + $this->assertInternalType('array', Zend_Locale_Data::getList($locale, 'language')); } @@ -7212,8 +7212,8 @@ public function testUnit() public function testGetListNonexistentTypeReturnsEmptyArray() { $result = Zend_Locale_Data::getList('de_AT', 'type', 'ddd'); - $this->assertTrue(is_array($result)); - $this->assertTrue(empty($result)); + $this->assertInternalType('array', $result); + $this->assertEmpty($result); } /** @@ -7222,7 +7222,7 @@ public function testGetListNonexistentTypeReturnsEmptyArray() public function testGetListValidTypeReturnsNonemptyArray() { $result = Zend_Locale_Data::getList('de_AT', 'type', 'calendar'); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertTrue(count($result) > 0); } @@ -7232,7 +7232,7 @@ public function testGetListValidTypeReturnsNonemptyArray() public function testGetListEmptyTypeReturnsNonemptyArray() { $result = Zend_Locale_Data::getList('de_AT', 'type', ''); - $this->assertTrue(is_array($result)); + $this->assertInternalType('array', $result); $this->assertTrue(count($result) > 0); } diff --git a/tests/Zend/Locale/FormatTest.php b/tests/Zend/Locale/FormatTest.php index 6114f0f1aa..1388a9eb15 100644 --- a/tests/Zend/Locale/FormatTest.php +++ b/tests/Zend/Locale/FormatTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Locale */ -class Zend_Locale_FormatTest extends PHPUnit_Framework_TestCase +class Zend_Locale_FormatTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -335,7 +335,7 @@ public function testgetDate() } catch (Zend_Locale_Exception $e) { // success } - $this->assertTrue(is_array(Zend_Locale_Format::getDate('10.10.06'))); + $this->assertInternalType('array', Zend_Locale_Format::getDate('10.10.06')); $this->assertEquals(5, count(Zend_Locale_Format::getDate('10.10.06', array('date_format' => 'dd.MM.yy')))); $value = Zend_Locale_Format::getDate('10.11.6', array('date_format' => 'dd.MM.yy')); @@ -581,7 +581,7 @@ public function testgetDate() $this->assertEquals(11, $value['month']); $this->assertEquals(2006, $value['year'] ); - $this->assertTrue(is_array(Zend_Locale_Format::getTime('13:14:55', array('date_format' => 'HH:mm:ss')))); + $this->assertInternalType('array', Zend_Locale_Format::getTime('13:14:55', array('date_format' => 'HH:mm:ss'))); Zend_Locale_Format::setOptions(array('format_type' => 'iso')); $value = Zend_Locale_Format::getDate('2006 Nov. 10', array('locale' => 'de_AT', 'fix_date' => true)); @@ -608,12 +608,12 @@ public function testgetTime() // success } - $this->assertTrue(is_array(Zend_Locale_Format::getTime('13:14:55', array('date_format' => 'HH:mm:ss')))); + $this->assertInternalType('array', Zend_Locale_Format::getTime('13:14:55', array('date_format' => 'HH:mm:ss'))); $options = array('date_format' => 'h:mm:ss a', 'locale' => 'en'); - $this->assertTrue(is_array(Zend_Locale_Format::getTime('11:14:55 am', $options))); - $this->assertTrue(is_array(Zend_Locale_Format::getTime('12:14:55 am', $options))); - $this->assertTrue(is_array(Zend_Locale_Format::getTime('11:14:55 pm', $options))); - $this->assertTrue(is_array(Zend_Locale_Format::getTime('12:14:55 pm', $options))); + $this->assertInternalType('array', Zend_Locale_Format::getTime('11:14:55 am', $options)); + $this->assertInternalType('array', Zend_Locale_Format::getTime('12:14:55 am', $options)); + $this->assertInternalType('array', Zend_Locale_Format::getTime('11:14:55 pm', $options)); + $this->assertInternalType('array', Zend_Locale_Format::getTime('12:14:55 pm', $options)); try { $value = Zend_Locale_Format::getTime('13:14:55', array('date_format' => 'nocontent')); @@ -765,7 +765,7 @@ public function testToNumberFormat2() public function testSetOption() { $this->assertEquals(8, count(Zend_Locale_Format::setOptions(array('format_type' => 'php')))); - $this->assertTrue(is_array(Zend_Locale_Format::setOptions())); + $this->assertInternalType('array', Zend_Locale_Format::setOptions()); try { $this->assertTrue(Zend_Locale_Format::setOptions(array('format_type' => 'xxx'))); @@ -802,7 +802,7 @@ public function testSetOption() // success } try { - $this->assertFalse(is_array(Zend_Locale_Format::setOptions(array('fix_date' => 'no')))); + $this->assertNotInternalType('array', Zend_Locale_Format::setOptions(array('fix_date' => 'no'))); $this->fail("exception expected"); } catch (Zend_Locale_Exception $e) { // success @@ -813,13 +813,13 @@ public function testSetOption() $this->assertEquals($locale->toString(), $format['locale']); try { - $this->assertFalse(is_array(Zend_Locale_Format::setOptions(array('locale' => 'nolocale')))); + $this->assertNotInternalType('array', Zend_Locale_Format::setOptions(array('locale' => 'nolocale'))); $this->fail("exception expected"); } catch (Zend_Locale_Exception $e) { // success } try { - $this->assertFalse(is_array(Zend_Locale_Format::setOptions(array('precision' => 50)))); + $this->assertNotInternalType('array', Zend_Locale_Format::setOptions(array('precision' => 50))); $this->fail("exception expected"); } catch (Zend_Locale_Exception $e) { // success @@ -986,12 +986,12 @@ public function testgetDateTime() // success } - $this->assertTrue(is_array(Zend_Locale_Format::getDateTime('10.11.2006 13:14:55', array('date_format' => 'dd.MM.yyyy HH:mm:ss')))); + $this->assertInternalType('array', Zend_Locale_Format::getDateTime('10.11.2006 13:14:55', array('date_format' => 'dd.MM.yyyy HH:mm:ss'))); $options = array('date_format' => 'dd.MM.yy h:mm:ss a', 'locale' => 'en'); - $this->assertTrue(is_array(Zend_Locale_Format::getDateTime('15.10.09 11:14:55 am', $options))); - $this->assertTrue(is_array(Zend_Locale_Format::getDateTime('15.10.09 12:14:55 am', $options))); - $this->assertTrue(is_array(Zend_Locale_Format::getDateTime('15.10.09 11:14:55 pm', $options))); - $this->assertTrue(is_array(Zend_Locale_Format::getDateTime('15.10.09 12:14:55 pm', $options))); + $this->assertInternalType('array', Zend_Locale_Format::getDateTime('15.10.09 11:14:55 am', $options)); + $this->assertInternalType('array', Zend_Locale_Format::getDateTime('15.10.09 12:14:55 am', $options)); + $this->assertInternalType('array', Zend_Locale_Format::getDateTime('15.10.09 11:14:55 pm', $options)); + $this->assertInternalType('array', Zend_Locale_Format::getDateTime('15.10.09 12:14:55 pm', $options)); try { $value = Zend_Locale_Format::getDateTime('15.10.09 13:14:55', array('date_format' => 'nocontent')); @@ -1120,7 +1120,7 @@ public function testCheckDateFormatDoesNotEmitNoticeWhenNoOptionsAreNotProvided( Zend_Locale_Format::setOptions(array('date_format' => 'yyyy-MM-dd')); $this->assertTrue(Zend_Locale_Format::checkDateFormat('2011-10-21', array())); - } catch ( PHPUnit_Framework_Error_Notice $ex ) { + } catch ( PHPUnit\Framework\Error\Notice $ex ) { $this->fail('Zend_Locale_Format::checkDateFormat emitted unexpected E_NOTICE'); } } diff --git a/tests/Zend/Locale/MathTest.php b/tests/Zend/Locale/MathTest.php index 2c0b7302af..fc8f7ff0c7 100644 --- a/tests/Zend/Locale/MathTest.php +++ b/tests/Zend/Locale/MathTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Locale */ -class Zend_Locale_MathTest extends PHPUnit_Framework_TestCase +class Zend_Locale_MathTest extends PHPUnit\Framework\TestCase { private static $savedLocale = 'C'; diff --git a/tests/Zend/LocaleTest.php b/tests/Zend/LocaleTest.php index e60639db45..481100d57d 100644 --- a/tests/Zend/LocaleTest.php +++ b/tests/Zend/LocaleTest.php @@ -36,7 +36,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Locale */ -class Zend_LocaleTest extends PHPUnit_Framework_TestCase +class Zend_LocaleTest extends PHPUnit\Framework\TestCase { private $_cache = null; private $_locale = null; @@ -186,16 +186,16 @@ public function testgetOrder() Zend_LocaleTestHelper::setDefault('de'); $value = new Zend_LocaleTestHelper(); $default = $value->getOrder(); - $this->assertTrue(array_key_exists('de', $default)); + $this->assertArrayHasKey('de', $default); $default = $value->getOrder(Zend_Locale::BROWSER); - $this->assertTrue(is_array($default)); + $this->assertInternalType('array', $default); $default = $value->getOrder(Zend_Locale::ENVIRONMENT); - $this->assertTrue(is_array($default)); + $this->assertInternalType('array', $default); $default = $value->getOrder(Zend_Locale::ZFDEFAULT); - $this->assertTrue(is_array($default)); + $this->assertInternalType('array', $default); } /** @@ -225,7 +225,7 @@ public function testEnvironment() { $value = new Zend_LocaleTestHelper(); $default = $value->getEnvironment(); - $this->assertTrue(is_array($default)); + $this->assertInternalType('array', $default); } /** @@ -236,7 +236,7 @@ public function testBrowser() { $value = new Zend_LocaleTestHelper(); $default = $value->getBrowser(); - $this->assertTrue(is_array($default)); + $this->assertInternalType('array', $default); } /** @@ -267,11 +267,11 @@ public function testsetLocale() $this->assertEquals('root', $value->toString()); $value->setLocale('auto'); - $this->assertTrue(is_string($value->toString())); + $this->assertInternalType('string', $value->toString()); try { $value->setLocale('browser'); - $this->assertTrue(is_string($value->toString())); + $this->assertInternalType('string', $value->toString()); } catch (Zend_Locale_Exception $e) { // ignore environments where the locale can not be detected $this->assertContains('Autodetection', $e->getMessage()); @@ -279,7 +279,7 @@ public function testsetLocale() try { $value->setLocale('environment'); - $this->assertTrue(is_string($value->toString())); + $this->assertInternalType('string', $value->toString()); } catch (Zend_Locale_Exception $e) { // ignore environments where the locale can not be detected $this->assertContains('Autodetection', $e->getMessage()); @@ -294,9 +294,9 @@ public function testgetLanguageTranslationList() { set_error_handler(array($this, 'errorHandlerIgnore')); $list = Zend_LocaleTestHelper::getLanguageTranslationList(); - $this->assertTrue(is_array($list)); + $this->assertInternalType('array', $list); $list = Zend_LocaleTestHelper::getLanguageTranslationList('de'); - $this->assertTrue(is_array($list)); + $this->assertInternalType('array', $list); restore_error_handler(); } @@ -310,7 +310,7 @@ public function testgetLanguageTranslation() $this->assertEquals('Deutsch', Zend_LocaleTestHelper::getLanguageTranslation('de', 'de_AT')); $this->assertEquals('German', Zend_LocaleTestHelper::getLanguageTranslation('de', 'en')); $this->assertFalse(Zend_LocaleTestHelper::getLanguageTranslation('xyz')); - $this->assertTrue(is_string(Zend_LocaleTestHelper::getLanguageTranslation('de', 'auto'))); + $this->assertInternalType('string', Zend_LocaleTestHelper::getLanguageTranslation('de', 'auto')); restore_error_handler(); } @@ -322,10 +322,10 @@ public function testgetScriptTranslationList() { set_error_handler(array($this, 'errorHandlerIgnore')); $list = Zend_LocaleTestHelper::getScriptTranslationList(); - $this->assertTrue(is_array($list)); + $this->assertInternalType('array', $list); $list = Zend_LocaleTestHelper::getScriptTranslationList('de'); - $this->assertTrue(is_array($list)); + $this->assertInternalType('array', $list); restore_error_handler(); } @@ -350,7 +350,7 @@ public function testgetCountryTranslationList() { set_error_handler(array($this, 'errorHandlerIgnore')); $list = Zend_LocaleTestHelper::getCountryTranslationList(); - $this->assertTrue(is_array($list)); + $this->assertInternalType('array', $list); $list = Zend_LocaleTestHelper::getCountryTranslationList('de'); $this->assertEquals("Vereinigte Staaten", $list['US']); @@ -378,10 +378,10 @@ public function testgetTerritoryTranslationList() { set_error_handler(array($this, 'errorHandlerIgnore')); $list = Zend_LocaleTestHelper::getTerritoryTranslationList(); - $this->assertTrue(is_array($list)); + $this->assertInternalType('array', $list); $list = Zend_LocaleTestHelper::getTerritoryTranslationList('de'); - $this->assertTrue(is_array($list)); + $this->assertInternalType('array', $list); restore_error_handler(); } @@ -395,7 +395,7 @@ public function testgetTerritoryTranslation() $this->assertEquals('Afrika', Zend_LocaleTestHelper::getTerritoryTranslation('002', 'de_AT')); $this->assertEquals('Africa', Zend_LocaleTestHelper::getTerritoryTranslation('002', 'en')); $this->assertFalse(Zend_LocaleTestHelper::getTerritoryTranslation('xyz')); - $this->assertTrue(is_string(Zend_LocaleTestHelper::getTerritoryTranslation('002', 'auto'))); + $this->assertInternalType('string', Zend_LocaleTestHelper::getTerritoryTranslation('002', 'auto')); restore_error_handler(); } @@ -603,16 +603,16 @@ public function testgetQuestion() $list = Zend_LocaleTestHelper::getQuestion('de'); $this->assertEquals('ja', $list['yes']); - $this->assertTrue(is_array(Zend_LocaleTestHelper::getQuestion('auto'))); + $this->assertInternalType('array', Zend_LocaleTestHelper::getQuestion('auto')); try { - $this->assertTrue(is_array(Zend_LocaleTestHelper::getQuestion('browser'))); + $this->assertInternalType('array', Zend_LocaleTestHelper::getQuestion('browser')); } catch (Zend_Locale_Exception $e) { $this->assertContains('Autodetection', $e->getMessage()); } try { - $this->assertTrue(is_array(Zend_LocaleTestHelper::getQuestion('environment'))); + $this->assertInternalType('array', Zend_LocaleTestHelper::getQuestion('environment')); } catch (Zend_Locale_Exception $e) { $this->assertContains('ocale', $e->getMessage()); } @@ -652,7 +652,7 @@ public function testgetHttpCharset() putenv("HTTP_ACCEPT_CHARSET="); $value = new Zend_LocaleTestHelper(); $list = $value->getHttpCharset(); - $this->assertTrue(empty($list)); + $this->assertEmpty($list); Zend_LocaleTestHelper::resetObject(); putenv("HTTP_ACCEPT_CHARSET=,iso-8859-1, utf-8, utf-16, *;q=0.1"); @@ -692,10 +692,10 @@ public function testIsLocale() $this->assertFalse(Zend_LocaleTestHelper::isLocale(1234)); $this->assertFalse(Zend_LocaleTestHelper::isLocale('', true)); $this->assertFalse(Zend_LocaleTestHelper::isLocale('', false)); - $this->assertTrue(is_string(Zend_LocaleTestHelper::isLocale('auto'))); - $this->assertTrue(is_string(Zend_LocaleTestHelper::isLocale('browser'))); + $this->assertInternalType('string', Zend_LocaleTestHelper::isLocale('auto')); + $this->assertInternalType('string', Zend_LocaleTestHelper::isLocale('browser')); if (count(Zend_Locale::getEnvironment()) != 0) { - $this->assertTrue(is_string(Zend_LocaleTestHelper::isLocale('environment'))); + $this->assertInternalType('string', Zend_LocaleTestHelper::isLocale('environment')); } restore_error_handler(); } @@ -706,7 +706,7 @@ public function testIsLocale() */ public function testGetLocaleList() { - $this->assertTrue(is_array(Zend_LocaleTestHelper::getLocaleList())); + $this->assertInternalType('array', Zend_LocaleTestHelper::getLocaleList()); } /** @@ -766,12 +766,12 @@ public function testsetDefault() */ public function testgetDefault() { Zend_LocaleTestHelper::setDefault('de'); - $this->assertTrue(array_key_exists('de', Zend_LocaleTestHelper::getDefault())); + $this->assertArrayHasKey('de', Zend_LocaleTestHelper::getDefault()); // compatibility tests set_error_handler(array($this, 'errorHandlerIgnore')); Zend_LocaleTestHelper::$compatibilityMode = true; - $this->assertTrue(array_key_exists('de', Zend_LocaleTestHelper::getDefault(Zend_Locale::BROWSER))); + $this->assertArrayHasKey('de', Zend_LocaleTestHelper::getDefault(Zend_Locale::BROWSER)); restore_error_handler(); } @@ -796,7 +796,7 @@ public function testCaching() */ public function testFindingTheProperLocale() { - $this->assertTrue(is_string(Zend_LocaleTestHelper::findLocale())); + $this->assertInternalType('string', Zend_LocaleTestHelper::findLocale()); $this->assertEquals('de', Zend_LocaleTestHelper::findLocale('de')); $this->assertEquals('de', Zend_LocaleTestHelper::findLocale('de_XX')); diff --git a/tests/Zend/Log/Filter/ChainingTest.php b/tests/Zend/Log/Filter/ChainingTest.php index f9454aeb88..2745a3e683 100644 --- a/tests/Zend/Log/Filter/ChainingTest.php +++ b/tests/Zend/Log/Filter/ChainingTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Log */ -class Zend_Log_Filter_ChainingTest extends PHPUnit_Framework_TestCase +class Zend_Log_Filter_ChainingTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Log/Filter/MessageTest.php b/tests/Zend/Log/Filter/MessageTest.php index e0b37e41d3..6dce4a755f 100644 --- a/tests/Zend/Log/Filter/MessageTest.php +++ b/tests/Zend/Log/Filter/MessageTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Log */ -class Zend_Log_Filter_MessageTest extends PHPUnit_Framework_TestCase +class Zend_Log_Filter_MessageTest extends PHPUnit\Framework\TestCase { public function testMessageFilterRecognizesInvalidRegularExpression() { diff --git a/tests/Zend/Log/Filter/PriorityTest.php b/tests/Zend/Log/Filter/PriorityTest.php index 09c3ce2a0c..12b36eda0f 100644 --- a/tests/Zend/Log/Filter/PriorityTest.php +++ b/tests/Zend/Log/Filter/PriorityTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Log */ -class Zend_Log_Filter_PriorityTest extends PHPUnit_Framework_TestCase +class Zend_Log_Filter_PriorityTest extends PHPUnit\Framework\TestCase { public function testComparisonDefaultsToLessThanOrEqual() { diff --git a/tests/Zend/Log/Filter/SuppressTest.php b/tests/Zend/Log/Filter/SuppressTest.php index 1450f97790..3f76fe147a 100644 --- a/tests/Zend/Log/Filter/SuppressTest.php +++ b/tests/Zend/Log/Filter/SuppressTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Log */ -class Zend_Log_Filter_SuppressTest extends PHPUnit_Framework_TestCase +class Zend_Log_Filter_SuppressTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Log/Formatter/FirebugTest.php b/tests/Zend/Log/Formatter/FirebugTest.php index f0d484ed8b..d9f807a94d 100644 --- a/tests/Zend/Log/Formatter/FirebugTest.php +++ b/tests/Zend/Log/Formatter/FirebugTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Log */ -class Zend_Log_Formatter_FirebugTest extends PHPUnit_Framework_TestCase +class Zend_Log_Formatter_FirebugTest extends PHPUnit\Framework\TestCase { public function testFormat() { diff --git a/tests/Zend/Log/Formatter/SimpleTest.php b/tests/Zend/Log/Formatter/SimpleTest.php index 0da6fb0727..fb2517259e 100644 --- a/tests/Zend/Log/Formatter/SimpleTest.php +++ b/tests/Zend/Log/Formatter/SimpleTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Log */ -class Zend_Log_Formatter_SimpleTest extends PHPUnit_Framework_TestCase +class Zend_Log_Formatter_SimpleTest extends PHPUnit\Framework\TestCase { public function testConstructorThrowsOnBadFormatString() { diff --git a/tests/Zend/Log/Formatter/XmlTest.php b/tests/Zend/Log/Formatter/XmlTest.php index 9caf7a65dd..c603af94b0 100644 --- a/tests/Zend/Log/Formatter/XmlTest.php +++ b/tests/Zend/Log/Formatter/XmlTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Log */ -class Zend_Log_Formatter_XmlTest extends PHPUnit_Framework_TestCase +class Zend_Log_Formatter_XmlTest extends PHPUnit\Framework\TestCase { public function testDefaultFormat() { diff --git a/tests/Zend/Log/LogTest.php b/tests/Zend/Log/LogTest.php index 6c8fc1812e..fd8d079a71 100644 --- a/tests/Zend/Log/LogTest.php +++ b/tests/Zend/Log/LogTest.php @@ -40,7 +40,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Log */ -class Zend_Log_LogTest extends PHPUnit_Framework_TestCase +class Zend_Log_LogTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -201,7 +201,7 @@ public function testLogWritesAndOverwritesExtraFields() { $this->assertEquals(1, count($mock->events)); $event = array_shift($mock->events); - $this->assertTrue(array_key_exists($field, $event)); + $this->assertArrayHasKey($field, $event); $this->assertEquals($value, $event[$field]); } @@ -334,14 +334,14 @@ public function testUsingWithErrorHandler() public function verifyHandlerData($errno, $errstr, $errfile, $errline, $errcontext) { if ($this->expectingLogging) { - $this->assertFalse(empty($this->errWriter->events)); + $this->assertNotEmpty($this->errWriter->events); $event = array_shift($this->errWriter->events); $this->assertEquals($errstr, $event['message']); $this->assertEquals($errno, $event['errno']); $this->assertEquals($errfile, $event['file']); $this->assertEquals($errline, $event['line']); } else { - $this->assertTrue(empty($this->errWriter->events)); + $this->assertEmpty($this->errWriter->events); } } @@ -439,7 +439,7 @@ public function testPriorityDuplicates() } $this->assertEquals(0, $mock->events[0]['priority']); $this->assertEquals('EMERG', $mock->events[0]['priorityName']); - $this->assertFalse(array_key_exists(1, $mock->events)); + $this->assertArrayNotHasKey(1, $mock->events); } /** @@ -555,10 +555,11 @@ public function testZendLogCanBeExtendedWhenUsingFactory() } /** - * @expectedException Zend_Log_Exception */ public function testZendLogThrowsAnExceptionWhenPassingIncorrectClassToFactory() { + $this->expectException(\Zend_Log_Exception::class); + $writer = new Zend_Log_Writer_Null(); ZLTest_My_Log::factory( array( diff --git a/tests/Zend/Log/Writer/AbstractTest.php b/tests/Zend/Log/Writer/AbstractTest.php index bcae863add..c2487a0097 100644 --- a/tests/Zend/Log/Writer/AbstractTest.php +++ b/tests/Zend/Log/Writer/AbstractTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Log */ -class Zend_Log_Writer_AbstractTest extends PHPUnit_Framework_TestCase +class Zend_Log_Writer_AbstractTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Log_Writer_Abstract @@ -54,7 +54,7 @@ public function testSetFormatter() require_once 'Zend/Log/Formatter/Simple.php'; $this->_writer->setFormatter(new Zend_Log_Formatter_Simple()); - $this->setExpectedException('PHPUnit_Framework_Error'); + $this->expectException('PHPUnit\Framework\Error\Error'); $this->_writer->setFormatter(new StdClass()); } @@ -63,7 +63,7 @@ public function testAddFilter() $this->_writer->addFilter(1); require_once 'Zend/Log/Filter/Message.php'; $this->_writer->addFilter(new Zend_Log_Filter_Message('/mess/')); - $this->setExpectedException('Zend_Log_Exception'); + $this->expectException('Zend_Log_Exception'); $this->_writer->addFilter(new StdClass()); } diff --git a/tests/Zend/Log/Writer/DbTest.php b/tests/Zend/Log/Writer/DbTest.php index d48a2dcf35..d33231d951 100644 --- a/tests/Zend/Log/Writer/DbTest.php +++ b/tests/Zend/Log/Writer/DbTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Log */ -class Zend_Log_Writer_DbTest extends PHPUnit_Framework_TestCase +class Zend_Log_Writer_DbTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -135,7 +135,7 @@ public function testThrowStrictSetFormatter() try { $this->writer->setFormatter(new StdClass()); } catch (Exception $e) { - $this->assertTrue($e instanceof PHPUnit_Framework_Error); + $this->assertTrue($e instanceof PHPUnit\Framework\Error\Error); $this->assertContains('must implement interface', $e->getMessage()); } } diff --git a/tests/Zend/Log/Writer/FirebugTest.php b/tests/Zend/Log/Writer/FirebugTest.php index aa82d62d6b..2dd841bcf7 100644 --- a/tests/Zend/Log/Writer/FirebugTest.php +++ b/tests/Zend/Log/Writer/FirebugTest.php @@ -49,7 +49,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Log */ -class Zend_Log_Writer_FirebugTest extends PHPUnit_Framework_TestCase +class Zend_Log_Writer_FirebugTest extends PHPUnit\Framework\TestCase { protected $_controller = null; protected $_request = null; diff --git a/tests/Zend/Log/Writer/MailTest.php b/tests/Zend/Log/Writer/MailTest.php index 02b6b62996..d4c204ada5 100644 --- a/tests/Zend/Log/Writer/MailTest.php +++ b/tests/Zend/Log/Writer/MailTest.php @@ -50,7 +50,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Log */ -class Zend_Log_Writer_MailTest extends PHPUnit_Framework_TestCase +class Zend_Log_Writer_MailTest extends PHPUnit\Framework\TestCase { /** * Mock Transport for Zend_Mail @@ -173,7 +173,7 @@ public function testSetSubjectPrependTextPreExisting() // Expect a Zend_Log_Exception because the subject prepend text cannot // be set of the Zend_Mail object already has a subject line set. - $this->setExpectedException('Zend_Log_Exception'); + $this->expectException('Zend_Log_Exception'); // Set a subject line so the setSubjectPrependText() call triggers an // exception. @@ -224,7 +224,7 @@ public function testSetLayoutFormatterWithoutLayout() list(, $writer) = $this->_getSimpleLogger(); // If Zend_Layout is not being used, a formatter cannot be set for it. - $this->setExpectedException('Zend_Log_Exception'); + $this->expectException('Zend_Log_Exception'); $writer->setLayoutFormatter(new Zend_Log_Formatter_Simple()); } @@ -248,7 +248,7 @@ public function testDestructorMailError() // Log an error message so that there's something to send via email. $log->err('a bogus error message to force mail sending'); - $this->setExpectedException('PHPUnit_Framework_Error'); + $this->expectException('PHPUnit\Framework\Error\Error'); unset($log); } @@ -272,7 +272,7 @@ public function testDestructorLayoutError() // Log an error message so that there's something to send via email. $log->err('a bogus error message to force mail sending'); - $this->setExpectedException('PHPUnit_Framework_Error'); + $this->expectException('PHPUnit\Framework\Error\Error'); unset($log); } @@ -408,7 +408,7 @@ public function testFactoryWithLayout() $writer->write($this->_getEvent()); $writer->shutdown(); - $this->assertFalse(empty($this->_transport->boundary)); + $this->assertNotEmpty($this->_transport->boundary); $this->assertContains('Content-Type: multipart/', $this->_transport->header); $this->assertContains('boundary=', $this->_transport->header); $this->assertContains('Content-Type: text/plain', $this->_transport->body); diff --git a/tests/Zend/Log/Writer/MockTest.php b/tests/Zend/Log/Writer/MockTest.php index fb9465af3c..2fd681ad44 100644 --- a/tests/Zend/Log/Writer/MockTest.php +++ b/tests/Zend/Log/Writer/MockTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Log */ -class Zend_Log_Writer_MockTest extends PHPUnit_Framework_TestCase +class Zend_Log_Writer_MockTest extends PHPUnit\Framework\TestCase { public function testWrite() { diff --git a/tests/Zend/Log/Writer/NullTest.php b/tests/Zend/Log/Writer/NullTest.php index e823309a0f..c56879bc68 100644 --- a/tests/Zend/Log/Writer/NullTest.php +++ b/tests/Zend/Log/Writer/NullTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Log */ -class Zend_Log_Writer_NullTest extends PHPUnit_Framework_TestCase +class Zend_Log_Writer_NullTest extends PHPUnit\Framework\TestCase { public function testWrite() { diff --git a/tests/Zend/Log/Writer/StreamTest.php b/tests/Zend/Log/Writer/StreamTest.php index 5aeecb8eca..960322d92a 100644 --- a/tests/Zend/Log/Writer/StreamTest.php +++ b/tests/Zend/Log/Writer/StreamTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Log */ -class Zend_Log_Writer_StreamTest extends PHPUnit_Framework_TestCase +class Zend_Log_Writer_StreamTest extends PHPUnit\Framework\TestCase { public function testConstructorThrowsWhenResourceIsNotStream() { diff --git a/tests/Zend/Log/Writer/SyslogTest.php b/tests/Zend/Log/Writer/SyslogTest.php index 8b75c1e66b..eb118aba85 100755 --- a/tests/Zend/Log/Writer/SyslogTest.php +++ b/tests/Zend/Log/Writer/SyslogTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Log */ -class Zend_Log_Writer_SyslogTest extends PHPUnit_Framework_TestCase +class Zend_Log_Writer_SyslogTest extends PHPUnit\Framework\TestCase { public function testWrite() { diff --git a/tests/Zend/Log/Writer/ZendMonitorTest.php b/tests/Zend/Log/Writer/ZendMonitorTest.php index 749aff7859..5e982786db 100755 --- a/tests/Zend/Log/Writer/ZendMonitorTest.php +++ b/tests/Zend/Log/Writer/ZendMonitorTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Log */ -class Zend_Log_Writer_ZendMonitorTest extends PHPUnit_Framework_TestCase +class Zend_Log_Writer_ZendMonitorTest extends PHPUnit\Framework\TestCase { /** * @group ZF-10081 @@ -53,6 +53,6 @@ public function testFactory() public function testIsEnabled() { $writer = new Zend_Log_Writer_ZendMonitor(); - $this->assertTrue(is_bool($writer->isEnabled())); + $this->assertInternalType('bool', $writer->isEnabled()); } } diff --git a/tests/Zend/Mail/FileTransportTest.php b/tests/Zend/Mail/FileTransportTest.php index 535c73099e..11023c8110 100644 --- a/tests/Zend/Mail/FileTransportTest.php +++ b/tests/Zend/Mail/FileTransportTest.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Mail */ -class Zend_Mail_FileTransportTest extends PHPUnit_Framework_TestCase +class Zend_Mail_FileTransportTest extends PHPUnit\Framework\TestCase { protected $_params; protected $_transport; @@ -123,7 +123,7 @@ public function testNotWritablePathFailure() $mail = $this->_prepareMail(); - $this->setExpectedException('Zend_Mail_Transport_Exception'); + $this->expectException('Zend_Mail_Transport_Exception'); $mail->send($transport); } diff --git a/tests/Zend/Mail/Header/HeaderNameTest.php b/tests/Zend/Mail/Header/HeaderNameTest.php index 09ee73c808..a825f19840 100644 --- a/tests/Zend/Mail/Header/HeaderNameTest.php +++ b/tests/Zend/Mail/Header/HeaderNameTest.php @@ -25,7 +25,7 @@ */ require_once 'Zend/Mail/Header/HeaderName.php'; -class Zend_Mail_Header_HeaderNameTest extends PHPUnit_Framework_TestCase +class Zend_Mail_Header_HeaderNameTest extends PHPUnit\Framework\TestCase { /** * Data for filter name @@ -90,7 +90,8 @@ public function assertNames() */ public function testAssertValidRaisesExceptionForInvalidNames($name) { - $this->setExpectedException('Zend_Mail_Exception', 'Invalid'); + $this->expectException('Zend_Mail_Exception'); + $this->expectExceptionMessage('Invalid'); Zend_Mail_Header_HeaderName::assertValid($name); } } diff --git a/tests/Zend/Mail/Header/HeaderValueTest.php b/tests/Zend/Mail/Header/HeaderValueTest.php index 172ec1ad89..e245802e55 100644 --- a/tests/Zend/Mail/Header/HeaderValueTest.php +++ b/tests/Zend/Mail/Header/HeaderValueTest.php @@ -25,7 +25,7 @@ */ require_once 'Zend/Mail/Header/HeaderValue.php'; -class Zend_Mail_Header_HeaderValueTest extends PHPUnit_Framework_TestCase +class Zend_Mail_Header_HeaderValueTest extends PHPUnit\Framework\TestCase { /** * Data for filter value @@ -104,7 +104,8 @@ public function assertValues() */ public function testAssertValidRaisesExceptionForInvalidValues($value) { - $this->setExpectedException('Zend_Mail_Exception', 'Invalid'); + $this->expectException('Zend_Mail_Exception'); + $this->expectExceptionMessage('Invalid'); Zend_Mail_Header_HeaderValue::assertValid($value); } } diff --git a/tests/Zend/Mail/ImapTest.php b/tests/Zend/Mail/ImapTest.php index 7eddde6859..63d75e5de1 100644 --- a/tests/Zend/Mail/ImapTest.php +++ b/tests/Zend/Mail/ImapTest.php @@ -44,7 +44,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Mail */ -class Zend_Mail_ImapTest extends PHPUnit_Framework_TestCase +class Zend_Mail_ImapTest extends PHPUnit\Framework\TestCase { protected $_params; @@ -737,7 +737,7 @@ public function testCapability() $protocol = new Zend_Mail_Protocol_Imap($this->_params['host']); $protocol->login($this->_params['user'], $this->_params['password']); $capa = $protocol->capability(); - $this->assertTrue(is_array($capa)); + $this->assertInternalType('array', $capa); $this->assertEquals($capa[0], 'CAPABILITY'); } @@ -746,7 +746,7 @@ public function testSelect() $protocol = new Zend_Mail_Protocol_Imap($this->_params['host']); $protocol->login($this->_params['user'], $this->_params['password']); $status = $protocol->select('INBOX'); - $this->assertTrue(is_array($status['flags'])); + $this->assertInternalType('array', $status['flags']); $this->assertEquals($status['exists'], 7); } @@ -756,7 +756,7 @@ public function testExamine() $protocol = new Zend_Mail_Protocol_Imap($this->_params['host']); $protocol->login($this->_params['user'], $this->_params['password']); $status = $protocol->examine('INBOX'); - $this->assertTrue(is_array($status['flags'])); + $this->assertInternalType('array', $status['flags']); $this->assertEquals($status['exists'], 7); } @@ -797,12 +797,12 @@ public function testFetch() $this->assertEquals($protocol->fetch('UID', 1, INF), $range); $this->assertEquals($protocol->fetch('UID', 1, 7), $range); $this->assertEquals($protocol->fetch('UID', range(1, 7)), $range); - $this->assertTrue(is_numeric($protocol->fetch('UID', 1))); + $this->assertInternalType('numeric', $protocol->fetch('UID', 1)); $result = $protocol->fetch(array('UID', 'FLAGS'), 1, INF); foreach ($result as $k => $v) { $this->assertEquals($k, $v['UID']); - $this->assertTrue(is_array($v['FLAGS'])); + $this->assertInternalType('array', $v['FLAGS']); } try { diff --git a/tests/Zend/Mail/InterfaceTest.php b/tests/Zend/Mail/InterfaceTest.php index f4e1fd8ece..b4202bfc7f 100644 --- a/tests/Zend/Mail/InterfaceTest.php +++ b/tests/Zend/Mail/InterfaceTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Mail */ -class Zend_Mail_InterfaceTest extends PHPUnit_Framework_TestCase +class Zend_Mail_InterfaceTest extends PHPUnit\Framework\TestCase { protected $_mboxFile; diff --git a/tests/Zend/Mail/MailTest.php b/tests/Zend/Mail/MailTest.php index e0de0dd939..481fb220f8 100644 --- a/tests/Zend/Mail/MailTest.php +++ b/tests/Zend/Mail/MailTest.php @@ -118,7 +118,7 @@ public function _sendMail() * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Mail */ -class Zend_Mail_MailTest extends PHPUnit_Framework_TestCase +class Zend_Mail_MailTest extends PHPUnit\Framework\TestCase { protected $numAssertions; @@ -909,9 +909,10 @@ public function testGetReplyToReturnsReplyTo() { } /** - * @expectedException Zend_Mail_Exception */ public function testReplyToCantBeSetTwice() { + $this->expectException(\Zend_Mail_Exception::class); + $mail = new Zend_Mail(); $mail->setReplyTo('user@example.com'); $mail->setReplyTo('user2@example.com'); diff --git a/tests/Zend/Mail/MaildirFolderTest.php b/tests/Zend/Mail/MaildirFolderTest.php index 7c2e027ca0..33aa2a6f50 100644 --- a/tests/Zend/Mail/MaildirFolderTest.php +++ b/tests/Zend/Mail/MaildirFolderTest.php @@ -39,7 +39,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Mail */ -class Zend_Mail_MaildirFolderTest extends PHPUnit_Framework_TestCase +class Zend_Mail_MaildirFolderTest extends PHPUnit\Framework\TestCase { protected $_params; protected $_originalDir; diff --git a/tests/Zend/Mail/MaildirMessageOldTest.php b/tests/Zend/Mail/MaildirMessageOldTest.php index 65ca34603f..d2bf012381 100644 --- a/tests/Zend/Mail/MaildirMessageOldTest.php +++ b/tests/Zend/Mail/MaildirMessageOldTest.php @@ -56,7 +56,7 @@ class Zend_Mail_Storage_Maildir_OldMessage extends Zend_Mail_Storage_Maildir * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Mail */ -class Zend_Mail_MaildirMessageOldTest extends PHPUnit_Framework_TestCase +class Zend_Mail_MaildirMessageOldTest extends PHPUnit\Framework\TestCase { protected $_originalMaildir; protected $_maildir; diff --git a/tests/Zend/Mail/MaildirTest.php b/tests/Zend/Mail/MaildirTest.php index a3c23f4c9c..ec82e7c2c2 100644 --- a/tests/Zend/Mail/MaildirTest.php +++ b/tests/Zend/Mail/MaildirTest.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Mail */ -class Zend_Mail_MaildirTest extends PHPUnit_Framework_TestCase +class Zend_Mail_MaildirTest extends PHPUnit\Framework\TestCase { protected $_originalMaildir; protected $_maildir; diff --git a/tests/Zend/Mail/MaildirWritableTest.php b/tests/Zend/Mail/MaildirWritableTest.php index 3dec4b844d..6717602bd7 100644 --- a/tests/Zend/Mail/MaildirWritableTest.php +++ b/tests/Zend/Mail/MaildirWritableTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Mail */ -class Zend_Mail_MaildirWritableTest extends PHPUnit_Framework_TestCase +class Zend_Mail_MaildirWritableTest extends PHPUnit\Framework\TestCase { protected $_params; protected $_originalDir; diff --git a/tests/Zend/Mail/MboxFolderTest.php b/tests/Zend/Mail/MboxFolderTest.php index 6f6a082fee..438cd61a88 100644 --- a/tests/Zend/Mail/MboxFolderTest.php +++ b/tests/Zend/Mail/MboxFolderTest.php @@ -39,7 +39,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Mail */ -class Zend_Mail_MboxFolderTest extends PHPUnit_Framework_TestCase +class Zend_Mail_MboxFolderTest extends PHPUnit\Framework\TestCase { protected $_params; protected $_originalDir; diff --git a/tests/Zend/Mail/MboxMessageOldTest.php b/tests/Zend/Mail/MboxMessageOldTest.php index cfb4f9a5b2..2cbcfb7a74 100644 --- a/tests/Zend/Mail/MboxMessageOldTest.php +++ b/tests/Zend/Mail/MboxMessageOldTest.php @@ -56,7 +56,7 @@ class Zend_Mail_Storage_Mbox_OldMessage extends Zend_Mail_Storage_Mbox * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Mail */ -class Zend_Mail_MboxMessageOldTest extends PHPUnit_Framework_TestCase +class Zend_Mail_MboxMessageOldTest extends PHPUnit\Framework\TestCase { protected $_mboxOriginalFile; protected $_mboxFile; diff --git a/tests/Zend/Mail/MboxTest.php b/tests/Zend/Mail/MboxTest.php index 0970139284..ef39bdcb7e 100644 --- a/tests/Zend/Mail/MboxTest.php +++ b/tests/Zend/Mail/MboxTest.php @@ -39,7 +39,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Mail */ -class Zend_Mail_MboxTest extends PHPUnit_Framework_TestCase +class Zend_Mail_MboxTest extends PHPUnit\Framework\TestCase { protected $_mboxOriginalFile; protected $_mboxFile; diff --git a/tests/Zend/Mail/MessageTest.php b/tests/Zend/Mail/MessageTest.php index cbffe5f67a..110878dde8 100644 --- a/tests/Zend/Mail/MessageTest.php +++ b/tests/Zend/Mail/MessageTest.php @@ -43,7 +43,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Mail */ -class Zend_Mail_MessageTest extends PHPUnit_Framework_TestCase +class Zend_Mail_MessageTest extends PHPUnit\Framework\TestCase { protected $_file; @@ -537,7 +537,8 @@ public function invalidHeaders() public function testRaisesExceptionWhenProvidedWithHeaderContainingCRLFInjection($name, $value) { $headers = array($name => $value); - $this->setExpectedException('Zend_Mail_Exception', 'valid'); + $this->expectException('Zend_Mail_Exception'); + $this->expectExceptionMessage('valid'); $message = new Zend_Mail_Message(array( 'headers' => $headers, )); diff --git a/tests/Zend/Mail/Pop3Test.php b/tests/Zend/Mail/Pop3Test.php index c5ec45e762..4f356736e7 100644 --- a/tests/Zend/Mail/Pop3Test.php +++ b/tests/Zend/Mail/Pop3Test.php @@ -43,7 +43,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Mail */ -class Zend_Mail_Pop3Test extends PHPUnit_Framework_TestCase +class Zend_Mail_Pop3Test extends PHPUnit\Framework\TestCase { protected $_params; @@ -348,7 +348,7 @@ public function testRequestAfterClose() public function testServerCapa() { $mail = new Zend_Mail_Protocol_Pop3($this->_params['host']); - $this->assertTrue(is_array($mail->capa())); + $this->assertInternalType('array', $mail->capa()); } public function testServerUidl() diff --git a/tests/Zend/Mail/SmtpOfflineTest.php b/tests/Zend/Mail/SmtpOfflineTest.php index 41273dc2b7..1a7b32f72c 100644 --- a/tests/Zend/Mail/SmtpOfflineTest.php +++ b/tests/Zend/Mail/SmtpOfflineTest.php @@ -44,7 +44,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Mail */ -class Zend_Mail_SmtpOfflineTest extends PHPUnit_Framework_TestCase +class Zend_Mail_SmtpOfflineTest extends PHPUnit\Framework\TestCase { protected $_params; diff --git a/tests/Zend/Mail/SmtpProtocolTest.php b/tests/Zend/Mail/SmtpProtocolTest.php index 3699f5e088..89e81e9c4c 100644 --- a/tests/Zend/Mail/SmtpProtocolTest.php +++ b/tests/Zend/Mail/SmtpProtocolTest.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Mail */ -class Zend_Mail_SmtpProtocolTest extends PHPUnit_Framework_TestCase +class Zend_Mail_SmtpProtocolTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Mail_Protocol_Smtp @@ -63,10 +63,11 @@ public function testEhlo() /** * @depends testEhlo - * @expectedException Zend_Mail_Protocol_Exception */ public function testHeloIsOnlyAllowedOncePerSession() { + $this->expectException(\Zend_Mail_Protocol_Exception::class); + $this->_connectAndEhlo(); // do it once $this->_protocol->helo(); // do it again } @@ -264,10 +265,11 @@ public function testExceptionCodeIsSmtpStatusCode() /** * @depends testMail - * @expectedException Zend_Mail_Protocol_Exception */ public function testRcptThrowsExceptionOnUnexpectedResponse() { + $this->expectException(\Zend_Mail_Protocol_Exception::class); + $p = $this->_protocol; $expectedDialog = $this->_connectAndEhlo(); @@ -308,10 +310,11 @@ public function testRcptBeforeMailThrowsException() /** * @depends testEhlo - * @expectedException Zend_Mail_Protocol_Exception */ public function testDataBeforeRcptThrowsException() { + $this->expectException(\Zend_Mail_Protocol_Exception::class); + $this->_connectAndEhlo(); $this->_protocol->data('foo'); diff --git a/tests/Zend/Mail/SmtpTest.php b/tests/Zend/Mail/SmtpTest.php index 62fc31cddc..0675ae046f 100644 --- a/tests/Zend/Mail/SmtpTest.php +++ b/tests/Zend/Mail/SmtpTest.php @@ -39,7 +39,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Mail */ -class Zend_Mail_SmtpTest extends PHPUnit_Framework_TestCase +class Zend_Mail_SmtpTest extends PHPUnit\Framework\TestCase { protected $_params; protected $_transport; diff --git a/tests/Zend/Markup/BbcodeAndHtmlTest.php b/tests/Zend/Markup/BbcodeAndHtmlTest.php index 8653c0a50d..912e61f44b 100644 --- a/tests/Zend/Markup/BbcodeAndHtmlTest.php +++ b/tests/Zend/Markup/BbcodeAndHtmlTest.php @@ -31,7 +31,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Markup_BbcodeAndHtmlTest extends PHPUnit_Framework_TestCase +class Zend_Markup_BbcodeAndHtmlTest extends PHPUnit\Framework\TestCase { /** @@ -102,7 +102,7 @@ public function testComplicatedTags() */ public function testExceptionParserWrongInputType() { - $this->setExpectedException('Zend_Markup_Parser_Exception'); + $this->expectException('Zend_Markup_Parser_Exception'); $this->_markup->getParser()->parse(array()); } @@ -114,7 +114,7 @@ public function testExceptionParserWrongInputType() */ public function testExceptionParserEmptyInput() { - $this->setExpectedException('Zend_Markup_Parser_Exception'); + $this->expectException('Zend_Markup_Parser_Exception'); $this->_markup->getParser()->parse(''); } diff --git a/tests/Zend/Markup/FactoryTest.php b/tests/Zend/Markup/FactoryTest.php index 40d378917a..3f5182f211 100644 --- a/tests/Zend/Markup/FactoryTest.php +++ b/tests/Zend/Markup/FactoryTest.php @@ -30,7 +30,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Markup_FactoryTest extends PHPUnit_Framework_TestCase +class Zend_Markup_FactoryTest extends PHPUnit\Framework\TestCase { public function testFactory() diff --git a/tests/Zend/Markup/ParserIntegrityTest.php b/tests/Zend/Markup/ParserIntegrityTest.php index ecb2b465f9..24f7e9e413 100644 --- a/tests/Zend/Markup/ParserIntegrityTest.php +++ b/tests/Zend/Markup/ParserIntegrityTest.php @@ -30,7 +30,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Markup_ParserIntegrityTest extends PHPUnit_Framework_TestCase +class Zend_Markup_ParserIntegrityTest extends PHPUnit\Framework\TestCase { public function testBbcodeParser() { diff --git a/tests/Zend/Measure/AccelerationTest.php b/tests/Zend/Measure/AccelerationTest.php index 36d1fb327b..19bb257c7c 100644 --- a/tests/Zend/Measure/AccelerationTest.php +++ b/tests/Zend/Measure/AccelerationTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_AccelerationTest extends PHPUnit_Framework_TestCase +class Zend_Measure_AccelerationTest extends PHPUnit\Framework\TestCase { /** @@ -214,7 +214,7 @@ public function testAccelerationConversionList() { $value = new Zend_Measure_Acceleration('-100',Zend_Measure_Acceleration::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } diff --git a/tests/Zend/Measure/AngleTest.php b/tests/Zend/Measure/AngleTest.php index 3fb33d68e0..ae3f8b902d 100644 --- a/tests/Zend/Measure/AngleTest.php +++ b/tests/Zend/Measure/AngleTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_AngleTest extends PHPUnit_Framework_TestCase +class Zend_Measure_AngleTest extends PHPUnit\Framework\TestCase { /** * test for Angle initialisation @@ -384,6 +384,6 @@ public function testAngleConversionList() { $value = new Zend_Measure_Angle('-100',Zend_Measure_Angle::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Measure/AreaTest.php b/tests/Zend/Measure/AreaTest.php index 63484ab080..1e25aa89d3 100644 --- a/tests/Zend/Measure/AreaTest.php +++ b/tests/Zend/Measure/AreaTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_AreaTest extends PHPUnit_Framework_TestCase +class Zend_Measure_AreaTest extends PHPUnit\Framework\TestCase { /** * test for area initialisation @@ -356,6 +356,6 @@ public function testAreaConversionList() { $value = new Zend_Measure_Area('-100',Zend_Measure_Area::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Measure/BinaryTest.php b/tests/Zend/Measure/BinaryTest.php index 7c840fff7c..365b62497e 100644 --- a/tests/Zend/Measure/BinaryTest.php +++ b/tests/Zend/Measure/BinaryTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_BinaryTest extends PHPUnit_Framework_TestCase +class Zend_Measure_BinaryTest extends PHPUnit\Framework\TestCase { /** * test for Binary initialisation @@ -94,7 +94,7 @@ public function testBinaryUnknownLocale() public function testBinaryNoLocale() { $value = new Zend_Measure_Binary('100',Zend_Measure_Binary::STANDARD); - $this->assertTrue(is_object($value),'Object expected because of standard locale'); + $this->assertInternalType('object', $value,'Object expected because of standard locale'); } /** @@ -346,6 +346,6 @@ public function testBinaryConversionList() { $value = new Zend_Measure_Binary('-100',Zend_Measure_Binary::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Measure/CapacitanceTest.php b/tests/Zend/Measure/CapacitanceTest.php index afc4f50217..cd5df1005b 100644 --- a/tests/Zend/Measure/CapacitanceTest.php +++ b/tests/Zend/Measure/CapacitanceTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_CapacitanceTest extends PHPUnit_Framework_TestCase +class Zend_Measure_CapacitanceTest extends PHPUnit\Framework\TestCase { /** * test for Capacitance initialisation @@ -359,6 +359,6 @@ public function testCapacitanceConversionList() { $value = new Zend_Measure_Capacitance('-100',Zend_Measure_Capacitance::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Measure/Cooking/VolumeTest.php b/tests/Zend/Measure/Cooking/VolumeTest.php index 39c967fe59..506f5dc13c 100644 --- a/tests/Zend/Measure/Cooking/VolumeTest.php +++ b/tests/Zend/Measure/Cooking/VolumeTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_Cooking_VolumeTest extends PHPUnit_Framework_TestCase +class Zend_Measure_Cooking_VolumeTest extends PHPUnit\Framework\TestCase { /** * test for Mass initialisation @@ -382,6 +382,6 @@ public function testCooking_VolumeConversionList() { $value = new Zend_Measure_Cooking_Volume('-100',Zend_Measure_Cooking_Volume::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Measure/Cooking/WeightTest.php b/tests/Zend/Measure/Cooking/WeightTest.php index c436b1df0b..91d98caf94 100644 --- a/tests/Zend/Measure/Cooking/WeightTest.php +++ b/tests/Zend/Measure/Cooking/WeightTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_Cooking_WeightTest extends PHPUnit_Framework_TestCase +class Zend_Measure_Cooking_WeightTest extends PHPUnit\Framework\TestCase { /** * test for Mass initialisation @@ -382,6 +382,6 @@ public function testCooking_WeightConversionList() { $value = new Zend_Measure_Cooking_Weight('-100',Zend_Measure_Cooking_Weight::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Measure/CurrentTest.php b/tests/Zend/Measure/CurrentTest.php index 35f51bfb38..249c803d99 100644 --- a/tests/Zend/Measure/CurrentTest.php +++ b/tests/Zend/Measure/CurrentTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_CurrentTest extends PHPUnit_Framework_TestCase +class Zend_Measure_CurrentTest extends PHPUnit\Framework\TestCase { /** * test for Current initialisation @@ -359,6 +359,6 @@ public function testCurrentConversionList() { $value = new Zend_Measure_Current('-100',Zend_Measure_Current::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Measure/DensityTest.php b/tests/Zend/Measure/DensityTest.php index bfe74b19fe..fadb6f6fc4 100644 --- a/tests/Zend/Measure/DensityTest.php +++ b/tests/Zend/Measure/DensityTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_DensityTest extends PHPUnit_Framework_TestCase +class Zend_Measure_DensityTest extends PHPUnit\Framework\TestCase { /** * test for Density initialisation @@ -383,6 +383,6 @@ public function testDensityConversionList() { $value = new Zend_Measure_Density('-100',Zend_Measure_Density::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Measure/EnergyTest.php b/tests/Zend/Measure/EnergyTest.php index ad7bfd3bae..1759b00aa9 100644 --- a/tests/Zend/Measure/EnergyTest.php +++ b/tests/Zend/Measure/EnergyTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_EnergyTest extends PHPUnit_Framework_TestCase +class Zend_Measure_EnergyTest extends PHPUnit\Framework\TestCase { /** * test for Energy initialisation @@ -384,6 +384,6 @@ public function testEnergyConversionList() { $value = new Zend_Measure_Energy('-100',Zend_Measure_Energy::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Measure/Flow/MassTest.php b/tests/Zend/Measure/Flow/MassTest.php index 5c03d1f7c5..eeb0dfd64d 100644 --- a/tests/Zend/Measure/Flow/MassTest.php +++ b/tests/Zend/Measure/Flow/MassTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_Flow_MassTest extends PHPUnit_Framework_TestCase +class Zend_Measure_Flow_MassTest extends PHPUnit\Framework\TestCase { /** * test for Mass initialisation @@ -383,6 +383,6 @@ public function testFlow_MassConversionList() { $value = new Zend_Measure_Flow_Mass('-100',Zend_Measure_Flow_Mass::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Measure/Flow/MoleTest.php b/tests/Zend/Measure/Flow/MoleTest.php index d0ba3fae4a..838970f987 100644 --- a/tests/Zend/Measure/Flow/MoleTest.php +++ b/tests/Zend/Measure/Flow/MoleTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_Flow_MoleTest extends PHPUnit_Framework_TestCase +class Zend_Measure_Flow_MoleTest extends PHPUnit\Framework\TestCase { /** * test for mole initialisation @@ -383,6 +383,6 @@ public function testFlow_MoleConversionList() { $value = new Zend_Measure_Flow_Mole('-100',Zend_Measure_Flow_Mole::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Measure/Flow/VolumeTest.php b/tests/Zend/Measure/Flow/VolumeTest.php index 85d4bc0f0b..d255516667 100644 --- a/tests/Zend/Measure/Flow/VolumeTest.php +++ b/tests/Zend/Measure/Flow/VolumeTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_Flow_VolumeTest extends PHPUnit_Framework_TestCase +class Zend_Measure_Flow_VolumeTest extends PHPUnit\Framework\TestCase { /** * test for Volume initialisation @@ -383,6 +383,6 @@ public function testFlow_VolumeConversionList() { $value = new Zend_Measure_Flow_Volume('-100',Zend_Measure_Flow_Volume::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Measure/ForceTest.php b/tests/Zend/Measure/ForceTest.php index 1e8e9469c4..762abb3f7f 100644 --- a/tests/Zend/Measure/ForceTest.php +++ b/tests/Zend/Measure/ForceTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_ForceTest extends PHPUnit_Framework_TestCase +class Zend_Measure_ForceTest extends PHPUnit\Framework\TestCase { /** * test for Force initialisation @@ -360,6 +360,6 @@ public function testForceConversionList() { $value = new Zend_Measure_Force('-100',Zend_Measure_Force::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Measure/FrequencyTest.php b/tests/Zend/Measure/FrequencyTest.php index e9b4271ceb..b21a9d7f57 100644 --- a/tests/Zend/Measure/FrequencyTest.php +++ b/tests/Zend/Measure/FrequencyTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_FrequencyTest extends PHPUnit_Framework_TestCase +class Zend_Measure_FrequencyTest extends PHPUnit\Framework\TestCase { /** * test for Frequency initialisation @@ -384,6 +384,6 @@ public function testFrequencyConversionList() { $value = new Zend_Measure_Frequency('-100',Zend_Measure_Frequency::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Measure/IlluminationTest.php b/tests/Zend/Measure/IlluminationTest.php index 4cb401b2be..7857aba900 100644 --- a/tests/Zend/Measure/IlluminationTest.php +++ b/tests/Zend/Measure/IlluminationTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_IlluminationTest extends PHPUnit_Framework_TestCase +class Zend_Measure_IlluminationTest extends PHPUnit\Framework\TestCase { /** * test for Illumination initialisation @@ -360,6 +360,6 @@ public function testIlluminationConversionList() { $value = new Zend_Measure_Illumination('-100',Zend_Measure_Illumination::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Measure/LengthTest.php b/tests/Zend/Measure/LengthTest.php index 1e6604dc8f..601e7da628 100644 --- a/tests/Zend/Measure/LengthTest.php +++ b/tests/Zend/Measure/LengthTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_LengthTest extends PHPUnit_Framework_TestCase +class Zend_Measure_LengthTest extends PHPUnit\Framework\TestCase { /** * test for Length initialisation @@ -383,7 +383,7 @@ public function testLengthConversionList() { $value = new Zend_Measure_Length('-100',Zend_Measure_Length::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } /** diff --git a/tests/Zend/Measure/LightnessTest.php b/tests/Zend/Measure/LightnessTest.php index 6f5ec291e3..160d0c3815 100644 --- a/tests/Zend/Measure/LightnessTest.php +++ b/tests/Zend/Measure/LightnessTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_LightnessTest extends PHPUnit_Framework_TestCase +class Zend_Measure_LightnessTest extends PHPUnit\Framework\TestCase { /** * test for Lightness initialisation @@ -360,6 +360,6 @@ public function testLightnessConversionList() { $value = new Zend_Measure_Lightness('-100',Zend_Measure_Lightness::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Measure/NumberTest.php b/tests/Zend/Measure/NumberTest.php index e9aa00e1b7..39a5b503af 100644 --- a/tests/Zend/Measure/NumberTest.php +++ b/tests/Zend/Measure/NumberTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_NumberTest extends PHPUnit_Framework_TestCase +class Zend_Measure_NumberTest extends PHPUnit\Framework\TestCase { /** * test for Number initialisation @@ -237,7 +237,7 @@ public function testNumberConversionList() { $value = new Zend_Measure_Number('-100',Zend_Measure_Number::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } /** diff --git a/tests/Zend/Measure/PowerTest.php b/tests/Zend/Measure/PowerTest.php index c404e24ef5..a515ffa6be 100644 --- a/tests/Zend/Measure/PowerTest.php +++ b/tests/Zend/Measure/PowerTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_PowerTest extends PHPUnit_Framework_TestCase +class Zend_Measure_PowerTest extends PHPUnit\Framework\TestCase { /** * test for Power initialisation @@ -396,6 +396,6 @@ public function testPowerConversionList() { $value = new Zend_Measure_Power('-100',Zend_Measure_Power::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Measure/PressureTest.php b/tests/Zend/Measure/PressureTest.php index 29bd952e6c..0c603bfbe5 100644 --- a/tests/Zend/Measure/PressureTest.php +++ b/tests/Zend/Measure/PressureTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_PressureTest extends PHPUnit_Framework_TestCase +class Zend_Measure_PressureTest extends PHPUnit\Framework\TestCase { /** * test for Pressure initialisation @@ -396,6 +396,6 @@ public function testPressureConversionList() { $value = new Zend_Measure_Pressure('-100',Zend_Measure_Pressure::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Measure/SpeedTest.php b/tests/Zend/Measure/SpeedTest.php index 47840d969c..b1a2a5460b 100644 --- a/tests/Zend/Measure/SpeedTest.php +++ b/tests/Zend/Measure/SpeedTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_SpeedTest extends PHPUnit_Framework_TestCase +class Zend_Measure_SpeedTest extends PHPUnit\Framework\TestCase { /** * test for Speed initialisation @@ -384,6 +384,6 @@ public function testSpeedConversionList() { $value = new Zend_Measure_Speed('-100',Zend_Measure_Speed::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Measure/TemperatureTest.php b/tests/Zend/Measure/TemperatureTest.php index 1a45c87721..efc5aaa12d 100644 --- a/tests/Zend/Measure/TemperatureTest.php +++ b/tests/Zend/Measure/TemperatureTest.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_TemperatureTest extends PHPUnit_Framework_TestCase +class Zend_Measure_TemperatureTest extends PHPUnit\Framework\TestCase { public function setup() { @@ -414,7 +414,7 @@ public function testTemperatureConversionList() { $value = new Zend_Measure_Temperature('-100',Zend_Measure_Temperature::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } diff --git a/tests/Zend/Measure/TimeTest.php b/tests/Zend/Measure/TimeTest.php index 7bb9b9c1de..59ae472cb8 100644 --- a/tests/Zend/Measure/TimeTest.php +++ b/tests/Zend/Measure/TimeTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_TimeTest extends PHPUnit_Framework_TestCase +class Zend_Measure_TimeTest extends PHPUnit\Framework\TestCase { /** * test for Time initialisation @@ -379,7 +379,7 @@ public function testTimeConversionList() { $value = new Zend_Measure_Time('-100',Zend_Measure_Time::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } /** diff --git a/tests/Zend/Measure/TorqueTest.php b/tests/Zend/Measure/TorqueTest.php index 1a516b94b2..129225f823 100644 --- a/tests/Zend/Measure/TorqueTest.php +++ b/tests/Zend/Measure/TorqueTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_TorqueTest extends PHPUnit_Framework_TestCase +class Zend_Measure_TorqueTest extends PHPUnit\Framework\TestCase { /** * test for Torque initialisation @@ -384,6 +384,6 @@ public function testTorqueConversionList() { $value = new Zend_Measure_Torque('-100',Zend_Measure_Torque::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Measure/Viscosity/DynamicTest.php b/tests/Zend/Measure/Viscosity/DynamicTest.php index 9184ce6611..b5e7e0d820 100644 --- a/tests/Zend/Measure/Viscosity/DynamicTest.php +++ b/tests/Zend/Measure/Viscosity/DynamicTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_Viscosity_DynamicTest extends PHPUnit_Framework_TestCase +class Zend_Measure_Viscosity_DynamicTest extends PHPUnit\Framework\TestCase { /** * test for Mass initialisation @@ -383,6 +383,6 @@ public function testViscosity_DynamicConversionList() { $value = new Zend_Measure_Viscosity_Dynamic('-100',Zend_Measure_Viscosity_Dynamic::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Measure/Viscosity/KinematicTest.php b/tests/Zend/Measure/Viscosity/KinematicTest.php index 5e6e1544aa..f3467227ed 100644 --- a/tests/Zend/Measure/Viscosity/KinematicTest.php +++ b/tests/Zend/Measure/Viscosity/KinematicTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_Viscosity_KinematicTest extends PHPUnit_Framework_TestCase +class Zend_Measure_Viscosity_KinematicTest extends PHPUnit\Framework\TestCase { /** * test for Mass initialisation @@ -383,6 +383,6 @@ public function testViscosity_KinematicConversionList() { $value = new Zend_Measure_Viscosity_Kinematic('-100',Zend_Measure_Viscosity_Kinematic::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Measure/VolumeTest.php b/tests/Zend/Measure/VolumeTest.php index 2e86dee650..dcda6324fd 100644 --- a/tests/Zend/Measure/VolumeTest.php +++ b/tests/Zend/Measure/VolumeTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_VolumeTest extends PHPUnit_Framework_TestCase +class Zend_Measure_VolumeTest extends PHPUnit\Framework\TestCase { public function setUp() @@ -390,6 +390,6 @@ public function testVolumeConversionList() { $value = new Zend_Measure_Volume('-100',Zend_Measure_Volume::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Measure/WeightTest.php b/tests/Zend/Measure/WeightTest.php index 7b608d969e..f05d59aa25 100644 --- a/tests/Zend/Measure/WeightTest.php +++ b/tests/Zend/Measure/WeightTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Measure */ -class Zend_Measure_WeightTest extends PHPUnit_Framework_TestCase +class Zend_Measure_WeightTest extends PHPUnit\Framework\TestCase { /** * test for Weight initialisation @@ -384,6 +384,6 @@ public function testWeightConversionList() { $value = new Zend_Measure_Weight('-100',Zend_Measure_Weight::STANDARD,'de'); $unit = $value->getConversionList(); - $this->assertTrue(is_array($unit), 'Array expected'); + $this->assertInternalType('array', $unit, 'Array expected'); } } diff --git a/tests/Zend/Memory/AccessControllerTest.php b/tests/Zend/Memory/AccessControllerTest.php index 90d65b8f5f..1e92e4bf70 100644 --- a/tests/Zend/Memory/AccessControllerTest.php +++ b/tests/Zend/Memory/AccessControllerTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Memory */ -class Zend_Memory_Container_AccessControllerTest extends PHPUnit_Framework_TestCase +class Zend_Memory_Container_AccessControllerTest extends PHPUnit\Framework\TestCase { /** * Memory manager, used for tests diff --git a/tests/Zend/Memory/LockedTest.php b/tests/Zend/Memory/LockedTest.php index 1140b20ca2..33670a1c70 100644 --- a/tests/Zend/Memory/LockedTest.php +++ b/tests/Zend/Memory/LockedTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Memory */ -class Zend_Memory_Container_LockedTest extends PHPUnit_Framework_TestCase +class Zend_Memory_Container_LockedTest extends PHPUnit\Framework\TestCase { /** * tests the Movable memory container object creation diff --git a/tests/Zend/Memory/MemoryManagerTest.php b/tests/Zend/Memory/MemoryManagerTest.php index f4cb3ddd65..d38231bc42 100644 --- a/tests/Zend/Memory/MemoryManagerTest.php +++ b/tests/Zend/Memory/MemoryManagerTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Memory */ -class Zend_Memory_MemoryManagerTest extends PHPUnit_Framework_TestCase +class Zend_Memory_MemoryManagerTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Memory/MemoryTest.php b/tests/Zend/Memory/MemoryTest.php index 50ea30a8cf..0192d4723d 100644 --- a/tests/Zend/Memory/MemoryTest.php +++ b/tests/Zend/Memory/MemoryTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Memory */ -class Zend_Memory_MemoryTest extends PHPUnit_Framework_TestCase +class Zend_Memory_MemoryTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Memory/MovableTest.php b/tests/Zend/Memory/MovableTest.php index 5beb8f09d4..85d62b463b 100644 --- a/tests/Zend/Memory/MovableTest.php +++ b/tests/Zend/Memory/MovableTest.php @@ -73,7 +73,7 @@ public function processUpdate(Zend_Memory_Container_Movable $container, $id) * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Memory */ -class Zend_Memory_Container_MovableTest extends PHPUnit_Framework_TestCase +class Zend_Memory_Container_MovableTest extends PHPUnit\Framework\TestCase { /** * tests the Movable memory container object creation diff --git a/tests/Zend/Memory/ValueTest.php b/tests/Zend/Memory/ValueTest.php index dff8632c48..69444179ff 100644 --- a/tests/Zend/Memory/ValueTest.php +++ b/tests/Zend/Memory/ValueTest.php @@ -58,7 +58,7 @@ public function processUpdate() * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Memory */ -class Zend_Memory_ValueTest extends PHPUnit_Framework_TestCase +class Zend_Memory_ValueTest extends PHPUnit\Framework\TestCase { /** * tests the Value object creation diff --git a/tests/Zend/Mime/MessageTest.php b/tests/Zend/Mime/MessageTest.php index c1ae384804..1cd830bd1c 100644 --- a/tests/Zend/Mime/MessageTest.php +++ b/tests/Zend/Mime/MessageTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Mime */ -class Zend_Mime_MessageTest extends PHPUnit_Framework_TestCase +class Zend_Mime_MessageTest extends PHPUnit\Framework\TestCase { public function testMultiPart() @@ -46,7 +46,7 @@ public function testSetGetParts() { $msg = new Zend_Mime_Message(); // No Parts $p = $msg->getParts(); - $this->assertTrue(is_array($p)); + $this->assertInternalType('array', $p); $this->assertTrue(count($p) == 0); $p2 = array(); @@ -54,7 +54,7 @@ public function testSetGetParts() $p2[] = new Zend_Mime_Part('This is another test'); $msg->setParts($p2); $p = $msg->getParts(); - $this->assertTrue(is_array($p)); + $this->assertInternalType('array', $p); $this->assertTrue(count($p) == 2); } diff --git a/tests/Zend/Mime/PartTest.php b/tests/Zend/Mime/PartTest.php index 89ceba259a..fcae898813 100644 --- a/tests/Zend/Mime/PartTest.php +++ b/tests/Zend/Mime/PartTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Mime */ -class Zend_Mime_PartTest extends PHPUnit_Framework_TestCase +class Zend_Mime_PartTest extends PHPUnit\Framework\TestCase { /** * MIME part test object @@ -94,22 +94,22 @@ public function testStreamEncoding() // Test Base64 $fp = fopen($testfile,'rb'); - $this->assertTrue(is_resource($fp)); + $this->assertInternalType('resource', $fp); $part = new Zend_Mime_Part($fp); $part->encoding = Zend_Mime::ENCODING_BASE64; $fp2 = $part->getEncodedStream(); - $this->assertTrue(is_resource($fp2)); + $this->assertInternalType('resource', $fp2); $encoded = stream_get_contents($fp2); fclose($fp); $this->assertEquals(base64_decode($encoded),$original); // test QuotedPrintable $fp = fopen($testfile,'rb'); - $this->assertTrue(is_resource($fp)); + $this->assertInternalType('resource', $fp); $part = new Zend_Mime_Part($fp); $part->encoding = Zend_Mime::ENCODING_QUOTEDPRINTABLE; $fp2 = $part->getEncodedStream(); - $this->assertTrue(is_resource($fp2)); + $this->assertInternalType('resource', $fp2); $encoded = stream_get_contents($fp2); fclose($fp); $this->assertEquals(quoted_printable_decode($encoded),$original); diff --git a/tests/Zend/MimeTest.php b/tests/Zend/MimeTest.php index f6f008aa61..32fb8941bc 100644 --- a/tests/Zend/MimeTest.php +++ b/tests/Zend/MimeTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Mime */ -class Zend_MimeTest extends PHPUnit_Framework_TestCase +class Zend_MimeTest extends PHPUnit\Framework\TestCase { public function testBoundary() { diff --git a/tests/Zend/Mobile/Push/AbstractTest.php b/tests/Zend/Mobile/Push/AbstractTest.php index 4aafd945fa..33ae7cae1b 100644 --- a/tests/Zend/Mobile/Push/AbstractTest.php +++ b/tests/Zend/Mobile/Push/AbstractTest.php @@ -34,7 +34,7 @@ * @group Zend_Mobile_Push_Abstract */ -class Zend_Mobile_Push_AbstractTest extends PHPUnit_Framework_TestCase +class Zend_Mobile_Push_AbstractTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Mobile/Push/ApnsTest.php b/tests/Zend/Mobile/Push/ApnsTest.php index 1d310818ea..81cda61d0e 100644 --- a/tests/Zend/Mobile/Push/ApnsTest.php +++ b/tests/Zend/Mobile/Push/ApnsTest.php @@ -33,7 +33,7 @@ * @group Zend_Mobile_Push * @group Zend_Mobile_Push_Apns */ -class Zend_Mobile_Push_ApnsTest extends PHPUnit_Framework_TestCase +class Zend_Mobile_Push_ApnsTest extends PHPUnit\Framework\TestCase { public function setUp() @@ -51,34 +51,38 @@ protected function _setupValidBase() } /** - * @expectedException Zend_Mobile_Push_Exception */ public function testConnectThrowsExceptionOnInvalidEnvironment() { + $this->expectException(\Zend_Mobile_Push_Exception::class); + $this->apns->connect(5); } /** - * @expectedException Zend_Mobile_Push_Exception */ public function testConnectThrowsExceptionOnMissingCertificate() { + $this->expectException(\Zend_Mobile_Push_Exception::class); + $this->apns->connect(); } /** - * @expectedException Zend_Mobile_Push_Exception */ public function testSetCertificateThrowsExceptionOnNonString() { + $this->expectException(\Zend_Mobile_Push_Exception::class); + $this->apns->setCertificate(array('foo')); } /** - * @expectedException Zend_Mobile_Push_Exception */ public function testSetCertificateThrowsExceptionOnMissingFile() { + $this->expectException(\Zend_Mobile_Push_Exception::class); + $this->apns->setCertificate('bar'); } @@ -89,10 +93,11 @@ public function testSetCertificateReturnsInstance() } /** - * @expectedException Zend_Mobile_Push_Exception */ public function testSetCertificatePassphraseThrowsExceptionOnNonString() { + $this->expectException(\Zend_Mobile_Push_Exception::class); + $this->apns->setCertificatePassphrase(array('foo')); } @@ -116,19 +121,21 @@ public function testConnectReturnsThis() } /** - * @expectedException Zend_Mobile_Push_Exception */ public function testSendThrowsExceptionOnInvalidMessage() { + $this->expectException(\Zend_Mobile_Push_Exception::class); + $this->apns->setCertificate('Zend/Mobile/Push/certificate.pem'); $this->apns->send($this->message); } /** - * @expectedException Zend_Mobile_Push_Exception_ServerUnavailable */ public function testSendThrowsServerUnavailableExceptionOnFalseReturn() { + $this->expectException(\Zend_Mobile_Push_Exception_ServerUnavailable::class); + $this->_setupValidBase(); $this->apns->setWriteResponse(false); $this->apns->send($this->message); @@ -147,80 +154,88 @@ public function testSendReturnsTrueOnErr0() } /** - * @expectedException Zend_Mobile_Push_Exception */ public function testSendThrowsExceptionOnProcessingError() { + $this->expectException(\Zend_Mobile_Push_Exception::class); + $this->_setupValidBase(); $this->apns->setReadResponse(pack('CCN*', 1, 1, 012345)); $this->apns->send($this->message); } /** - * @expectedException Zend_Mobile_Push_Exception_InvalidToken */ public function testSendThrowsExceptionOnInvalidToken() { + $this->expectException(\Zend_Mobile_Push_Exception_InvalidToken::class); + $this->_setupValidBase(); $this->apns->setReadResponse(pack('CCN*', 2, 2, 012345)); $this->apns->send($this->message); } /** - * @expectedException Zend_Mobile_Push_Exception_InvalidTopic */ public function testSendThrowsExceptionOnInvalidTopic() { + $this->expectException(\Zend_Mobile_Push_Exception_InvalidTopic::class); + $this->_setupValidBase(); $this->apns->setReadResponse(pack('CCN*', 3, 3, 012345)); $this->apns->send($this->message); } /** - * @expectedException Zend_Mobile_Push_Exception_InvalidPayload */ public function testSendThrowsExceptionOnInvalidPayload() { + $this->expectException(\Zend_Mobile_Push_Exception_InvalidPayload::class); + $this->_setupValidBase(); $this->apns->setReadResponse(pack('CCN*', 4, 4, 012345)); $this->apns->send($this->message); } /** - * @expectedException Zend_Mobile_Push_Exception_InvalidToken */ public function testSendThrowsExceptionOnInvalidToken2() { + $this->expectException(\Zend_Mobile_Push_Exception_InvalidToken::class); + $this->_setupValidBase(); $this->apns->setReadResponse(pack('CCN*', 5, 5, 012345)); $this->apns->send($this->message); } /** - * @expectedException Zend_Mobile_Push_Exception_InvalidTopic */ public function testSendThrowsExceptionOnInvalidTopic2() { + $this->expectException(\Zend_Mobile_Push_Exception_InvalidTopic::class); + $this->_setupValidBase(); $this->apns->setReadResponse(pack('CCN*', 6, 6, 012345)); $this->apns->send($this->message); } /** - * @expectedException Zend_Mobile_Push_Exception_InvalidPayload */ public function testSendThrowsExceptionOnMessageTooBig() { + $this->expectException(\Zend_Mobile_Push_Exception_InvalidPayload::class); + $this->_setupValidBase(); $this->apns->setReadResponse(pack('CCN*', 7, 7, 012345)); $this->apns->send($this->message); } /** - * @expectedException Zend_Mobile_Push_Exception_InvalidToken */ public function testSendThrowsExceptionOnInvalidToken3() { + $this->expectException(\Zend_Mobile_Push_Exception_InvalidToken::class); + $this->_setupValidBase(); $this->apns->setReadResponse(pack('CCN*', 8, 8, 012345)); $this->apns->send($this->message); diff --git a/tests/Zend/Mobile/Push/GcmTest.php b/tests/Zend/Mobile/Push/GcmTest.php index 6f6f3efabc..2daaf8c5b7 100644 --- a/tests/Zend/Mobile/Push/GcmTest.php +++ b/tests/Zend/Mobile/Push/GcmTest.php @@ -34,7 +34,7 @@ * @group Zend_Mobile_Push * @group Zend_Mobile_Push_Gcm */ -class Zend_Mobile_Push_gcmTest extends PHPUnit_Framework_TestCase +class Zend_Mobile_Push_gcmTest extends PHPUnit\Framework\TestCase { protected function _createJSONResponse($id, $success, $failure, $ids, $results) @@ -62,10 +62,11 @@ public function setUp() } /** - * @expectedException Zend_Mobile_Push_Exception */ public function testSetApiKeyThrowsExceptionOnNonString() { + $this->expectException(\Zend_Mobile_Push_Exception::class); + $this->gcm->setApiKey(array()); } @@ -91,47 +92,52 @@ public function testSetHttpClient() } /** - * @expectedException Zend_Mobile_Push_Exception */ public function testSendThrowsExceptionWithNonValidMessage() { + $this->expectException(\Zend_Mobile_Push_Exception::class); + $msg = new Zend_Mobile_Push_Message_Gcm(); $this->gcm->send($msg); } /** - * @expectedException Zend_Mobile_Push_Exception */ public function testSendThrowsExceptionWithTtlNoId() { + $this->expectException(\Zend_Mobile_Push_Exception::class); + $msg = $this->message; $msg->setTtl(300); $this->gcm->send($msg); } /** - * @expectedException Zend_Mobile_Push_Exception_ServerUnavailable */ public function testSendThrowsExceptionWhenServerUnavailable() { + $this->expectException(\Zend_Mobile_Push_Exception_ServerUnavailable::class); + $this->adapter->setResponse('HTTP/1.1 500 Internal Server Error' . "\r\n\r\n"); $this->gcm->send($this->message); } /** - * @expectedException Zend_Mobile_Push_Exception_InvalidAuthToken */ public function testSendThrowsExceptionWhenInvalidAuthToken() { + $this->expectException(\Zend_Mobile_Push_Exception_InvalidAuthToken::class); + $this->adapter->setResponse('HTTP/1.1 401 Unauthorized' . "\r\n\r\n"); $this->gcm->send($this->message); } /** - * @expectedException Zend_Mobile_Push_Exception_InvalidPayload */ public function testSendThrowsExceptionWhenInvalidPayload() { + $this->expectException(\Zend_Mobile_Push_Exception_InvalidPayload::class); + $this->adapter->setResponse('HTTP/1.1 400 Bad Request' . "\r\n\r\n"); $this->gcm->send($this->message); } diff --git a/tests/Zend/Mobile/Push/Message/AbstractTest.php b/tests/Zend/Mobile/Push/Message/AbstractTest.php index 012e846426..efd60e13cb 100644 --- a/tests/Zend/Mobile/Push/Message/AbstractTest.php +++ b/tests/Zend/Mobile/Push/Message/AbstractTest.php @@ -30,7 +30,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Mobile */ -class Zend_Mobile_Push_Message_AbstractTest extends PHPUnit_Framework_TestCase +class Zend_Mobile_Push_Message_AbstractTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -46,10 +46,11 @@ public function testSetToken() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetTokenThrowsExceptionOnNonStringToken() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $this->msg->setToken(array('dummy')); } @@ -62,10 +63,11 @@ public function testSetId() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetIdThrowsExceptionOnNonScalar() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $this->msg->setId(array('foo')); } @@ -84,10 +86,11 @@ public function testSetOptions() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetOptionsThrowsExceptionOnMissingMethod() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $this->msg->setOptions(array( 'thisMethodDoesNotExist' => 'value' )); diff --git a/tests/Zend/Mobile/Push/Message/ApnsTest.php b/tests/Zend/Mobile/Push/Message/ApnsTest.php index 4a42e61cc1..fa4580dc95 100644 --- a/tests/Zend/Mobile/Push/Message/ApnsTest.php +++ b/tests/Zend/Mobile/Push/Message/ApnsTest.php @@ -32,7 +32,7 @@ * @group Zend_Mobile_Push * @group Zend_Mobile_Push_Apns */ -class Zend_Mobile_Push_Message_ApnsTest extends PHPUnit_Framework_TestCase +class Zend_Mobile_Push_Message_ApnsTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -45,47 +45,52 @@ public function testSetAlertTextReturnsCorrectly() $ret = $this->message->setAlert($text); $this->assertTrue($ret instanceof Zend_Mobile_Push_Message_Apns); $checkText = $this->message->getAlert(); - $this->assertTrue(is_array($checkText)); + $this->assertInternalType('array', $checkText); $this->assertEquals($checkText['body'], $text); } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetAlertThrowsExceptionOnTextNonString() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $this->message->setAlert(array()); } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetAlertThrowsExceptionOnActionLocKeyNonString() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $this->message->setAlert('text', array()); } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetAlertThrowsExceptionOnLocKeyNonString() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $this->message->setAlert('text', 'button', array()); } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetAlertThrowsExceptionOnLocArgsNonArray() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $this->message->setAlert('text', 'button', 'action', 'whoa'); } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetAlertThrowsExceptionOnLaunchImageNonString() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $this->message->setAlert('text', 'button', 'action', array('locale'), array()); } @@ -97,18 +102,20 @@ public function testSetBadgeReturnsCorrectNumber() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetBadgeNonNumericThrowsException() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $this->message->setBadge('string!'); } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetBadgeNegativeNumberThrowsException() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $this->message->setBadge(-5); } @@ -126,10 +133,11 @@ public function testSetExpireReturnsInteger() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetExpireNonNumericThrowsException() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $this->message->setExpire('sting!'); } @@ -141,10 +149,11 @@ public function testSetSoundReturnsString() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetSoundThrowsExceptionOnNonString() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $this->message->setSound(array()); } @@ -166,18 +175,20 @@ public function testAddCustomDataReturnsSetData() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testAddCustomDataThrowsExceptionOnNonStringKey() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $this->message->addCustomData(array('key'), 'val'); } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testAddCustomDataThrowsExceptionOnReservedKeyAps() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $this->message->addCustomData('aps', 'val'); } diff --git a/tests/Zend/Mobile/Push/Message/GcmTest.php b/tests/Zend/Mobile/Push/Message/GcmTest.php index 514c267915..326af7be83 100644 --- a/tests/Zend/Mobile/Push/Message/GcmTest.php +++ b/tests/Zend/Mobile/Push/Message/GcmTest.php @@ -32,22 +32,24 @@ * @group Zend_Mobile_Push * @group Zend_Mobile_Push_Gcm */ -class Zend_Mobile_Push_Message_GcmTest extends PHPUnit_Framework_TestCase +class Zend_Mobile_Push_Message_GcmTest extends PHPUnit\Framework\TestCase { /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testAddDataThrowsExceptionOnNonStringKey() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $msg = new Zend_Mobile_Push_Message_Gcm(); $msg->addData(array(), 'value'); } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testAddDataThrowsExceptionOnNonScalarValue() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $msg = new Zend_Mobile_Push_Message_Gcm(); $msg->addData('key', new stdClass); } @@ -92,10 +94,11 @@ public function testDelayWhileIdle() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testDelayWhileIdleThrowsExceptionOnInvalidValue() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $msg = new Zend_Mobile_Push_Message_Gcm(); $msg->setDelayWhileIdle('true'); } @@ -116,10 +119,11 @@ public function testTtlSendMessageOnZero() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testTtlThrowsExceptionOnInvalidValue() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $msg = new Zend_Mobile_Push_Message_Gcm(); $msg->setTtl('foo'); } diff --git a/tests/Zend/Mobile/Push/Message/Mpns/RawTest.php b/tests/Zend/Mobile/Push/Message/Mpns/RawTest.php index fcc7b6e8c2..bbf9c87df7 100644 --- a/tests/Zend/Mobile/Push/Message/Mpns/RawTest.php +++ b/tests/Zend/Mobile/Push/Message/Mpns/RawTest.php @@ -32,7 +32,7 @@ * @group Zend_Mobile_Push * @group Zend_Mobile_Push_Mpns */ -class Zend_Mobile_Push_Message_Mpns_RawTest extends PHPUnit_Framework_TestCase +class Zend_Mobile_Push_Message_Mpns_RawTest extends PHPUnit\Framework\TestCase { private $_msg; @@ -49,19 +49,21 @@ public function testSetToken() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetTokenNonStringThrowsException() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $token = array('foo' => 'bar'); $this->_msg->setToken($token); } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetTokenInvalidUrlThrowsException() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $token = 'notaurl'; $this->_msg->setToken($token); } @@ -79,19 +81,21 @@ public function testSetMessage() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetMessageThrowsExceptionOnNonString() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $msg = array('foo' => 'bar'); $this->_msg->setMessage($msg); } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetMessageThrowsExceptionOnNonXml() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $msg = 'foo'; $this->_msg->setMessage($msg); } @@ -112,10 +116,11 @@ public function testSetDelay() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetDelayThrowsExceptionOnInvalidDelay() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $delay = 'foo'; $this->_msg->setDelay($delay); } diff --git a/tests/Zend/Mobile/Push/Message/Mpns/TileTest.php b/tests/Zend/Mobile/Push/Message/Mpns/TileTest.php index a2813ee9c1..5eabef5b14 100644 --- a/tests/Zend/Mobile/Push/Message/Mpns/TileTest.php +++ b/tests/Zend/Mobile/Push/Message/Mpns/TileTest.php @@ -32,7 +32,7 @@ * @group Zend_Mobile_Push * @group Zend_Mobile_Push_Mpns */ -class Zend_Mobile_Push_Message_Mpns_TileTest extends PHPUnit_Framework_TestCase +class Zend_Mobile_Push_Message_Mpns_TileTest extends PHPUnit\Framework\TestCase { private $_msg; @@ -49,19 +49,21 @@ public function testSetToken() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetTokenNonStringThrowsException() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $token = array('foo' => 'bar'); $this->_msg->setToken($token); } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetTokenInvalidUrlThrowsException() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $token = 'notaurl'; $this->_msg->setToken($token); } @@ -84,10 +86,11 @@ public function testSetBackgroundImage() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetBackgroundImageThrowsExceptionOnNonString() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $image = array('foo' => 'bar'); $this->_msg->setBackgroundImage($image); } @@ -103,10 +106,11 @@ public function testSetCount() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetCountThrowsExceptionOnNonNumeric() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $count = 'five'; $this->_msg->setCount($count); } @@ -119,10 +123,11 @@ public function testSetTitle() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetTitleThrowsExceptionOnNonString() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $title = array('foo' => 'bar'); $this->_msg->setTitle($title); } @@ -135,10 +140,11 @@ public function testSetBackBackgroundImage() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetBackBackgroundImageThrowsExceptionOnNonString() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $image = array('foo' => 'bar'); $this->_msg->setBackBackgroundImage($image); } @@ -151,10 +157,11 @@ public function testSetBackTitle() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetBackTitleThrowsExceptionOnNonString() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $title = array('foo' => 'bar'); $this->_msg->setBackTitle($title); } @@ -167,10 +174,11 @@ public function testSetBackContent() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetBackContentThrowsExceptionOnNonString() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $content = array('foo' => 'bar'); $this->_msg->setBackContent($content); $this->assertEquals($content, $this->_msg->getBackContent()); @@ -184,10 +192,11 @@ public function testSetTileId() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetTileIdThrowsExceptionOnNonString() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $id = array('foo' => 'bar'); $this->_msg->setTileId($id); } diff --git a/tests/Zend/Mobile/Push/Message/Mpns/ToastTest.php b/tests/Zend/Mobile/Push/Message/Mpns/ToastTest.php index 835258b2af..79efdc62d5 100644 --- a/tests/Zend/Mobile/Push/Message/Mpns/ToastTest.php +++ b/tests/Zend/Mobile/Push/Message/Mpns/ToastTest.php @@ -32,7 +32,7 @@ * @group Zend_Mobile_Push * @group Zend_Mobile_Push_Mpns */ -class Zend_Mobile_Push_Message_Mpns_ToastTest extends PHPUnit_Framework_TestCase +class Zend_Mobile_Push_Message_Mpns_ToastTest extends PHPUnit\Framework\TestCase { private $_msg; @@ -49,19 +49,21 @@ public function testSetToken() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetTokenNonStringThrowsException() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $token = array('foo' => 'bar'); $this->_msg->setToken($token); } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetTokenInvalidUrlThrowsException() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $token = 'notaurl'; $this->_msg->setToken($token); } @@ -79,10 +81,11 @@ public function testSetTitle() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetTitleThrowsExceptionOnNonString() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $title = array('foo' => 'bar'); $this->_msg->setTitle($title); } @@ -95,10 +98,11 @@ public function testSetMessage() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetMessageThrowsExceptionOnNonString() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $msg = array('foo' => 'bar'); $this->_msg->setMessage($msg); } @@ -111,10 +115,11 @@ public function testSetParams() } /** - * @expectedException Zend_Mobile_Push_Message_Exception */ public function testSetParamsThrowsExceptionOnNonString() { + $this->expectException(\Zend_Mobile_Push_Message_Exception::class); + $params = array('foo' => 'bar'); $this->_msg->setParams($params); } diff --git a/tests/Zend/Mobile/Push/MpnsTest.php b/tests/Zend/Mobile/Push/MpnsTest.php index 466b5acbd3..b57f845265 100644 --- a/tests/Zend/Mobile/Push/MpnsTest.php +++ b/tests/Zend/Mobile/Push/MpnsTest.php @@ -37,7 +37,7 @@ * @group Zend_Mobile_Push * @group Zend_Mobile_Push_Mpns */ -class Zend_Mobile_Push_MpnsTest extends PHPUnit_Framework_TestCase +class Zend_Mobile_Push_MpnsTest extends PHPUnit\Framework\TestCase { public function setUp() @@ -80,82 +80,91 @@ public function testSetHttpClient() } /** - * @expectedException Zend_Mobile_Push_Exception */ public function testSendThrowsExceptionWithNonValidMessage() { + $this->expectException(\Zend_Mobile_Push_Exception::class); + $msg = new Zend_Mobile_Push_Message_Mpns_Tile(); $this->mpns->send($msg); } /** - * @expectedException Zend_Mobile_Push_Exception_DeviceQuotaExceeded */ public function testSendThrowsExceptionWhenDeviceQuotaExceeded() { + $this->expectException(\Zend_Mobile_Push_Exception_DeviceQuotaExceeded::class); + $this->adapter->setResponse('HTTP/1.1 200 OK' . "\r\n" . 'NotificationStatus: QueueFull' . "\r\n\r\n"); $this->mpns->send($this->getMessage('raw')); } /** - * @expectedException Zend_Mobile_Push_Exception_InvalidPayload */ public function testSendThrowsExceptionWhenInvalidPayload() { + $this->expectException(\Zend_Mobile_Push_Exception_InvalidPayload::class); + $this->adapter->setResponse('HTTP/1.1 400 Bad Request' . "\r\n\r\n"); $this->mpns->send($this->getMessage('raw')); } /** - * @expectedException Zend_Mobile_Push_Exception_InvalidToken */ public function testSendThrowsExceptionWhenInvalidToken() { + $this->expectException(\Zend_Mobile_Push_Exception_InvalidToken::class); + $this->adapter->setResponse('HTTP/1.1 401 Unauthorized' . "\r\n\r\n"); $this->mpns->send($this->getMessage('raw')); } /** - * @expectedException Zend_Mobile_Push_Exception_InvalidToken */ public function testSendThrowsExceptionWhenDeviceNotRegistered() { + $this->expectException(\Zend_Mobile_Push_Exception_InvalidToken::class); + $this->adapter->setResponse('HTTP/1.1 404 Not Found' . "\r\n\r\n"); $this->mpns->send($this->getMessage('raw')); } /** - * @expectedException Zend_Mobile_Push_Exception */ public function testSendThrowsExceptionWhenMethodNotPost() { + $this->expectException(\Zend_Mobile_Push_Exception::class); + $this->adapter->setResponse('HTTP/1.1 405 Method Not Allowed' . "\r\n\r\n"); $this->mpns->send($this->getMessage('raw')); } /** - * @expectedException Zend_Mobile_Push_Exception_QuotaExceeded */ public function testSendThrowsExceptionWhenServiceQuotaExceeded() { + $this->expectException(\Zend_Mobile_Push_Exception_QuotaExceeded::class); + $this->adapter->setResponse('HTTP/1.1 406 Not Acceptable'); $this->mpns->send($this->getMessage('raw')); } /** - * @expectedException Zend_Mobile_Push_Exception_InvalidToken */ public function testSendThrowsExceptionWhenInvalidToken2() { + $this->expectException(\Zend_Mobile_Push_Exception_InvalidToken::class); + $this->adapter->setResponse('HTTP/1.1 412 Precondition Failed' . "\r\n\r\n"); $this->mpns->send($this->getMessage('raw')); } /** - * @expectedException Zend_Mobile_Push_Exception_ServerUnavailable */ public function testSendThrowsExceptionWhenServerUnavailable() { + $this->expectException(\Zend_Mobile_Push_Exception_ServerUnavailable::class); + $this->adapter->setResponse('HTTP/1.1 503 Service Unavailable' . "\r\n\r\n"); $this->mpns->send($this->getMessage('raw')); } diff --git a/tests/Zend/Mobile/Push/Response/GcmTest.php b/tests/Zend/Mobile/Push/Response/GcmTest.php index 35b9023bad..ccbe8fc278 100644 --- a/tests/Zend/Mobile/Push/Response/GcmTest.php +++ b/tests/Zend/Mobile/Push/Response/GcmTest.php @@ -33,7 +33,7 @@ * @group Zend_Mobile_Push * @group Zend_Mobile_Push_Gcm */ -class Zend_Mobile_Push_Response_GcmTest extends PHPUnit_Framework_TestCase +class Zend_Mobile_Push_Response_GcmTest extends PHPUnit\Framework\TestCase { public function testConstructor() { @@ -62,10 +62,11 @@ public function testConstructor() } /** - * @expectedException Zend_Mobile_Push_Exception_ServerUnavailable */ public function testConstructorThrowsExceptionOnBadOrEmptyJsonString() { + $this->expectException(\Zend_Mobile_Push_Exception_ServerUnavailable::class); + $response = new Zend_Mobile_Push_Response_Gcm('{bad'); } diff --git a/tests/Zend/Navigation/ContainerTest.php b/tests/Zend/Navigation/ContainerTest.php index 75bda1aa09..b039423b1b 100644 --- a/tests/Zend/Navigation/ContainerTest.php +++ b/tests/Zend/Navigation/ContainerTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Navigation */ -class Zend_Navigation_ContainerTest extends PHPUnit_Framework_TestCase +class Zend_Navigation_ContainerTest extends PHPUnit\Framework\TestCase { /** * Prepares the environment before running a test. diff --git a/tests/Zend/Navigation/Page/MvcTest.php b/tests/Zend/Navigation/Page/MvcTest.php index 32f22954db..d6f8a95500 100644 --- a/tests/Zend/Navigation/Page/MvcTest.php +++ b/tests/Zend/Navigation/Page/MvcTest.php @@ -36,7 +36,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Navigation */ -class Zend_Navigation_Page_MvcTest extends PHPUnit_Framework_TestCase +class Zend_Navigation_Page_MvcTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Controller_Front diff --git a/tests/Zend/Navigation/Page/UriTest.php b/tests/Zend/Navigation/Page/UriTest.php index 29353073f4..9a5779fe85 100644 --- a/tests/Zend/Navigation/Page/UriTest.php +++ b/tests/Zend/Navigation/Page/UriTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Navigation */ -class Zend_Navigation_Page_UriTest extends PHPUnit_Framework_TestCase +class Zend_Navigation_Page_UriTest extends PHPUnit\Framework\TestCase { public function testUriOptionAsString() { diff --git a/tests/Zend/Navigation/PageFactoryTest.php b/tests/Zend/Navigation/PageFactoryTest.php index 5ad8ede848..585968d880 100644 --- a/tests/Zend/Navigation/PageFactoryTest.php +++ b/tests/Zend/Navigation/PageFactoryTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Navigation */ -class Zend_Navigation_PageFactoryTest extends PHPUnit_Framework_TestCase +class Zend_Navigation_PageFactoryTest extends PHPUnit\Framework\TestCase { protected $_oldIncludePath; diff --git a/tests/Zend/Navigation/PageTest.php b/tests/Zend/Navigation/PageTest.php index ae86dbf167..9c985e28d1 100644 --- a/tests/Zend/Navigation/PageTest.php +++ b/tests/Zend/Navigation/PageTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Navigation */ -class Zend_Navigation_PageTest extends PHPUnit_Framework_TestCase +class Zend_Navigation_PageTest extends PHPUnit\Framework\TestCase { /** * Prepares the environment before running a test. diff --git a/tests/Zend/NavigationTest.php b/tests/Zend/NavigationTest.php index df6653bdd8..835b036dd6 100644 --- a/tests/Zend/NavigationTest.php +++ b/tests/Zend/NavigationTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Navigation */ -class Zend_NavigationTest extends PHPUnit_Framework_TestCase +class Zend_NavigationTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Navigation diff --git a/tests/Zend/Oauth/ClientTest.php b/tests/Zend/Oauth/ClientTest.php index dee66023e4..1bbc5d0a16 100644 --- a/tests/Zend/Oauth/ClientTest.php +++ b/tests/Zend/Oauth/ClientTest.php @@ -39,7 +39,7 @@ public function getSignableParametersAsQueryString() * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Oauth */ -class Zend_Oauth_ClientTest extends PHPUnit_Framework_TestCase +class Zend_Oauth_ClientTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Oauth/ConfigTest.php b/tests/Zend/Oauth/ConfigTest.php index 55ba68d7fc..847d4ab13c 100644 --- a/tests/Zend/Oauth/ConfigTest.php +++ b/tests/Zend/Oauth/ConfigTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Oauth */ -class Zend_Oauth_ConfigTest extends PHPUnit_Framework_TestCase +class Zend_Oauth_ConfigTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Oauth/Oauth/ConsumerTest.php b/tests/Zend/Oauth/Oauth/ConsumerTest.php index 6ba55bde82..dcc163ec6d 100644 --- a/tests/Zend/Oauth/Oauth/ConsumerTest.php +++ b/tests/Zend/Oauth/Oauth/ConsumerTest.php @@ -30,7 +30,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Oauth */ -class Zend_Oauth_ConsumerTest extends PHPUnit_Framework_TestCase +class Zend_Oauth_ConsumerTest extends PHPUnit\Framework\TestCase { public function teardown() diff --git a/tests/Zend/Oauth/Oauth/Http/AccessTokenTest.php b/tests/Zend/Oauth/Oauth/Http/AccessTokenTest.php index 91ee13911e..d660d2f887 100644 --- a/tests/Zend/Oauth/Oauth/Http/AccessTokenTest.php +++ b/tests/Zend/Oauth/Oauth/Http/AccessTokenTest.php @@ -31,7 +31,7 @@ * @group Zend_Oauth * @group Zend_Oauth_Http */ -class Zend_Oauth_Http_AccessTokenTest extends PHPUnit_Framework_TestCase +class Zend_Oauth_Http_AccessTokenTest extends PHPUnit\Framework\TestCase { protected $stubConsumer = null; diff --git a/tests/Zend/Oauth/Oauth/Http/RequestTokenTest.php b/tests/Zend/Oauth/Oauth/Http/RequestTokenTest.php index 0a4ead5191..f6bdeee739 100644 --- a/tests/Zend/Oauth/Oauth/Http/RequestTokenTest.php +++ b/tests/Zend/Oauth/Oauth/Http/RequestTokenTest.php @@ -31,7 +31,7 @@ * @group Zend_Oauth * @group Zend_Oauth_Http */ -class Zend_Oauth_Http_RequestTokenTest extends PHPUnit_Framework_TestCase +class Zend_Oauth_Http_RequestTokenTest extends PHPUnit\Framework\TestCase { protected $stubConsumer = null; diff --git a/tests/Zend/Oauth/Oauth/Http/UserAuthorizationTest.php b/tests/Zend/Oauth/Oauth/Http/UserAuthorizationTest.php index 02c9362a99..291e484221 100644 --- a/tests/Zend/Oauth/Oauth/Http/UserAuthorizationTest.php +++ b/tests/Zend/Oauth/Oauth/Http/UserAuthorizationTest.php @@ -31,7 +31,7 @@ * @group Zend_Oauth * @group Zend_Oauth_Http */ -class Zend_Oauth_Http_UserAuthorizationTest extends PHPUnit_Framework_TestCase +class Zend_Oauth_Http_UserAuthorizationTest extends PHPUnit\Framework\TestCase { protected $stubConsumer = null; diff --git a/tests/Zend/Oauth/Oauth/Http/UtilityTest.php b/tests/Zend/Oauth/Oauth/Http/UtilityTest.php index 01b55990fd..f105d2958d 100644 --- a/tests/Zend/Oauth/Oauth/Http/UtilityTest.php +++ b/tests/Zend/Oauth/Oauth/Http/UtilityTest.php @@ -31,7 +31,7 @@ * @group Zend_Oauth * @group Zend_Oauth_Http */ -class Zend_Oauth_Http_UtilityTest extends PHPUnit_Framework_TestCase +class Zend_Oauth_Http_UtilityTest extends PHPUnit\Framework\TestCase { // see: http://wiki.oauth.net/TestCases (Parameter Encoding Tests) diff --git a/tests/Zend/Oauth/Oauth/Signature/AbstractTest.php b/tests/Zend/Oauth/Oauth/Signature/AbstractTest.php index 024b9531f4..9e3a9aef2c 100644 --- a/tests/Zend/Oauth/Oauth/Signature/AbstractTest.php +++ b/tests/Zend/Oauth/Oauth/Signature/AbstractTest.php @@ -31,7 +31,7 @@ * @group Zend_Oauth * @group Zend_Oauth_Signature */ -class Zend_Oauth_Signature_AbstractTest extends PHPUnit_Framework_TestCase +class Zend_Oauth_Signature_AbstractTest extends PHPUnit\Framework\TestCase { public function testNormaliseHttpBaseSignatureUrl() diff --git a/tests/Zend/Oauth/Oauth/Signature/HmacTest.php b/tests/Zend/Oauth/Oauth/Signature/HmacTest.php index d52d8e6bfc..c73c5d7230 100644 --- a/tests/Zend/Oauth/Oauth/Signature/HmacTest.php +++ b/tests/Zend/Oauth/Oauth/Signature/HmacTest.php @@ -31,7 +31,7 @@ * @group Zend_Oauth * @group Zend_Oauth_Signature */ -class Zend_Oauth_Signature_HmacTest extends PHPUnit_Framework_TestCase +class Zend_Oauth_Signature_HmacTest extends PHPUnit\Framework\TestCase { public function testSignatureWithoutAccessSecretIsHashedWithConsumerSecret() diff --git a/tests/Zend/Oauth/Oauth/Signature/PlaintextTest.php b/tests/Zend/Oauth/Oauth/Signature/PlaintextTest.php index c037207722..fe07f65978 100644 --- a/tests/Zend/Oauth/Oauth/Signature/PlaintextTest.php +++ b/tests/Zend/Oauth/Oauth/Signature/PlaintextTest.php @@ -31,7 +31,7 @@ * @group Zend_Oauth * @group Zend_Oauth_Signature */ -class Zend_Oauth_Signature_PlaintextTest extends PHPUnit_Framework_TestCase +class Zend_Oauth_Signature_PlaintextTest extends PHPUnit\Framework\TestCase { public function testSignatureWithoutAccessSecretIsOnlyConsumerSecretString() diff --git a/tests/Zend/Oauth/Oauth/Signature/RsaTest.php b/tests/Zend/Oauth/Oauth/Signature/RsaTest.php index 08acfeb22e..2aa5e70e42 100644 --- a/tests/Zend/Oauth/Oauth/Signature/RsaTest.php +++ b/tests/Zend/Oauth/Oauth/Signature/RsaTest.php @@ -31,7 +31,7 @@ * @group Zend_Oauth * @group Zend_Oauth_Signature */ -class Zend_Oauth_Signature_RsaTest extends PHPUnit_Framework_TestCase +class Zend_Oauth_Signature_RsaTest extends PHPUnit\Framework\TestCase { public function testSignatureWithoutAccessSecretIsHashedWithConsumerSecret() diff --git a/tests/Zend/Oauth/Oauth/Token/AccessTest.php b/tests/Zend/Oauth/Oauth/Token/AccessTest.php index ecfd6385da..35cee78f45 100644 --- a/tests/Zend/Oauth/Oauth/Token/AccessTest.php +++ b/tests/Zend/Oauth/Oauth/Token/AccessTest.php @@ -32,7 +32,7 @@ * @group Zend_Oauth * @group Zend_Oauth_Token */ -class Zend_Oauth_Token_AccessTest extends PHPUnit_Framework_TestCase +class Zend_Oauth_Token_AccessTest extends PHPUnit\Framework\TestCase { public function testConstructorSetsResponseObject() diff --git a/tests/Zend/Oauth/Oauth/Token/AuthorizedRequestTest.php b/tests/Zend/Oauth/Oauth/Token/AuthorizedRequestTest.php index 92cdc9384d..b8e85a51fa 100644 --- a/tests/Zend/Oauth/Oauth/Token/AuthorizedRequestTest.php +++ b/tests/Zend/Oauth/Oauth/Token/AuthorizedRequestTest.php @@ -31,7 +31,7 @@ * @group Zend_Oauth * @group Zend_Oauth_Token */ -class Zend_Oauth_Token_AuthorizedRequestTest extends PHPUnit_Framework_TestCase +class Zend_Oauth_Token_AuthorizedRequestTest extends PHPUnit\Framework\TestCase { public function testConstructorSetsInputData() diff --git a/tests/Zend/Oauth/Oauth/Token/RequestTest.php b/tests/Zend/Oauth/Oauth/Token/RequestTest.php index 9568efff0a..b515d295c2 100644 --- a/tests/Zend/Oauth/Oauth/Token/RequestTest.php +++ b/tests/Zend/Oauth/Oauth/Token/RequestTest.php @@ -31,7 +31,7 @@ * @group Zend_Oauth * @group Zend_Oauth_Token */ -class Zend_Oauth_Token_RequestTest extends PHPUnit_Framework_TestCase +class Zend_Oauth_Token_RequestTest extends PHPUnit\Framework\TestCase { public function testConstructorSetsResponseObject() diff --git a/tests/Zend/Oauth/OauthTest.php b/tests/Zend/Oauth/OauthTest.php index c493d4c315..63dac1cd1c 100644 --- a/tests/Zend/Oauth/OauthTest.php +++ b/tests/Zend/Oauth/OauthTest.php @@ -32,7 +32,7 @@ class Test_Http_Client_19485876 extends Zend_Http_Client {} * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Oauth */ -class Zend_OauthTest extends PHPUnit_Framework_TestCase +class Zend_OauthTest extends PHPUnit\Framework\TestCase { public function teardown() diff --git a/tests/Zend/OpenId/Consumer/Storage/FileTest.php b/tests/Zend/OpenId/Consumer/Storage/FileTest.php index 5ab619bfd0..7ee080d46e 100644 --- a/tests/Zend/OpenId/Consumer/Storage/FileTest.php +++ b/tests/Zend/OpenId/Consumer/Storage/FileTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_OpenId */ -class Zend_OpenId_Consumer_Storage_FileTest extends PHPUnit_Framework_TestCase +class Zend_OpenId_Consumer_Storage_FileTest extends PHPUnit\Framework\TestCase { const URL = "http://www.myopenid.com/"; const HANDLE = "d41d8cd98f00b204e9800998ecf8427e"; @@ -101,7 +101,7 @@ public function testConstruct() $dir = $tmp . '/openid_consumer'; $storage = new Zend_OpenId_Consumer_Storage_File($dir); - $this->assertTrue( is_dir($dir) ); + $this->assertDirectoryExists( $dir ); if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { return; @@ -119,7 +119,7 @@ public function testConstruct() $this->assertSame( Zend_OpenId_Exception::ERROR_STORAGE, $ex->getCode() ); $this->assertContains( 'Cannot access storage directory', $ex->getMessage() ); chmod($dir, 0777); - $this->assertFalse( is_dir($dir2) ); + $this->assertDirectoryNotExists( $dir2 ); self::_rmDir($dir); } @@ -145,7 +145,7 @@ public function testGetAssociation() $this->assertFalse( $storage->getAssociation(self::URL, $handle, $macFunc, $secret, $expires) ); $storage = new Zend_OpenId_Consumer_Storage_File($dir); - $this->assertTrue( is_dir($dir) ); + $this->assertDirectoryExists( $dir ); if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { return; @@ -235,7 +235,7 @@ public function testGetDiscoveryInfo() self::_rmDir($dir); $storage = new Zend_OpenId_Consumer_Storage_File($dir); - $this->assertTrue( is_dir($dir) ); + $this->assertDirectoryExists( $dir ); if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { return; diff --git a/tests/Zend/OpenId/ConsumerTest.php b/tests/Zend/OpenId/ConsumerTest.php index 7c38e58f61..c5df64b852 100644 --- a/tests/Zend/OpenId/ConsumerTest.php +++ b/tests/Zend/OpenId/ConsumerTest.php @@ -53,7 +53,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_OpenId */ -class Zend_OpenId_ConsumerTest extends PHPUnit_Framework_TestCase +class Zend_OpenId_ConsumerTest extends PHPUnit\Framework\TestCase { const ID = "http://id.myopenid.com/"; const REAL_ID = "http://real_id.myopenid.com/"; @@ -83,9 +83,9 @@ public function testLogin() $this->assertTrue( $consumer->login(self::ID, null, null, null, $response) ); $headers = $response->getHeaders(); $this->assertSame( '', $response->getBody() ); - $this->assertTrue( is_array($headers) ); + $this->assertInternalType( 'array', $headers ); $this->assertSame( 1, count($headers) ); - $this->assertTrue( is_array($headers[0]) ); + $this->assertInternalType( 'array', $headers[0] ); $this->assertSame( 3, count($headers[0]) ); $this->assertSame( 'Location', $headers[0]['name'] ); $this->assertSame( true, $headers[0]['replace'] ); @@ -101,7 +101,7 @@ public function testLogin() $query[$key] = $val; } } - $this->assertTrue( is_array($query) ); + $this->assertInternalType( 'array', $query ); $this->assertSame( 6, count($query) ); $this->assertSame( 'checkid_setup', $query['openid.mode'] ); $this->assertSame( 'http%3A%2F%2Freal_id.myopenid.com%2F', $query['openid.identity'] ); @@ -124,7 +124,7 @@ public function testLogin() $query[$key] = $val; } } - $this->assertTrue( is_array($query) ); + $this->assertInternalType( 'array', $query ); $this->assertSame( 6, count($query) ); $this->assertSame( 'checkid_setup', $query['openid.mode'] ); $this->assertSame( 'http%3A%2F%2Freal_id.myopenid.com%2F', $query['openid.identity'] ); @@ -150,7 +150,7 @@ public function testLogin() $query[$key] = $val; } } - $this->assertTrue( is_array($query) ); + $this->assertInternalType( 'array', $query ); $this->assertSame( 7, count($query) ); $this->assertSame( 'http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0', $query['openid.ns'] ); $this->assertSame( 'checkid_setup', $query['openid.mode'] ); @@ -175,7 +175,7 @@ public function testLogin() $query[$key] = $val; } } - $this->assertTrue( is_array($query) ); + $this->assertInternalType( 'array', $query ); $this->assertSame( 9, count($query) ); $this->assertSame( 'http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0', $query['openid.ns'] ); $this->assertSame( 'checkid_setup', $query['openid.mode'] ); @@ -202,7 +202,7 @@ public function testLogin() $query[$key] = $val; } } - $this->assertTrue( is_array($query) ); + $this->assertInternalType( 'array', $query ); $this->assertSame( 6, count($query) ); $this->assertSame( 'http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0', $query['openid.ns'] ); $this->assertSame( 'checkid_setup', $query['openid.mode'] ); @@ -234,9 +234,9 @@ public function testCheck() $this->assertTrue( $consumer->check(self::ID, null, null, null, $response) ); $headers = $response->getHeaders(); $this->assertSame( '', $response->getBody() ); - $this->assertTrue( is_array($headers) ); + $this->assertInternalType( 'array', $headers ); $this->assertSame( 1, count($headers) ); - $this->assertTrue( is_array($headers[0]) ); + $this->assertInternalType( 'array', $headers[0] ); $this->assertSame( 3, count($headers[0]) ); $this->assertSame( 'Location', $headers[0]['name'] ); $this->assertSame( true, $headers[0]['replace'] ); @@ -252,7 +252,7 @@ public function testCheck() $query[$key] = $val; } } - $this->assertTrue( is_array($query) ); + $this->assertInternalType( 'array', $query ); $this->assertSame( 6, count($query) ); $this->assertSame( 'checkid_immediate', $query['openid.mode'] ); $this->assertSame( 'http%3A%2F%2Freal_id.myopenid.com%2F', $query['openid.identity'] ); diff --git a/tests/Zend/OpenId/Extension/SregTest.php b/tests/Zend/OpenId/Extension/SregTest.php index 813c1b5265..d9cc70fd0e 100644 --- a/tests/Zend/OpenId/Extension/SregTest.php +++ b/tests/Zend/OpenId/Extension/SregTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_OpenId */ -class Zend_OpenId_Extension_SregTest extends PHPUnit_Framework_TestCase +class Zend_OpenId_Extension_SregTest extends PHPUnit\Framework\TestCase { const USER = "test_user"; const EMAIL = "user@test.com"; diff --git a/tests/Zend/OpenId/ExtensionTest.php b/tests/Zend/OpenId/ExtensionTest.php index 08481397ce..ffab41e0d8 100644 --- a/tests/Zend/OpenId/ExtensionTest.php +++ b/tests/Zend/OpenId/ExtensionTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_OpenId */ -class Zend_OpenId_ExtensionTest extends PHPUnit_Framework_TestCase +class Zend_OpenId_ExtensionTest extends PHPUnit\Framework\TestCase { /** * testing forAll diff --git a/tests/Zend/OpenId/Provider/Storage/FileTest.php b/tests/Zend/OpenId/Provider/Storage/FileTest.php index 1c6a21593c..ff2fbf5876 100644 --- a/tests/Zend/OpenId/Provider/Storage/FileTest.php +++ b/tests/Zend/OpenId/Provider/Storage/FileTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_OpenId */ -class Zend_OpenId_Provider_Storage_FileTest extends PHPUnit_Framework_TestCase +class Zend_OpenId_Provider_Storage_FileTest extends PHPUnit\Framework\TestCase { const HANDLE = "d41d8cd98f00b204e9800998ecf8427e"; const MAC_FUNC = "sha256"; @@ -53,7 +53,7 @@ public function testConstruct() $dir = $tmp . '/openid_provider'; @rmdir($dir); $storage = new Zend_OpenId_Provider_Storage_File($dir); - $this->assertTrue( is_dir($dir) ); + $this->assertDirectoryExists( $dir ); if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { return; @@ -71,7 +71,7 @@ public function testConstruct() $this->assertSame( Zend_OpenId_Exception::ERROR_STORAGE, $ex->getCode() ); $this->assertContains( 'Cannot access storage directory', $ex->getMessage() ); chmod($dir, 0777); - $this->assertFalse( is_dir($dir2) ); + $this->assertDirectoryNotExists( $dir2 ); @rmdir($dir); } @@ -96,7 +96,7 @@ public function testGetAssociation() $dir = $tmp . '/openid_consumer'; @rmdir($dir); $storage = new Zend_OpenId_Provider_Storage_File($dir); - $this->assertTrue( is_dir($dir) ); + $this->assertDirectoryExists( $dir ); if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { return; @@ -177,7 +177,7 @@ public function testAddSite() $this->assertTrue( $storage->addUser(self::USER, self::PASSWORD) ); $this->assertTrue( $storage->addSite(self::USER, self::SITE1, true) ); $trusted = $storage->getTrustedSites(self::USER); - $this->assertTrue( is_array($trusted) ); + $this->assertInternalType( 'array', $trusted ); $this->assertSame( 1, count($trusted) ); reset($trusted); $this->assertSame( self::SITE1, key($trusted) ); @@ -186,24 +186,24 @@ public function testAddSite() $this->assertFalse( $storage->addSite(self::USER, self::SITE1, true) ); $this->assertTrue( $storage->addUser(self::USER, self::PASSWORD) ); $trusted = $storage->getTrustedSites(self::USER); - $this->assertTrue( is_array($trusted) ); + $this->assertInternalType( 'array', $trusted ); $this->assertSame( 0, count($trusted) ); $this->assertTrue( $storage->addSite(self::USER, self::SITE1, self::SITE1) ); $this->assertTrue( $storage->addSite(self::USER, self::SITE2, self::SITE2) ); $this->assertTrue( $storage->addSite(self::USER, self::SITE1, self::USER) ); $trusted = $storage->getTrustedSites(self::USER); - $this->assertTrue( is_array($trusted) ); + $this->assertInternalType( 'array', $trusted ); $this->assertSame( 2, count($trusted) ); $this->assertSame( self::USER, $trusted[self::SITE1] ); $this->assertSame( self::SITE2, $trusted[self::SITE2] ); $this->assertTrue( $storage->addSite(self::USER, self::SITE2, null) ); $trusted = $storage->getTrustedSites(self::USER); - $this->assertTrue( is_array($trusted) ); + $this->assertInternalType( 'array', $trusted ); $this->assertSame( 1, count($trusted) ); $this->assertSame( self::USER, $trusted[self::SITE1] ); $this->assertTrue( $storage->addSite(self::USER, self::SITE1, null) ); $trusted = $storage->getTrustedSites(self::USER); - $this->assertTrue( is_array($trusted) ); + $this->assertInternalType( 'array', $trusted ); $this->assertSame( 0, count($trusted) ); $this->assertTrue( $storage->delUser(self::USER) ); $storage->delUser(self::USER); diff --git a/tests/Zend/OpenId/Provider/User/SessionTest.php b/tests/Zend/OpenId/Provider/User/SessionTest.php index 681881cf8e..036f9095bd 100644 --- a/tests/Zend/OpenId/Provider/User/SessionTest.php +++ b/tests/Zend/OpenId/Provider/User/SessionTest.php @@ -34,14 +34,14 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_OpenId */ -class Zend_OpenId_Provider_User_SessionTest extends PHPUnit_Framework_TestCase +class Zend_OpenId_Provider_User_SessionTest extends PHPUnit\Framework\TestCase { const USER1 = "test_user1"; const USER2 = "test_user2"; private $_user; - public function __construct() + public function setUp() { $this->_user1 = new Zend_OpenId_Provider_User_Session(); $this->_user2 = new Zend_OpenId_Provider_User_Session(new Zend_Session_Namespace("openid2")); diff --git a/tests/Zend/OpenId/ProviderTest.php b/tests/Zend/OpenId/ProviderTest.php index 35ffdee537..4ba8942c2e 100644 --- a/tests/Zend/OpenId/ProviderTest.php +++ b/tests/Zend/OpenId/ProviderTest.php @@ -43,7 +43,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_OpenId */ -class Zend_OpenId_ProviderTest extends PHPUnit_Framework_TestCase +class Zend_OpenId_ProviderTest extends PHPUnit\Framework\TestCase { const USER = "http://test_user.myopenid.com/"; const PASSWORD = "01234567890abcdef"; @@ -260,7 +260,7 @@ public function testAllowSite() $this->assertTrue( $provider->allowSite("http://www.test.com/") ); $trusted = $storage->getTrustedSites(self::USER); - $this->assertTrue( is_array($trusted) ); + $this->assertInternalType( 'array', $trusted ); $this->assertSame( 1, count($trusted) ); reset($trusted); $this->assertSame( "http://www.test.com/", key($trusted) ); @@ -270,7 +270,7 @@ public function testAllowSite() $this->assertTrue( $provider->allowSite("http://www.test.com/") ); $trusted = $storage->getTrustedSites(self::USER); - $this->assertTrue( is_array($trusted) ); + $this->assertInternalType( 'array', $trusted ); $this->assertSame( 1, count($trusted) ); reset($trusted); $this->assertSame( "http://www.test.com/", key($trusted) ); @@ -281,7 +281,7 @@ public function testAllowSite() $this->assertTrue( $provider->allowSite("http://www.test.com/", $sreg) ); $trusted = $storage->getTrustedSites(self::USER); - $this->assertTrue( is_array($trusted) ); + $this->assertInternalType( 'array', $trusted ); $this->assertSame( 1, count($trusted) ); reset($trusted); $this->assertSame( "http://www.test.com/", key($trusted) ); @@ -457,12 +457,12 @@ public function testGenSecret() // SHA1 $x = $provider->genSecret("sha1"); - $this->assertTrue( is_string($x) ); + $this->assertInternalType( 'string', $x ); $this->assertSame( 20, strlen($x) ); // SHA256 $x = $provider->genSecret("sha256"); - $this->assertTrue( is_string($x) ); + $this->assertInternalType( 'string', $x ); $this->assertSame( 32, strlen($x) ); // invalid function diff --git a/tests/Zend/OpenIdTest.php b/tests/Zend/OpenIdTest.php index 8043a7f7f5..5389716424 100644 --- a/tests/Zend/OpenIdTest.php +++ b/tests/Zend/OpenIdTest.php @@ -39,7 +39,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_OpenId */ -class Zend_OpenIdTest extends PHPUnit_Framework_TestCase +class Zend_OpenIdTest extends PHPUnit\Framework\TestCase { private $_serverVariables; @@ -415,9 +415,9 @@ public function testRedirect() $this->assertSame( 302, $response->getHttpResponseCode() ); $this->assertSame( array(), $response->getRawHeaders() ); $headers = $response->getHeaders(); - $this->assertTrue( is_array($headers) ); + $this->assertInternalType( 'array', $headers ); $this->assertSame( 1, count($headers) ); - $this->assertTrue( is_array($headers[0]) ); + $this->assertInternalType( 'array', $headers[0] ); $this->assertSame( 3, count($headers[0]) ); $this->assertSame( 'Location', $headers[0]['name'] ); $this->assertSame( 'http://www.test.com/', $headers[0]['value'] ); @@ -530,10 +530,10 @@ public function testRandomBytes() { $this->assertSame( '', Zend_OpenId::randomBytes(0) ); $x = Zend_OpenId::randomBytes(1); - $this->assertTrue( is_string($x) ); + $this->assertInternalType( 'string', $x ); $this->assertSame( 1, strlen($x) ); $x = Zend_OpenId::randomBytes(1024); - $this->assertTrue( is_string($x) ); + $this->assertInternalType( 'string', $x ); $this->assertSame( 1024, strlen($x) ); } @@ -585,7 +585,7 @@ public function testCreateDhKey() pack('H*', '05'), pack('H*', '09')); $dh_details = Zend_OpenId::getDhKeyDetails($dh); - $this->assertTrue( is_array($dh_details) ); + $this->assertInternalType( 'array', $dh_details ); $this->assertSame( 4, count($dh_details)); $this->assertSame( '0233', bin2hex($dh_details['p']) ); $this->assertSame( '05', bin2hex($dh_details['g']) ); @@ -597,7 +597,7 @@ public function testCreateDhKey() pack('H*', '02'), pack('H*', '09')); $dh_details = Zend_OpenId::getDhKeyDetails($dh); - $this->assertTrue( is_array($dh_details) ); + $this->assertInternalType( 'array', $dh_details ); $this->assertSame( 4, count($dh_details) ); $this->assertSame( '0233', bin2hex($dh_details['p']) ); $this->assertSame( '02', bin2hex($dh_details['g']) ); @@ -608,13 +608,13 @@ public function testCreateDhKey() pack('H*', '0233'), pack('H*', '02')); $dh_details = Zend_OpenId::getDhKeyDetails($dh); - $this->assertTrue( is_array($dh_details) ); + $this->assertInternalType( 'array', $dh_details ); $this->assertSame( 4, count($dh_details) ); $this->assertSame( '0233', bin2hex($dh_details['p']) ); $this->assertSame( '02', bin2hex($dh_details['g']) ); - $this->assertTrue( is_string($dh_details['priv_key']) ); + $this->assertInternalType( 'string', $dh_details['priv_key'] ); $this->assertTrue( strlen($dh_details['priv_key']) > 0 ); - $this->assertTrue( is_string($dh_details['pub_key']) ); + $this->assertInternalType( 'string', $dh_details['pub_key'] ); $this->assertTrue( strlen($dh_details['pub_key']) > 0 ); } catch (Zend_OpenId_Exception $e) { $this->markTestSkipped($e->getMessage()); diff --git a/tests/Zend/Paginator/Adapter/ArrayTest.php b/tests/Zend/Paginator/Adapter/ArrayTest.php index 322fabd2ce..b00f4fd92e 100644 --- a/tests/Zend/Paginator/Adapter/ArrayTest.php +++ b/tests/Zend/Paginator/Adapter/ArrayTest.php @@ -26,7 +26,7 @@ require_once 'Zend/Paginator/Adapter/Array.php'; /** - * @see PHPUnit_Framework_TestCase + * @see PHPUnit\Framework\TestCase */ /** @@ -37,7 +37,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Paginator */ -class Zend_Paginator_Adapter_ArrayTest extends PHPUnit_Framework_TestCase +class Zend_Paginator_Adapter_ArrayTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Paginator_Adapter_Array diff --git a/tests/Zend/Paginator/Adapter/DbSelectTest.php b/tests/Zend/Paginator/Adapter/DbSelectTest.php index f983502711..38e3a98e42 100644 --- a/tests/Zend/Paginator/Adapter/DbSelectTest.php +++ b/tests/Zend/Paginator/Adapter/DbSelectTest.php @@ -33,7 +33,7 @@ require_once 'Zend/Db/Adapter/Abstract.php'; /** - * @see PHPUnit_Framework_TestCase + * @see PHPUnit\Framework\TestCase */ require_once dirname(__FILE__) . '/../_files/TestTable.php'; @@ -46,7 +46,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Paginator */ -class Zend_Paginator_Adapter_DbSelectTest extends PHPUnit_Framework_TestCase +class Zend_Paginator_Adapter_DbSelectTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Paginator_Adapter_DbSelect diff --git a/tests/Zend/Paginator/Adapter/IteratorTest.php b/tests/Zend/Paginator/Adapter/IteratorTest.php index 2dba80529b..35d52d6459 100644 --- a/tests/Zend/Paginator/Adapter/IteratorTest.php +++ b/tests/Zend/Paginator/Adapter/IteratorTest.php @@ -26,7 +26,7 @@ require_once 'Zend/Paginator/Adapter/Iterator.php'; /** - * @see PHPUnit_Framework_TestCase + * @see PHPUnit\Framework\TestCase */ /** @@ -37,7 +37,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Paginator */ -class Zend_Paginator_Adapter_IteratorTest extends PHPUnit_Framework_TestCase +class Zend_Paginator_Adapter_IteratorTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Paginator_Adapter_Iterator diff --git a/tests/Zend/Paginator/Adapter/NullTest.php b/tests/Zend/Paginator/Adapter/NullTest.php index cab6110dfd..10bcc08940 100644 --- a/tests/Zend/Paginator/Adapter/NullTest.php +++ b/tests/Zend/Paginator/Adapter/NullTest.php @@ -31,7 +31,7 @@ require_once 'Zend/Paginator/Adapter/Null.php'; /** - * @see PHPUnit_Framework_TestCase + * @see PHPUnit\Framework\TestCase */ /** @@ -42,7 +42,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Paginator */ -class Zend_Paginator_Adapter_NullTest extends PHPUnit_Framework_TestCase +class Zend_Paginator_Adapter_NullTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Paginator_Adapter_Array diff --git a/tests/Zend/Paginator/ScrollingStyle/AllTest.php b/tests/Zend/Paginator/ScrollingStyle/AllTest.php index 435d89c308..9ce7e64c8b 100644 --- a/tests/Zend/Paginator/ScrollingStyle/AllTest.php +++ b/tests/Zend/Paginator/ScrollingStyle/AllTest.php @@ -31,7 +31,7 @@ require_once 'Zend/Paginator/ScrollingStyle/All.php'; /** - * @see PHPUnit_Framework_TestCase + * @see PHPUnit\Framework\TestCase */ /** @@ -42,7 +42,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Paginator */ -class Zend_Paginator_ScrollingStyle_AllTest extends PHPUnit_Framework_TestCase +class Zend_Paginator_ScrollingStyle_AllTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Paginator_ScrollingStyle_All diff --git a/tests/Zend/Paginator/ScrollingStyle/ElasticTest.php b/tests/Zend/Paginator/ScrollingStyle/ElasticTest.php index 5a99fb4e0e..73d747c19c 100644 --- a/tests/Zend/Paginator/ScrollingStyle/ElasticTest.php +++ b/tests/Zend/Paginator/ScrollingStyle/ElasticTest.php @@ -26,7 +26,7 @@ require_once 'Zend/Paginator/ScrollingStyle/Elastic.php'; /** - * @see PHPUnit_Framework_TestCase + * @see PHPUnit\Framework\TestCase */ /** @@ -42,7 +42,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Paginator */ -class Zend_Paginator_ScrollingStyle_ElasticTest extends PHPUnit_Framework_TestCase +class Zend_Paginator_ScrollingStyle_ElasticTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Paginator_ScrollingStyle_Elastic diff --git a/tests/Zend/Paginator/ScrollingStyle/JumpingTest.php b/tests/Zend/Paginator/ScrollingStyle/JumpingTest.php index 322fa05797..a2c22a2627 100644 --- a/tests/Zend/Paginator/ScrollingStyle/JumpingTest.php +++ b/tests/Zend/Paginator/ScrollingStyle/JumpingTest.php @@ -31,7 +31,7 @@ require_once 'Zend/Paginator/ScrollingStyle/Jumping.php'; /** - * @see PHPUnit_Framework_TestCase + * @see PHPUnit\Framework\TestCase */ /** @@ -42,7 +42,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Paginator */ -class Zend_Paginator_ScrollingStyle_JumpingTest extends PHPUnit_Framework_TestCase +class Zend_Paginator_ScrollingStyle_JumpingTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Paginator_ScrollingStyle_Jumping diff --git a/tests/Zend/Paginator/ScrollingStyle/SlidingTest.php b/tests/Zend/Paginator/ScrollingStyle/SlidingTest.php index 50a2bc9cde..93aba20179 100644 --- a/tests/Zend/Paginator/ScrollingStyle/SlidingTest.php +++ b/tests/Zend/Paginator/ScrollingStyle/SlidingTest.php @@ -26,7 +26,7 @@ require_once 'Zend/Paginator/ScrollingStyle/Sliding.php'; /** - * @see PHPUnit_Framework_TestCase + * @see PHPUnit\Framework\TestCase */ /** @@ -42,7 +42,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Paginator */ -class Zend_Paginator_ScrollingStyle_SlidingTest extends PHPUnit_Framework_TestCase +class Zend_Paginator_ScrollingStyle_SlidingTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Paginator_ScrollingStyle_Sliding diff --git a/tests/Zend/Paginator/_files/test.sqlite b/tests/Zend/Paginator/_files/test.sqlite index 1a1e7eb1d0566a86d527707b11f24faaa46d3041..63a4539322b76db2c00bf9591b418766bbb07c19 100644 GIT binary patch delta 48 wcmZn&Xb6}fCB(tXz`(!-#8AM@HBrZi4JfK7@^E8Hfb!%m>IR#iD9f+_0KSb0rT_o{ delta 47 vcmZn&Xb6}fCB%M}fq{Vwh@pV#(?lI3HlV2PBh8H|0m>667;Ju`EW-i-_}&Zi diff --git a/tests/Zend/PaginatorTest.php b/tests/Zend/PaginatorTest.php index 9d882ef8e0..4241552b84 100644 --- a/tests/Zend/PaginatorTest.php +++ b/tests/Zend/PaginatorTest.php @@ -31,7 +31,7 @@ require_once 'Zend/Paginator/AdapterAggregate.php'; /** - * @see PHPUnit_Framework_TestCase + * @see PHPUnit\Framework\TestCase */ /** @@ -102,7 +102,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Paginator */ -class Zend_PaginatorTest extends PHPUnit_Framework_TestCase +class Zend_PaginatorTest extends PHPUnit\Framework\TestCase { /** * Paginator instance @@ -986,7 +986,7 @@ public function testAcceptAndHandlePaginatorAdapterAggreageInConstructor() */ public function testInvalidDataInConstructor_ThrowsException() { - $this->setExpectedException("Zend_Paginator_Exception"); + $this->expectException("Zend_Paginator_Exception"); $p = new Zend_Paginator(array()); } diff --git a/tests/Zend/Pdf/ActionTest.php b/tests/Zend/Pdf/ActionTest.php index 443e18985d..acce8cb1a7 100644 --- a/tests/Zend/Pdf/ActionTest.php +++ b/tests/Zend/Pdf/ActionTest.php @@ -51,7 +51,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Pdf */ -class Zend_Pdf_ActionTest extends PHPUnit_Framework_TestCase +class Zend_Pdf_ActionTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Pdf/DestinationTest.php b/tests/Zend/Pdf/DestinationTest.php index 78b9b3c42f..29553e4252 100644 --- a/tests/Zend/Pdf/DestinationTest.php +++ b/tests/Zend/Pdf/DestinationTest.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Pdf */ -class Zend_Pdf_DestinationTest extends PHPUnit_Framework_TestCase +class Zend_Pdf_DestinationTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Pdf/DrawingTest.php b/tests/Zend/Pdf/DrawingTest.php index b469a1e44d..fa8f77aaec 100644 --- a/tests/Zend/Pdf/DrawingTest.php +++ b/tests/Zend/Pdf/DrawingTest.php @@ -53,7 +53,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Pdf */ -class Zend_Pdf_DrawingTest extends PHPUnit_Framework_TestCase +class Zend_Pdf_DrawingTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Pdf/Element/ArrayTest.php b/tests/Zend/Pdf/Element/ArrayTest.php index 7558826868..117b799d7f 100644 --- a/tests/Zend/Pdf/Element/ArrayTest.php +++ b/tests/Zend/Pdf/Element/ArrayTest.php @@ -58,7 +58,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Pdf */ -class Zend_Pdf_Element_ArrayTest extends PHPUnit_Framework_TestCase +class Zend_Pdf_Element_ArrayTest extends PHPUnit\Framework\TestCase { public function testPDFArray1() { diff --git a/tests/Zend/Pdf/Element/BooleanTest.php b/tests/Zend/Pdf/Element/BooleanTest.php index d17c4d133e..a8d73818c0 100644 --- a/tests/Zend/Pdf/Element/BooleanTest.php +++ b/tests/Zend/Pdf/Element/BooleanTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Pdf */ -class Zend_Pdf_Element_BooleanTest extends PHPUnit_Framework_TestCase +class Zend_Pdf_Element_BooleanTest extends PHPUnit\Framework\TestCase { public function testPDFBoolean() { diff --git a/tests/Zend/Pdf/Element/DictionaryTest.php b/tests/Zend/Pdf/Element/DictionaryTest.php index 9102ea5e2b..2c6a045de7 100644 --- a/tests/Zend/Pdf/Element/DictionaryTest.php +++ b/tests/Zend/Pdf/Element/DictionaryTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Pdf */ -class Zend_Pdf_Element_DictionaryTest extends PHPUnit_Framework_TestCase +class Zend_Pdf_Element_DictionaryTest extends PHPUnit\Framework\TestCase { public function testPDFDictionary1() { diff --git a/tests/Zend/Pdf/Element/NameTest.php b/tests/Zend/Pdf/Element/NameTest.php index c9f56295c8..0d7c08b392 100644 --- a/tests/Zend/Pdf/Element/NameTest.php +++ b/tests/Zend/Pdf/Element/NameTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Pdf */ -class Zend_Pdf_Element_NameTest extends PHPUnit_Framework_TestCase +class Zend_Pdf_Element_NameTest extends PHPUnit\Framework\TestCase { public function testPDFName() { diff --git a/tests/Zend/Pdf/Element/NullTest.php b/tests/Zend/Pdf/Element/NullTest.php index 6e8d986cfa..4c5d3cb18c 100644 --- a/tests/Zend/Pdf/Element/NullTest.php +++ b/tests/Zend/Pdf/Element/NullTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Pdf */ -class Zend_Pdf_Element_NullTest extends PHPUnit_Framework_TestCase +class Zend_Pdf_Element_NullTest extends PHPUnit\Framework\TestCase { public function testPDFNull() { diff --git a/tests/Zend/Pdf/Element/NumericTest.php b/tests/Zend/Pdf/Element/NumericTest.php index 2c6f4f45d6..f68fac80ad 100644 --- a/tests/Zend/Pdf/Element/NumericTest.php +++ b/tests/Zend/Pdf/Element/NumericTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Pdf */ -class Zend_Pdf_Element_NumericTest extends PHPUnit_Framework_TestCase +class Zend_Pdf_Element_NumericTest extends PHPUnit\Framework\TestCase { public function testPDFNumeric() { diff --git a/tests/Zend/Pdf/Element/Object/StreamTest.php b/tests/Zend/Pdf/Element/Object/StreamTest.php index ac2ccb1dc5..80116e9f70 100644 --- a/tests/Zend/Pdf/Element/Object/StreamTest.php +++ b/tests/Zend/Pdf/Element/Object/StreamTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Pdf */ -class Zend_Pdf_Element_Object_StreamTest extends PHPUnit_Framework_TestCase +class Zend_Pdf_Element_Object_StreamTest extends PHPUnit\Framework\TestCase { public function testPDFStreamObject() { diff --git a/tests/Zend/Pdf/Element/ObjectTest.php b/tests/Zend/Pdf/Element/ObjectTest.php index ee960a8a13..eceba91811 100644 --- a/tests/Zend/Pdf/Element/ObjectTest.php +++ b/tests/Zend/Pdf/Element/ObjectTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Pdf */ -class Zend_Pdf_Element_ObjectTest extends PHPUnit_Framework_TestCase +class Zend_Pdf_Element_ObjectTest extends PHPUnit\Framework\TestCase { public function testPDFObject() { diff --git a/tests/Zend/Pdf/Element/StreamTest.php b/tests/Zend/Pdf/Element/StreamTest.php index 750d919f02..6f462edcb0 100644 --- a/tests/Zend/Pdf/Element/StreamTest.php +++ b/tests/Zend/Pdf/Element/StreamTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Pdf */ -class Zend_Pdf_Element_StreamTest extends PHPUnit_Framework_TestCase +class Zend_Pdf_Element_StreamTest extends PHPUnit\Framework\TestCase { public function testPDFStream() { diff --git a/tests/Zend/Pdf/Element/String/BinaryTest.php b/tests/Zend/Pdf/Element/String/BinaryTest.php index aa1231c133..a5f5cd31c1 100644 --- a/tests/Zend/Pdf/Element/String/BinaryTest.php +++ b/tests/Zend/Pdf/Element/String/BinaryTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Pdf */ -class Zend_Pdf_Element_String_BinaryTest extends PHPUnit_Framework_TestCase +class Zend_Pdf_Element_String_BinaryTest extends PHPUnit\Framework\TestCase { public function testPDFBinaryString() { diff --git a/tests/Zend/Pdf/Element/StringTest.php b/tests/Zend/Pdf/Element/StringTest.php index 299c89f249..7fc37cd819 100644 --- a/tests/Zend/Pdf/Element/StringTest.php +++ b/tests/Zend/Pdf/Element/StringTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Pdf */ -class Zend_Pdf_Element_StringTest extends PHPUnit_Framework_TestCase +class Zend_Pdf_Element_StringTest extends PHPUnit\Framework\TestCase { public function testPDFString() { diff --git a/tests/Zend/Pdf/FactoryTest.php b/tests/Zend/Pdf/FactoryTest.php index cceb892fcc..2bb6a9e827 100644 --- a/tests/Zend/Pdf/FactoryTest.php +++ b/tests/Zend/Pdf/FactoryTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Pdf */ -class Zend_Pdf_FactoryTest extends PHPUnit_Framework_TestCase +class Zend_Pdf_FactoryTest extends PHPUnit\Framework\TestCase { public function testNewPageCreator() { diff --git a/tests/Zend/Pdf/Filter/Ascii85Test.php b/tests/Zend/Pdf/Filter/Ascii85Test.php index 09963a4bb6..28577d6557 100644 --- a/tests/Zend/Pdf/Filter/Ascii85Test.php +++ b/tests/Zend/Pdf/Filter/Ascii85Test.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Pdf */ -class Zend_Pdf_Filter_Ascii85Test extends PHPUnit_Framework_TestCase +class Zend_Pdf_Filter_Ascii85Test extends PHPUnit\Framework\TestCase { public function testStringDivisibleBy4Encode() { diff --git a/tests/Zend/Pdf/Filter/RunLengthTest.php b/tests/Zend/Pdf/Filter/RunLengthTest.php index faa9b581f4..8a6e16d6bc 100644 --- a/tests/Zend/Pdf/Filter/RunLengthTest.php +++ b/tests/Zend/Pdf/Filter/RunLengthTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Pdf */ -class Zend_Pdf_Filter_RunLengthTest extends PHPUnit_Framework_TestCase +class Zend_Pdf_Filter_RunLengthTest extends PHPUnit\Framework\TestCase { public function testSimpleStringEncode() { diff --git a/tests/Zend/Pdf/NamedDestinationsTest.php b/tests/Zend/Pdf/NamedDestinationsTest.php index e2de15a5be..40c4defa43 100644 --- a/tests/Zend/Pdf/NamedDestinationsTest.php +++ b/tests/Zend/Pdf/NamedDestinationsTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Pdf */ -class Zend_Pdf_NamedDestinationsTest extends PHPUnit_Framework_TestCase +class Zend_Pdf_NamedDestinationsTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Pdf/ProcessingTest.php b/tests/Zend/Pdf/ProcessingTest.php index 260b062eaf..af06967794 100644 --- a/tests/Zend/Pdf/ProcessingTest.php +++ b/tests/Zend/Pdf/ProcessingTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Pdf */ -class Zend_Pdf_ProcessingTest extends PHPUnit_Framework_TestCase +class Zend_Pdf_ProcessingTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/PdfTest.php b/tests/Zend/PdfTest.php index 5df3051fb8..82f02febac 100644 --- a/tests/Zend/PdfTest.php +++ b/tests/Zend/PdfTest.php @@ -37,7 +37,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Pdf */ -class Zend_PdfTest extends PHPUnit_Framework_TestCase +class Zend_PdfTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Pdf = null @@ -81,12 +81,12 @@ public function testSetTextField() /** * Asserts: Setting a non-existent field shouls throw an exception * - * @expectedException Zend_Pdf_Exception - * @expectedExceptionMessage Field 'FieldNotExists' does not exist or is not - * a textfield */ public function testSetTextFieldNonExistent() { + $this->expectException(\Zend_Pdf_Exception::class); + $this->expectExceptionMessage('Field \'FieldNotExists\' does not exist or is not a textfield'); + $this->_pdf->setTextField('FieldNotExists', 'Value1'); } @@ -116,12 +116,12 @@ public function testSetTextFieldProperties() /** * Asserts setting property of non-existent field shouls throw an exception * - * @expectedException Zend_Pdf_Exception - * @expectedExceptionMessage Field 'FieldNotExists' does not exist or is not - * a textfield */ public function testSetTextFieldPropertiesNonExistent() { + $this->expectException(\Zend_Pdf_Exception::class); + $this->expectExceptionMessage('Field \'FieldNotExists\' does not exist or is not a textfield'); + $this->_pdf->setTextFieldProperties( 'FieldNotExists', Zend_Pdf::PDF_FORM_FIELD_REQUIRED ); @@ -141,12 +141,12 @@ public function testMarkTextFieldAsReadOnly() /** * Asserts setting property of non-existent field shouls throw an exception * - * @expectedException Zend_Pdf_Exception - * @expectedExceptionMessage Field 'FieldNotExists' does not exist or is not - * a textfield */ public function testMarkTextFieldAsReadOnlyNonExistent() { + $this->expectException(\Zend_Pdf_Exception::class); + $this->expectExceptionMessage('Field \'FieldNotExists\' does not exist or is not a textfield'); + $this->_pdf->markTextFieldAsReadOnly('FieldNotExists'); } @@ -162,7 +162,7 @@ public function testSetAndGetJavasriptArray() // getting JavaScript after setting it returns array $pdf = new Zend_Pdf(); $pdf->setJavaScript('print();'); - $this->assertTrue(is_array($pdf->getJavaScript())); + $this->assertInternalType('array', $pdf->getJavaScript()); } public function testSetJavaScriptString() @@ -206,12 +206,12 @@ public function testAddJavaScript() /** * Asserts setting empty JavaScript string throws exception * - * @expectedException Zend_Pdf_Exception - * @expectedExceptionMessage JavaScript must be a non empty string or array - * of strings */ public function testSetJavaScriptEmptyString() { + $this->expectException(\Zend_Pdf_Exception::class); + $this->expectExceptionMessage('JavaScript must be a non empty string or array of strings'); + $pdf = new Zend_Pdf(); $pdf->setJavaScript(''); } @@ -219,12 +219,12 @@ public function testSetJavaScriptEmptyString() /** * Asserts setting empty JavaScript array throws exception * - * @expectedException Zend_Pdf_Exception - * @expectedExceptionMessage JavaScript must be a non empty string or array - * of strings */ public function testSetJavaScriptEmptyArray() { + $this->expectException(\Zend_Pdf_Exception::class); + $this->expectExceptionMessage('JavaScript must be a non empty string or array of strings'); + $pdf = new Zend_Pdf(); $pdf->setJavaScript(array()); } diff --git a/tests/Zend/ProgressBar/Adapter/ConsoleTest.php b/tests/Zend/ProgressBar/Adapter/ConsoleTest.php index 9b434dd9d2..f2dc52d64c 100644 --- a/tests/Zend/ProgressBar/Adapter/ConsoleTest.php +++ b/tests/Zend/ProgressBar/Adapter/ConsoleTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_ProgressBar */ -class Zend_ProgressBar_Adapter_ConsoleTest extends PHPUnit_Framework_TestCase +class Zend_ProgressBar_Adapter_ConsoleTest extends PHPUnit\Framework\TestCase { protected function setUp() @@ -63,7 +63,7 @@ public function testStandardOutputStream() { $adapter = new Zend_ProgressBar_Adapter_Console_Stub(); - $this->assertTrue(is_resource($adapter->getOutputStream())); + $this->assertInternalType('resource', $adapter->getOutputStream()); $metaData = stream_get_meta_data($adapter->getOutputStream()); $this->assertEquals('php://stdout', $metaData['uri']); @@ -73,7 +73,7 @@ public function testManualStandardOutputStream() { $adapter = new Zend_ProgressBar_Adapter_Console_Stub(array('outputStream' => 'php://stdout')); - $this->assertTrue(is_resource($adapter->getOutputStream())); + $this->assertInternalType('resource', $adapter->getOutputStream()); $metaData = stream_get_meta_data($adapter->getOutputStream()); $this->assertEquals('php://stdout', $metaData['uri']); @@ -83,7 +83,7 @@ public function testManualErrorOutputStream() { $adapter = new Zend_ProgressBar_Adapter_Console_Stub(array('outputStream' => 'php://stderr')); - $this->assertTrue(is_resource($adapter->getOutputStream())); + $this->assertInternalType('resource', $adapter->getOutputStream()); $metaData = stream_get_meta_data($adapter->getOutputStream()); $this->assertEquals('php://stderr', $metaData['uri']); @@ -273,7 +273,7 @@ public function testgetOutputStream() { public function testgetOutputStreamReturnigStdout() { $adapter = new Zend_ProgressBar_Adapter_Console(); $resource = $adapter->getOutputStream(); - $this->assertTrue(is_resource($resource)); + $this->assertInternalType('resource', $resource); } public function testFinishEol() { diff --git a/tests/Zend/ProgressBar/Adapter/JsPullTest.php b/tests/Zend/ProgressBar/Adapter/JsPullTest.php index 4cf2312c5f..823eab5bce 100644 --- a/tests/Zend/ProgressBar/Adapter/JsPullTest.php +++ b/tests/Zend/ProgressBar/Adapter/JsPullTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_ProgressBar */ -class Zend_ProgressBar_Adapter_JsPullTest extends PHPUnit_Framework_TestCase +class Zend_ProgressBar_Adapter_JsPullTest extends PHPUnit\Framework\TestCase { public function testJson() { diff --git a/tests/Zend/ProgressBar/Adapter/JsPushTest.php b/tests/Zend/ProgressBar/Adapter/JsPushTest.php index 040e38642e..af36953a3e 100644 --- a/tests/Zend/ProgressBar/Adapter/JsPushTest.php +++ b/tests/Zend/ProgressBar/Adapter/JsPushTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_ProgressBar */ -class Zend_ProgressBar_Adapter_jsPushTest extends PHPUnit_Framework_TestCase +class Zend_ProgressBar_Adapter_jsPushTest extends PHPUnit\Framework\TestCase { public function testJson() { diff --git a/tests/Zend/ProgressBar/ProgressBarTest.php b/tests/Zend/ProgressBar/ProgressBarTest.php index f3d1e1be79..5a91f6bb86 100644 --- a/tests/Zend/ProgressBar/ProgressBarTest.php +++ b/tests/Zend/ProgressBar/ProgressBarTest.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_ProgressBar */ -class Zend_ProgressBar_ProgressBarTest extends PHPUnit_Framework_TestCase +class Zend_ProgressBar_ProgressBarTest extends PHPUnit\Framework\TestCase { public function testGreaterMin() { diff --git a/tests/Zend/Queue/Adapter/ActivemqOfflineTest.php b/tests/Zend/Queue/Adapter/ActivemqOfflineTest.php index 7db5ba7f15..09681ceeb4 100644 --- a/tests/Zend/Queue/Adapter/ActivemqOfflineTest.php +++ b/tests/Zend/Queue/Adapter/ActivemqOfflineTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Queue */ -class Zend_Queue_Adapter_ActivemqOfflineTest extends PHPUnit_Framework_TestCase +class Zend_Queue_Adapter_ActivemqOfflineTest extends PHPUnit\Framework\TestCase { /** * @group ZF-7948 diff --git a/tests/Zend/Queue/Adapter/ActivemqTest.php b/tests/Zend/Queue/Adapter/ActivemqTest.php index f6fa62d771..b7d3003bd2 100644 --- a/tests/Zend/Queue/Adapter/ActivemqTest.php +++ b/tests/Zend/Queue/Adapter/ActivemqTest.php @@ -94,9 +94,9 @@ public function testConst() * @see Zend_Queue_Adapter_Activemq */ require_once 'Zend/Queue/Adapter/Activemq.php'; - $this->assertTrue(is_string(Zend_Queue_Adapter_Activemq::DEFAULT_SCHEME)); - $this->assertTrue(is_string(Zend_Queue_Adapter_Activemq::DEFAULT_HOST)); - $this->assertTrue(is_integer(Zend_Queue_Adapter_Activemq::DEFAULT_PORT)); + $this->assertInternalType('string', Zend_Queue_Adapter_Activemq::DEFAULT_SCHEME); + $this->assertInternalType('string', Zend_Queue_Adapter_Activemq::DEFAULT_HOST); + $this->assertInternalType('integer', Zend_Queue_Adapter_Activemq::DEFAULT_PORT); } /** diff --git a/tests/Zend/Queue/Adapter/AdapterTest.php b/tests/Zend/Queue/Adapter/AdapterTest.php index 2cde6addbb..109bea2a04 100644 --- a/tests/Zend/Queue/Adapter/AdapterTest.php +++ b/tests/Zend/Queue/Adapter/AdapterTest.php @@ -53,7 +53,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Queue */ -abstract class Zend_Queue_Adapter_AdapterTest extends PHPUnit_Framework_TestCase +abstract class Zend_Queue_Adapter_AdapterTest extends PHPUnit\Framework\TestCase { public function tearDown() { @@ -184,7 +184,7 @@ public function testGetOptions() $new = $adapter->getOptions(); - $this->assertTrue(is_array($new)); + $this->assertInternalType('array', $new); $this->assertEquals($new['setting'], $config['setting']); // delete the queue we created @@ -511,7 +511,7 @@ public function testGetQueues() $queues = $adapter->getQueues(); // this is an array right? - $this->assertTrue(is_array($queues)); + $this->assertInternalType('array', $queues); // make sure our current queue is in this list. $this->assertTrue(in_array($queue->getName(), $queues)); @@ -578,7 +578,7 @@ public function testCapabilities() $adapter = $queue->getAdapter(); $list = $adapter->getCapabilities(); - $this->assertTrue(is_array($list)); + $this->assertInternalType('array', $list); // these functions must have an boolean answer $func = array( @@ -589,7 +589,7 @@ public function testCapabilities() foreach ( array_values($func) as $f ) { $this->assertTrue(isset($list[$f])); - $this->assertTrue(is_bool($list[$f])); + $this->assertInternalType('bool', $list[$f]); } // delete the queue we created @@ -605,7 +605,7 @@ public function testIsSupported() $list = $adapter->getCapabilities(); foreach ( $list as $function => $result ) { - $this->assertTrue(is_bool($result)); + $this->assertInternalType('bool', $result); if ( $result ) { $this->assertTrue($adapter->isSupported($function)); } else { diff --git a/tests/Zend/Queue/Adapter/ArrayTest.php b/tests/Zend/Queue/Adapter/ArrayTest.php index 4f455f65d1..5651f031aa 100644 --- a/tests/Zend/Queue/Adapter/ArrayTest.php +++ b/tests/Zend/Queue/Adapter/ArrayTest.php @@ -94,7 +94,7 @@ public function test_magic() $queue = $this->createQueue(__FUNCTION__); $adapter = $queue->getAdapter(); - $this->assertTrue(is_array($adapter->__sleep())); + $this->assertInternalType('array', $adapter->__sleep()); $data = serialize($adapter); $new = unserialize($data); $this->assertEquals($new->getData(), $adapter->getData()); diff --git a/tests/Zend/Queue/Adapter/MemcacheqTest.php b/tests/Zend/Queue/Adapter/MemcacheqTest.php index 809a5b6fdf..b1e6507a43 100644 --- a/tests/Zend/Queue/Adapter/MemcacheqTest.php +++ b/tests/Zend/Queue/Adapter/MemcacheqTest.php @@ -111,9 +111,9 @@ public function testConst() * @see Zend_Queue_Adapter_Memcacheq */ require_once 'Zend/Queue/Adapter/Memcacheq.php'; - $this->assertTrue(is_string(Zend_Queue_Adapter_Memcacheq::DEFAULT_HOST)); - $this->assertTrue(is_integer(Zend_Queue_Adapter_Memcacheq::DEFAULT_PORT)); - $this->assertTrue(is_string(Zend_Queue_Adapter_Memcacheq::EOL)); + $this->assertInternalType('string', Zend_Queue_Adapter_Memcacheq::DEFAULT_HOST); + $this->assertInternalType('integer', Zend_Queue_Adapter_Memcacheq::DEFAULT_PORT); + $this->assertInternalType('string', Zend_Queue_Adapter_Memcacheq::EOL); } /** diff --git a/tests/Zend/Queue/CustomTest.php b/tests/Zend/Queue/CustomTest.php index d8e2e2fda3..346e8f598a 100644 --- a/tests/Zend/Queue/CustomTest.php +++ b/tests/Zend/Queue/CustomTest.php @@ -66,7 +66,7 @@ public function __sleep() } } -class Zend_Queue_CustomTest extends PHPUnit_Framework_TestCase +class Zend_Queue_CustomTest extends PHPUnit\Framework\TestCase { public function test_behavior() { diff --git a/tests/Zend/Queue/FactoryTest.php b/tests/Zend/Queue/FactoryTest.php index 37dbbaf95d..4d3d4f9447 100644 --- a/tests/Zend/Queue/FactoryTest.php +++ b/tests/Zend/Queue/FactoryTest.php @@ -40,7 +40,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Queue */ -class Zend_Queue_FactoryTest extends PHPUnit_Framework_TestCase +class Zend_Queue_FactoryTest extends PHPUnit\Framework\TestCase { protected function setUp() { diff --git a/tests/Zend/Queue/Message/IteratorTest.php b/tests/Zend/Queue/Message/IteratorTest.php index 4a1ea9308b..9a21324de3 100644 --- a/tests/Zend/Queue/Message/IteratorTest.php +++ b/tests/Zend/Queue/Message/IteratorTest.php @@ -47,7 +47,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Queue */ -class Zend_Queue_Message_IteratorTest extends PHPUnit_Framework_TestCase +class Zend_Queue_Message_IteratorTest extends PHPUnit\Framework\TestCase { protected function setUp() { @@ -89,7 +89,7 @@ protected function setUp() public function test_setup() { $this->assertTrue($this->queue instanceof Zend_Queue); - $this->assertTrue(is_array($this->options)); + $this->assertInternalType('array', $this->options); foreach ($this->messages as $i => $message) { $this->assertTrue($message instanceof Zend_Queue_Message); @@ -126,7 +126,7 @@ public function test_count() public function test_magic() { - $this->assertTrue(is_array($this->messages->__sleep())); + $this->assertInternalType('array', $this->messages->__sleep()); $messages = serialize($this->messages); $woken = unserialize($messages); @@ -156,7 +156,7 @@ public function test_iterator() public function test_toArray() { $array = $this->messages->toArray(); - $this->assertTrue(is_array($array)); + $this->assertInternalType('array', $array); $this->assertEquals($this->message_count, count($array)); $this->assertEquals('Hello world', $array[0]['body']); } diff --git a/tests/Zend/Queue/MessageTest.php b/tests/Zend/Queue/MessageTest.php index e001c4539f..6e9c2f253f 100644 --- a/tests/Zend/Queue/MessageTest.php +++ b/tests/Zend/Queue/MessageTest.php @@ -47,7 +47,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Queue */ -class Zend_Queue_MessageTest extends PHPUnit_Framework_TestCase +class Zend_Queue_MessageTest extends PHPUnit\Framework\TestCase { protected function setUp() { @@ -179,7 +179,7 @@ public function test_set_getQueue() public function test_array() { $array = $this->message->toArray(); - $this->assertTrue(is_array($array)); + $this->assertInternalType('array', $array); $array['id'] = 'hello'; $this->message->setFromArray($array); @@ -189,7 +189,7 @@ public function test_array() public function test_magic() { - $this->assertTrue(is_array($this->message->__sleep())); + $this->assertInternalType('array', $this->message->__sleep()); $message = serialize($this->message); $woken = unserialize($message); diff --git a/tests/Zend/Queue/QueueBaseTest.php b/tests/Zend/Queue/QueueBaseTest.php index 54f7403e5c..4435ef7173 100644 --- a/tests/Zend/Queue/QueueBaseTest.php +++ b/tests/Zend/Queue/QueueBaseTest.php @@ -48,7 +48,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Queue */ -abstract class Zend_Queue_QueueBaseTest extends PHPUnit_Framework_TestCase +abstract class Zend_Queue_QueueBaseTest extends PHPUnit\Framework\TestCase { protected function setUp() { @@ -66,9 +66,9 @@ protected function tearDown() public function testConst() { - $this->assertTrue(is_string(Zend_Queue::TIMEOUT)); - $this->assertTrue(is_integer(Zend_Queue::VISIBILITY_TIMEOUT)); - $this->assertTrue(is_string(Zend_Queue::NAME)); + $this->assertInternalType('string', Zend_Queue::TIMEOUT); + $this->assertInternalType('integer', Zend_Queue::VISIBILITY_TIMEOUT); + $this->assertInternalType('string', Zend_Queue::NAME); } /** @@ -104,14 +104,14 @@ public function testConstruct() public function testDebugInfo() { - $this->assertTrue(is_array($this->queue->debugInfo())); + $this->assertInternalType('array', $this->queue->debugInfo()); // var_dump($this->queue->debugInfo()); } public function testGetOptions() { $options = $this->queue->getOptions(); - $this->assertTrue(is_array($options)); + $this->assertInternalType('array', $options); $this->assertEquals($this->config['name'], $options['name']); } @@ -224,7 +224,7 @@ public function testSendAndCountAndReceiveAndDeleteMessage() public function testCapabilities() { $list = $this->queue->getCapabilities(); - $this->assertTrue(is_array($list)); + $this->assertInternalType('array', $list); // these functions must have an boolean answer $func = array( @@ -235,7 +235,7 @@ public function testCapabilities() foreach ( array_values($func) as $f ) { $this->assertTrue(isset($list[$f])); - $this->assertTrue(is_bool($list[$f])); + $this->assertInternalType('bool', $list[$f]); } } @@ -243,7 +243,7 @@ public function testIsSupported() { $list = $this->queue->getCapabilities(); foreach ( $list as $function => $result ) { - $this->assertTrue(is_bool($result)); + $this->assertInternalType('bool', $result); if ( $result ) { $this->assertTrue($this->queue->isSupported($function)); } else { @@ -256,7 +256,7 @@ public function testGetQueues() { if ($this->queue->isSupported('getQueues')) { $queues = $this->queue->getQueues(); - $this->assertTrue(is_array($queues)); + $this->assertInternalType('array', $queues); $this->assertTrue(in_array($this->config['name'], $queues)); } else { try { diff --git a/tests/Zend/Queue/QueueTest.php b/tests/Zend/Queue/QueueTest.php index 70f26e6f41..6dac1392c8 100644 --- a/tests/Zend/Queue/QueueTest.php +++ b/tests/Zend/Queue/QueueTest.php @@ -45,7 +45,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Queue */ -class Zend_Queue_QueueTest extends PHPUnit_Framework_TestCase +class Zend_Queue_QueueTest extends PHPUnit\Framework\TestCase { protected function setUp() { @@ -64,9 +64,9 @@ protected function tearDown() public function testConst() { - $this->assertTrue(is_string(Zend_Queue::TIMEOUT)); - $this->assertTrue(is_integer(Zend_Queue::VISIBILITY_TIMEOUT)); - $this->assertTrue(is_string(Zend_Queue::NAME)); + $this->assertInternalType('string', Zend_Queue::TIMEOUT); + $this->assertInternalType('integer', Zend_Queue::VISIBILITY_TIMEOUT); + $this->assertInternalType('string', Zend_Queue::NAME); } /** @@ -101,7 +101,7 @@ public function testConstruct() public function test_getOptions() { $config = $this->queue->getOptions(); - $this->assertTrue(is_array($config)); + $this->assertInternalType('array', $config); $this->assertEquals($this->config['name'], $config['name']); } @@ -203,7 +203,7 @@ public function test_send_count_receive_deleteMessage() public function test_capabilities() { $list = $this->queue->getCapabilities(); - $this->assertTrue(is_array($list)); + $this->assertInternalType('array', $list); // these functions must have an boolean answer $func = array( @@ -214,7 +214,7 @@ public function test_capabilities() foreach ( array_values($func) as $f ) { $this->assertTrue(isset($list[$f])); - $this->assertTrue(is_bool($list[$f])); + $this->assertInternalType('bool', $list[$f]); } } @@ -222,7 +222,7 @@ public function test_isSupported() { $list = $this->queue->getCapabilities(); foreach ( $list as $function => $result ) { - $this->assertTrue(is_bool($result)); + $this->assertInternalType('bool', $result); if ( $result ) { $this->assertTrue($this->queue->isSupported($function)); } else { @@ -234,7 +234,7 @@ public function test_isSupported() public function test_getQueues() { $queues = $this->queue->getQueues(); - $this->assertTrue(is_array($queues)); + $this->assertInternalType('array', $queues); $this->assertTrue(in_array($this->config['name'], $queues)); } } diff --git a/tests/Zend/Queue/Stomp/ClientTest.php b/tests/Zend/Queue/Stomp/ClientTest.php index 36d2347aaa..3a69a34a45 100644 --- a/tests/Zend/Queue/Stomp/ClientTest.php +++ b/tests/Zend/Queue/Stomp/ClientTest.php @@ -117,7 +117,7 @@ public function read() * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Queue */ -class Zend_Queue_Stomp_ClientTest extends PHPUnit_Framework_TestCase +class Zend_Queue_Stomp_ClientTest extends PHPUnit\Framework\TestCase { public function testConstruct() { diff --git a/tests/Zend/Queue/Stomp/FrameTest.php b/tests/Zend/Queue/Stomp/FrameTest.php index cc53fb93cf..f8773a5656 100644 --- a/tests/Zend/Queue/Stomp/FrameTest.php +++ b/tests/Zend/Queue/Stomp/FrameTest.php @@ -39,7 +39,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Queue */ -class Zend_Queue_Stomp_FrameTest extends PHPUnit_Framework_TestCase +class Zend_Queue_Stomp_FrameTest extends PHPUnit\Framework\TestCase { protected $body = 'hello world'; // 11 characters @@ -143,9 +143,9 @@ public function test_parameters() public function test_constant() { - $this->assertTrue(is_string(Zend_Queue_Stomp_Frame::END_OF_FRAME)); - $this->assertTrue(is_string(Zend_Queue_Stomp_Frame::CONTENT_LENGTH)); - $this->assertTrue(is_string(Zend_Queue_Stomp_Frame::EOL)); + $this->assertInternalType('string', Zend_Queue_Stomp_Frame::END_OF_FRAME); + $this->assertInternalType('string', Zend_Queue_Stomp_Frame::CONTENT_LENGTH); + $this->assertInternalType('string', Zend_Queue_Stomp_Frame::EOL); } } diff --git a/tests/Zend/Reflection/ClassTest.php b/tests/Zend/Reflection/ClassTest.php index c3a5376960..0f28b143cb 100644 --- a/tests/Zend/Reflection/ClassTest.php +++ b/tests/Zend/Reflection/ClassTest.php @@ -33,7 +33,7 @@ * @group Zend_Reflection * @group Zend_Reflection_Class */ -class Zend_Reflection_ClassTest extends PHPUnit_Framework_TestCase +class Zend_Reflection_ClassTest extends PHPUnit\Framework\TestCase { static protected $_sampleClassFileRequired = false; diff --git a/tests/Zend/Reflection/Docblock/Tag/ParamTest.php b/tests/Zend/Reflection/Docblock/Tag/ParamTest.php index bdf48d0dd0..1353a85baa 100644 --- a/tests/Zend/Reflection/Docblock/Tag/ParamTest.php +++ b/tests/Zend/Reflection/Docblock/Tag/ParamTest.php @@ -34,7 +34,7 @@ * @group Zend_Reflection_Docblock_Tag * @group Zend_Reflection_Docblock_Tag_Param */ -class Zend_Reflection_Docblock_Tag_ParamTest extends PHPUnit_Framework_TestCase +class Zend_Reflection_Docblock_Tag_ParamTest extends PHPUnit\Framework\TestCase { diff --git a/tests/Zend/Reflection/Docblock/Tag/ReturnTest.php b/tests/Zend/Reflection/Docblock/Tag/ReturnTest.php index 5e7a83ee52..414c3058c5 100644 --- a/tests/Zend/Reflection/Docblock/Tag/ReturnTest.php +++ b/tests/Zend/Reflection/Docblock/Tag/ReturnTest.php @@ -33,7 +33,7 @@ * @group Zend_Reflection_Docblock_Tag * @group Zend_Reflection_Docblock_Tag_Return */ -class Zend_Reflection_Docblock_Tag_ReturnTest extends PHPUnit_Framework_TestCase +class Zend_Reflection_Docblock_Tag_ReturnTest extends PHPUnit\Framework\TestCase { static protected $_sampleClassFileRequired = false; diff --git a/tests/Zend/Reflection/Docblock/TagTest.php b/tests/Zend/Reflection/Docblock/TagTest.php index 208fbc050d..28e04ae82d 100644 --- a/tests/Zend/Reflection/Docblock/TagTest.php +++ b/tests/Zend/Reflection/Docblock/TagTest.php @@ -32,7 +32,7 @@ * @group Zend_Reflection_Docblock * @group Zend_Reflection_Docblock_Tag */ -class Zend_Reflection_Docblock_TagTest extends PHPUnit_Framework_TestCase +class Zend_Reflection_Docblock_TagTest extends PHPUnit\Framework\TestCase { diff --git a/tests/Zend/Reflection/DocblockTest.php b/tests/Zend/Reflection/DocblockTest.php index 099415390b..b380ef99d1 100644 --- a/tests/Zend/Reflection/DocblockTest.php +++ b/tests/Zend/Reflection/DocblockTest.php @@ -32,7 +32,7 @@ * @group Zend_Reflection * @group Zend_Reflection_Docblock */ -class Zend_Reflection_DocblockTest extends PHPUnit_Framework_TestCase +class Zend_Reflection_DocblockTest extends PHPUnit\Framework\TestCase { diff --git a/tests/Zend/Reflection/ExtensionTest.php b/tests/Zend/Reflection/ExtensionTest.php index 7a0b003399..6be88d91a9 100644 --- a/tests/Zend/Reflection/ExtensionTest.php +++ b/tests/Zend/Reflection/ExtensionTest.php @@ -32,7 +32,7 @@ * @group Zend_Reflection * @group Zend_Reflection_Extension */ -class Zend_Reflection_ExtensionTest extends PHPUnit_Framework_TestCase +class Zend_Reflection_ExtensionTest extends PHPUnit\Framework\TestCase { public function testClassReturn() diff --git a/tests/Zend/Reflection/FileTest.php b/tests/Zend/Reflection/FileTest.php index 06b468d603..597d39cd3d 100644 --- a/tests/Zend/Reflection/FileTest.php +++ b/tests/Zend/Reflection/FileTest.php @@ -34,7 +34,7 @@ * @group Zend_Reflection * @group Zend_Reflection_File */ -class Zend_Reflection_FileTest extends PHPUnit_Framework_TestCase +class Zend_Reflection_FileTest extends PHPUnit\Framework\TestCase { public function testFileConstructor() @@ -45,10 +45,11 @@ public function testFileConstructor() } /** - * @expectedException Zend_Reflection_Exception */ public function testFileConstructorThrowsExceptionOnNonExistentFile() { + $this->expectException(\Zend_Reflection_Exception::class); + $nonExistentFile = 'Non/Existent/File.php'; $reflectionFile = new Zend_Reflection_File($nonExistentFile); $this->fail('Exception should have been thrown'); @@ -74,10 +75,11 @@ public function testFileGetClassReturnsFirstClassWithNoOptions() /** - * @expectedException Zend_Reflection_Exception */ public function testFileGetClassThrowsExceptionOnNonExistentClassName() { + $this->expectException(\Zend_Reflection_Exception::class); + $fileToRequire = dirname(__FILE__) . '/_files/TestSampleClass.php'; require_once $fileToRequire; $reflectionFile = new Zend_Reflection_File($fileToRequire); diff --git a/tests/Zend/Reflection/FunctionTest.php b/tests/Zend/Reflection/FunctionTest.php index 5e36375d5e..c43fe7444c 100644 --- a/tests/Zend/Reflection/FunctionTest.php +++ b/tests/Zend/Reflection/FunctionTest.php @@ -34,7 +34,7 @@ * @group Zend_Reflection * @group Zend_Reflection_Function */ -class Zend_Reflection_FunctionTest extends PHPUnit_Framework_TestCase +class Zend_Reflection_FunctionTest extends PHPUnit\Framework\TestCase { static protected $_sampleClassFileRequired = false; diff --git a/tests/Zend/Reflection/MethodTest.php b/tests/Zend/Reflection/MethodTest.php index f21a3f2579..fd83c73d8b 100644 --- a/tests/Zend/Reflection/MethodTest.php +++ b/tests/Zend/Reflection/MethodTest.php @@ -39,7 +39,7 @@ * @group Zend_Reflection * @group Zend_Reflection_Method */ -class Zend_Reflection_MethodTest extends PHPUnit_Framework_TestCase +class Zend_Reflection_MethodTest extends PHPUnit\Framework\TestCase { static protected $_sampleClassFileRequired = false; diff --git a/tests/Zend/Reflection/ParameterTest.php b/tests/Zend/Reflection/ParameterTest.php index a539f13bc9..9bd3524001 100644 --- a/tests/Zend/Reflection/ParameterTest.php +++ b/tests/Zend/Reflection/ParameterTest.php @@ -34,7 +34,7 @@ * @group Zend_Reflection * @group Zend_Reflection_Parameter */ -class Zend_Reflection_ParameterTest extends PHPUnit_Framework_TestCase +class Zend_Reflection_ParameterTest extends PHPUnit\Framework\TestCase { static protected $_sampleClassFileRequired = false; diff --git a/tests/Zend/Reflection/PropertyTest.php b/tests/Zend/Reflection/PropertyTest.php index 59da4c7f7a..67200bc78b 100644 --- a/tests/Zend/Reflection/PropertyTest.php +++ b/tests/Zend/Reflection/PropertyTest.php @@ -34,7 +34,7 @@ * @group Zend_Reflection * @group Zend_Reflection_Property */ -class Zend_Reflection_PropertyTest extends PHPUnit_Framework_TestCase +class Zend_Reflection_PropertyTest extends PHPUnit\Framework\TestCase { static protected $_sampleClassFileRequired = false; diff --git a/tests/Zend/RegistryTest.php b/tests/Zend/RegistryTest.php index a8602053b3..4f0af3893a 100644 --- a/tests/Zend/RegistryTest.php +++ b/tests/Zend/RegistryTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Registry */ -class Zend_RegistryTest extends PHPUnit_Framework_TestCase +class Zend_RegistryTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Rest/ClientTest.php b/tests/Zend/Rest/ClientTest.php index c53f05a573..a4f0528e5d 100644 --- a/tests/Zend/Rest/ClientTest.php +++ b/tests/Zend/Rest/ClientTest.php @@ -37,7 +37,7 @@ * @group Zend_Rest * @group Zend_Rest_Client */ -class Zend_Rest_ClientTest extends PHPUnit_Framework_TestCase +class Zend_Rest_ClientTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Rest/ControllerTest.php b/tests/Zend/Rest/ControllerTest.php index eb81787ba6..14ffbf6059 100644 --- a/tests/Zend/Rest/ControllerTest.php +++ b/tests/Zend/Rest/ControllerTest.php @@ -79,7 +79,7 @@ public function deleteAction() * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Rest */ -class Zend_Rest_ControllerTest extends PHPUnit_Framework_TestCase +class Zend_Rest_ControllerTest extends PHPUnit\Framework\TestCase { protected $_testController; diff --git a/tests/Zend/Rest/ResultTest.php b/tests/Zend/Rest/ResultTest.php index 33bae91c4d..75baa199f9 100644 --- a/tests/Zend/Rest/ResultTest.php +++ b/tests/Zend/Rest/ResultTest.php @@ -36,11 +36,11 @@ * @group Zend_Rest * @group Zend_Rest_Result */ -class Zend_Rest_ResultTest extends PHPUnit_Framework_TestCase +class Zend_Rest_ResultTest extends PHPUnit\Framework\TestCase { static $path; - public function __construct() + public function setUp() { self::$path = dirname(__FILE__).'/responses/'; } @@ -145,7 +145,7 @@ public function testGetXpathValueArray() $xml = file_get_contents(self::$path . DIRECTORY_SEPARATOR . 'returnNestedArray.xml'); $result = new Zend_Rest_Client_Result($xml); $baz = $result->baz; - $this->assertTrue(is_array($baz), var_export($baz, 1)); + $this->assertInternalType('array', $baz, var_export($baz, 1)); $this->assertEquals('1', (string) $baz[0]); $this->assertEquals('farama', (string) $baz[1]); } diff --git a/tests/Zend/Rest/RouteTest.php b/tests/Zend/Rest/RouteTest.php index 9e93f9ce42..891658c59b 100644 --- a/tests/Zend/Rest/RouteTest.php +++ b/tests/Zend/Rest/RouteTest.php @@ -37,7 +37,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Rest */ -class Zend_Rest_RouteTest extends PHPUnit_Framework_TestCase +class Zend_Rest_RouteTest extends PHPUnit\Framework\TestCase { protected $_front; @@ -105,7 +105,7 @@ public function test_RESTfulApp_defaults() $request = $this->_buildRequest('GET', '/'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('default', $values['module']); $this->assertEquals('index', $values['controller']); @@ -120,7 +120,7 @@ public function test_RESTfulApp_GET_user_defaults() $request = $this->_buildRequest('GET', '/user'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('default', $values['module']); $this->assertEquals('user', $values['controller']); @@ -132,7 +132,7 @@ public function test_RESTfulApp_GET_user_index() $request = $this->_buildRequest('GET', '/user/index'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('default', $values['module']); $this->assertEquals('user', $values['controller']); @@ -144,7 +144,7 @@ public function test_RESTfulApp_GET_user_index_withParams() $request = $this->_buildRequest('GET', '/user/index/changedSince/123456789/status/active'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('default', $values['module']); $this->assertEquals('user', $values['controller']); @@ -158,7 +158,7 @@ public function test_RESTfulApp_GET_user_index_withQueryParams() $request = $this->_buildRequest('GET', '/user/?changedSince=123456789&status=active'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('default', $values['module']); $this->assertEquals('user', $values['controller']); @@ -175,7 +175,7 @@ public function test_RESTfulApp_GET_user_index_withParam_urlencodedWithPlusSymbo $request = $this->_buildRequest('GET', '/user/index/the%2Bemail%40address/email%2Btest%40example.com'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('default', $values['module']); $this->assertEquals('user', $values['controller']); @@ -188,7 +188,7 @@ public function test_RESTfulApp_GET_project_byIdentifier() $request = $this->_buildRequest('GET', '/project/zendframework'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('default', $values['module']); $this->assertEquals('project', $values['controller']); @@ -201,7 +201,7 @@ public function test_RESTfulApp_GET_project_byIdQueryParam() $request = $this->_buildRequest('GET', '/project/?id=zendframework'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('default', $values['module']); $this->assertEquals('project', $values['controller']); @@ -214,7 +214,7 @@ public function test_RESTfulApp_GET_project_byIdentifier_urlencoded() $request = $this->_buildRequest('GET', '/project/zend+framework'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('default', $values['module']); $this->assertEquals('project', $values['controller']); @@ -230,7 +230,7 @@ public function test_RESTfulApp_GET_project_byIdentifier_urlencodedWithPlusSymbo $request = $this->_buildRequest('GET', '/project/email%2Btest%40example.com'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('default', $values['module']); $this->assertEquals('project', $values['controller']); @@ -243,7 +243,7 @@ public function test_RESTfulApp_HEAD_project_byIdentifier() $request = $this->_buildRequest('HEAD', '/project/lcrouch'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('default', $values['module']); $this->assertEquals('project', $values['controller']); @@ -258,7 +258,7 @@ public function test_RESTfulApp_HEAD_project_byIdentifier_urlencodedWithPlusSymb $request = $this->_buildRequest('HEAD', '/project/email%2Btest%40example.com'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('default', $values['module']); $this->assertEquals('project', $values['controller']); @@ -271,7 +271,7 @@ public function test_RESTfulApp_GET_project_edit() $request = $this->_buildRequest('GET', '/project/zendframework/edit'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('default', $values['module']); $this->assertEquals('project', $values['controller']); @@ -287,7 +287,7 @@ public function test_RESTfulApp_GET_project_edit_urlencodedWithPlusSymbol() $request = $this->_buildRequest('GET', '/project/email%2Btest%40example.com/edit'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('default', $values['module']); $this->assertEquals('project', $values['controller']); @@ -300,7 +300,7 @@ public function test_RESTfulApp_PUT_user_byIdentifier() $request = $this->_buildRequest('PUT', '/mod/user/lcrouch'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -316,7 +316,7 @@ public function test_RESTfulApp_PUT_user_byIdentifier_urlencodedWithPlusSymbol() $request = $this->_buildRequest('PUT', '/mod/user/email%2Btest%40example.com'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -329,7 +329,7 @@ public function test_RESTfulApp_POST_user() $request = $this->_buildRequest('POST', '/mod/user'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -341,7 +341,7 @@ public function test_RESTfulApp_DELETE_user_byIdentifier() $request = $this->_buildRequest('DELETE', '/mod/user/lcrouch'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -357,7 +357,7 @@ public function test_RESTfulApp_DELETE_user_byIdentifier_urlencodedWithPlusSymbo $request = $this->_buildRequest('DELETE', '/mod/user/email%2Btest%40example.com'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -370,7 +370,7 @@ public function test_RESTfulApp_POST_user_with_identifier_doesPUT() $request = $this->_buildRequest('POST', '/mod/user/lcrouch'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -386,7 +386,7 @@ public function test_RESTfulApp_POST_user_with_identifier_urlencodedWithPlusSymb $request = $this->_buildRequest('POST', '/mod/user/email%2Btest%40example.com'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -400,7 +400,7 @@ public function test_RESTfulApp_overload_POST_with_method_param_PUT() $request->setParam('_method', 'PUT'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -413,7 +413,7 @@ public function test_RESTfulApp_overload_POST_with_http_header_DELETE() $request->setHeader('X-HTTP-Method-Override', 'DELETE'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -430,7 +430,7 @@ public function test_RESTfulApp_overload_POST_with_http_header_DELETE_urlencoded $request->setHeader('X-HTTP-Method-Override', 'DELETE'); $values = $this->_invokeRouteMatch($request); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -487,7 +487,7 @@ public function test_RESTfulModule_GET_user_index() $config = array('mod'); $values = $this->_invokeRouteMatch($request, $config); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -503,7 +503,7 @@ public function test_RESTfulModule_GET_user_index_withParam_urlencodedWithPlusSy $config = array('mod'); $values = $this->_invokeRouteMatch($request, $config); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -517,7 +517,7 @@ public function test_RESTfulModule_GET_user() $config = array('mod'); $values = $this->_invokeRouteMatch($request, $config); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -533,7 +533,7 @@ public function test_RESTfulModule_GET_user_urlencodedWithPlusSymbol() $config = array('mod'); $values = $this->_invokeRouteMatch($request, $config); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -547,7 +547,7 @@ public function test_RESTfulModule_POST_user() $config = array('mod'); $values = $this->_invokeRouteMatch($request, $config); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -569,7 +569,7 @@ public function test_RESTfulModule_PUT_user_byIdentifier() $config = array('mod'); $values = $this->_invokeRouteMatch($request, $config); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -586,7 +586,7 @@ public function test_RESTfulModule_PUT_user_byIdentifier_urlencodedWithPlusSymbo $config = array('mod'); $values = $this->_invokeRouteMatch($request, $config); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -600,7 +600,7 @@ public function test_RESTfulModule_DELETE_user_byIdentifier() $config = array('mod'); $values = $this->_invokeRouteMatch($request, $config); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -617,7 +617,7 @@ public function test_RESTfulModule_DELETE_user_byIdentifier_urlencodedWithPlusSy $config = array('mod'); $values = $this->_invokeRouteMatch($request, $config); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -631,7 +631,7 @@ public function test_RESTfulController_GET_user_index() $config = array('mod'=>array('user')); $values = $this->_invokeRouteMatch($request, $config); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -662,7 +662,7 @@ public function test_RESTfulController_GET_user() $config = array('mod'=>array('user')); $values = $this->_invokeRouteMatch($request, $config); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -678,7 +678,7 @@ public function test_RESTfulController_GET_user_urlencodedWithPlusSymbol() $config = array('mod'=>array('user')); $values = $this->_invokeRouteMatch($request, $config); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -692,7 +692,7 @@ public function test_RESTfulController_POST_user() $config = array('mod'=>array('user')); $values = $this->_invokeRouteMatch($request, $config); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -732,7 +732,7 @@ public function test_RESTfulController_PUT_user_byIdentifier() $config = array('mod'=>array('user')); $values = $this->_invokeRouteMatch($request, $config); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -749,7 +749,7 @@ public function test_RESTfulController_PUT_user_byIdentifier_urlencodedWithPlusS $config = array('mod'=>array('user')); $values = $this->_invokeRouteMatch($request, $config); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -763,7 +763,7 @@ public function test_RESTfulController_DELETE_user_byIdentifier() $config = array('mod'); $values = $this->_invokeRouteMatch($request, $config); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); @@ -780,7 +780,7 @@ public function test_RESTfulController_DELETE_user_byIdentifier_urlencodedWithPl $config = array('mod'); $values = $this->_invokeRouteMatch($request, $config); - $this->assertTrue(is_array($values)); + $this->assertInternalType('array', $values); $this->assertTrue(isset($values['module'])); $this->assertEquals('mod', $values['module']); $this->assertEquals('user', $values['controller']); diff --git a/tests/Zend/Rest/ServerTest.php b/tests/Zend/Rest/ServerTest.php index a55a0efbb4..714e77803b 100644 --- a/tests/Zend/Rest/ServerTest.php +++ b/tests/Zend/Rest/ServerTest.php @@ -36,7 +36,7 @@ * @group Zend_Rest * @group Zend_Rest_Server */ -class Zend_Rest_ServerTest extends PHPUnit_Framework_TestCase +class Zend_Rest_ServerTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -427,7 +427,7 @@ public function testReturnResponseForcesHandleToReturnResponse() ob_start(); $response = $server->handle(array('method' => 'test2Xml')); $result = ob_get_clean(); - $this->assertTrue(empty($result)); + $this->assertEmpty($result); $this->assertContains('bar', $response); } @@ -439,7 +439,7 @@ public function testGeneratedXmlEncodesScalarAmpersands() ob_start(); $response = $server->handle(array('method' => 'testScalarEncoding')); $result = ob_get_clean(); - $this->assertTrue(empty($result)); + $this->assertEmpty($result); $this->assertContains('This string has chars & ampersands', $response); } @@ -451,7 +451,7 @@ public function testGeneratedXmlEncodesStructAmpersands() ob_start(); $response = $server->handle(array('method' => 'testStructEncoding')); $result = ob_get_clean(); - $this->assertTrue(empty($result)); + $this->assertEmpty($result); $this->assertContains('bar & baz', $response); } @@ -463,7 +463,7 @@ public function testGeneratedXmlEncodesFaultAmpersands() ob_start(); $response = $server->handle(array('method' => 'testExceptionsEncoding')); $result = ob_get_clean(); - $this->assertTrue(empty($result)); + $this->assertEmpty($result); $this->assertContains('testing class method exception & encoding', $response); } diff --git a/tests/Zend/Search/Lucene/AnalysisTest.php b/tests/Zend/Search/Lucene/AnalysisTest.php index 39814e933f..b1a2d62a42 100644 --- a/tests/Zend/Search/Lucene/AnalysisTest.php +++ b/tests/Zend/Search/Lucene/AnalysisTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Search_Lucene */ -class Zend_Search_Lucene_AnalysisTest extends PHPUnit_Framework_TestCase +class Zend_Search_Lucene_AnalysisTest extends PHPUnit\Framework\TestCase { public function testAnalyzer() { diff --git a/tests/Zend/Search/Lucene/DocumentTest.php b/tests/Zend/Search/Lucene/DocumentTest.php index 162aa05b9a..f37dc934a5 100644 --- a/tests/Zend/Search/Lucene/DocumentTest.php +++ b/tests/Zend/Search/Lucene/DocumentTest.php @@ -58,7 +58,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Search_Lucene */ -class Zend_Search_Lucene_DocumentTest extends PHPUnit_Framework_TestCase +class Zend_Search_Lucene_DocumentTest extends PHPUnit\Framework\TestCase { private function _clearDirectory($dirName) @@ -93,7 +93,7 @@ public function testFields() $document->addField(Zend_Search_Lucene_Field::Text('body', 'Document body, document body, document body...')); $fieldnamesDiffArray = array_diff($document->getFieldNames(), array('title', 'annotation', 'body')); - $this->assertTrue(is_array($fieldnamesDiffArray)); + $this->assertInternalType('array', $fieldnamesDiffArray); $this->assertEquals(count($fieldnamesDiffArray), 0); $this->assertEquals($document->title, 'Title'); diff --git a/tests/Zend/Search/Lucene/FSMTest.php b/tests/Zend/Search/Lucene/FSMTest.php index aa1138ca5e..482c2231c2 100644 --- a/tests/Zend/Search/Lucene/FSMTest.php +++ b/tests/Zend/Search/Lucene/FSMTest.php @@ -117,7 +117,7 @@ public function __construct() * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Search_Lucene */ -class Zend_Search_Lucene_FSMTest extends PHPUnit_Framework_TestCase +class Zend_Search_Lucene_FSMTest extends PHPUnit\Framework\TestCase { public function testCreate() { diff --git a/tests/Zend/Search/Lucene/FieldTest.php b/tests/Zend/Search/Lucene/FieldTest.php index 5fb6f26592..babe58fa76 100644 --- a/tests/Zend/Search/Lucene/FieldTest.php +++ b/tests/Zend/Search/Lucene/FieldTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Search_Lucene */ -class Zend_Search_Lucene_FieldTest extends PHPUnit_Framework_TestCase +class Zend_Search_Lucene_FieldTest extends PHPUnit\Framework\TestCase { public function testBinary() { diff --git a/tests/Zend/Search/Lucene/Index/DictionaryLoaderTest.php b/tests/Zend/Search/Lucene/Index/DictionaryLoaderTest.php index cd62595201..a10504dcf7 100644 --- a/tests/Zend/Search/Lucene/Index/DictionaryLoaderTest.php +++ b/tests/Zend/Search/Lucene/Index/DictionaryLoaderTest.php @@ -44,7 +44,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Search_Lucene */ -class Zend_Search_Lucene_Index_DictionaryLoaderTest extends PHPUnit_Framework_TestCase +class Zend_Search_Lucene_Index_DictionaryLoaderTest extends PHPUnit\Framework\TestCase { public function testCreate() { diff --git a/tests/Zend/Search/Lucene/Index/FieldInfoTest.php b/tests/Zend/Search/Lucene/Index/FieldInfoTest.php index 1740dc7a33..88f557aa3a 100644 --- a/tests/Zend/Search/Lucene/Index/FieldInfoTest.php +++ b/tests/Zend/Search/Lucene/Index/FieldInfoTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Search_Lucene */ -class Zend_Search_Lucene_Index_FieldInfoTest extends PHPUnit_Framework_TestCase +class Zend_Search_Lucene_Index_FieldInfoTest extends PHPUnit\Framework\TestCase { public function testCreate() { diff --git a/tests/Zend/Search/Lucene/Index/SegmentInfoTest.php b/tests/Zend/Search/Lucene/Index/SegmentInfoTest.php index 13afea265f..5c03caafaa 100644 --- a/tests/Zend/Search/Lucene/Index/SegmentInfoTest.php +++ b/tests/Zend/Search/Lucene/Index/SegmentInfoTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Search_Lucene */ -class Zend_Search_Lucene_Index_SegmentInfoTest extends PHPUnit_Framework_TestCase +class Zend_Search_Lucene_Index_SegmentInfoTest extends PHPUnit\Framework\TestCase { public function testCreate() { diff --git a/tests/Zend/Search/Lucene/Index/SegmentMergerTest.php b/tests/Zend/Search/Lucene/Index/SegmentMergerTest.php index ccfaf4b4bc..fa425384bf 100644 --- a/tests/Zend/Search/Lucene/Index/SegmentMergerTest.php +++ b/tests/Zend/Search/Lucene/Index/SegmentMergerTest.php @@ -44,7 +44,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Search_Lucene */ -class Zend_Search_Lucene_Index_SegmentMergerTest extends PHPUnit_Framework_TestCase +class Zend_Search_Lucene_Index_SegmentMergerTest extends PHPUnit\Framework\TestCase { public function testMerge() { diff --git a/tests/Zend/Search/Lucene/Index/TermInfoTest.php b/tests/Zend/Search/Lucene/Index/TermInfoTest.php index 83aacc6342..431b9cc209 100644 --- a/tests/Zend/Search/Lucene/Index/TermInfoTest.php +++ b/tests/Zend/Search/Lucene/Index/TermInfoTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Search_Lucene */ -class Zend_Search_Lucene_Index_TermInfoTest extends PHPUnit_Framework_TestCase +class Zend_Search_Lucene_Index_TermInfoTest extends PHPUnit\Framework\TestCase { public function testCreate() { diff --git a/tests/Zend/Search/Lucene/Index/TermTest.php b/tests/Zend/Search/Lucene/Index/TermTest.php index 520b99d85e..e8576d5cfe 100644 --- a/tests/Zend/Search/Lucene/Index/TermTest.php +++ b/tests/Zend/Search/Lucene/Index/TermTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Search_Lucene */ -class Zend_Search_Lucene_Index_TermTest extends PHPUnit_Framework_TestCase +class Zend_Search_Lucene_Index_TermTest extends PHPUnit\Framework\TestCase { public function testCreate() { diff --git a/tests/Zend/Search/Lucene/Index/TermsPriorityQueueTest.php b/tests/Zend/Search/Lucene/Index/TermsPriorityQueueTest.php index f259183786..caf9c3a2de 100644 --- a/tests/Zend/Search/Lucene/Index/TermsPriorityQueueTest.php +++ b/tests/Zend/Search/Lucene/Index/TermsPriorityQueueTest.php @@ -43,7 +43,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Search_Lucene */ -class Zend_Search_Lucene_Index_TermsPriorityQueueTest extends PHPUnit_Framework_TestCase +class Zend_Search_Lucene_Index_TermsPriorityQueueTest extends PHPUnit\Framework\TestCase { public function testQueue() { diff --git a/tests/Zend/Search/Lucene/LuceneTest.php b/tests/Zend/Search/Lucene/LuceneTest.php index 46d9d6f9f6..745b649fc1 100644 --- a/tests/Zend/Search/Lucene/LuceneTest.php +++ b/tests/Zend/Search/Lucene/LuceneTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Search_Lucene */ -class Zend_Search_Lucene_LuceneTest extends PHPUnit_Framework_TestCase +class Zend_Search_Lucene_LuceneTest extends PHPUnit\Framework\TestCase { private function _clearDirectory($dirName) { diff --git a/tests/Zend/Search/Lucene/PriorityQueueTest.php b/tests/Zend/Search/Lucene/PriorityQueueTest.php index 851637d972..599aabf51c 100644 --- a/tests/Zend/Search/Lucene/PriorityQueueTest.php +++ b/tests/Zend/Search/Lucene/PriorityQueueTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Search_Lucene */ -class Zend_Search_Lucene_PriorityQueueTest extends PHPUnit_Framework_TestCase +class Zend_Search_Lucene_PriorityQueueTest extends PHPUnit\Framework\TestCase { public function testCreate() { diff --git a/tests/Zend/Search/Lucene/Search23Test.php b/tests/Zend/Search/Lucene/Search23Test.php index e10dee1d82..6ee29b2031 100755 --- a/tests/Zend/Search/Lucene/Search23Test.php +++ b/tests/Zend/Search/Lucene/Search23Test.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Search_Lucene */ -class Zend_Search_Lucene_Search23Test extends PHPUnit_Framework_TestCase +class Zend_Search_Lucene_Search23Test extends PHPUnit\Framework\TestCase { public function testQueryParser() { diff --git a/tests/Zend/Search/Lucene/SearchHighlightTest.php b/tests/Zend/Search/Lucene/SearchHighlightTest.php index 26630fbe5f..90b95977ae 100644 --- a/tests/Zend/Search/Lucene/SearchHighlightTest.php +++ b/tests/Zend/Search/Lucene/SearchHighlightTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Search_Lucene */ -class Zend_Search_Lucene_SearchHighlightTest extends PHPUnit_Framework_TestCase +class Zend_Search_Lucene_SearchHighlightTest extends PHPUnit\Framework\TestCase { /** * Wildcard pattern minimum preffix diff --git a/tests/Zend/Search/Lucene/SearchTest.php b/tests/Zend/Search/Lucene/SearchTest.php index 6dd9f952f5..f380d62326 100644 --- a/tests/Zend/Search/Lucene/SearchTest.php +++ b/tests/Zend/Search/Lucene/SearchTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Search_Lucene */ -class Zend_Search_Lucene_SearchTest extends PHPUnit_Framework_TestCase +class Zend_Search_Lucene_SearchTest extends PHPUnit\Framework\TestCase { public function testQueryParser() { diff --git a/tests/Zend/Search/Lucene/Storage/DirectoryTest.php b/tests/Zend/Search/Lucene/Storage/DirectoryTest.php index eba6754a75..e988954b84 100644 --- a/tests/Zend/Search/Lucene/Storage/DirectoryTest.php +++ b/tests/Zend/Search/Lucene/Storage/DirectoryTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Search_Lucene */ -class Zend_Search_Lucene_Storage_DirectoryTest extends PHPUnit_Framework_TestCase +class Zend_Search_Lucene_Storage_DirectoryTest extends PHPUnit\Framework\TestCase { public function testFilesystem() { diff --git a/tests/Zend/Search/Lucene/Storage/FileTest.php b/tests/Zend/Search/Lucene/Storage/FileTest.php index bf62a24127..5532993a2b 100644 --- a/tests/Zend/Search/Lucene/Storage/FileTest.php +++ b/tests/Zend/Search/Lucene/Storage/FileTest.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Search_Lucene */ -class Zend_Search_Lucene_Storage_FileTest extends PHPUnit_Framework_TestCase +class Zend_Search_Lucene_Storage_FileTest extends PHPUnit\Framework\TestCase { public function testFilesystem() { diff --git a/tests/Zend/Serializer/Adapter/Amf0Test.php b/tests/Zend/Serializer/Adapter/Amf0Test.php index 41933bdef1..6ee9de039f 100644 --- a/tests/Zend/Serializer/Adapter/Amf0Test.php +++ b/tests/Zend/Serializer/Adapter/Amf0Test.php @@ -32,7 +32,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Serializer_Adapter_Amf0Test extends PHPUnit_Framework_TestCase +class Zend_Serializer_Adapter_Amf0Test extends PHPUnit\Framework\TestCase { private $_adapter; diff --git a/tests/Zend/Serializer/Adapter/Amf3Test.php b/tests/Zend/Serializer/Adapter/Amf3Test.php index c4dee04178..142d77551c 100644 --- a/tests/Zend/Serializer/Adapter/Amf3Test.php +++ b/tests/Zend/Serializer/Adapter/Amf3Test.php @@ -32,7 +32,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Serializer_Adapter_Amf3Test extends PHPUnit_Framework_TestCase +class Zend_Serializer_Adapter_Amf3Test extends PHPUnit\Framework\TestCase { private $_adapter; diff --git a/tests/Zend/Serializer/Adapter/IgbinaryTest.php b/tests/Zend/Serializer/Adapter/IgbinaryTest.php index 12796f98b4..a15a915c20 100644 --- a/tests/Zend/Serializer/Adapter/IgbinaryTest.php +++ b/tests/Zend/Serializer/Adapter/IgbinaryTest.php @@ -32,7 +32,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Serializer_Adapter_IgbinaryTest extends PHPUnit_Framework_TestCase +class Zend_Serializer_Adapter_IgbinaryTest extends PHPUnit\Framework\TestCase { private $_adapter; @@ -146,7 +146,7 @@ public function testUnserializeObject() public function testUnserialzeInvalid() { $value = "\0\1\r\n"; - $this->setExpectedException('Zend_Serializer_Exception'); + $this->expectException('Zend_Serializer_Exception'); $this->_adapter->unserialize($value); } diff --git a/tests/Zend/Serializer/Adapter/JsonTest.php b/tests/Zend/Serializer/Adapter/JsonTest.php index 2267bb0507..ab1eb9dbda 100644 --- a/tests/Zend/Serializer/Adapter/JsonTest.php +++ b/tests/Zend/Serializer/Adapter/JsonTest.php @@ -32,7 +32,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Serializer_Adapter_JsonTest extends PHPUnit_Framework_TestCase +class Zend_Serializer_Adapter_JsonTest extends PHPUnit\Framework\TestCase { private $_adapter; @@ -150,7 +150,7 @@ public function testUnserializeAsObject() public function testUnserialzeInvalid() { $value = 'not a serialized string'; - $this->setExpectedException('Zend_Serializer_Exception'); + $this->expectException('Zend_Serializer_Exception'); $this->_adapter->unserialize($value); } diff --git a/tests/Zend/Serializer/Adapter/PhpCodeTest.php b/tests/Zend/Serializer/Adapter/PhpCodeTest.php index aa7387880e..65bffcf761 100644 --- a/tests/Zend/Serializer/Adapter/PhpCodeTest.php +++ b/tests/Zend/Serializer/Adapter/PhpCodeTest.php @@ -32,7 +32,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Serializer_Adapter_PhpCodeTest extends PHPUnit_Framework_TestCase +class Zend_Serializer_Adapter_PhpCodeTest extends PHPUnit\Framework\TestCase { private $_adapter; @@ -145,7 +145,7 @@ public function testUnserialzeInvalid() $this->markTestSkipped('Evaling of invalid input is PHP Parse error in PHP7+'); } $value = 'not a serialized string'; - $this->setExpectedException('Zend_Serializer_Exception'); + $this->expectException('Zend_Serializer_Exception'); $this->_adapter->unserialize($value); } diff --git a/tests/Zend/Serializer/Adapter/PhpSerializeTest.php b/tests/Zend/Serializer/Adapter/PhpSerializeTest.php index c15a277b2b..34c0f1feaf 100644 --- a/tests/Zend/Serializer/Adapter/PhpSerializeTest.php +++ b/tests/Zend/Serializer/Adapter/PhpSerializeTest.php @@ -32,7 +32,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Serializer_Adapter_PhpSerializeTest extends PHPUnit_Framework_TestCase +class Zend_Serializer_Adapter_PhpSerializeTest extends PHPUnit\Framework\TestCase { private $_adapter; @@ -140,7 +140,7 @@ public function testUnserializeObject() public function testUnserialzeInvalid() { $value = 'not a serialized string'; - $this->setExpectedException('Zend_Serializer_Exception'); + $this->expectException('Zend_Serializer_Exception'); $this->_adapter->unserialize($value); } diff --git a/tests/Zend/Serializer/Adapter/PythonPickleSerializeProtocol0Test.php b/tests/Zend/Serializer/Adapter/PythonPickleSerializeProtocol0Test.php index 5370d33ba2..ad1a53433c 100644 --- a/tests/Zend/Serializer/Adapter/PythonPickleSerializeProtocol0Test.php +++ b/tests/Zend/Serializer/Adapter/PythonPickleSerializeProtocol0Test.php @@ -32,7 +32,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Serializer_Adapter_PythonPickleSerializeProtocol0Test extends PHPUnit_Framework_TestCase +class Zend_Serializer_Adapter_PythonPickleSerializeProtocol0Test extends PHPUnit\Framework\TestCase { private $_adapter; diff --git a/tests/Zend/Serializer/Adapter/PythonPickleSerializeProtocol1Test.php b/tests/Zend/Serializer/Adapter/PythonPickleSerializeProtocol1Test.php index f25b37f88a..7cbc14664d 100644 --- a/tests/Zend/Serializer/Adapter/PythonPickleSerializeProtocol1Test.php +++ b/tests/Zend/Serializer/Adapter/PythonPickleSerializeProtocol1Test.php @@ -32,7 +32,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Serializer_Adapter_PythonPickleSerializeProtocol1Test extends PHPUnit_Framework_TestCase +class Zend_Serializer_Adapter_PythonPickleSerializeProtocol1Test extends PHPUnit\Framework\TestCase { private $_adapter; diff --git a/tests/Zend/Serializer/Adapter/PythonPickleUnserializeTest.php b/tests/Zend/Serializer/Adapter/PythonPickleUnserializeTest.php index 503270335d..9f419b0d1f 100644 --- a/tests/Zend/Serializer/Adapter/PythonPickleUnserializeTest.php +++ b/tests/Zend/Serializer/Adapter/PythonPickleUnserializeTest.php @@ -32,7 +32,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit_Framework_TestCase +class Zend_Serializer_Adapter_PythonPickleUnserializeTest extends PHPUnit\Framework\TestCase { private $_adapter; @@ -375,7 +375,7 @@ public function testUnserializeTuple3() public function testUnserialzeInvalid() { $value = 'not a serialized string'; - $this->setExpectedException('Zend_Serializer_Exception'); + $this->expectException('Zend_Serializer_Exception'); $this->_adapter->unserialize($value); } diff --git a/tests/Zend/Serializer/Adapter/WddxTest.php b/tests/Zend/Serializer/Adapter/WddxTest.php index 93513b1eae..0446e75b8b 100644 --- a/tests/Zend/Serializer/Adapter/WddxTest.php +++ b/tests/Zend/Serializer/Adapter/WddxTest.php @@ -32,7 +32,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Serializer_Adapter_WddxTest extends PHPUnit_Framework_TestCase +class Zend_Serializer_Adapter_WddxTest extends PHPUnit\Framework\TestCase { private $_adapter; @@ -209,7 +209,7 @@ public function testUnserializeObject() public function testUnserialzeInvalid() { $value = 'not a serialized string'; - $this->setExpectedException('Zend_Serializer_Exception'); + $this->expectException('Zend_Serializer_Exception'); $this->_adapter->unserialize($value); } @@ -234,8 +234,10 @@ public function testUnserializeInvalidXml() } $value = 'not a serialized string'; - $this->setExpectedException( - 'Zend_Serializer_Exception', + $this->expectException( + 'Zend_Serializer_Exception' + ); + $this->expectExceptionMessage( 'Can\'t unserialize wddx string' ); $this->_adapter->unserialize($value); @@ -246,7 +248,7 @@ public function testShouldThrowExceptionIfXmlToUnserializeFromContainsADoctype() $value = '' . '
' . 'test'; - $this->setExpectedException("Zend_Serializer_Exception"); + $this->expectException("Zend_Serializer_Exception"); $data = $this->_adapter->unserialize($value); } } diff --git a/tests/Zend/Serializer/SerializerTest.php b/tests/Zend/Serializer/SerializerTest.php index b4230a55ae..c23ee19b53 100644 --- a/tests/Zend/Serializer/SerializerTest.php +++ b/tests/Zend/Serializer/SerializerTest.php @@ -32,7 +32,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Serializer_SerializerTest extends PHPUnit_Framework_TestCase +class Zend_Serializer_SerializerTest extends PHPUnit\Framework\TestCase { public function setUp() @@ -64,13 +64,15 @@ public function testFactoryValidCall() public function testFactoryUnknownAdapter() { - $this->setExpectedException('Zend_Serializer_Exception','Can\'t load serializer adapter'); + $this->expectException('Zend_Serializer_Exception'); + $this->expectExceptionMessage('Can\'t load serializer adapter'); Zend_Serializer::factory('unknown'); } public function testFactoryOnADummyClassAdapter() { - $this->setExpectedException('Zend_Serializer_Exception','must implement Zend_Serializer_Adapter_AdapterInterface'); + $this->expectException('Zend_Serializer_Exception'); + $this->expectExceptionMessage('must implement Zend_Serializer_Adapter_AdapterInterface'); Zend_Serializer::setAdapterLoader(new Zend_Loader_PluginLoader(array('Zend_Serializer_Adapter' => dirname(__FILE__) . '/_files'))); Zend_Serializer::factory('dummy'); } diff --git a/tests/Zend/Server/DefinitionTest.php b/tests/Zend/Server/DefinitionTest.php index 0c1088bd2a..f66f90f6c0 100644 --- a/tests/Zend/Server/DefinitionTest.php +++ b/tests/Zend/Server/DefinitionTest.php @@ -42,7 +42,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Server */ -class Zend_Server_DefinitionTest extends PHPUnit_Framework_TestCase +class Zend_Server_DefinitionTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -68,8 +68,8 @@ public function tearDown() public function testMethodsShouldBeEmptyArrayByDefault() { $methods = $this->definition->getMethods(); - $this->assertTrue(is_array($methods)); - $this->assertTrue(empty($methods)); + $this->assertInternalType('array', $methods); + $this->assertEmpty($methods); } public function testDefinitionShouldAllowAddingSingleMethods() @@ -131,7 +131,7 @@ public function testDefinitionShouldAllowClearingAllMethods() $this->testDefinitionShouldAllowAddingMultipleMethods(); $this->definition->clearMethods(); $test = $this->definition->getMethods(); - $this->assertTrue(empty($test)); + $this->assertEmpty($test); } public function testDefinitionShouldSerializeToArray() diff --git a/tests/Zend/Server/Method/CallbackTest.php b/tests/Zend/Server/Method/CallbackTest.php index 177bcd1215..f3a53a04cc 100644 --- a/tests/Zend/Server/Method/CallbackTest.php +++ b/tests/Zend/Server/Method/CallbackTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Server */ -class Zend_Server_Method_CallbackTest extends PHPUnit_Framework_TestCase +class Zend_Server_Method_CallbackTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -105,10 +105,11 @@ public function testTypeShouldBeMutable() } /** - * @expectedException Zend_Server_Exception */ public function testSettingTypeShouldThrowExceptionWhenInvalidTypeProvided() { + $this->expectException(\Zend_Server_Exception::class); + $this->callback->setType('bogus'); } @@ -118,7 +119,7 @@ public function testCallbackShouldSerializeToArray() ->setMethod('bar') ->setType('instance'); $test = $this->callback->toArray(); - $this->assertTrue(is_array($test)); + $this->assertInternalType('array', $test); $this->assertEquals('Foo', $test['class']); $this->assertEquals('bar', $test['method']); $this->assertEquals('instance', $test['type']); diff --git a/tests/Zend/Server/Method/DefinitionTest.php b/tests/Zend/Server/Method/DefinitionTest.php index 43a4cbd890..e94ccf5f2b 100644 --- a/tests/Zend/Server/Method/DefinitionTest.php +++ b/tests/Zend/Server/Method/DefinitionTest.php @@ -39,7 +39,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Server */ -class Zend_Server_Method_DefinitionTest extends PHPUnit_Framework_TestCase +class Zend_Server_Method_DefinitionTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -124,18 +124,19 @@ public function testObjectShouldBeMutable() } /** - * @expectedException Zend_Server_Exception */ public function testSettingObjectToNonObjectShouldThrowException() { + $this->expectException(\Zend_Server_Exception::class); + $this->definition->setObject('foo'); } public function testInvokeArgumentsShouldBeEmptyArrayByDefault() { $args = $this->definition->getInvokeArguments(); - $this->assertTrue(is_array($args)); - $this->assertTrue(empty($args)); + $this->assertInternalType('array', $args); + $this->assertEmpty($args); } public function testInvokeArgumentsShouldBeMutable() @@ -149,8 +150,8 @@ public function testInvokeArgumentsShouldBeMutable() public function testPrototypesShouldBeEmptyArrayByDefault() { $prototypes = $this->definition->getPrototypes(); - $this->assertTrue(is_array($prototypes)); - $this->assertTrue(empty($prototypes)); + $this->assertInternalType('array', $prototypes); + $this->assertEmpty($prototypes); } public function testDefinitionShouldAllowAddingSinglePrototypes() diff --git a/tests/Zend/Server/Method/ParameterTest.php b/tests/Zend/Server/Method/ParameterTest.php index b89129078f..989e33e82d 100644 --- a/tests/Zend/Server/Method/ParameterTest.php +++ b/tests/Zend/Server/Method/ParameterTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Server */ -class Zend_Server_Method_ParameterTest extends PHPUnit_Framework_TestCase +class Zend_Server_Method_ParameterTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/Server/Method/PrototypeTest.php b/tests/Zend/Server/Method/PrototypeTest.php index d745a723e6..d597ae4c15 100644 --- a/tests/Zend/Server/Method/PrototypeTest.php +++ b/tests/Zend/Server/Method/PrototypeTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Server */ -class Zend_Server_Method_PrototypeTest extends PHPUnit_Framework_TestCase +class Zend_Server_Method_PrototypeTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -71,8 +71,8 @@ public function testReturnTypeShouldBeMutable() public function testParametersShouldBeEmptyArrayByDefault() { $params = $this->prototype->getParameters(); - $this->assertTrue(is_array($params)); - $this->assertTrue(empty($params)); + $this->assertInternalType('array', $params); + $this->assertEmpty($params); } public function testPrototypeShouldAllowAddingSingleParameters() @@ -80,7 +80,7 @@ public function testPrototypeShouldAllowAddingSingleParameters() $this->testParametersShouldBeEmptyArrayByDefault(); $this->prototype->addParameter('string'); $params = $this->prototype->getParameters(); - $this->assertTrue(is_array($params)); + $this->assertInternalType('array', $params); $this->assertEquals(1, count($params)); $this->assertEquals('string', $params[0]); diff --git a/tests/Zend/Server/Reflection/ClassTest.php b/tests/Zend/Server/Reflection/ClassTest.php index 7704f5a761..2b5189d8f0 100644 --- a/tests/Zend/Server/Reflection/ClassTest.php +++ b/tests/Zend/Server/Reflection/ClassTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Server */ -class Zend_Server_Reflection_ClassTest extends PHPUnit_Framework_TestCase +class Zend_Server_Reflection_ClassTest extends PHPUnit\Framework\TestCase { /** * __construct() test @@ -55,7 +55,7 @@ public function test__construct() $this->assertEquals('', $r->getNamespace()); $methods = $r->getMethods(); - $this->assertTrue(is_array($methods)); + $this->assertInternalType('array', $methods); foreach ($methods as $m) { $this->assertTrue($m instanceof Zend_Server_Reflection_Method); } @@ -78,7 +78,7 @@ public function test__construct() public function test__call() { $r = new Zend_Server_Reflection_Class(new ReflectionClass('Zend_Server_Reflection')); - $this->assertTrue(is_string($r->getName())); + $this->assertInternalType('string', $r->getName()); $this->assertEquals('Zend_Server_Reflection', $r->getName()); } @@ -104,7 +104,7 @@ public function testGetMethods() $r = new Zend_Server_Reflection_Class(new ReflectionClass('Zend_Server_Reflection')); $methods = $r->getMethods(); - $this->assertTrue(is_array($methods)); + $this->assertInternalType('array', $methods); foreach ($methods as $m) { $this->assertTrue($m instanceof Zend_Server_Reflection_Method); } diff --git a/tests/Zend/Server/Reflection/FunctionTest.php b/tests/Zend/Server/Reflection/FunctionTest.php index 80ce9c640c..5f0ca0bc87 100644 --- a/tests/Zend/Server/Reflection/FunctionTest.php +++ b/tests/Zend/Server/Reflection/FunctionTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Server */ -class Zend_Server_Reflection_FunctionTest extends PHPUnit_Framework_TestCase +class Zend_Server_Reflection_FunctionTest extends PHPUnit\Framework\TestCase { public function test__construct() { @@ -53,11 +53,11 @@ public function test__construct() $argv = array('string1', 'string2'); $r = new Zend_Server_Reflection_Function($function, 'namespace', $argv); - $this->assertTrue(is_array($r->getInvokeArguments())); + $this->assertInternalType('array', $r->getInvokeArguments()); $this->assertTrue($argv === $r->getInvokeArguments()); $prototypes = $r->getPrototypes(); - $this->assertTrue(is_array($prototypes)); + $this->assertInternalType('array', $prototypes); $this->assertTrue(0 < count($prototypes)); } @@ -95,7 +95,7 @@ public function testGetPrototypes() $r = new Zend_Server_Reflection_Function($function); $prototypes = $r->getPrototypes(); - $this->assertTrue(is_array($prototypes)); + $this->assertInternalType('array', $prototypes); $this->assertTrue(0 < count($prototypes)); $this->assertEquals(8, count($prototypes)); @@ -110,7 +110,7 @@ public function testGetPrototypes2() $r = new Zend_Server_Reflection_Function($function); $prototypes = $r->getPrototypes(); - $this->assertTrue(is_array($prototypes)); + $this->assertInternalType('array', $prototypes); $this->assertTrue(0 < count($prototypes)); $this->assertEquals(1, count($prototypes)); @@ -125,13 +125,13 @@ public function testGetInvokeArguments() $function = new ReflectionFunction('Zend_Server_Reflection_FunctionTest_function'); $r = new Zend_Server_Reflection_Function($function); $args = $r->getInvokeArguments(); - $this->assertTrue(is_array($args)); + $this->assertInternalType('array', $args); $this->assertEquals(0, count($args)); $argv = array('string1', 'string2'); $r = new Zend_Server_Reflection_Function($function, null, $argv); $args = $r->getInvokeArguments(); - $this->assertTrue(is_array($args)); + $this->assertInternalType('array', $args); $this->assertEquals(2, count($args)); $this->assertTrue($argv === $args); } @@ -152,13 +152,13 @@ public function testMultipleWhitespaceBetweenDoctagsAndTypes() $r = new Zend_Server_Reflection_Function($function); $prototypes = $r->getPrototypes(); - $this->assertTrue(is_array($prototypes)); + $this->assertInternalType('array', $prototypes); $this->assertTrue(0 < count($prototypes)); $this->assertEquals(1, count($prototypes)); $proto = $prototypes[0]; $params = $proto->getParameters(); - $this->assertTrue(is_array($params)); + $this->assertInternalType('array', $params); $this->assertEquals(1, count($params)); $this->assertEquals('string', $params[0]->getType()); } diff --git a/tests/Zend/Server/Reflection/MethodTest.php b/tests/Zend/Server/Reflection/MethodTest.php index b58225a7c7..214c138662 100644 --- a/tests/Zend/Server/Reflection/MethodTest.php +++ b/tests/Zend/Server/Reflection/MethodTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Server */ -class Zend_Server_Reflection_MethodTest extends PHPUnit_Framework_TestCase +class Zend_Server_Reflection_MethodTest extends PHPUnit\Framework\TestCase { protected $_classRaw; protected $_class; diff --git a/tests/Zend/Server/Reflection/NodeTest.php b/tests/Zend/Server/Reflection/NodeTest.php index 2990b74fad..070509fe0b 100644 --- a/tests/Zend/Server/Reflection/NodeTest.php +++ b/tests/Zend/Server/Reflection/NodeTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Server */ -class Zend_Server_Reflection_NodeTest extends PHPUnit_Framework_TestCase +class Zend_Server_Reflection_NodeTest extends PHPUnit\Framework\TestCase { /** * __construct() test @@ -44,14 +44,14 @@ public function test__construct() $this->assertEquals('string', $node->getValue()); $this->assertTrue(null === $node->getParent()); $children = $node->getChildren(); - $this->assertTrue(empty($children)); + $this->assertEmpty($children); $child = new Zend_Server_Reflection_Node('array', $node); $this->assertTrue($child instanceof Zend_Server_Reflection_Node); $this->assertEquals('array', $child->getValue()); $this->assertTrue($node === $child->getParent()); $children = $child->getChildren(); - $this->assertTrue(empty($children)); + $this->assertEmpty($children); $children = $node->getChildren(); $this->assertTrue($child === $children[0]); @@ -111,7 +111,7 @@ public function testGetChildren() foreach ($children as $c) { $types[] = $c->getValue(); } - $this->assertTrue(is_array($children)); + $this->assertInternalType('array', $children); $this->assertEquals(1, count($children), var_export($types, 1)); $this->assertTrue($child === $children[0]); } diff --git a/tests/Zend/Server/Reflection/ParameterTest.php b/tests/Zend/Server/Reflection/ParameterTest.php index 809cd0e41d..c567609cf7 100644 --- a/tests/Zend/Server/Reflection/ParameterTest.php +++ b/tests/Zend/Server/Reflection/ParameterTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Server */ -class Zend_Server_Reflection_ParameterTest extends PHPUnit_Framework_TestCase +class Zend_Server_Reflection_ParameterTest extends PHPUnit\Framework\TestCase { protected function _getParameter() { @@ -77,8 +77,8 @@ public function test__call() $r = new Zend_Server_Reflection_Parameter($this->_getParameter()); // just test a few call proxies... - $this->assertTrue(is_bool($r->allowsNull())); - $this->assertTrue(is_bool($r->isOptional())); + $this->assertInternalType('bool', $r->allowsNull()); + $this->assertInternalType('bool', $r->isOptional()); } /** diff --git a/tests/Zend/Server/Reflection/PrototypeTest.php b/tests/Zend/Server/Reflection/PrototypeTest.php index 79568c5811..9aa59b5aeb 100644 --- a/tests/Zend/Server/Reflection/PrototypeTest.php +++ b/tests/Zend/Server/Reflection/PrototypeTest.php @@ -36,7 +36,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Server */ -class Zend_Server_Reflection_PrototypeTest extends PHPUnit_Framework_TestCase +class Zend_Server_Reflection_PrototypeTest extends PHPUnit\Framework\TestCase { /** * Zend_Server_Reflection_Prototype object @@ -151,7 +151,7 @@ public function testGetParameters() $r = new Zend_Server_Reflection_Prototype($this->_r->getReturnValue(), $this->_parameters); $p = $r->getParameters(); - $this->assertTrue(is_array($p)); + $this->assertInternalType('array', $p); foreach ($p as $parameter) { $this->assertTrue($parameter instanceof Zend_Server_Reflection_Parameter); } diff --git a/tests/Zend/Server/Reflection/ReturnValueTest.php b/tests/Zend/Server/Reflection/ReturnValueTest.php index dd43498593..3572dc85db 100644 --- a/tests/Zend/Server/Reflection/ReturnValueTest.php +++ b/tests/Zend/Server/Reflection/ReturnValueTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Server */ -class Zend_Server_Reflection_ReturnValueTest extends PHPUnit_Framework_TestCase +class Zend_Server_Reflection_ReturnValueTest extends PHPUnit\Framework\TestCase { /** * __construct() test diff --git a/tests/Zend/Server/ReflectionTest.php b/tests/Zend/Server/ReflectionTest.php index 5ccd72a3bf..8a6480bd6c 100644 --- a/tests/Zend/Server/ReflectionTest.php +++ b/tests/Zend/Server/ReflectionTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Server */ -class Zend_Server_ReflectionTest extends PHPUnit_Framework_TestCase +class Zend_Server_ReflectionTest extends PHPUnit\Framework\TestCase { /** * reflectClass() test diff --git a/tests/Zend/Service/AkismetTest.php b/tests/Zend/Service/AkismetTest.php index ac176457d6..51db5dfe3b 100644 --- a/tests/Zend/Service/AkismetTest.php +++ b/tests/Zend/Service/AkismetTest.php @@ -39,7 +39,7 @@ * @group Zend_Service * @group Zend_Service_Akismet */ -class Zend_Service_AkismetTest extends PHPUnit_Framework_TestCase +class Zend_Service_AkismetTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Service/Amazon/AbstractTest.php b/tests/Zend/Service/Amazon/AbstractTest.php index 8551b17a8d..b77af34329 100644 --- a/tests/Zend/Service/Amazon/AbstractTest.php +++ b/tests/Zend/Service/Amazon/AbstractTest.php @@ -33,7 +33,7 @@ * @group Zend_Service * @group Zend_Service_Amazon */ -class AmamzonAbstract extends PHPUnit_Framework_TestCase +class AmamzonAbstract extends PHPUnit\Framework\TestCase { /** * Prepares the environment before running a test. diff --git a/tests/Zend/Service/Amazon/Authentication/S3Test.php b/tests/Zend/Service/Amazon/Authentication/S3Test.php index f08ac7e8bf..f6363e5753 100644 --- a/tests/Zend/Service/Amazon/Authentication/S3Test.php +++ b/tests/Zend/Service/Amazon/Authentication/S3Test.php @@ -31,7 +31,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_Amazon_Authentication_S3Test extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_Authentication_S3Test extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Service/Amazon/Authentication/V1Test.php b/tests/Zend/Service/Amazon/Authentication/V1Test.php index 8c127ae0cf..cfad44dd78 100644 --- a/tests/Zend/Service/Amazon/Authentication/V1Test.php +++ b/tests/Zend/Service/Amazon/Authentication/V1Test.php @@ -31,7 +31,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_Amazon_Authentication_V1Test extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_Authentication_V1Test extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Service/Amazon/Authentication/V2Test.php b/tests/Zend/Service/Amazon/Authentication/V2Test.php index 80b6cb08f8..1cf576b177 100644 --- a/tests/Zend/Service/Amazon/Authentication/V2Test.php +++ b/tests/Zend/Service/Amazon/Authentication/V2Test.php @@ -31,7 +31,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_Amazon_Authentication_V2Test extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_Authentication_V2Test extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Service/Amazon/Ec2/AbstractTest.php b/tests/Zend/Service/Amazon/Ec2/AbstractTest.php index a3e1a1df9c..543940281b 100644 --- a/tests/Zend/Service/Amazon/Ec2/AbstractTest.php +++ b/tests/Zend/Service/Amazon/Ec2/AbstractTest.php @@ -34,7 +34,7 @@ * @group Zend_Service_Amazon * @group Zend_Service_Amazon_Ec2 */ -class Zend_Service_Amazon_Ec2_AbstractTest extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_Ec2_AbstractTest extends PHPUnit\Framework\TestCase { /** * Prepares the environment before running a test. diff --git a/tests/Zend/Service/Amazon/Ec2/AvailabilityzonesTest.php b/tests/Zend/Service/Amazon/Ec2/AvailabilityzonesTest.php index f1773c1ecd..e55a3444d0 100644 --- a/tests/Zend/Service/Amazon/Ec2/AvailabilityzonesTest.php +++ b/tests/Zend/Service/Amazon/Ec2/AvailabilityzonesTest.php @@ -36,7 +36,7 @@ * @group Zend_Service_Amazon * @group Zend_Service_Amazon_Ec2 */ -class Zend_Service_Amazon_Ec2_AvailabilityzonesTest extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_Ec2_AvailabilityzonesTest extends PHPUnit\Framework\TestCase { /** @@ -96,7 +96,7 @@ public function testDescribeSingleAvailabilityZone() $this->adapter->setResponse($rawHttpResponse); $response = $this->Zend_Service_Amazon_Ec2_Availabilityzones->describe('us-east-1a'); - $this->assertTrue(is_array($response)); + $this->assertInternalType('array', $response); $this->assertEquals('us-east-1a', $response[0]['zoneName']); $this->assertEquals('available', $response[0]['zoneState']); } @@ -132,7 +132,7 @@ public function testDescribeMultipleAvailabilityZones() $response = $this->Zend_Service_Amazon_Ec2_Availabilityzones->describe(); - $this->assertTrue(is_array($response)); + $this->assertInternalType('array', $response); $arrExpected = array('us-east-1a', 'us-east-1b', 'us-east-1c'); foreach ($response as $k => $node) { diff --git a/tests/Zend/Service/Amazon/Ec2/CloudWatchTest.php b/tests/Zend/Service/Amazon/Ec2/CloudWatchTest.php index 85a9c34f0a..5bc073d096 100644 --- a/tests/Zend/Service/Amazon/Ec2/CloudWatchTest.php +++ b/tests/Zend/Service/Amazon/Ec2/CloudWatchTest.php @@ -36,7 +36,7 @@ * @group Zend_Service_Amazon * @group Zend_Service_Amazon_Ec2 */ -class Zend_Service_Amazon_Ec2_CloudWatchTest extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_Ec2_CloudWatchTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Service/Amazon/Ec2/EbsTest.php b/tests/Zend/Service/Amazon/Ec2/EbsTest.php index ddd6a0d415..7aa877b245 100644 --- a/tests/Zend/Service/Amazon/Ec2/EbsTest.php +++ b/tests/Zend/Service/Amazon/Ec2/EbsTest.php @@ -36,7 +36,7 @@ * @group Zend_Service_Amazon * @group Zend_Service_Amazon_Ec2 */ -class Zend_Service_Amazon_Ec2_EbsTest extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_Ec2_EbsTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Service/Amazon/Ec2/Ec2Test.php b/tests/Zend/Service/Amazon/Ec2/Ec2Test.php index 27250d10e6..bc2b025939 100644 --- a/tests/Zend/Service/Amazon/Ec2/Ec2Test.php +++ b/tests/Zend/Service/Amazon/Ec2/Ec2Test.php @@ -34,7 +34,7 @@ * @group Zend_Service_Amazon * @group Zend_Service_Amazon_Ec2 */ -class Zend_Service_Amazon_Ec2_Ec2Test extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_Ec2_Ec2Test extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Service/Amazon/Ec2/ElasticipTest.php b/tests/Zend/Service/Amazon/Ec2/ElasticipTest.php index 1ad64cda10..4852ebb8d8 100644 --- a/tests/Zend/Service/Amazon/Ec2/ElasticipTest.php +++ b/tests/Zend/Service/Amazon/Ec2/ElasticipTest.php @@ -36,7 +36,7 @@ * @group Zend_Service_Amazon * @group Zend_Service_Amazon_Ec2 */ -class Zend_Service_Amazon_Ec2_ElasticipTest extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_Ec2_ElasticipTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Service/Amazon/Ec2/ImageTest.php b/tests/Zend/Service/Amazon/Ec2/ImageTest.php index f1725bc680..a0cfa514bc 100644 --- a/tests/Zend/Service/Amazon/Ec2/ImageTest.php +++ b/tests/Zend/Service/Amazon/Ec2/ImageTest.php @@ -37,7 +37,7 @@ * @group Zend_Service_Amazon * @group Zend_Service_Amazon_Ec2 */ -class Zend_Service_Amazon_Ec2_ImageTest extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_Ec2_ImageTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Service/Amazon/Ec2/InstanceReservedTest.php b/tests/Zend/Service/Amazon/Ec2/InstanceReservedTest.php index 6763c70607..ba7a6b4f51 100644 --- a/tests/Zend/Service/Amazon/Ec2/InstanceReservedTest.php +++ b/tests/Zend/Service/Amazon/Ec2/InstanceReservedTest.php @@ -38,7 +38,7 @@ * @group Zend_Service_Amazon * @group Zend_Service_Amazon_Ec2 */ -class InstanceReservedTest extends PHPUnit_Framework_TestCase +class InstanceReservedTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Service/Amazon/Ec2/InstanceTest.php b/tests/Zend/Service/Amazon/Ec2/InstanceTest.php index 1d03bc6515..2a3f2259e8 100644 --- a/tests/Zend/Service/Amazon/Ec2/InstanceTest.php +++ b/tests/Zend/Service/Amazon/Ec2/InstanceTest.php @@ -37,7 +37,7 @@ * @group Zend_Service_Amazon * @group Zend_Service_Amazon_Ec2 */ -class Zend_Service_Amazon_Ec2_InstanceTest extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_Ec2_InstanceTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Service/Amazon/Ec2/InstanceWindowsTest.php b/tests/Zend/Service/Amazon/Ec2/InstanceWindowsTest.php index 55cb4ddf71..bfa7445a37 100644 --- a/tests/Zend/Service/Amazon/Ec2/InstanceWindowsTest.php +++ b/tests/Zend/Service/Amazon/Ec2/InstanceWindowsTest.php @@ -38,7 +38,7 @@ * @group Zend_Service_Amazon * @group Zend_Service_Amazon_Ec2 */ -class InstanceWindowsTest extends PHPUnit_Framework_TestCase +class InstanceWindowsTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Service/Amazon/Ec2/KeypairTest.php b/tests/Zend/Service/Amazon/Ec2/KeypairTest.php index 0b84ec5a09..9a720c1523 100644 --- a/tests/Zend/Service/Amazon/Ec2/KeypairTest.php +++ b/tests/Zend/Service/Amazon/Ec2/KeypairTest.php @@ -36,7 +36,7 @@ * @group Zend_Service_Amazon * @group Zend_Service_Amazon_Ec2 */ -class Zend_Service_Amazon_Ec2_KeypairTest extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_Ec2_KeypairTest extends PHPUnit\Framework\TestCase { /** @@ -130,7 +130,7 @@ public function testCreateKeyPair() $response = $this->Zend_Service_Amazon_Ec2_Keypair->create('example-key-name'); - $this->assertTrue(is_array($response)); + $this->assertInternalType('array', $response); $this->assertEquals('example-key-name', $response['keyName']); $this->assertEquals('1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f', $response['keyFingerprint']); @@ -233,7 +233,7 @@ public function testDeleteFailsOnNonValidKey() $this->adapter->setResponse($rawHttpResponse); $response = $this->Zend_Service_Amazon_Ec2_Keypair->delete('myfakekeyname'); - $this->assertTrue(is_bool($response)); + $this->assertInternalType('bool', $response); $this->assertFalse($response); } @@ -255,7 +255,7 @@ public function testDeleteDoesNotFailOnValidKey() $this->adapter->setResponse($rawHttpResponse); $response = $this->Zend_Service_Amazon_Ec2_Keypair->delete('example-key-name'); - $this->assertTrue(is_bool($response)); + $this->assertInternalType('bool', $response); $this->assertTrue($response); } } diff --git a/tests/Zend/Service/Amazon/Ec2/RegionTest.php b/tests/Zend/Service/Amazon/Ec2/RegionTest.php index 75a945e4f8..5a7503de8c 100644 --- a/tests/Zend/Service/Amazon/Ec2/RegionTest.php +++ b/tests/Zend/Service/Amazon/Ec2/RegionTest.php @@ -36,7 +36,7 @@ * @group Zend_Service_Amazon * @group Zend_Service_Amazon_Ec2 */ -class Zend_Service_Amazon_Ec2_RegionTest extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_Ec2_RegionTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Service/Amazon/Ec2/SecuritygroupsTest.php b/tests/Zend/Service/Amazon/Ec2/SecuritygroupsTest.php index fb62ca4589..5a619e9ff1 100644 --- a/tests/Zend/Service/Amazon/Ec2/SecuritygroupsTest.php +++ b/tests/Zend/Service/Amazon/Ec2/SecuritygroupsTest.php @@ -36,7 +36,7 @@ * @group Zend_Service_Amazon * @group Zend_Service_Amazon_Ec2 */ -class Zend_Service_Amazon_Ec2_SecuritygroupsTest extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_Ec2_SecuritygroupsTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Service/Amazon/OfflineTest.php b/tests/Zend/Service/Amazon/OfflineTest.php index 528818385c..81890c6e17 100644 --- a/tests/Zend/Service/Amazon/OfflineTest.php +++ b/tests/Zend/Service/Amazon/OfflineTest.php @@ -56,7 +56,7 @@ * @group Zend_Service * @group Zend_Service_Amazon */ -class Zend_Service_Amazon_OfflineTest extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_OfflineTest extends PHPUnit\Framework\TestCase { /** * Reference to Amazon service consumer object diff --git a/tests/Zend/Service/Amazon/OnlineTest.php b/tests/Zend/Service/Amazon/OnlineTest.php index 8bdd5f8ecb..7ac7e0bfcc 100644 --- a/tests/Zend/Service/Amazon/OnlineTest.php +++ b/tests/Zend/Service/Amazon/OnlineTest.php @@ -44,7 +44,7 @@ * @group Zend_Service * @group Zend_Service_Amazon */ -class Zend_Service_Amazon_OnlineTest extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_OnlineTest extends PHPUnit\Framework\TestCase { /** * Reference to Amazon service consumer object diff --git a/tests/Zend/Service/Amazon/S3/OnlineTest.php b/tests/Zend/Service/Amazon/S3/OnlineTest.php index 21170e6a3a..0497339948 100755 --- a/tests/Zend/Service/Amazon/S3/OnlineTest.php +++ b/tests/Zend/Service/Amazon/S3/OnlineTest.php @@ -41,7 +41,7 @@ * @group Zend_Service_Amazon * @group Zend_Service_Amazon_S3 */ -class Zend_Service_Amazon_S3_OnlineTest extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_S3_OnlineTest extends PHPUnit\Framework\TestCase { /** * Reference to Amazon service consumer object @@ -124,7 +124,7 @@ public function testGetObjectStream() $response = $this->_amazon->getObjectStream($this->_bucket."/zftest"); $this->assertTrue($response instanceof Zend_Http_Response_Stream, 'The test did not return stream response'); - $this->assertTrue(is_resource($response->getStream()), 'Request does not contain stream!'); + $this->assertInternalType('resource', $response->getStream(), 'Request does not contain stream!'); $stream_name = $response->getStreamName(); @@ -148,7 +148,7 @@ public function testGetObjectStreamNamed() $response = $this->_amazon->getObjectStream($this->_bucket."/zftest", $outfile); $this->assertTrue($response instanceof Zend_Http_Response_Stream, 'The test did not return stream response'); - $this->assertTrue(is_resource($response->getStream()), 'Request does not contain stream!'); + $this->assertInternalType('resource', $response->getStream(), 'Request does not contain stream!'); $this->assertEquals($outfile, $response->getStreamName()); diff --git a/tests/Zend/Service/Amazon/S3/StreamTest.php b/tests/Zend/Service/Amazon/S3/StreamTest.php index 8511d3335d..91f78c78ce 100755 --- a/tests/Zend/Service/Amazon/S3/StreamTest.php +++ b/tests/Zend/Service/Amazon/S3/StreamTest.php @@ -40,7 +40,7 @@ * @group Zend_Service_Amazon * @group Zend_Service_Amazon_S3 */ -class Zend_Service_Amazon_S3_StreamTest extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_S3_StreamTest extends PHPUnit\Framework\TestCase { /** * Sets up this test case @@ -238,7 +238,7 @@ public function testObjectStat() $result = mkdir($this->_bucketName); $this->assertTrue($result); - $this->assertTrue(is_dir($this->_bucketName)); + $this->assertDirectoryExists($this->_bucketName); $data = str_repeat('x', 10000); $len = strlen($data); @@ -247,7 +247,7 @@ public function testObjectStat() $size = file_put_contents($this->_fileName, $data); $this->assertEquals($len, $size); - $this->assertFalse(is_dir($this->_fileName)); + $this->assertDirectoryNotExists($this->_fileName); // Stat an object $info = stat($this->_fileName); @@ -271,7 +271,7 @@ public function testObjectStat() * @group Zend_Service_Amazon * @group Zend_Service_Amazon_S3 */ -class Zend_Service_Amazon_S3_StreamTest_Skip extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_S3_StreamTest_Skip extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Service/Amazon/SimpleDb/OnlineTest.php b/tests/Zend/Service/Amazon/SimpleDb/OnlineTest.php index 25e6fda723..4abee708e4 100644 --- a/tests/Zend/Service/Amazon/SimpleDb/OnlineTest.php +++ b/tests/Zend/Service/Amazon/SimpleDb/OnlineTest.php @@ -52,7 +52,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_Amazon_SimpleDb_OnlineTest extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_SimpleDb_OnlineTest extends PHPUnit\Framework\TestCase { /** * Reference to Amazon service consumer object @@ -172,8 +172,8 @@ public function testGetAttributes() { // Multiple attributes $results = $this->request('getAttributes', array($domainName, $itemName)); $this->assertEquals(2, count($results)); - $this->assertTrue(array_key_exists($attributeName1, $results)); - $this->assertTrue(array_key_exists($attributeName2, $results)); + $this->assertArrayHasKey($attributeName1, $results); + $this->assertArrayHasKey($attributeName2, $results); $this->assertEquals($attributeValue1, current($results[$attributeName1]->getValues())); $this->assertEquals($attributeValue2, current($results[$attributeName2]->getValues())); @@ -205,8 +205,8 @@ public function testPutAttributes() { // Multiple attributes $results = $this->request('getAttributes', array($domainName, $itemName)); $this->assertEquals(2, count($results)); - $this->assertTrue(array_key_exists($attributeName1, $results)); - $this->assertTrue(array_key_exists($attributeName2, $results)); + $this->assertArrayHasKey($attributeName1, $results); + $this->assertArrayHasKey($attributeName2, $results); $this->assertEquals($attributes[$attributeName1], $results[$attributeName1]); $this->assertEquals($attributes[$attributeName2], $results[$attributeName2]); $this->request('deleteDomain', array($domainName)); @@ -258,19 +258,19 @@ public function testBatchPutAttributes() { $result = $this->request('getAttributes', array($domainName, $itemName1, $attributeName1)); - $this->assertTrue(array_key_exists($attributeName1, $result)); + $this->assertArrayHasKey($attributeName1, $result); $this->assertEquals($attributeName1, $result[$attributeName1]->getName()); $this->assertEquals($attributeValue1, current($result[$attributeName1]->getValues())); $result = $this->request('getAttributes', array($domainName, $itemName2, $attributeName4)); - $this->assertTrue(array_key_exists($attributeName4, $result)); + $this->assertArrayHasKey($attributeName4, $result); $this->assertEquals(2, count($result[$attributeName4]->getValues())); $result = $this->request('getAttributes', array($domainName, $itemName2)); $this->assertEquals(2, count($result)); - $this->assertTrue(array_key_exists($attributeName3, $result)); + $this->assertArrayHasKey($attributeName3, $result); $this->assertEquals($attributeName3, $result[$attributeName3]->getName()); $this->assertEquals(1, count($result[$attributeName3])); $this->assertEquals($attributeValue3, current($result[$attributeName3]->getValues())); - $this->assertTrue(array_key_exists($attributeName4, $result)); + $this->assertArrayHasKey($attributeName4, $result); $this->assertEquals($attributeName4, $result[$attributeName4]->getName()); $this->assertEquals(2, count($result[$attributeName4]->getValues())); $this->assertEquals(array($attributeValue4, $attributeValue5), $result[$attributeName4]->getValues()); @@ -334,10 +334,10 @@ public function testDeleteAttributes() { $results = $this->request('getAttributes', array($domainName, $itemName)); $this->assertEquals(4, count($results)); - $this->assertTrue(array_key_exists($attributeName1, $results)); - $this->assertTrue(array_key_exists($attributeName2, $results)); - $this->assertTrue(array_key_exists($attributeName3, $results)); - $this->assertTrue(array_key_exists($attributeName4, $results)); + $this->assertArrayHasKey($attributeName1, $results); + $this->assertArrayHasKey($attributeName2, $results); + $this->assertArrayHasKey($attributeName3, $results); + $this->assertArrayHasKey($attributeName4, $results); $this->assertEquals($attributeValue1, current($results[$attributeName1]->getValues())); $this->assertEquals($attributeValue2, current($results[$attributeName2]->getValues())); $this->assertEquals($attributeValue3, current($results[$attributeName3]->getValues())); @@ -347,9 +347,9 @@ public function testDeleteAttributes() { $results = $this->request('getAttributes', array($domainName, $itemName)); $this->assertEquals(3, count($results)); - $this->assertTrue(array_key_exists($attributeName2, $results)); - $this->assertTrue(array_key_exists($attributeName3, $results)); - $this->assertTrue(array_key_exists($attributeName4, $results)); + $this->assertArrayHasKey($attributeName2, $results); + $this->assertArrayHasKey($attributeName3, $results); + $this->assertArrayHasKey($attributeName4, $results); $this->assertEquals($attributeValue2, current($results[$attributeName2]->getValues())); $this->assertEquals($attributeValue3, current($results[$attributeName3]->getValues())); $this->assertEquals($attributeValue4, current($results[$attributeName4]->getValues())); @@ -358,7 +358,7 @@ public function testDeleteAttributes() { $results = $this->request('getAttributes', array($domainName, $itemName)); $this->assertEquals(1, count($results)); - $this->assertTrue(array_key_exists($attributeName4, $results)); + $this->assertArrayHasKey($attributeName4, $results); $this->assertEquals($attributeValue4, current($results[$attributeName4]->getValues())); @@ -443,21 +443,21 @@ public function testDomainMetadata() { $this->request('createDomain', array($domainName)); try { $metadata = $this->request('domainMetadata', array($domainName)); - $this->assertTrue(is_array($metadata)); + $this->assertInternalType('array', $metadata); $this->assertGreaterThan(0, count($metadata)); - $this->assertTrue(array_key_exists('ItemCount', $metadata)); + $this->assertArrayHasKey('ItemCount', $metadata); $this->assertEquals(0, (int)$metadata['ItemCount']); - $this->assertTrue(array_key_exists('ItemNamesSizeBytes', $metadata)); + $this->assertArrayHasKey('ItemNamesSizeBytes', $metadata); $this->assertEquals(0, (int)$metadata['ItemNamesSizeBytes']); - $this->assertTrue(array_key_exists('AttributeNameCount', $metadata)); + $this->assertArrayHasKey('AttributeNameCount', $metadata); $this->assertEquals(0, (int)$metadata['AttributeNameCount']); - $this->assertTrue(array_key_exists('AttributeValueCount', $metadata)); + $this->assertArrayHasKey('AttributeValueCount', $metadata); $this->assertEquals(0, (int)$metadata['AttributeValueCount']); - $this->assertTrue(array_key_exists('AttributeNamesSizeBytes', $metadata)); + $this->assertArrayHasKey('AttributeNamesSizeBytes', $metadata); $this->assertEquals(0, (int)$metadata['AttributeNamesSizeBytes']); - $this->assertTrue(array_key_exists('AttributeValuesSizeBytes', $metadata)); + $this->assertArrayHasKey('AttributeValuesSizeBytes', $metadata); $this->assertEquals(0, (int)$metadata['AttributeValuesSizeBytes']); - $this->assertTrue(array_key_exists('Timestamp', $metadata)); + $this->assertArrayHasKey('Timestamp', $metadata); // Delete the domain $this->request('deleteDomain', array($domainName)); diff --git a/tests/Zend/Service/Amazon/SimpleDb/PageTest.php b/tests/Zend/Service/Amazon/SimpleDb/PageTest.php index 5abce83879..58670fbb3b 100644 --- a/tests/Zend/Service/Amazon/SimpleDb/PageTest.php +++ b/tests/Zend/Service/Amazon/SimpleDb/PageTest.php @@ -30,7 +30,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_Amazon_SimpleDb_PageTest extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_SimpleDb_PageTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Service_Amazon_SimpleDb_Page diff --git a/tests/Zend/Service/Amazon/Sqs/OfflineTest.php b/tests/Zend/Service/Amazon/Sqs/OfflineTest.php index e4af9523bb..42890efbb0 100644 --- a/tests/Zend/Service/Amazon/Sqs/OfflineTest.php +++ b/tests/Zend/Service/Amazon/Sqs/OfflineTest.php @@ -34,7 +34,7 @@ * @group Zend_Service_Amazon * @group Zend_Service_Amazon_Sqs */ -class Zend_Service_Amazon_Sqs_OfflineTest extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_Sqs_OfflineTest extends PHPUnit\Framework\TestCase { /** * Reference to Amazon service consumer object @@ -77,9 +77,11 @@ public function testSetNewRegion() public function testSetEmptyRegion() { - $this->setExpectedException( - 'Zend_Service_Amazon_Sqs_Exception', - 'Empty region specified.' + $this->expectException( + 'Zend_Service_Amazon_Sqs_Exception' + ); + $this->expectExceptionMessage( + 'Empty region specified.' ); $this->_amazon->setEndpoint(''); } diff --git a/tests/Zend/Service/Amazon/Sqs/OnlineTest.php b/tests/Zend/Service/Amazon/Sqs/OnlineTest.php index ceaac638a4..dddc934497 100644 --- a/tests/Zend/Service/Amazon/Sqs/OnlineTest.php +++ b/tests/Zend/Service/Amazon/Sqs/OnlineTest.php @@ -33,7 +33,7 @@ * @group Zend_Service_Amazon * @group Zend_Service_Amazon_Sqs */ -class Zend_Service_Amazon_Sqs_OnlineTest extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_Sqs_OnlineTest extends PHPUnit\Framework\TestCase { /** * Reference to Amazon service consumer object @@ -125,7 +125,7 @@ public function tearDown() } -class Zend_Service_Amazon_Sqs_OnlineTest_Skip extends PHPUnit_Framework_TestCase +class Zend_Service_Amazon_Sqs_OnlineTest_Skip extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Service/Audioscrobbler/AudioscrobblerTest.php b/tests/Zend/Service/Audioscrobbler/AudioscrobblerTest.php index 982ae9bdd4..bf5ddf2c92 100644 --- a/tests/Zend/Service/Audioscrobbler/AudioscrobblerTest.php +++ b/tests/Zend/Service/Audioscrobbler/AudioscrobblerTest.php @@ -83,7 +83,7 @@ public function testSetViaCallIntercept() */ public function testUnknownMethodViaCallInterceptThrowsException() { - $this->setExpectedException("Zend_Service_Exception"); + $this->expectException("Zend_Service_Exception"); $as = new Zend_Service_Audioscrobbler(); $as->someInvalidMethod(); @@ -94,7 +94,7 @@ public function testUnknownMethodViaCallInterceptThrowsException() */ public function testCallInterceptMethodsRequireExactlyOneParameterAndThrowExceptionOtherwise() { - $this->setExpectedException("Zend_Service_Exception"); + $this->expectException("Zend_Service_Exception"); $as = new Zend_Service_Audioscrobbler(); $as->setUser(); diff --git a/tests/Zend/Service/Audioscrobbler/AudioscrobblerTestCase.php b/tests/Zend/Service/Audioscrobbler/AudioscrobblerTestCase.php index d2822db00f..60ca1afc71 100644 --- a/tests/Zend/Service/Audioscrobbler/AudioscrobblerTestCase.php +++ b/tests/Zend/Service/Audioscrobbler/AudioscrobblerTestCase.php @@ -35,7 +35,7 @@ * @group Zend_Service * @group Zend_Service_Audioscrobbler */ -class Zend_Service_Audioscrobbler_AudioscrobblerTestCase extends PHPUnit_Framework_TestCase +class Zend_Service_Audioscrobbler_AudioscrobblerTestCase extends PHPUnit\Framework\TestCase { /** * @var Zend_Http_Client diff --git a/tests/Zend/Service/Delicious/PostTest.php b/tests/Zend/Service/Delicious/PostTest.php index bcfe3bee6e..7d6d8bc9d6 100644 --- a/tests/Zend/Service/Delicious/PostTest.php +++ b/tests/Zend/Service/Delicious/PostTest.php @@ -40,7 +40,7 @@ * @group Zend_Service * @group Zend_Service_Delicious */ -class Zend_Service_Delicious_PostTest extends PHPUnit_Framework_TestCase +class Zend_Service_Delicious_PostTest extends PHPUnit\Framework\TestCase { const UNAME = 'zfTestUser'; const PASS = 'zfuser'; diff --git a/tests/Zend/Service/Delicious/PrivateDataTest.php b/tests/Zend/Service/Delicious/PrivateDataTest.php index ec58493339..39b22db02a 100644 --- a/tests/Zend/Service/Delicious/PrivateDataTest.php +++ b/tests/Zend/Service/Delicious/PrivateDataTest.php @@ -35,7 +35,7 @@ * @group Zend_Service * @group Zend_Service_Delicious */ -class Zend_Service_Delicious_PrivateDataTest extends PHPUnit_Framework_TestCase +class Zend_Service_Delicious_PrivateDataTest extends PHPUnit\Framework\TestCase { const TEST_UNAME = 'zfTestUser'; const TEST_PASS = 'zfuser'; @@ -89,7 +89,7 @@ public function testTagsAndBundles() { // get tags $tags = $this->_delicious->getTags(); - $this->assertTrue(is_array($tags)); + $this->assertInternalType('array', $tags); $tags = array_keys($tags); if (count($tags) < 1) { @@ -120,7 +120,7 @@ public function testTagsAndBundles() // check if bundle was added $bundles = $this->_delicious->getBundles(); - $this->assertTrue(is_array($bundles)); + $this->assertInternalType('array', $bundles); $this->assertArrayHasKey($newBundleName, $bundles); $this->assertEquals($tags, $bundles[$newBundleName]); @@ -180,8 +180,8 @@ public function _testAddDeletePost() $this->assertEquals(self::$TEST_POST_TAGS, $savedPost->getTags()); $this->assertEquals(self::$TEST_POST_SHARED, $savedPost->getShared()); $this->assertTrue($savedPost->getDate() instanceof Zend_Date); - $this->assertTrue(is_string($savedPost->getHash())); - $this->assertTrue(is_int($savedPost->getOthers())); + $this->assertInternalType('string', $savedPost->getHash()); + $this->assertInternalType('int', $savedPost->getOthers()); // delete post $savedPost->delete(); @@ -246,6 +246,6 @@ public function testGetPosts() */ public function testDates() { - $this->assertTrue(is_array($this->_delicious->getDates())); + $this->assertInternalType('array', $this->_delicious->getDates()); } } diff --git a/tests/Zend/Service/Delicious/PublicDataTest.php b/tests/Zend/Service/Delicious/PublicDataTest.php index f7ae8496d9..99f62b2563 100644 --- a/tests/Zend/Service/Delicious/PublicDataTest.php +++ b/tests/Zend/Service/Delicious/PublicDataTest.php @@ -36,7 +36,7 @@ * @group Zend_Service * @group Zend_Service_Delicious */ -class Zend_Service_Delicious_PublicDataTest extends PHPUnit_Framework_TestCase +class Zend_Service_Delicious_PublicDataTest extends PHPUnit\Framework\TestCase { const TEST_UNAME = 'zfTestUser'; const TEST_PASS = 'zfuser'; @@ -76,7 +76,7 @@ public function testGetTags() { $tags = $this->_delicious->getUserTags(self::TEST_UNAME); - $this->assertTrue(is_array($tags)); + $this->assertInternalType('array', $tags); } /** @@ -86,7 +86,7 @@ public function testGetTagsWithCount() { $tags = $this->_delicious->getUserTags(self::TEST_UNAME, null, 20); - $this->assertTrue(is_array($tags)); + $this->assertInternalType('array', $tags); $this->assertTrue(count($tags) <= 20); } @@ -97,7 +97,7 @@ public function testGetTagsWithAtLeast() { $tags = $this->_delicious->getUserTags(self::TEST_UNAME, 5); - $this->assertTrue(is_array($tags)); + $this->assertInternalType('array', $tags); foreach ($tags as $count) { $this->assertTrue($count >= 5); } @@ -110,7 +110,7 @@ public function testGetNetwork() { $network = $this->_delicious->getUserNetwork(self::TEST_UNAME); - $this->assertTrue(is_array($network)); + $this->assertInternalType('array', $network); } /** @@ -120,7 +120,7 @@ public function testGetFans() { $fans = $this->_delicious->getUserFans(self::TEST_UNAME); - $this->assertTrue(is_array($fans)); + $this->assertInternalType('array', $fans); } /** @@ -142,7 +142,7 @@ public function testGetUserPosts() $filterPostList = $posts->withTag('zfSite'); foreach ($filterPostList as $post) { - $this->assertTrue(is_array($post->getTags())); + $this->assertInternalType('array', $post->getTags()); $this->assertContains('zfSite', $post->getTags()); } } @@ -155,13 +155,13 @@ public function testGetUserPosts() public function testGetUrlDetails() { $details = $this->_delicious->getUrlDetails(self::TEST_URL); - $this->assertTrue(is_array($details)); + $this->assertInternalType('array', $details); $this->assertArrayHasKey('hash', $details); $this->assertArrayHasKey('top_tags', $details); $this->assertArrayHasKey('url', $details); $this->assertArrayHasKey('total_posts', $details); $this->assertEquals(self::TEST_URL, $details['url']); - $this->assertTrue(is_array($details['top_tags'])); + $this->assertInternalType('array', $details['top_tags']); } } diff --git a/tests/Zend/Service/Delicious/SimplePostTest.php b/tests/Zend/Service/Delicious/SimplePostTest.php index 8c7b72d3e7..cc081a2b2d 100644 --- a/tests/Zend/Service/Delicious/SimplePostTest.php +++ b/tests/Zend/Service/Delicious/SimplePostTest.php @@ -35,7 +35,7 @@ * @group Zend_Service * @group Zend_Service_Delicious */ -class Zend_Service_Delicious_SimplePostTest extends PHPUnit_Framework_TestCase +class Zend_Service_Delicious_SimplePostTest extends PHPUnit\Framework\TestCase { /** * Ensures that the constructor throws an exception when the title is missing diff --git a/tests/Zend/Service/Ebay/AbstractTest.php b/tests/Zend/Service/Ebay/AbstractTest.php index 9868886ad1..7535639e5e 100644 --- a/tests/Zend/Service/Ebay/AbstractTest.php +++ b/tests/Zend/Service/Ebay/AbstractTest.php @@ -37,7 +37,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_Ebay_AbstractTest extends PHPUnit_Framework_TestCase +class Zend_Service_Ebay_AbstractTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Service_Ebay_AbstractConcrete @@ -82,7 +82,7 @@ public function testSetOptions() public function testOptionsToArrayInvalid() { - $this->setExpectedException('Zend_Service_Ebay_Exception'); + $this->expectException('Zend_Service_Ebay_Exception'); Zend_Service_Ebay_Abstract::optionsToArray('invalid'); } @@ -141,7 +141,7 @@ public function testToPhpValue() public function testToPhpValueInvalidType() { - $this->setExpectedException('Zend_Service_Ebay_Exception'); + $this->expectException('Zend_Service_Ebay_Exception'); Zend_Service_Ebay_Abstract::toPhpValue('value', 'invalid-type'); } diff --git a/tests/Zend/Service/Ebay/Finding/OfflineTest.php b/tests/Zend/Service/Ebay/Finding/OfflineTest.php index af8212007e..804a4c8814 100644 --- a/tests/Zend/Service/Ebay/Finding/OfflineTest.php +++ b/tests/Zend/Service/Ebay/Finding/OfflineTest.php @@ -42,7 +42,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_Ebay_OfflineTest extends PHPUnit_Framework_TestCase +class Zend_Service_Ebay_OfflineTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Service_Ebay_Finding @@ -62,7 +62,7 @@ public function testClient() $this->assertTrue($this->_finding->setClient(new ClientCustom()) instanceof Zend_Service_Ebay_Finding); $this->assertTrue($this->_finding->getClient() instanceof ClientCustom); - $this->setExpectedException('Zend_Service_Ebay_Finding_Exception'); + $this->expectException('Zend_Service_Ebay_Finding_Exception'); $this->_finding->setClient(new stdClass()); } @@ -81,7 +81,7 @@ public function testConstructor() $this->assertEquals('app-id', $finding->getOption(Zend_Service_Ebay_Finding::OPTION_APP_ID)); $this->assertEquals('bar', $finding->getOption('foo')); - $this->setExpectedException('Zend_Service_Ebay_Finding_Exception'); + $this->expectException('Zend_Service_Ebay_Finding_Exception'); $finding = new Zend_Service_Ebay_Finding(array('foo' => 'bar')); } @@ -117,8 +117,8 @@ public function testErrorMessage() $this->assertNotNull($object->domain); $this->assertNotNull($object->errorId); $this->assertNotNull($object->message); - $this->assertTrue(is_array($object->parameter)); - $this->assertTrue(is_array($object->attributes('parameter', 'name'))); + $this->assertInternalType('array', $object->parameter); + $this->assertInternalType('array', $object->attributes('parameter', 'name')); $this->assertNotNull($object->severity); $this->assertNotNull($object->subdomain); @@ -176,14 +176,14 @@ public function testSearchItem() $this->assertTrue($object instanceof Zend_Service_Ebay_Finding_Search_Item); $this->assertNotNull($object->autoPay); $this->assertNotNull($object->country); - $this->assertTrue(is_array($object->galleryPlusPictureURL)); + $this->assertInternalType('array', $object->galleryPlusPictureURL); $this->assertNotNull($object->galleryPlusPictureURL[0]); $this->assertNotNull($object->galleryURL); $this->assertNotNull($object->globalId); $this->assertNotNull($object->itemId); $this->assertTrue($object->listingInfo instanceof Zend_Service_Ebay_Finding_ListingInfo); $this->assertNotNull($object->location); - $this->assertTrue(is_array($object->paymentMethod)); + $this->assertInternalType('array', $object->paymentMethod); $this->assertNotNull($object->paymentMethod[0]); $this->assertNotNull($object->postalCode); $this->assertTrue($object->primaryCategory instanceof Zend_Service_Ebay_Finding_Category); @@ -281,7 +281,7 @@ public function testShippingInfo() $this->assertNotNull($object->shippingServiceCost); $this->assertNotNull($object->attributes('shippingServiceCost', 'currencyId')); $this->assertNotNull($object->shippingType); - $this->assertTrue(is_array($object->shipToLocations)); + $this->assertInternalType('array', $object->shipToLocations); $this->assertNotNull($object->shipToLocations[0]); } @@ -313,7 +313,7 @@ public function testResponseHistogramAspect() // Zend_Service_Ebay_Finding_Aspect $object = $object->aspect->current(); $this->assertTrue($object->valueHistogram instanceof Zend_Service_Ebay_Finding_Aspect_Histogram_Value_Set); - $this->assertTrue(is_array($object->attributes('valueHistogram', 'valueName'))); + $this->assertInternalType('array', $object->attributes('valueHistogram', 'valueName')); // Zend_Service_Ebay_Finding_Aspect_Histogram_Value $object = $object->valueHistogram->current(); diff --git a/tests/Zend/Service/Ebay/Finding/OnlineTest.php b/tests/Zend/Service/Ebay/Finding/OnlineTest.php index 931498f565..c629f064bc 100644 --- a/tests/Zend/Service/Ebay/Finding/OnlineTest.php +++ b/tests/Zend/Service/Ebay/Finding/OnlineTest.php @@ -32,7 +32,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_Ebay_Finding_OnlineTest extends PHPUnit_Framework_TestCase +class Zend_Service_Ebay_Finding_OnlineTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Service_Ebay_Finding diff --git a/tests/Zend/Service/Flickr/OfflineTest.php b/tests/Zend/Service/Flickr/OfflineTest.php index 5a2d3ee30c..e139743484 100644 --- a/tests/Zend/Service/Flickr/OfflineTest.php +++ b/tests/Zend/Service/Flickr/OfflineTest.php @@ -35,7 +35,7 @@ * @group Zend_Service * @group Zend_Service_Flickr */ -class Zend_Service_Flickr_OfflineTest extends PHPUnit_Framework_TestCase +class Zend_Service_Flickr_OfflineTest extends PHPUnit\Framework\TestCase { /** * Reference to Flickr service consumer object diff --git a/tests/Zend/Service/Flickr/OnlineTest.php b/tests/Zend/Service/Flickr/OnlineTest.php index 1f3adb92dd..868efe6282 100644 --- a/tests/Zend/Service/Flickr/OnlineTest.php +++ b/tests/Zend/Service/Flickr/OnlineTest.php @@ -29,7 +29,7 @@ * @group Zend_Service * @group Zend_Service_Flickr */ -class Zend_Service_Flickr_OnlineTest extends PHPUnit_Framework_TestCase +class Zend_Service_Flickr_OnlineTest extends PHPUnit\Framework\TestCase { /** * Reference to Flickr service consumer object diff --git a/tests/Zend/Service/LiveDocx/LiveDocxTest.php b/tests/Zend/Service/LiveDocx/LiveDocxTest.php index eb8b3834c9..6df02a53dd 100644 --- a/tests/Zend/Service/LiveDocx/LiveDocxTest.php +++ b/tests/Zend/Service/LiveDocx/LiveDocxTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: $ */ -class Zend_Service_LiveDocX_LiveDocxTest extends PHPUnit_Framework_TestCase +class Zend_Service_LiveDocX_LiveDocxTest extends PHPUnit\Framework\TestCase { public $phpLiveDocx; diff --git a/tests/Zend/Service/LiveDocx/MailMergeTest.php b/tests/Zend/Service/LiveDocx/MailMergeTest.php index 9710539949..1fb86de518 100644 --- a/tests/Zend/Service/LiveDocx/MailMergeTest.php +++ b/tests/Zend/Service/LiveDocx/MailMergeTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: $ */ -class Zend_Service_LiveDocx_MailMergeTest extends PHPUnit_Framework_TestCase +class Zend_Service_LiveDocx_MailMergeTest extends PHPUnit\Framework\TestCase { const TEST_TEMPLATE_1 = 'phpunit-template.docx'; const TEST_TEMPLATE_2 = 'phpunit-template-block-fields.doc'; @@ -98,10 +98,11 @@ public function testLoginUsernamePasswordSoapClient() } /** - * @expectedException Zend_Service_LiveDocx_Exception */ public function testLoginUsernamePasswordException() { + $this->expectException(\Zend_Service_LiveDocx_Exception::class); + $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge(); $phpLiveDocx->setUsername('phpunitInvalidUsername'); $phpLiveDocx->setPassword('phpunitInvalidPassword'); @@ -109,10 +110,11 @@ public function testLoginUsernamePasswordException() } /** - * @expectedException Zend_Service_LiveDocx_Exception */ public function testLoginUsernamePasswordSoapClientException() { + $this->expectException(\Zend_Service_LiveDocx_Exception::class); + $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge(); $phpLiveDocx->setUsername('phpunitInvalidUsername'); $phpLiveDocx->setPassword('phpunitInvalidPassword'); @@ -148,7 +150,7 @@ public function testConstructorOptionsUsernamePasswordSoapClient() public function testSetLocalTemplate() { $this->assertTrue(is_a($this->phpLiveDocx->setLocalTemplate($this->path . DIRECTORY_SEPARATOR . self::TEST_TEMPLATE_1), 'Zend_Service_LiveDocx_MailMerge')); - $this->setExpectedException('Zend_Service_LiveDocx_Exception'); + $this->expectException('Zend_Service_LiveDocx_Exception'); @$this->phpLiveDocx->setLocalTemplate('phpunit-nonexistent.doc'); } diff --git a/tests/Zend/Service/Rackspace/Files/OfflineTest.php b/tests/Zend/Service/Rackspace/Files/OfflineTest.php index c51177cc8c..54cc5f841c 100644 --- a/tests/Zend/Service/Rackspace/Files/OfflineTest.php +++ b/tests/Zend/Service/Rackspace/Files/OfflineTest.php @@ -35,7 +35,7 @@ * @group Zend_Service_Rackspace_Files */ class Zend_Service_Rackspace_Files_OfflineTest - extends PHPUnit_Framework_TestCase + extends PHPUnit\Framework\TestCase { /** * Reference to RackspaceFiles @@ -248,14 +248,14 @@ public function testGetSizeContainers() { $size = $this->rackspace->getSizeContainers(); $this->assertTrue($size !== false); - $this->assertTrue(is_numeric($size)); + $this->assertInternalType('numeric', $size); } public function testGetCountObjects() { $count = $this->rackspace->getCountObjects(); $this->assertTrue($count !== false); - $this->assertTrue(is_numeric($count)); + $this->assertInternalType('numeric', $count); } public function testSetMetadataObject() @@ -282,7 +282,7 @@ public function testEnableCdnContainer() { $data = $this->rackspace->enableCdnContainer('zf-unit-test'); $this->assertTrue($data !== false); - $this->assertTrue(is_array($data)); + $this->assertInternalType('array', $data); $this->assertTrue(!empty($data['cdn_uri'])); $this->assertTrue(!empty($data['cdn_uri_ssl'])); } @@ -342,7 +342,7 @@ public function testGetInfoCdnContainer() TESTS_ZEND_SERVICE_RACKSPACE_CONTAINER_NAME ); $this->assertTrue($info !== false); - $this->assertTrue(is_array($info)); + $this->assertInternalType('array', $info); $this->assertTrue(!empty($info['ttl'])); $this->assertTrue(!empty($info['cdn_uri'])); $this->assertTrue(!empty($info['cdn_uri_ssl'])); diff --git a/tests/Zend/Service/Rackspace/Files/OnlineTest.php b/tests/Zend/Service/Rackspace/Files/OnlineTest.php index fedb9b68de..17066c19f9 100644 --- a/tests/Zend/Service/Rackspace/Files/OnlineTest.php +++ b/tests/Zend/Service/Rackspace/Files/OnlineTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Service_Rackspace_Files */ -class Zend_Service_Rackspace_Files_OnlineTest extends PHPUnit_Framework_TestCase +class Zend_Service_Rackspace_Files_OnlineTest extends PHPUnit\Framework\TestCase { /** * Reference to Rackspace Files object @@ -188,14 +188,14 @@ public function testGetSizeContainers() { $size= $this->rackspace->getSizeContainers(); $this->assertTrue($size!==false); - $this->assertTrue(is_numeric($size)); + $this->assertInternalType('numeric', $size); } public function testGetCountObjects() { $count= $this->rackspace->getCountObjects(); $this->assertTrue($count!==false); - $this->assertTrue(is_numeric($count)); + $this->assertInternalType('numeric', $count); } public function testSetMetadataObject() @@ -218,7 +218,7 @@ public function testEnableCdnContainer() { $data= $this->rackspace->enableCdnContainer(TESTS_ZEND_SERVICE_RACKSPACE_CONTAINER_NAME); $this->assertTrue($data!==false); - $this->assertTrue(is_array($data)); + $this->assertInternalType('array', $data); $this->assertTrue(!empty($data['cdn_uri'])); $this->assertTrue(!empty($data['cdn_uri_ssl'])); } diff --git a/tests/Zend/Service/Rackspace/OfflineTest.php b/tests/Zend/Service/Rackspace/OfflineTest.php index 5fc910fc79..7367b9f713 100644 --- a/tests/Zend/Service/Rackspace/OfflineTest.php +++ b/tests/Zend/Service/Rackspace/OfflineTest.php @@ -37,7 +37,7 @@ * @group Zend\Service\Rackspace * @group Zend\Service\Rackspace\Files */ - class Zend_Service_Rackspace_OfflineTest extends PHPUnit_Framework_TestCase + class Zend_Service_Rackspace_OfflineTest extends PHPUnit\Framework\TestCase { /** * Reference to RackspaceFiles @@ -85,8 +85,10 @@ protected function _loadResponse($name) */ public function testConstructExceptionMissingUserAttribute() { - $this->setExpectedException( - 'Zend_Service_Rackspace_Exception', + $this->expectException( + 'Zend_Service_Rackspace_Exception' + ); + $this->expectExceptionMessage( 'The user cannot be empty' ); $file= new Zend_Service_Rackspace_Files(null,'bar'); @@ -98,8 +100,10 @@ public function testConstructExceptionMissingUserAttribute() */ public function testConstructExceptionMissingKeyAttribute() { - $this->setExpectedException( - 'Zend_Service_Rackspace_Exception', + $this->expectException( + 'Zend_Service_Rackspace_Exception' + ); + $this->expectExceptionMessage( 'The key cannot be empty' ); $file= new Zend_Service_Rackspace_Files('foo',null); @@ -142,8 +146,10 @@ public function testSetUser() */ public function testSetInvalidAuthUrl() { - $this->setExpectedException( - 'Zend_Service_Rackspace_Exception', + $this->expectException( + 'Zend_Service_Rackspace_Exception' + ); + $this->expectExceptionMessage( 'The authentication URL is not valid' ); $this->_files->setAuthUrl('http://test'); diff --git a/tests/Zend/Service/Rackspace/Servers/OfflineTest.php b/tests/Zend/Service/Rackspace/Servers/OfflineTest.php index ce318111ea..02f1e85488 100644 --- a/tests/Zend/Service/Rackspace/Servers/OfflineTest.php +++ b/tests/Zend/Service/Rackspace/Servers/OfflineTest.php @@ -30,7 +30,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Service_Rackspace_Servers */ -class Zend_Service_Rackspace_Servers_OfflineTest extends PHPUnit_Framework_TestCase +class Zend_Service_Rackspace_Servers_OfflineTest extends PHPUnit\Framework\TestCase { /** * Reference to Rackspace Servers object diff --git a/tests/Zend/Service/Rackspace/Servers/OnlineTest.php b/tests/Zend/Service/Rackspace/Servers/OnlineTest.php index 427777c638..4bccb1ae74 100644 --- a/tests/Zend/Service/Rackspace/Servers/OnlineTest.php +++ b/tests/Zend/Service/Rackspace/Servers/OnlineTest.php @@ -30,7 +30,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Service_Rackspace_Servers */ -class Zend_Service_Rackspace_Servers_OnlineTest extends PHPUnit_Framework_TestCase +class Zend_Service_Rackspace_Servers_OnlineTest extends PHPUnit\Framework\TestCase { /** * Reference to Rackspace Servers object diff --git a/tests/Zend/Service/ReCaptcha/MailHideTest.php b/tests/Zend/Service/ReCaptcha/MailHideTest.php index 460ea45c43..b9d46d677d 100644 --- a/tests/Zend/Service/ReCaptcha/MailHideTest.php +++ b/tests/Zend/Service/ReCaptcha/MailHideTest.php @@ -35,7 +35,7 @@ * @group Zend_Service * @group Zend_Service_ReCaptcha */ -class Zend_Service_ReCaptcha_MailHideTest extends PHPUnit_Framework_TestCase +class Zend_Service_ReCaptcha_MailHideTest extends PHPUnit\Framework\TestCase { protected $_publicKey = TESTS_ZEND_SERVICE_RECAPTCHA_MAILHIDE_PUBLIC_KEY; protected $_privateKey = TESTS_ZEND_SERVICE_RECAPTCHA_MAILHIDE_PRIVATE_KEY; @@ -108,13 +108,13 @@ public function testGetHtml() { } public function testGetHtmlWithNoEmail() { - $this->setExpectedException('Zend_Service_ReCaptcha_MailHide_Exception'); + $this->expectException('Zend_Service_ReCaptcha_MailHide_Exception'); $html = $this->_mailHide->getHtml(); } public function testGetHtmlWithMissingPublicKey() { - $this->setExpectedException('Zend_Service_ReCaptcha_MailHide_Exception'); + $this->expectException('Zend_Service_ReCaptcha_MailHide_Exception'); $mail = 'mail@example.com'; @@ -125,7 +125,7 @@ public function testGetHtmlWithMissingPublicKey() { } public function testGetHtmlWithMissingPrivateKey() { - $this->setExpectedException('Zend_Service_ReCaptcha_MailHide_Exception'); + $this->expectException('Zend_Service_ReCaptcha_MailHide_Exception'); $mail = 'mail@example.com'; diff --git a/tests/Zend/Service/ReCaptcha/ReCaptchaTest.php b/tests/Zend/Service/ReCaptcha/ReCaptchaTest.php index 14a86e1a7d..807fcbc1b6 100644 --- a/tests/Zend/Service/ReCaptcha/ReCaptchaTest.php +++ b/tests/Zend/Service/ReCaptcha/ReCaptchaTest.php @@ -38,7 +38,7 @@ * @group Zend_Service * @group Zend_Service_ReCaptcha */ -class Zend_Service_ReCaptcha_ReCaptchaTest extends PHPUnit_Framework_TestCase +class Zend_Service_ReCaptcha_ReCaptchaTest extends PHPUnit\Framework\TestCase { protected $_publicKey = TESTS_ZEND_SERVICE_RECAPTCHA_PUBLIC_KEY; protected $_privateKey = TESTS_ZEND_SERVICE_RECAPTCHA_PRIVATE_KEY; @@ -139,7 +139,7 @@ public function testSetMultipleParamsFromZendConfig() { } public function testSetInvalidParams() { - $this->setExpectedException('Zend_Service_ReCaptcha_Exception'); + $this->expectException('Zend_Service_ReCaptcha_Exception'); $var = 'string'; $this->_reCaptcha->setParams($var); } @@ -160,7 +160,7 @@ public function testSetMultipleOptionsFromZendConfig() { } public function testSetInvalidOptions() { - $this->setExpectedException('Zend_Service_ReCaptcha_Exception'); + $this->expectException('Zend_Service_ReCaptcha_Exception'); $var = 'string'; $this->_reCaptcha->setOptions($var); } @@ -206,7 +206,7 @@ public function testConstructorWithNoIp() { } public function testGetHtmlWithNoPublicKey() { - $this->setExpectedException('Zend_Service_ReCaptcha_Exception'); + $this->expectException('Zend_Service_ReCaptcha_Exception'); $html = $this->_reCaptcha->getHtml(); } @@ -259,13 +259,13 @@ public function testHtmlGenerationWillUseSuppliedNameForNoScriptElements() } public function testVerifyWithMissingPrivateKey() { - $this->setExpectedException('Zend_Service_ReCaptcha_Exception'); + $this->expectException('Zend_Service_ReCaptcha_Exception'); $this->_reCaptcha->verify('challenge', 'response'); } public function testVerifyWithMissingIp() { - $this->setExpectedException('Zend_Service_ReCaptcha_Exception'); + $this->expectException('Zend_Service_ReCaptcha_Exception'); $this->_reCaptcha->setPrivateKey($this->_privateKey); $this->_reCaptcha->verify('challenge', 'response'); diff --git a/tests/Zend/Service/ReCaptcha/ResponseTest.php b/tests/Zend/Service/ReCaptcha/ResponseTest.php index b67d9dd868..ce5523c479 100644 --- a/tests/Zend/Service/ReCaptcha/ResponseTest.php +++ b/tests/Zend/Service/ReCaptcha/ResponseTest.php @@ -32,7 +32,7 @@ * @group Zend_Service * @group Zend_Service_ReCaptcha */ -class Zend_Service_ReCaptcha_ResponseTest extends PHPUnit_Framework_TestCase +class Zend_Service_ReCaptcha_ResponseTest extends PHPUnit\Framework\TestCase { protected $_response = null; diff --git a/tests/Zend/Service/ShortUrl/BitLyTest.php b/tests/Zend/Service/ShortUrl/BitLyTest.php index b0b2500440..087556d426 100644 --- a/tests/Zend/Service/ShortUrl/BitLyTest.php +++ b/tests/Zend/Service/ShortUrl/BitLyTest.php @@ -26,7 +26,7 @@ * @package Zend_Service * @subpackage UnitTests */ -class Zend_Service_ShortUrl_BitLyTest extends PHPUnit_Framework_TestCase +class Zend_Service_ShortUrl_BitLyTest extends PHPUnit\Framework\TestCase { /** @@ -47,7 +47,7 @@ public function setUp () public function testShortenEmptyUrlException() { - $this->setExpectedException('Zend_Service_ShortUrl_Exception'); + $this->expectException('Zend_Service_ShortUrl_Exception'); $s = new Zend_Service_ShortUrl_BitLy('test'); $s->shorten(''); @@ -55,7 +55,7 @@ public function testShortenEmptyUrlException() public function testShortenIncorrectUrlException() { - $this->setExpectedException('Zend_Service_ShortUrl_Exception'); + $this->expectException('Zend_Service_ShortUrl_Exception'); $s = new Zend_Service_ShortUrl_BitLy('test'); $s->shorten('wrongAdress.cccc'); @@ -63,7 +63,7 @@ public function testShortenIncorrectUrlException() public function testExceptionOnBadApiResponse() { - $this->setExpectedException('Zend_Service_ShortUrl_Exception'); + $this->expectException('Zend_Service_ShortUrl_Exception'); $clientResponse = $this->getMockBuilder('Zend_Http_Response') ->disableOriginalConstructor() diff --git a/tests/Zend/Service/ShortUrl/IsGdTest.php b/tests/Zend/Service/ShortUrl/IsGdTest.php index c19e375ed4..365c386c73 100644 --- a/tests/Zend/Service/ShortUrl/IsGdTest.php +++ b/tests/Zend/Service/ShortUrl/IsGdTest.php @@ -26,7 +26,7 @@ * @package Zend_Service * @subpackage UnitTests */ -class Zend_Service_ShortUrl_IsGdTest extends PHPUnit_Framework_TestCase +class Zend_Service_ShortUrl_IsGdTest extends PHPUnit\Framework\TestCase { /** * Zend_Service_ShortUrl_IsGd object @@ -56,13 +56,13 @@ public function setUp () public function testShortenEmptyUrlException() { - $this->setExpectedException('Zend_Service_ShortUrl_Exception'); + $this->expectException('Zend_Service_ShortUrl_Exception'); $this->_s->shorten(''); } public function testShortenIncorrectUrlException() { - $this->setExpectedException('Zend_Service_ShortUrl_Exception'); + $this->expectException('Zend_Service_ShortUrl_Exception'); $this->_s->shorten('wrongAdress.cccc'); } @@ -95,19 +95,19 @@ public function testUnshorten() public function testUnshortenEmptyUrlException() { - $this->setExpectedException('Zend_Service_ShortUrl_Exception'); + $this->expectException('Zend_Service_ShortUrl_Exception'); $this->_s->unshorten(''); } public function testUnshortenIncorrectUrlException() { - $this->setExpectedException('Zend_Service_ShortUrl_Exception'); + $this->expectException('Zend_Service_ShortUrl_Exception'); $this->_s->unshorten('wrongAdress.cccc'); } public function testUnshortenWrongUrlException() { - $this->setExpectedException('Zend_Service_ShortUrl_Exception'); + $this->expectException('Zend_Service_ShortUrl_Exception'); $this->_s->unshorten('http://www.zend.com'); } } diff --git a/tests/Zend/Service/ShortUrl/JdemCzTest.php b/tests/Zend/Service/ShortUrl/JdemCzTest.php index 611323a577..f77080071a 100644 --- a/tests/Zend/Service/ShortUrl/JdemCzTest.php +++ b/tests/Zend/Service/ShortUrl/JdemCzTest.php @@ -26,7 +26,7 @@ * @package Zend_Service * @subpackage UnitTests */ -class Zend_Service_ShortUrl_JdemCzTest extends PHPUnit_Framework_TestCase +class Zend_Service_ShortUrl_JdemCzTest extends PHPUnit\Framework\TestCase { /** * Zend_Service_JdemCz object @@ -55,13 +55,13 @@ public function setUp () public function testShortenEmptyUrlException() { - $this->setExpectedException('Zend_Service_ShortUrl_Exception'); + $this->expectException('Zend_Service_ShortUrl_Exception'); $this->_s->shorten(''); } public function testShortenIncorrectUrlException() { - $this->setExpectedException('Zend_Service_ShortUrl_Exception'); + $this->expectException('Zend_Service_ShortUrl_Exception'); $this->_s->shorten('wrongAdress.cccc'); } @@ -91,19 +91,19 @@ public function testUnshorten() public function testUnshortenEmptyUrlException() { - $this->setExpectedException('Zend_Service_ShortUrl_Exception'); + $this->expectException('Zend_Service_ShortUrl_Exception'); $this->_s->unshorten(''); } public function testUnshortenIncorrectUrlException() { - $this->setExpectedException('Zend_Service_ShortUrl_Exception'); + $this->expectException('Zend_Service_ShortUrl_Exception'); $this->_s->unshorten('wrongAdress.cccc'); } public function testUnshortenWrongUrlException() { - $this->setExpectedException('Zend_Service_ShortUrl_Exception'); + $this->expectException('Zend_Service_ShortUrl_Exception'); $this->_s->unshorten('http://www.zend.com'); } } diff --git a/tests/Zend/Service/ShortUrl/MetamarkNetTest.php b/tests/Zend/Service/ShortUrl/MetamarkNetTest.php index c434ba1d92..070611cb4a 100644 --- a/tests/Zend/Service/ShortUrl/MetamarkNetTest.php +++ b/tests/Zend/Service/ShortUrl/MetamarkNetTest.php @@ -27,7 +27,7 @@ * @subpackage UnitTests * @see http://metamark.net/docs/api/rest.html */ -class Zend_Service_ShortUrl_MetamarkNetTest extends PHPUnit_Framework_TestCase +class Zend_Service_ShortUrl_MetamarkNetTest extends PHPUnit\Framework\TestCase { /** * Zend_Service_ShortUrl_MetamarkNet object @@ -56,13 +56,13 @@ public function setUp () public function testShortenEmptyUrlException() { - $this->setExpectedException('Zend_Service_ShortUrl_Exception'); + $this->expectException('Zend_Service_ShortUrl_Exception'); $this->_s->shorten(''); } public function testShortenIncorrectUrlException() { - $this->setExpectedException('Zend_Service_ShortUrl_Exception'); + $this->expectException('Zend_Service_ShortUrl_Exception'); $this->_s->shorten('wrongAdress.cccc'); } @@ -92,19 +92,19 @@ public function testUnshorten() public function testUnshortenEmptyUrlException() { - $this->setExpectedException('Zend_Service_ShortUrl_Exception'); + $this->expectException('Zend_Service_ShortUrl_Exception'); $this->_s->unshorten(''); } public function testUnshortenIncorrectUrlException() { - $this->setExpectedException('Zend_Service_ShortUrl_Exception'); + $this->expectException('Zend_Service_ShortUrl_Exception'); $this->_s->unshorten('wrongAdress.cccc'); } public function testUnshortenWrongUrlException() { - $this->setExpectedException('Zend_Service_ShortUrl_Exception'); + $this->expectException('Zend_Service_ShortUrl_Exception'); $this->_s->unshorten('http://www.zend.com'); } } diff --git a/tests/Zend/Service/ShortUrl/TinyUrlComTest.php b/tests/Zend/Service/ShortUrl/TinyUrlComTest.php index 25263f4402..e3d913c393 100644 --- a/tests/Zend/Service/ShortUrl/TinyUrlComTest.php +++ b/tests/Zend/Service/ShortUrl/TinyUrlComTest.php @@ -26,7 +26,7 @@ * @package Zend_Service * @subpackage UnitTests */ -class Zend_Service_ShortUrl_TinyUrlComTest extends PHPUnit_Framework_TestCase +class Zend_Service_ShortUrl_TinyUrlComTest extends PHPUnit\Framework\TestCase { /** * Zend_Service_TinyUrlCom object @@ -55,13 +55,13 @@ public function setUp () public function testShortenEmptyUrlException() { - $this->setExpectedException('Zend_Service_ShortUrl_Exception'); + $this->expectException('Zend_Service_ShortUrl_Exception'); $this->_s->shorten(''); } public function testShortenIncorrectUrlException() { - $this->setExpectedException('Zend_Service_ShortUrl_Exception'); + $this->expectException('Zend_Service_ShortUrl_Exception'); $this->_s->shorten('wrongAdress.cccc'); } @@ -91,19 +91,19 @@ public function testUnshorten() public function testUnshortenEmptyUrlException() { - $this->setExpectedException('Zend_Service_ShortUrl_Exception'); + $this->expectException('Zend_Service_ShortUrl_Exception'); $this->_s->unshorten(''); } public function testUnshortenIncorrectUrlException() { - $this->setExpectedException('Zend_Service_ShortUrl_Exception'); + $this->expectException('Zend_Service_ShortUrl_Exception'); $this->_s->unshorten('wrongAdress.cccc'); } public function testUnshortenWrongUrlException() { - $this->setExpectedException('Zend_Service_ShortUrl_Exception'); + $this->expectException('Zend_Service_ShortUrl_Exception'); $this->_s->unshorten('http://zend.com'); } } diff --git a/tests/Zend/Service/SlideShareTest.php b/tests/Zend/Service/SlideShareTest.php index dbd84324af..9022001821 100644 --- a/tests/Zend/Service/SlideShareTest.php +++ b/tests/Zend/Service/SlideShareTest.php @@ -34,7 +34,7 @@ * @group Zend_Service * @group Zend_Service_SlideShare */ -class Zend_Service_SlideShareTest extends PHPUnit_Framework_TestCase +class Zend_Service_SlideShareTest extends PHPUnit\Framework\TestCase { /** * The Slide share object instance @@ -121,7 +121,7 @@ public function testGetSlideShowByTag() $this->fail("Exception Caught retrieving Slideshow List (tag)"); } - $this->assertTrue(is_array($results)); + $this->assertInternalType('array', $results); $this->assertTrue(count($results) == 1); $this->assertTrue( $results[0] instanceof Zend_Service_SlideShare_SlideShow @@ -143,7 +143,7 @@ public function testGetSlideShowByTags() $this->fail("Exception Caught retrieving Slideshow List (tag)"); } - $this->assertTrue(is_array($results)); + $this->assertInternalType('array', $results); if (!empty($results)) { $this->assertTrue(count($results) == 1); @@ -165,7 +165,7 @@ public function testGetSlideShowByUsername() $this->fail("Exception Caught retrieving Slideshow List (tag)"); } - $this->assertTrue(is_array($results)); + $this->assertInternalType('array', $results); $this->assertTrue(count($results) == 1); $this->assertTrue( $results[0] instanceof Zend_Service_SlideShare_SlideShow diff --git a/tests/Zend/Service/SqlAzure/Management/ManagementClientTest.php b/tests/Zend/Service/SqlAzure/Management/ManagementClientTest.php index 98ccc7c56c..580220b188 100644 --- a/tests/Zend/Service/SqlAzure/Management/ManagementClientTest.php +++ b/tests/Zend/Service/SqlAzure/Management/ManagementClientTest.php @@ -39,19 +39,15 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_SqlAzure_Management_ManagementClientTest extends PHPUnit_Framework_TestCase +class Zend_Service_SqlAzure_Management_ManagementClientTest extends PHPUnit\Framework\TestCase { static $path; static $debug = true; static $serverName = ''; - public function __construct() - { - self::$path = dirname(__FILE__).'/_files/'; - } - public function setUp() { + self::$path = dirname(__FILE__).'/_files/'; if (!defined(TESTS_ZEND_SERVICE_WINDOWSAZURE_SQLMANAGEMENT_RUNTESTS)) { $this->markTestSkipped('Tests not configured to run'); return; diff --git a/tests/Zend/Service/StrikeIron/BaseTest.php b/tests/Zend/Service/StrikeIron/BaseTest.php index 4a4d2e539f..112208b27e 100644 --- a/tests/Zend/Service/StrikeIron/BaseTest.php +++ b/tests/Zend/Service/StrikeIron/BaseTest.php @@ -34,7 +34,7 @@ * @group Zend_Service * @group Zend_Service_StrikeIron */ -class Zend_Service_StrikeIron_BaseTest extends PHPUnit_Framework_TestCase +class Zend_Service_StrikeIron_BaseTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -80,7 +80,7 @@ public function testDefaultSoapHeadersHasTheLicenseInfoHeader() $this->base->foo(); $headers = $this->soapClient->calls[0]['headers']; - $this->assertTrue(is_array($headers)); + $this->assertInternalType('array', $headers); $this->assertEquals(1, count($headers)); $header = $headers[0]; @@ -139,7 +139,7 @@ public function testAddingScalarSoapHeaderThatOverridesLicenseInfo() $headers = $this->soapClient->calls[0]['headers']; - $this->assertTrue(is_array($headers)); + $this->assertInternalType('array', $headers); $this->assertEquals(1, count($headers)); $header = $headers[0]; @@ -160,7 +160,7 @@ public function testAddingArrayOfSoapHeaders() $headers = $this->soapClient->calls[0]['headers']; - $this->assertTrue(is_array($headers)); + $this->assertInternalType('array', $headers); $this->assertEquals(3, count($headers)); // these 2 + default LicenseInfo } diff --git a/tests/Zend/Service/StrikeIron/DecoratorTest.php b/tests/Zend/Service/StrikeIron/DecoratorTest.php index e19a5e1b86..29455d1b90 100644 --- a/tests/Zend/Service/StrikeIron/DecoratorTest.php +++ b/tests/Zend/Service/StrikeIron/DecoratorTest.php @@ -35,7 +35,7 @@ * @group Zend_Service * @group Zend_Service_StrikeIron */ -class Zend_Service_StrikeIron_DecoratorTest extends PHPUnit_Framework_TestCase +class Zend_Service_StrikeIron_DecoratorTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Service/StrikeIron/ExceptionTest.php b/tests/Zend/Service/StrikeIron/ExceptionTest.php index ff5decd8b1..a3c64098f5 100644 --- a/tests/Zend/Service/StrikeIron/ExceptionTest.php +++ b/tests/Zend/Service/StrikeIron/ExceptionTest.php @@ -35,7 +35,7 @@ * @group Zend_Service * @group Zend_Service_StrikeIron */ -class Zend_Service_StrikeIron_ExceptionTest extends PHPUnit_Framework_TestCase +class Zend_Service_StrikeIron_ExceptionTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Service/StrikeIron/NoSoapTest.php b/tests/Zend/Service/StrikeIron/NoSoapTest.php index f5e46aa09d..e2b47855d1 100644 --- a/tests/Zend/Service/StrikeIron/NoSoapTest.php +++ b/tests/Zend/Service/StrikeIron/NoSoapTest.php @@ -36,7 +36,7 @@ * @group Zend_Service * @group Zend_Service_StrikeIron */ -class Zend_Service_StrikeIron_NoSoapTest extends PHPUnit_Framework_TestCase +class Zend_Service_StrikeIron_NoSoapTest extends PHPUnit\Framework\TestCase { public function setUp() diff --git a/tests/Zend/Service/StrikeIron/SalesUseTaxBasicTest.php b/tests/Zend/Service/StrikeIron/SalesUseTaxBasicTest.php index d3b024e319..8f6d5b7f74 100644 --- a/tests/Zend/Service/StrikeIron/SalesUseTaxBasicTest.php +++ b/tests/Zend/Service/StrikeIron/SalesUseTaxBasicTest.php @@ -40,7 +40,7 @@ * @group Zend_Service * @group Zend_Service_StrikeIron */ -class Zend_Service_StrikeIron_SalesUseTaxBasicTest extends PHPUnit_Framework_TestCase +class Zend_Service_StrikeIron_SalesUseTaxBasicTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Service/StrikeIron/StrikeIronTest.php b/tests/Zend/Service/StrikeIron/StrikeIronTest.php index 7fe6fa1298..01635acc76 100644 --- a/tests/Zend/Service/StrikeIron/StrikeIronTest.php +++ b/tests/Zend/Service/StrikeIron/StrikeIronTest.php @@ -34,7 +34,7 @@ * @group Zend_Service * @group Zend_Service_StrikeIron */ -class Zend_Service_StrikeIron_StrikeIronTest extends PHPUnit_Framework_TestCase +class Zend_Service_StrikeIron_StrikeIronTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Service/StrikeIron/USAddressVerificationTest.php b/tests/Zend/Service/StrikeIron/USAddressVerificationTest.php index 257927c45d..9cb76e7471 100644 --- a/tests/Zend/Service/StrikeIron/USAddressVerificationTest.php +++ b/tests/Zend/Service/StrikeIron/USAddressVerificationTest.php @@ -40,7 +40,7 @@ * @group Zend_Service * @group Zend_Service_StrikeIron */ -class Zend_Service_StrikeIron_USAddressVerificationTest extends PHPUnit_Framework_TestCase +class Zend_Service_StrikeIron_USAddressVerificationTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Service/StrikeIron/ZipCodeInfoTest.php b/tests/Zend/Service/StrikeIron/ZipCodeInfoTest.php index 9127515fbf..252dc9eafa 100644 --- a/tests/Zend/Service/StrikeIron/ZipCodeInfoTest.php +++ b/tests/Zend/Service/StrikeIron/ZipCodeInfoTest.php @@ -40,7 +40,7 @@ * @group Zend_Service * @group Zend_Service_StrikeIron */ -class Zend_Service_StrikeIron_ZipCodeInfoTest extends PHPUnit_Framework_TestCase +class Zend_Service_StrikeIron_ZipCodeInfoTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Service/Twitter/TwitterTest.php b/tests/Zend/Service/Twitter/TwitterTest.php index 5b37453faa..2f501518f2 100644 --- a/tests/Zend/Service/Twitter/TwitterTest.php +++ b/tests/Zend/Service/Twitter/TwitterTest.php @@ -44,7 +44,7 @@ * @group Zend_Service * @group Zend_Service_Twitter */ -class Zend_Service_Twitter_TwitterTest extends PHPUnit_Framework_TestCase +class Zend_Service_Twitter_TwitterTest extends PHPUnit\Framework\TestCase { /** * Quick reusable Twitter Service stub setup. Its purpose is to fake @@ -179,7 +179,7 @@ public function testResetsHttpClientOnReceiptOfAccessTokenToOauthClient() public function testAuthorisationFailureWithUsernameAndNoAccessToken() { - $this->setExpectedException('Zend_Service_Twitter_Exception'); + $this->expectException('Zend_Service_Twitter_Exception'); $twitter = new Zend_Service_Twitter(array('username'=>'me')); $twitter->statusesPublicTimeline(); } @@ -217,7 +217,7 @@ public function testRetrievingStatusesWithValidScreenNameThrowsNoInvalidScreenNa */ public function testRetrievingStatusesWithInvalidScreenNameCharacterThrowsInvalidScreenNameException() { - $this->setExpectedException('Zend_Service_Twitter_Exception'); + $this->expectException('Zend_Service_Twitter_Exception'); $twitter = new Zend_Service_Twitter(); $twitter->statuses->userTimeline(array('screen_name' => 'abc.def')); } @@ -227,7 +227,7 @@ public function testRetrievingStatusesWithInvalidScreenNameCharacterThrowsInvali */ public function testRetrievingStatusesWithInvalidScreenNameLengthThrowsInvalidScreenNameException() { - $this->setExpectedException('Zend_Service_Twitter_Exception'); + $this->expectException('Zend_Service_Twitter_Exception'); $twitter = new Zend_Service_Twitter(); $twitter->statuses->userTimeline(array('screen_name' => 'abcdef_abc123_abc123x')); } @@ -268,14 +268,14 @@ public function testOverloadingGetShouldReturnObjectInstanceWithValidMethodType( public function testOverloadingGetShouldthrowExceptionWithInvalidMethodType() { - $this->setExpectedException('Zend_Service_Twitter_Exception'); + $this->expectException('Zend_Service_Twitter_Exception'); $twitter = new Zend_Service_Twitter; $return = $twitter->foo; } public function testOverloadingGetShouldthrowExceptionWithInvalidFunction() { - $this->setExpectedException('Zend_Service_Twitter_Exception'); + $this->expectException('Zend_Service_Twitter_Exception'); $twitter = new Zend_Service_Twitter; $return = $twitter->foo(); } @@ -291,7 +291,7 @@ public function testMethodProxyingDoesNotThrowExceptionsWithValidMethods() public function testMethodProxyingThrowExceptionsWithInvalidMethods() { - $this->setExpectedException('Zend_Service_Twitter_Exception'); + $this->expectException('Zend_Service_Twitter_Exception'); $twitter = new Zend_Service_Twitter; $twitter->statuses->foo(); } @@ -393,14 +393,14 @@ public function testPostStatusUpdateReturnsResponse() public function testPostStatusUpdateToLongShouldThrowException() { - $this->setExpectedException('Zend_Service_Twitter_Exception'); + $this->expectException('Zend_Service_Twitter_Exception'); $twitter = new Zend_Service_Twitter; $twitter->statuses->update('Test Message - ' . str_repeat(' Hello ', 140)); } public function testPostStatusUpdateEmptyShouldThrowException() { - $this->setExpectedException('Zend_Service_Twitter_Exception'); + $this->expectException('Zend_Service_Twitter_Exception'); $twitter = new Zend_Service_Twitter; $twitter->statuses->update(''); } diff --git a/tests/Zend/Service/WindowsAzure/BlobStorageSharedAccessTest.php b/tests/Zend/Service/WindowsAzure/BlobStorageSharedAccessTest.php index c77ff4b694..5d4292c94c 100644 --- a/tests/Zend/Service/WindowsAzure/BlobStorageSharedAccessTest.php +++ b/tests/Zend/Service/WindowsAzure/BlobStorageSharedAccessTest.php @@ -40,21 +40,18 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_WindowsAzure_BlobStorageSharedAccessTest extends PHPUnit_Framework_TestCase +class Zend_Service_WindowsAzure_BlobStorageSharedAccessTest extends PHPUnit\Framework\TestCase { static $path; protected $skipped; - public function __construct() - { - self::$path = dirname(__FILE__).'/_files/'; - } /** * Test setup */ public function setUp() { + self::$path = dirname(__FILE__).'/_files/'; $this->skipped = false; if (!TESTS_ZEND_SERVICE_WINDOWSAZURE_BLOB_RUNTESTS) { diff --git a/tests/Zend/Service/WindowsAzure/BlobStorageTest.php b/tests/Zend/Service/WindowsAzure/BlobStorageTest.php index f557280265..888245684a 100644 --- a/tests/Zend/Service/WindowsAzure/BlobStorageTest.php +++ b/tests/Zend/Service/WindowsAzure/BlobStorageTest.php @@ -37,21 +37,17 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_WindowsAzure_BlobStorageTest extends PHPUnit_Framework_TestCase +class Zend_Service_WindowsAzure_BlobStorageTest extends PHPUnit\Framework\TestCase { static $path; protected $skipped; - public function __construct() - { - self::$path = dirname(__FILE__).'/_files/'; - } - /** * Test setup */ public function setUp() { + self::$path = dirname(__FILE__).'/_files/'; $this->skipped = false; if (!TESTS_ZEND_SERVICE_WINDOWSAZURE_BLOB_RUNTESTS) { @@ -380,7 +376,7 @@ public function testGetBlob() $fileName = tempnam('', 'tst'); $storageClient->getBlob($containerName, 'images/WindowsAzure.gif', $fileName); - $this->assertTrue(file_exists($fileName)); + $this->assertFileExists($fileName); $this->assertEquals( file_get_contents(self::$path . 'WindowsAzure.gif'), file_get_contents($fileName) @@ -430,7 +426,7 @@ public function testSnapshotBlob() $fileName = tempnam('', 'tst'); $storageClient->getBlob($containerName, 'images/WindowsAzure.gif', $fileName, $snapshotId); - $this->assertTrue(file_exists($fileName)); + $this->assertFileExists($fileName); $this->assertEquals( file_get_contents(self::$path . 'WindowsAzure.gif'), file_get_contents($fileName) @@ -694,7 +690,7 @@ public function testRootContainer() $fileName = tempnam('', 'tst'); $storageClient->getBlob($containerName, 'WindowsAzure.gif', $fileName); - $this->assertTrue(file_exists($fileName)); + $this->assertFileExists($fileName); $this->assertEquals( file_get_contents(self::$path . 'WindowsAzure.gif'), file_get_contents($fileName) diff --git a/tests/Zend/Service/WindowsAzure/BlobStreamTest.php b/tests/Zend/Service/WindowsAzure/BlobStreamTest.php index 941bad11ff..e5c4d775bc 100644 --- a/tests/Zend/Service/WindowsAzure/BlobStreamTest.php +++ b/tests/Zend/Service/WindowsAzure/BlobStreamTest.php @@ -37,20 +37,16 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_WindowsAzure_BlobStreamTest extends PHPUnit_Framework_TestCase +class Zend_Service_WindowsAzure_BlobStreamTest extends PHPUnit\Framework\TestCase { static $path; - public function __construct() - { - self::$path = dirname(__FILE__).'/_files/'; - } - /** * Test setup */ public function setUp() { + self::$path = dirname(__FILE__).'/_files/'; if (!TESTS_ZEND_SERVICE_WINDOWSAZURE_BLOB_RUNTESTS) { $this->markTestSkipped('Test not enabled in TestConfiguration.php'); } diff --git a/tests/Zend/Service/WindowsAzure/Credentials/SharedAccessSignatureTest.php b/tests/Zend/Service/WindowsAzure/Credentials/SharedAccessSignatureTest.php index b2b644b856..3ad883a652 100644 --- a/tests/Zend/Service/WindowsAzure/Credentials/SharedAccessSignatureTest.php +++ b/tests/Zend/Service/WindowsAzure/Credentials/SharedAccessSignatureTest.php @@ -37,7 +37,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_WindowsAzure_Credentials_SharedAccessSignatureTest extends PHPUnit_Framework_TestCase +class Zend_Service_WindowsAzure_Credentials_SharedAccessSignatureTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Service/WindowsAzure/Credentials/SharedKeyLiteTest.php b/tests/Zend/Service/WindowsAzure/Credentials/SharedKeyLiteTest.php index c0b18db7fc..685534f249 100644 --- a/tests/Zend/Service/WindowsAzure/Credentials/SharedKeyLiteTest.php +++ b/tests/Zend/Service/WindowsAzure/Credentials/SharedKeyLiteTest.php @@ -37,7 +37,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_WindowsAzure_Credentials_SharedKeyLiteTest extends PHPUnit_Framework_TestCase +class Zend_Service_WindowsAzure_Credentials_SharedKeyLiteTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -60,7 +60,7 @@ public function testSignForDevstoreWithRootPath() true ); - $this->assertTrue(is_array($signedHeaders)); + $this->assertInternalType('array', $signedHeaders); $this->assertEquals(2, count($signedHeaders)); $this->assertEquals("SharedKeyLite devstoreaccount1:iRQpXGzlMRb1A57bkcryX7Bg/3Uf5YOfNCG+XIingJI=", $signedHeaders["Authorization"]); } @@ -79,7 +79,7 @@ public function testSignForDevstoreWithOtherPath() true ); - $this->assertTrue(is_array($signedHeaders)); + $this->assertInternalType('array', $signedHeaders); $this->assertEquals(2, count($signedHeaders)); $this->assertEquals("SharedKeyLite devstoreaccount1:MsC5SIbFB4M4UZd83CiMaL8ibUhaS5H9CcJBJpsnWqo=", $signedHeaders["Authorization"]); } @@ -98,7 +98,7 @@ public function testSignForDevstoreWithQueryString() true ); - $this->assertTrue(is_array($signedHeaders)); + $this->assertInternalType('array', $signedHeaders); $this->assertEquals(2, count($signedHeaders)); $this->assertEquals("SharedKeyLite devstoreaccount1:iRQpXGzlMRb1A57bkcryX7Bg/3Uf5YOfNCG+XIingJI=", $signedHeaders["Authorization"]); } @@ -117,7 +117,7 @@ public function testSignForProductionWithRootPath() true ); - $this->assertTrue(is_array($signedHeaders)); + $this->assertInternalType('array', $signedHeaders); $this->assertEquals(2, count($signedHeaders)); $this->assertEquals("SharedKeyLite testing:vZdOn/j0gW5FG0kAUG9NhSBO9eBjZqfe6RwALPYUtqU=", $signedHeaders["Authorization"]); } @@ -136,7 +136,7 @@ public function testSignForProductionWithOtherPath() true ); - $this->assertTrue(is_array($signedHeaders)); + $this->assertInternalType('array', $signedHeaders); $this->assertEquals(2, count($signedHeaders)); $this->assertEquals("SharedKeyLite testing:HJTSiRDtMsQVsFVispSHkcODeFykLO+WEuOepwmh51o=", $signedHeaders["Authorization"]); } @@ -155,7 +155,7 @@ public function testSignForProductionWithQueryString() true ); - $this->assertTrue(is_array($signedHeaders)); + $this->assertInternalType('array', $signedHeaders); $this->assertEquals(2, count($signedHeaders)); $this->assertEquals("SharedKeyLite testing:vZdOn/j0gW5FG0kAUG9NhSBO9eBjZqfe6RwALPYUtqU=", $signedHeaders["Authorization"]); } diff --git a/tests/Zend/Service/WindowsAzure/Credentials/SharedKeyTest.php b/tests/Zend/Service/WindowsAzure/Credentials/SharedKeyTest.php index 42495ea483..15d7b406ee 100644 --- a/tests/Zend/Service/WindowsAzure/Credentials/SharedKeyTest.php +++ b/tests/Zend/Service/WindowsAzure/Credentials/SharedKeyTest.php @@ -37,7 +37,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_WindowsAzure_Credentials_SharedKeyTest extends PHPUnit_Framework_TestCase +class Zend_Service_WindowsAzure_Credentials_SharedKeyTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -60,7 +60,7 @@ public function testSignForDevstoreWithRootPath() false ); - $this->assertTrue(is_array($signedHeaders)); + $this->assertInternalType('array', $signedHeaders); $this->assertEquals(2, count($signedHeaders)); $this->assertEquals("SharedKey devstoreaccount1:9tokqwSDIqvRioVZ1k0mv5m/iseHsGRYmAMGJVu6NcU=", $signedHeaders["Authorization"]); } @@ -79,7 +79,7 @@ public function testSignForDevstoreWithOtherPath() false ); - $this->assertTrue(is_array($signedHeaders)); + $this->assertInternalType('array', $signedHeaders); $this->assertEquals(2, count($signedHeaders)); $this->assertEquals("SharedKey devstoreaccount1:YHPfUXoeL/XZjEYii2pfSZi3CsOB++5sA4QT7CAvPig=", $signedHeaders["Authorization"]); } @@ -98,7 +98,7 @@ public function testSignForDevstoreWithQueryString() false ); - $this->assertTrue(is_array($signedHeaders)); + $this->assertInternalType('array', $signedHeaders); $this->assertEquals(2, count($signedHeaders)); $this->assertEquals("SharedKey devstoreaccount1:S1+AcI8z19N0EP0eRTEj4UUCtPbKyUcZDAt299AWudw=", $signedHeaders["Authorization"]); } @@ -117,7 +117,7 @@ public function testSignForProductionWithRootPath() false ); - $this->assertTrue(is_array($signedHeaders)); + $this->assertInternalType('array', $signedHeaders); $this->assertEquals(2, count($signedHeaders)); $this->assertEquals("SharedKey testing:amg3/Z6Yx0KxwhRz9yn1ZCPZXYWIp5aEDCeZ1H5UIwo=", $signedHeaders["Authorization"]); } @@ -136,7 +136,7 @@ public function testSignForProductionWithOtherPath() false ); - $this->assertTrue(is_array($signedHeaders)); + $this->assertInternalType('array', $signedHeaders); $this->assertEquals(2, count($signedHeaders)); $this->assertEquals("SharedKey testing:ISA0m0Gy2SrxxjBO9ogtIbz0xNNyJ/GujUv5s1ibQrY=", $signedHeaders["Authorization"]); } @@ -155,7 +155,7 @@ public function testSignForProductionWithQueryString() false ); - $this->assertTrue(is_array($signedHeaders)); + $this->assertInternalType('array', $signedHeaders); $this->assertEquals(2, count($signedHeaders)); $this->assertEquals("SharedKey testing:vlfVjEbBaRVTv35e924cR4B/Z5zCaSYjbtMz9/k3UCY=", $signedHeaders["Authorization"]); } diff --git a/tests/Zend/Service/WindowsAzure/Diagnostics/ManagerTest.php b/tests/Zend/Service/WindowsAzure/Diagnostics/ManagerTest.php index 933e883f8d..75e5cafaf5 100644 --- a/tests/Zend/Service/WindowsAzure/Diagnostics/ManagerTest.php +++ b/tests/Zend/Service/WindowsAzure/Diagnostics/ManagerTest.php @@ -43,7 +43,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_WindowsAzure_Diagnostics_ManagerTest extends PHPUnit_Framework_TestCase +class Zend_Service_WindowsAzure_Diagnostics_ManagerTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Service/WindowsAzure/DynamicTableEntityTest.php b/tests/Zend/Service/WindowsAzure/DynamicTableEntityTest.php index 0c9b32a2e9..ca8a5e100e 100644 --- a/tests/Zend/Service/WindowsAzure/DynamicTableEntityTest.php +++ b/tests/Zend/Service/WindowsAzure/DynamicTableEntityTest.php @@ -40,7 +40,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_WindowsAzure_DynamicTableEntityTest extends PHPUnit_Framework_TestCase +class Zend_Service_WindowsAzure_DynamicTableEntityTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Service/WindowsAzure/Management/ManagementClientTest.php b/tests/Zend/Service/WindowsAzure/Management/ManagementClientTest.php index 5ff177219f..0967b1eb5a 100644 --- a/tests/Zend/Service/WindowsAzure/Management/ManagementClientTest.php +++ b/tests/Zend/Service/WindowsAzure/Management/ManagementClientTest.php @@ -39,23 +39,19 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_WindowsAzure_Management_ManagementClientTest extends PHPUnit_Framework_TestCase +class Zend_Service_WindowsAzure_Management_ManagementClientTest extends PHPUnit\Framework\TestCase { static $path; static $debug = true; protected $packageUrl; protected $skipped; - public function __construct() - { - self::$path = dirname(__FILE__).'/_files/'; - } - /** * Test setup */ protected function setUp() { + self::$path = dirname(__FILE__).'/_files/'; $this->skipped = false; if (!TESTS_ZEND_SERVICE_WINDOWSAZURE_MANAGEMENT_RUNTESTS) { $this->skipped = true; diff --git a/tests/Zend/Service/WindowsAzure/QueueStorageTest.php b/tests/Zend/Service/WindowsAzure/QueueStorageTest.php index b35eb38bce..ff28b30fe4 100644 --- a/tests/Zend/Service/WindowsAzure/QueueStorageTest.php +++ b/tests/Zend/Service/WindowsAzure/QueueStorageTest.php @@ -37,7 +37,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_WindowsAzure_QueueStorageTest extends PHPUnit_Framework_TestCase +class Zend_Service_WindowsAzure_QueueStorageTest extends PHPUnit\Framework\TestCase { /** * Test setup diff --git a/tests/Zend/Service/WindowsAzure/RetryPolicyTest.php b/tests/Zend/Service/WindowsAzure/RetryPolicyTest.php index 825d5086bc..c2b61459a2 100644 --- a/tests/Zend/Service/WindowsAzure/RetryPolicyTest.php +++ b/tests/Zend/Service/WindowsAzure/RetryPolicyTest.php @@ -37,7 +37,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_WindowsAzure_RetryPolicyTest extends PHPUnit_Framework_TestCase +class Zend_Service_WindowsAzure_RetryPolicyTest extends PHPUnit\Framework\TestCase { /** * Helper variable for counting retries diff --git a/tests/Zend/Service/WindowsAzure/SessionHandlerTest.php b/tests/Zend/Service/WindowsAzure/SessionHandlerTest.php index 22dde0dbb8..c748ea3b21 100644 --- a/tests/Zend/Service/WindowsAzure/SessionHandlerTest.php +++ b/tests/Zend/Service/WindowsAzure/SessionHandlerTest.php @@ -34,15 +34,11 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_WindowsAzure_SessionHandlerTest extends PHPUnit_Framework_TestCase +class Zend_Service_WindowsAzure_SessionHandlerTest extends PHPUnit\Framework\TestCase { protected static $uniqId = 0; - public function __construct() - { - } - /** * Test setup */ @@ -58,7 +54,7 @@ protected function setUp() */ protected function tearDown() { - if ($this->status == PHPUnit_Runner_BaseTestRunner::STATUS_SKIPPED) { + if ($this->status == PHPUnit\Runner\BaseTestRunner::STATUS_SKIPPED) { return; } $storageClient = $this->createStorageInstance(); diff --git a/tests/Zend/Service/WindowsAzure/StorageTest.php b/tests/Zend/Service/WindowsAzure/StorageTest.php index a73fb9872f..6bad461b82 100644 --- a/tests/Zend/Service/WindowsAzure/StorageTest.php +++ b/tests/Zend/Service/WindowsAzure/StorageTest.php @@ -37,7 +37,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_WindowsAzure_StorageTest extends PHPUnit_Framework_TestCase +class Zend_Service_WindowsAzure_StorageTest extends PHPUnit\Framework\TestCase { /** * Test constructor for devstore diff --git a/tests/Zend/Service/WindowsAzure/TableEntityQueryTest.php b/tests/Zend/Service/WindowsAzure/TableEntityQueryTest.php index da4f3b2236..0e700598c8 100644 --- a/tests/Zend/Service/WindowsAzure/TableEntityQueryTest.php +++ b/tests/Zend/Service/WindowsAzure/TableEntityQueryTest.php @@ -37,7 +37,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_WindowsAzure_TableEntityQueryTest extends PHPUnit_Framework_TestCase +class Zend_Service_WindowsAzure_TableEntityQueryTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Service/WindowsAzure/TableEntityTest.php b/tests/Zend/Service/WindowsAzure/TableEntityTest.php index 2c1174e630..54d12bdb4d 100644 --- a/tests/Zend/Service/WindowsAzure/TableEntityTest.php +++ b/tests/Zend/Service/WindowsAzure/TableEntityTest.php @@ -37,7 +37,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_WindowsAzure_TableEntityTest extends PHPUnit_Framework_TestCase +class Zend_Service_WindowsAzure_TableEntityTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Service/WindowsAzure/TableSessionHandlerTest.php b/tests/Zend/Service/WindowsAzure/TableSessionHandlerTest.php index e4e8c1228f..8d3d94aa5c 100644 --- a/tests/Zend/Service/WindowsAzure/TableSessionHandlerTest.php +++ b/tests/Zend/Service/WindowsAzure/TableSessionHandlerTest.php @@ -40,12 +40,8 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_WindowsAzure_TableSessionHandlerTest extends PHPUnit_Framework_TestCase +class Zend_Service_WindowsAzure_TableSessionHandlerTest extends PHPUnit\Framework\TestCase { - public function __construct() - { - } - /** * Test setup */ diff --git a/tests/Zend/Service/WindowsAzure/TableStorageTest.php b/tests/Zend/Service/WindowsAzure/TableStorageTest.php index a3e96f652b..e8b38d5ebe 100644 --- a/tests/Zend/Service/WindowsAzure/TableStorageTest.php +++ b/tests/Zend/Service/WindowsAzure/TableStorageTest.php @@ -37,12 +37,8 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Service_WindowsAzure_TableStorageTest extends PHPUnit_Framework_TestCase +class Zend_Service_WindowsAzure_TableStorageTest extends PHPUnit\Framework\TestCase { - public function __construct() - { - } - /** * Test setup */ diff --git a/tests/Zend/Service/Yahoo/OfflineTest.php b/tests/Zend/Service/Yahoo/OfflineTest.php index 29da25675c..867216e381 100644 --- a/tests/Zend/Service/Yahoo/OfflineTest.php +++ b/tests/Zend/Service/Yahoo/OfflineTest.php @@ -54,7 +54,7 @@ * @group Zend_Service * @group Zend_Service_Yahoo */ -class Zend_Service_Yahoo_OfflineTest extends PHPUnit_Framework_TestCase +class Zend_Service_Yahoo_OfflineTest extends PHPUnit\Framework\TestCase { /** * Reference to Yahoo service consumer object diff --git a/tests/Zend/Service/Yahoo/OnlineTest.php b/tests/Zend/Service/Yahoo/OnlineTest.php index a52ac1c19f..8cca4d2539 100644 --- a/tests/Zend/Service/Yahoo/OnlineTest.php +++ b/tests/Zend/Service/Yahoo/OnlineTest.php @@ -39,7 +39,7 @@ * @group Zend_Service * @group Zend_Service_Yahoo */ -class Zend_Service_Yahoo_OnlineTest extends PHPUnit_Framework_TestCase +class Zend_Service_Yahoo_OnlineTest extends PHPUnit\Framework\TestCase { /** * Reference to Yahoo service consumer object diff --git a/tests/Zend/Session/SaveHandler/DbTableTest.php b/tests/Zend/Session/SaveHandler/DbTableTest.php index ad391f7480..139669b97e 100644 --- a/tests/Zend/Session/SaveHandler/DbTableTest.php +++ b/tests/Zend/Session/SaveHandler/DbTableTest.php @@ -37,7 +37,7 @@ * @group Zend_Session * @group Zend_Db_Table */ -class Zend_Session_SaveHandler_DbTableTest extends PHPUnit_Framework_TestCase +class Zend_Session_SaveHandler_DbTableTest extends PHPUnit\Framework\TestCase { /** * @var array @@ -149,7 +149,7 @@ public function testTableEmptyNamePullFromSavePath() public function testPrimaryAssignmentIdNotSet() { - $this->setExpectedException('Zend_Session_SaveHandler_Exception'); + $this->expectException('Zend_Session_SaveHandler_Exception'); $config = $this->_saveHandlerTableConfig; $config['primary'] = array('id'); $config[Zend_Session_SaveHandler_DbTable::PRIMARY_ASSIGNMENT] @@ -176,7 +176,7 @@ public function testPrimaryAssignmentNotArray() public function testModifiedColumnNotSet() { - $this->setExpectedException('Zend_Session_SaveHandler_Exception'); + $this->expectException('Zend_Session_SaveHandler_Exception'); $config = $this->_saveHandlerTableConfig; unset($config[Zend_Session_SaveHandler_DbTable::MODIFIED_COLUMN]); $this->_usedSaveHandlers[] = @@ -188,7 +188,7 @@ public function testModifiedColumnNotSet() public function testLifetimeColumnNotSet() { - $this->setExpectedException('Zend_Session_SaveHandler_Exception'); + $this->expectException('Zend_Session_SaveHandler_Exception'); $config = $this->_saveHandlerTableConfig; unset($config[Zend_Session_SaveHandler_DbTable::LIFETIME_COLUMN]); $this->_usedSaveHandlers[] = @@ -200,7 +200,7 @@ public function testLifetimeColumnNotSet() public function testDataColumnNotSet() { - $this->setExpectedException('Zend_Session_SaveHandler_Exception'); + $this->expectException('Zend_Session_SaveHandler_Exception'); $config = $this->_saveHandlerTableConfig; unset($config[Zend_Session_SaveHandler_DbTable::DATA_COLUMN]); $this->_usedSaveHandlers[] = diff --git a/tests/Zend/Session/SessionTest.php b/tests/Zend/Session/SessionTest.php index 1b1f194609..f71cb3bd60 100644 --- a/tests/Zend/Session/SessionTest.php +++ b/tests/Zend/Session/SessionTest.php @@ -36,7 +36,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Session */ -class Zend_SessionTest extends PHPUnit_Framework_TestCase +class Zend_SessionTest extends PHPUnit\Framework\TestCase { /** * Helper script invoked via exec() @@ -665,7 +665,7 @@ public function testUnsetAll() foreach ($s->getIterator() as $key => $val) { $result .= "$key === $val;"; } - $this->assertTrue(empty($result), "tearDown failure, found keys in default namespace: '$result'"); + $this->assertEmpty($result, "tearDown failure, found keys in default namespace: '$result'"); $s->a = 'apple'; $s->lock(); $s->unlock(); @@ -683,7 +683,7 @@ public function testUnsetAll() foreach ($s->getIterator() as $key => $val) { $result .= "$key === $val;"; } - $this->assertTrue(empty($result), "unsetAll() did not remove keys from namespace: '$result'"); + $this->assertEmpty($result, "unsetAll() did not remove keys from namespace: '$result'"); } /** @@ -698,7 +698,7 @@ public function testUnset() foreach ($s->getIterator() as $key => $val) { $result .= "$key === $val;"; } - $this->assertTrue(empty($result), "tearDown failure, found keys in default namespace: '$result'"); + $this->assertEmpty($result, "tearDown failure, found keys in default namespace: '$result'"); $s->a = 'apple'; $s->lock(); $s->unlock(); @@ -712,7 +712,7 @@ public function testUnset() foreach ($s->getIterator() as $key => $val) { $result .= "$key === $val;"; } - $this->assertTrue(empty($result), "unsetAll() did not remove keys from namespace: '$result'"); + $this->assertEmpty($result, "unsetAll() did not remove keys from namespace: '$result'"); } @@ -728,7 +728,7 @@ public function testUnsetNamespace() foreach ($s->getIterator() as $key => $val) { $result .= "$key === $val;"; } - $this->assertTrue(empty($result), "tearDown failure, found keys in default namespace: '$result'"); + $this->assertEmpty($result, "tearDown failure, found keys in default namespace: '$result'"); $s->a = 'apple'; $s->lock(); $s->unlock(); @@ -742,7 +742,7 @@ public function testUnsetNamespace() foreach ($s->getIterator() as $key => $val) { $result .= "$key === $val;"; } - $this->assertTrue(empty($result), "unsetAll() did not remove keys from namespace: '$result'"); + $this->assertEmpty($result, "unsetAll() did not remove keys from namespace: '$result'"); } /** @@ -757,7 +757,7 @@ public function testUnsetAllNamespace() foreach ($s->getIterator() as $key => $val) { $result .= "$key === $val;"; } - $this->assertTrue(empty($result), "tearDown failure, found keys in 'somenamespace' namespace: '$result'"); + $this->assertEmpty($result, "tearDown failure, found keys in 'somenamespace' namespace: '$result'"); $s->a = 'apple'; $s->lock(); $s->unlock(); @@ -775,7 +775,7 @@ public function testUnsetAllNamespace() foreach ($s->getIterator() as $key => $val) { $result .= "$key === $val;"; } - $this->assertTrue(empty($result), "unsetAll() did not remove keys from namespace: '$result'"); + $this->assertEmpty($result, "unsetAll() did not remove keys from namespace: '$result'"); } /** @@ -1068,7 +1068,7 @@ public function testNoNoticesIfNoValidatorDataInSession() Zend_Session::start(); require_once dirname(__FILE__) . '/Validator/NoticeValidator.php'; Zend_Session::registerValidator(new Zend_Session_Validator_NoticeValidator); - } catch (PHPUnit_Framework_Error_Notice $exception) { + } catch (PHPUnit\Framework\Error\Notice $exception) { $this->fail($exception->getMessage()); } } diff --git a/tests/Zend/Soap/AutoDiscover/OnlineTest.php b/tests/Zend/Soap/AutoDiscover/OnlineTest.php index ade177d766..aaf9c8a607 100644 --- a/tests/Zend/Soap/AutoDiscover/OnlineTest.php +++ b/tests/Zend/Soap/AutoDiscover/OnlineTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Soap */ -class Zend_Soap_AutoDiscover_OnlineTest extends PHPUnit_Framework_TestCase +class Zend_Soap_AutoDiscover_OnlineTest extends PHPUnit\Framework\TestCase { protected $baseuri; @@ -56,9 +56,9 @@ public function testNestedObjectArrayResponse() $client = new Zend_Soap_Client($wsdl); $ret = $client->request($b); - $this->assertTrue( is_array($ret) ); + $this->assertInternalType( 'array', $ret ); $this->assertEquals(1, count($ret) ); - $this->assertTrue( is_array($ret[0]->baz) ); + $this->assertInternalType( 'array', $ret[0]->baz ); $this->assertEquals(3, count($ret[0]->baz) ); $baz = $ret[0]->baz; diff --git a/tests/Zend/Soap/AutoDiscoverTest.php b/tests/Zend/Soap/AutoDiscoverTest.php index cbb8737678..64ccbabd60 100644 --- a/tests/Zend/Soap/AutoDiscoverTest.php +++ b/tests/Zend/Soap/AutoDiscoverTest.php @@ -42,7 +42,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Soap */ -class Zend_Soap_AutoDiscoverTest extends PHPUnit_Framework_TestCase +class Zend_Soap_AutoDiscoverTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Soap/ClientTest.php b/tests/Zend/Soap/ClientTest.php index da2c24b061..217f2a395c 100644 --- a/tests/Zend/Soap/ClientTest.php +++ b/tests/Zend/Soap/ClientTest.php @@ -36,7 +36,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Soap */ -class Zend_Soap_ClientTest extends PHPUnit_Framework_TestCase +class Zend_Soap_ClientTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Soap/ServerTest.php b/tests/Zend/Soap/ServerTest.php index 06b9fe8bf6..6d23ce9492 100644 --- a/tests/Zend/Soap/ServerTest.php +++ b/tests/Zend/Soap/ServerTest.php @@ -41,7 +41,7 @@ * @group Zend_Soap * @group Zend_Soap_Server */ -class Zend_Soap_ServerTest extends PHPUnit_Framework_TestCase +class Zend_Soap_ServerTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -978,7 +978,7 @@ public function testHandleUsesProperRequestParameter() { $server = new Zend_Soap_MockServer(); $r = $server->handle(new DomDocument('1.0', 'UTF-8')); - $this->assertTrue(is_string($server->mockSoapServer->handle[0])); + $this->assertInternalType('string', $server->mockSoapServer->handle[0]); } /** diff --git a/tests/Zend/Soap/Wsdl/ArrayOfTypeComplexStrategyTest.php b/tests/Zend/Soap/Wsdl/ArrayOfTypeComplexStrategyTest.php index c42dc55b57..9e6a9bd177 100644 --- a/tests/Zend/Soap/Wsdl/ArrayOfTypeComplexStrategyTest.php +++ b/tests/Zend/Soap/Wsdl/ArrayOfTypeComplexStrategyTest.php @@ -37,7 +37,7 @@ * @group Zend_Soap * @group Zend_Soap_Wsdl */ -class Zend_Soap_Wsdl_ArrayOfTypeComplexStrategyTest extends PHPUnit_Framework_TestCase +class Zend_Soap_Wsdl_ArrayOfTypeComplexStrategyTest extends PHPUnit\Framework\TestCase { private $wsdl; private $strategy; diff --git a/tests/Zend/Soap/Wsdl/ArrayOfTypeSequenceStrategyTest.php b/tests/Zend/Soap/Wsdl/ArrayOfTypeSequenceStrategyTest.php index 49ad39b558..5ed6928980 100644 --- a/tests/Zend/Soap/Wsdl/ArrayOfTypeSequenceStrategyTest.php +++ b/tests/Zend/Soap/Wsdl/ArrayOfTypeSequenceStrategyTest.php @@ -38,7 +38,7 @@ * @group Zend_Soap * @group Zend_Soap_Wsdl */ -class Zend_Soap_Wsdl_ArrayOfTypeSequenceStrategyTest extends PHPUnit_Framework_TestCase +class Zend_Soap_Wsdl_ArrayOfTypeSequenceStrategyTest extends PHPUnit\Framework\TestCase { private $wsdl; private $strategy; @@ -153,7 +153,7 @@ public function testAddComplexTypeArrayOfObject() public function testAddComplexTypeOfNonExistingClassThrowsException() { - $this->setExpectedException("Zend_Soap_Wsdl_Exception"); + $this->expectException("Zend_Soap_Wsdl_Exception"); $this->wsdl->addComplexType('Zend_Soap_Wsdl_UnknownClass[]'); } diff --git a/tests/Zend/Soap/Wsdl/CompositeStrategyTest.php b/tests/Zend/Soap/Wsdl/CompositeStrategyTest.php index e7f91b9dbf..d5cf3da0e3 100644 --- a/tests/Zend/Soap/Wsdl/CompositeStrategyTest.php +++ b/tests/Zend/Soap/Wsdl/CompositeStrategyTest.php @@ -43,7 +43,7 @@ * @group Zend_Soap * @group Zend_Soap_Wsdl */ -class Zend_Soap_Wsdl_CompositeStrategyTest extends PHPUnit_Framework_TestCase +class Zend_Soap_Wsdl_CompositeStrategyTest extends PHPUnit\Framework\TestCase { public function testCompositeApiAddingStragiesToTypes() { diff --git a/tests/Zend/Soap/Wsdl/DefaultComplexTypeTest.php b/tests/Zend/Soap/Wsdl/DefaultComplexTypeTest.php index 49b26d508f..81c6501a42 100644 --- a/tests/Zend/Soap/Wsdl/DefaultComplexTypeTest.php +++ b/tests/Zend/Soap/Wsdl/DefaultComplexTypeTest.php @@ -32,7 +32,7 @@ * @group Zend_Soap * @group Zend_Soap_Wsdl */ -class Zend_Soap_Wsdl_DefaultComplexTypeTest extends PHPUnit_Framework_TestCase +class Zend_Soap_Wsdl_DefaultComplexTypeTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Soap_Wsdl diff --git a/tests/Zend/Soap/WsdlTest.php b/tests/Zend/Soap/WsdlTest.php index 25ca1e1d34..6f1e76e917 100644 --- a/tests/Zend/Soap/WsdlTest.php +++ b/tests/Zend/Soap/WsdlTest.php @@ -40,7 +40,7 @@ * @group Zend_Soap * @group Zend_Soap_Wsdl */ -class Zend_Soap_WsdlTest extends PHPUnit_Framework_TestCase +class Zend_Soap_WsdlTest extends PHPUnit\Framework\TestCase { protected function sanitizeWsdlXmlOutputForOsCompability($xmlstring) { diff --git a/tests/Zend/Stdlib/CallbackHandlerTest.php b/tests/Zend/Stdlib/CallbackHandlerTest.php index 45e3aeca42..8b185c544b 100644 --- a/tests/Zend/Stdlib/CallbackHandlerTest.php +++ b/tests/Zend/Stdlib/CallbackHandlerTest.php @@ -33,7 +33,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Stdlib_CallbackHandlerTest extends PHPUnit_Framework_TestCase +class Zend_Stdlib_CallbackHandlerTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -72,7 +72,7 @@ public function testCallShouldInvokeCallbackWithSuppliedArguments() public function testPassingInvalidCallbackShouldRaiseInvalidCallbackExceptionDuringInstantiation() { - $this->setExpectedException('Zend_Stdlib_Exception_InvalidCallbackException'); + $this->expectException('Zend_Stdlib_Exception_InvalidCallbackException'); $handler = new Zend_Stdlib_CallbackHandler('boguscallback'); } @@ -88,13 +88,13 @@ public function testCallShouldReturnTheReturnValueOfTheCallback() public function testStringCallbackResolvingToClassDefiningInvokeNameShouldRaiseException() { - $this->setExpectedException('Zend_Stdlib_Exception_InvalidCallbackException'); + $this->expectException('Zend_Stdlib_Exception_InvalidCallbackException'); $handler = new Zend_Stdlib_CallbackHandler('Zend_Stdlib_TestAsset_SignalHandlers_Invokable'); } public function testStringCallbackReferringToClassWithoutDefinedInvokeShouldRaiseException() { - $this->setExpectedException('Zend_Stdlib_Exception_InvalidCallbackException'); + $this->expectException('Zend_Stdlib_Exception_InvalidCallbackException'); $class = new Zend_Stdlib_TestAsset_SignalHandlers_InstanceMethod(); $handler = new Zend_Stdlib_CallbackHandler($class); } @@ -109,7 +109,7 @@ public function testCallbackConsistingOfStringContextWithNonStaticMethodShouldRa if (version_compare(PHP_VERSION, '5.3.0', '>=')) { $this->markTestSkipped('Behavior of is_callable changes between 5.2 and 5.3'); } - $this->setExpectedException('Zend_Stdlib_Exception_InvalidCallbackException'); + $this->expectException('Zend_Stdlib_Exception_InvalidCallbackException'); $handler = new Zend_Stdlib_CallbackHandler(array('Zend_Stdlib_TestAsset_SignalHandlers_InstanceMethod', 'handler')); } @@ -118,13 +118,13 @@ public function testStringCallbackConsistingOfNonStaticMethodShouldRaiseExceptio if (version_compare(PHP_VERSION, '5.3.0', '>=')) { $this->markTestSkipped('Behavior of is_callable changes between 5.2 and 5.3'); } - $this->setExpectedException('Zend_Stdlib_Exception_InvalidCallbackException'); + $this->expectException('Zend_Stdlib_Exception_InvalidCallbackException'); $handler = new Zend_Stdlib_CallbackHandler('Zend_Stdlib_TestAsset_SignalHandlers_InstanceMethod::handler'); } public function testCallbackToClassImplementingOverloadingButNotInvocableShouldRaiseException() { - $this->setExpectedException('Zend_Stdlib_Exception_InvalidCallbackException'); + $this->expectException('Zend_Stdlib_Exception_InvalidCallbackException'); $handler = new Zend_Stdlib_CallbackHandler('foo', array( 'Zend_Stdlib_TestAsset_SignalHandlers_Overloadable', 'foo' )); } diff --git a/tests/Zend/Stdlib/PriorityQueueTest.php b/tests/Zend/Stdlib/PriorityQueueTest.php index aa69cbdbe4..9dc65e2856 100644 --- a/tests/Zend/Stdlib/PriorityQueueTest.php +++ b/tests/Zend/Stdlib/PriorityQueueTest.php @@ -29,7 +29,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Stdlib_PriorityQueueTest extends PHPUnit_Framework_TestCase +class Zend_Stdlib_PriorityQueueTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Stdlib/SplPriorityQueueTest.php b/tests/Zend/Stdlib/SplPriorityQueueTest.php index aa4e74a79c..ceae783e9d 100644 --- a/tests/Zend/Stdlib/SplPriorityQueueTest.php +++ b/tests/Zend/Stdlib/SplPriorityQueueTest.php @@ -30,7 +30,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Stdlib_SplPriorityQueueTest extends PHPUnit_Framework_TestCase +class Zend_Stdlib_SplPriorityQueueTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/Tag/Cloud/CloudTest.php b/tests/Zend/Tag/Cloud/CloudTest.php index cf46664cc8..9db9c7ec6a 100644 --- a/tests/Zend/Tag/Cloud/CloudTest.php +++ b/tests/Zend/Tag/Cloud/CloudTest.php @@ -36,7 +36,7 @@ * @group Zend_Tag * @group Zend_Tag_Cloud */ -class Zend_Tag_Cloud_CloudTest extends PHPUnit_Framework_TestCase +class Zend_Tag_Cloud_CloudTest extends PHPUnit\Framework\TestCase { public function testGetAndSetItemList() { diff --git a/tests/Zend/Tag/Cloud/Decorator/HtmlCloudTest.php b/tests/Zend/Tag/Cloud/Decorator/HtmlCloudTest.php index 0f7bfea797..ebb1d9fbf9 100644 --- a/tests/Zend/Tag/Cloud/Decorator/HtmlCloudTest.php +++ b/tests/Zend/Tag/Cloud/Decorator/HtmlCloudTest.php @@ -32,7 +32,7 @@ * @group Zend_Tag * @group Zend_Tag_Cloud */ -class Zend_Tag_Cloud_Decorator_HtmlCloudTest extends PHPUnit_Framework_TestCase +class Zend_Tag_Cloud_Decorator_HtmlCloudTest extends PHPUnit\Framework\TestCase { public function testDefaultOutput() { diff --git a/tests/Zend/Tag/Cloud/Decorator/HtmlTagTest.php b/tests/Zend/Tag/Cloud/Decorator/HtmlTagTest.php index 15c918626b..10fa33e9c5 100644 --- a/tests/Zend/Tag/Cloud/Decorator/HtmlTagTest.php +++ b/tests/Zend/Tag/Cloud/Decorator/HtmlTagTest.php @@ -34,7 +34,7 @@ * @group Zend_Tag * @group Zend_Tag_Cloud */ -class Zend_Tag_Cloud_Decorator_HtmlTagTest extends PHPUnit_Framework_TestCase +class Zend_Tag_Cloud_Decorator_HtmlTagTest extends PHPUnit\Framework\TestCase { public function testDefaultOutput() { diff --git a/tests/Zend/Tag/ItemListTest.php b/tests/Zend/Tag/ItemListTest.php index 0485918dc7..9409170be7 100644 --- a/tests/Zend/Tag/ItemListTest.php +++ b/tests/Zend/Tag/ItemListTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Tag */ -class Zend_Tag_ItemListTest extends PHPUnit_Framework_TestCase +class Zend_Tag_ItemListTest extends PHPUnit\Framework\TestCase { public function testArrayAccessAndCount() { diff --git a/tests/Zend/Tag/ItemTest.php b/tests/Zend/Tag/ItemTest.php index 06b291d6cb..046e8bfce6 100644 --- a/tests/Zend/Tag/ItemTest.php +++ b/tests/Zend/Tag/ItemTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Tag */ -class Zend_Tag_ItemTest extends PHPUnit_Framework_TestCase +class Zend_Tag_ItemTest extends PHPUnit\Framework\TestCase { public function testConstuctor() { @@ -96,7 +96,7 @@ public function testSetWeight() $tag->setWeight('10'); $this->assertEquals(10.0, $tag->getWeight()); - $this->assertTrue(is_float($tag->getWeight())); + $this->assertInternalType('float', $tag->getWeight()); } public function testInvalidWeight() diff --git a/tests/Zend/Test/DbAdapterTest.php b/tests/Zend/Test/DbAdapterTest.php index b770e9a191..beb1869f77 100644 --- a/tests/Zend/Test/DbAdapterTest.php +++ b/tests/Zend/Test/DbAdapterTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Test */ -class Zend_Test_DbAdapterTest extends PHPUnit_Framework_TestCase +class Zend_Test_DbAdapterTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Test_DbAdapter diff --git a/tests/Zend/Test/DbStatementTest.php b/tests/Zend/Test/DbStatementTest.php index 7162a454a4..d4d4723385 100644 --- a/tests/Zend/Test/DbStatementTest.php +++ b/tests/Zend/Test/DbStatementTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Test */ -class Zend_Test_DbStatementTest extends PHPUnit_Framework_TestCase +class Zend_Test_DbStatementTest extends PHPUnit\Framework\TestCase { public function testRowCountDefault() { @@ -127,7 +127,7 @@ public function testFetchColumn() public function testFetchColumn_OutOfBounds() { - $this->setExpectedException("Zend_Db_Statement_Exception"); + $this->expectException("Zend_Db_Statement_Exception"); $row = array("foo" => "bar", "bar" => "baz"); @@ -152,7 +152,7 @@ public function testFetchObject() public function testFetchObject_ClassNotExists_ThrowsException() { - $this->setExpectedException("Zend_Db_Statement_Exception"); + $this->expectException("Zend_Db_Statement_Exception"); $row = array("foo" => "bar", "bar" => "baz"); diff --git a/tests/Zend/Test/PHPUnit/Constraint/DomQueryTest.php b/tests/Zend/Test/PHPUnit/Constraint/DomQueryTest.php index 993fa84986..d3b9b9e425 100644 --- a/tests/Zend/Test/PHPUnit/Constraint/DomQueryTest.php +++ b/tests/Zend/Test/PHPUnit/Constraint/DomQueryTest.php @@ -34,7 +34,7 @@ * @group Zend_Test * @group Zend_Test_PHPUnit */ -class Zend_Test_PHPUnit_Constraint_DomQueryTest extends PHPUnit_Framework_TestCase +class Zend_Test_PHPUnit_Constraint_DomQueryTest extends PHPUnit\Framework\TestCase { /** * @group ZF-4010 diff --git a/tests/Zend/Test/PHPUnit/ControllerTestCaseTest.php b/tests/Zend/Test/PHPUnit/ControllerTestCaseTest.php index b6ed014d7b..0e875c3faf 100644 --- a/tests/Zend/Test/PHPUnit/ControllerTestCaseTest.php +++ b/tests/Zend/Test/PHPUnit/ControllerTestCaseTest.php @@ -43,7 +43,7 @@ * @group Zend_Test * @group Zend_Test_PHPUnit */ -class Zend_Test_PHPUnit_ControllerTestCaseTest extends PHPUnit_Framework_TestCase +class Zend_Test_PHPUnit_ControllerTestCaseTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -54,7 +54,6 @@ class Zend_Test_PHPUnit_ControllerTestCaseTest extends PHPUnit_Framework_TestCas public function setUp() { $_SESSION = array(); - $this->setExpectedException(null); $this->testCase = new Zend_Test_PHPUnit_ControllerTestCaseTest_Concrete(); $this->testCase->reset(); $this->testCase->bootstrap = array($this, 'bootstrap'); @@ -532,7 +531,7 @@ public function testModuleAssertionShouldThrowExceptionForInvalidComparison() { $this->testCase->getFrontController()->setControllerDirectory(dirname(__FILE__) . '/_files/application/controllers'); $this->testCase->dispatch('/zend-test-php-unit-foo/baz'); - $this->setExpectedException('PHPUnit_Framework_AssertionFailedError'); + $this->expectException('PHPUnit\Framework\AssertionFailedError'); $this->testCase->assertModule('zend-test-php-unit-foo'); $this->testCase->assertNotModule('default'); } @@ -549,7 +548,7 @@ public function testControllerAssertionShouldThrowExceptionForInvalidComparison( { $this->testCase->getFrontController()->setControllerDirectory(dirname(__FILE__) . '/_files/application/controllers'); $this->testCase->dispatch('/zend-test-php-unit-foo/baz'); - $this->setExpectedException('PHPUnit_Framework_AssertionFailedError'); + $this->expectException('PHPUnit\Framework\AssertionFailedError'); $this->testCase->assertController('baz'); $this->testCase->assertNotController('zend-test-php-unit-foo'); } @@ -566,7 +565,7 @@ public function testActionAssertionShouldThrowExceptionForInvalidComparison() { $this->testCase->getFrontController()->setControllerDirectory(dirname(__FILE__) . '/_files/application/controllers'); $this->testCase->dispatch('/foo/baz'); - $this->setExpectedException('PHPUnit_Framework_AssertionFailedError'); + $this->expectException('PHPUnit\Framework\AssertionFailedError'); $this->testCase->assertAction('foo'); $this->testCase->assertNotAction('baz'); } @@ -583,18 +582,18 @@ public function testRouteAssertionShouldThrowExceptionForInvalidComparison() { $this->testCase->getFrontController()->setControllerDirectory(dirname(__FILE__) . '/_files/application/controllers'); $this->testCase->dispatch('/foo/baz'); - $this->setExpectedException('PHPUnit_Framework_AssertionFailedError'); + $this->expectException('PHPUnit\Framework\AssertionFailedError'); $this->testCase->assertRoute('foo'); $this->testCase->assertNotRoute('default'); } public function testResetShouldResetSessionArray() { - $this->assertTrue(empty($_SESSION)); + $this->assertEmpty($_SESSION); $_SESSION = array('foo' => 'bar', 'bar' => 'baz'); $this->assertEquals(array('foo' => 'bar', 'bar' => 'baz'), $_SESSION, var_export($_SESSION, 1)); $this->testCase->reset(); - $this->assertTrue(empty($_SESSION)); + $this->assertEmpty($_SESSION); } public function testResetShouldUnitTestEnableZendSession() @@ -717,8 +716,8 @@ public function testResetRequestShouldClearPostAndQueryParameters() )); $this->testCase->dispatch('/zend-test-php-unit-foo/baz'); $this->testCase->resetRequest(); - $this->assertTrue(empty($_POST)); - $this->assertTrue(empty($_GET)); + $this->assertEmpty($_POST); + $this->assertEmpty($_GET); } /** diff --git a/tests/Zend/Test/PHPUnit/Db/ConnectionTest.php b/tests/Zend/Test/PHPUnit/Db/ConnectionTest.php index 49bafee0c5..ba8b179df8 100644 --- a/tests/Zend/Test/PHPUnit/Db/ConnectionTest.php +++ b/tests/Zend/Test/PHPUnit/Db/ConnectionTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Test */ -class Zend_Test_PHPUnit_Db_ConnectionTest extends PHPUnit_Framework_TestCase +class Zend_Test_PHPUnit_Db_ConnectionTest extends PHPUnit\Framework\TestCase { protected $adapterMock; diff --git a/tests/Zend/Test/PHPUnit/Db/DataSet/DataSetTestCase.php b/tests/Zend/Test/PHPUnit/Db/DataSet/DataSetTestCase.php index 14b4360480..9d00e27160 100644 --- a/tests/Zend/Test/PHPUnit/Db/DataSet/DataSetTestCase.php +++ b/tests/Zend/Test/PHPUnit/Db/DataSet/DataSetTestCase.php @@ -30,10 +30,10 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Test */ -abstract class Zend_Test_PHPUnit_Db_DataSet_DataSetTestCase extends PHPUnit_Framework_TestCase +abstract class Zend_Test_PHPUnit_Db_DataSet_DataSetTestCase extends PHPUnit\Framework\TestCase { /** - * @var PHPUnit_Extensions_Database_DB_IDatabaseConnection + * @var PHPUnit\DbUnit\Database\Connection */ protected $connectionMock = null; diff --git a/tests/Zend/Test/PHPUnit/Db/DataSet/DbRowsetTest.php b/tests/Zend/Test/PHPUnit/Db/DataSet/DbRowsetTest.php index 91933437c5..49d1ca7be5 100644 --- a/tests/Zend/Test/PHPUnit/Db/DataSet/DbRowsetTest.php +++ b/tests/Zend/Test/PHPUnit/Db/DataSet/DbRowsetTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Test */ -class Zend_Test_PHPUnit_Db_DataSet_DbRowsetTest extends PHPUnit_Framework_TestCase +class Zend_Test_PHPUnit_Db_DataSet_DbRowsetTest extends PHPUnit\Framework\TestCase { protected function getRowSet() { @@ -65,7 +65,7 @@ public function testRowsetGetSpecificRow() public function testRowset_ConstructWithDisconnectedRowset_NoTableName_ThrowsException() { - $this->setExpectedException("Zend_Test_PHPUnit_Db_Exception"); + $this->expectException("Zend_Test_PHPUnit_Db_Exception"); $rowset = $this->getMockBuilder('Zend_Db_Table_Rowset_Abstract') ->disableOriginalConstructor() diff --git a/tests/Zend/Test/PHPUnit/Db/DataSet/DbTableDataSetTest.php b/tests/Zend/Test/PHPUnit/Db/DataSet/DbTableDataSetTest.php index 216ed65813..8446f1c235 100644 --- a/tests/Zend/Test/PHPUnit/Db/DataSet/DbTableDataSetTest.php +++ b/tests/Zend/Test/PHPUnit/Db/DataSet/DbTableDataSetTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Test */ -class Zend_Test_PHPUnit_Db_DataSet_DbTableDataSetTest extends PHPUnit_Framework_TestCase +class Zend_Test_PHPUnit_Db_DataSet_DbTableDataSetTest extends PHPUnit\Framework\TestCase { public function testAddTableAppendedToTableNames() { @@ -69,7 +69,7 @@ public function testAddTableCreatesDbTableInstance() public function testGetUnknownTableThrowsException() { - $this->setExpectedException('InvalidArgumentException'); + $this->expectException('InvalidArgumentException'); $dataSet = new Zend_Test_PHPUnit_Db_DataSet_DbTableDataSet(); $dataSet->getTable('unknown'); } diff --git a/tests/Zend/Test/PHPUnit/Db/DataSet/DbTableTest.php b/tests/Zend/Test/PHPUnit/Db/DataSet/DbTableTest.php index 637e7b580f..f8e65d212a 100644 --- a/tests/Zend/Test/PHPUnit/Db/DataSet/DbTableTest.php +++ b/tests/Zend/Test/PHPUnit/Db/DataSet/DbTableTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Test */ -class Zend_Test_PHPUnit_Db_DataSet_DbTableTest extends PHPUnit_Framework_TestCase +class Zend_Test_PHPUnit_Db_DataSet_DbTableTest extends PHPUnit\Framework\TestCase { public function testLoadDataSetDelegatesWhereLimitOrderBy() { diff --git a/tests/Zend/Test/PHPUnit/Db/DataSet/QueryDataSetTest.php b/tests/Zend/Test/PHPUnit/Db/DataSet/QueryDataSetTest.php index 6fe175b14c..7191739130 100644 --- a/tests/Zend/Test/PHPUnit/Db/DataSet/QueryDataSetTest.php +++ b/tests/Zend/Test/PHPUnit/Db/DataSet/QueryDataSetTest.php @@ -46,8 +46,8 @@ class Zend_Test_PHPUnit_Db_DataSet_QueryDataSetTest extends Zend_Test_PHPUnit_Db { public function testCreateQueryDataSetWithoutZendDbAdapterThrowsException() { - $connectionMock = $this->getMockBuilder('PHPUnit_Extensions_Database_DB_IDatabaseConnection')->getMock(); - $this->setExpectedException('Zend_Test_PHPUnit_Db_Exception'); + $connectionMock = $this->getMockBuilder('PHPUnit\DbUnit\Database\Connection')->getMock(); + $this->expectException('Zend_Test_PHPUnit_Db_Exception'); $queryDataSet = new Zend_Test_PHPUnit_Db_DataSet_QueryDataSet($connectionMock); } diff --git a/tests/Zend/Test/PHPUnit/Db/DataSet/QueryTableTest.php b/tests/Zend/Test/PHPUnit/Db/DataSet/QueryTableTest.php index cc0bd5354a..9060ad1c2a 100644 --- a/tests/Zend/Test/PHPUnit/Db/DataSet/QueryTableTest.php +++ b/tests/Zend/Test/PHPUnit/Db/DataSet/QueryTableTest.php @@ -43,9 +43,9 @@ class Zend_Test_PHPUnit_Db_DataSet_QueryTableTest extends Zend_Test_PHPUnit_Db_D { public function testCreateQueryTableWithoutZendDbConnectionThrowsException() { - $connectionMock = $this->getMockBuilder('PHPUnit_Extensions_Database_DB_IDatabaseConnection')->getMock(); + $connectionMock = $this->getMockBuilder('PHPUnit\DbUnit\Database\Connection')->getMock(); - $this->setExpectedException('Zend_Test_PHPUnit_Db_Exception'); + $this->expectException('Zend_Test_PHPUnit_Db_Exception'); $queryTable = new Zend_Test_PHPUnit_Db_DataSet_QueryTable("foo", "SELECT * FROM foo", $connectionMock); } @@ -118,7 +118,7 @@ public function testQueryTableWithoutRows() $queryTable = new Zend_Test_PHPUnit_Db_DataSet_QueryTable("foo", null, $this->connectionMock); $metadata = $queryTable->getTableMetaData(); - $this->assertTrue($metadata instanceof PHPUnit_Extensions_Database_DataSet_ITableMetaData); + $this->assertTrue($metadata instanceof PHPUnit\DbUnit\DataSet\ITableMetaData); $this->assertEquals(array(), $metadata->getColumns()); $this->assertEquals(array(), $metadata->getPrimaryKeys()); $this->assertEquals("foo", $metadata->getTableName()); diff --git a/tests/Zend/Test/PHPUnit/Db/Integration/AbstractTestCase.php b/tests/Zend/Test/PHPUnit/Db/Integration/AbstractTestCase.php index c7508d8306..120bffc23d 100644 --- a/tests/Zend/Test/PHPUnit/Db/Integration/AbstractTestCase.php +++ b/tests/Zend/Test/PHPUnit/Db/Integration/AbstractTestCase.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Test */ -abstract class Zend_Test_PHPUnit_Db_Integration_AbstractTestCase extends PHPUnit_Framework_TestCase +abstract class Zend_Test_PHPUnit_Db_Integration_AbstractTestCase extends PHPUnit\Framework\TestCase { /** * @var Zend_Db_Adapter_Abstract @@ -71,7 +71,7 @@ public function testZendDbTableEqualsXmlDataSet() $dataSet = new Zend_Test_PHPUnit_Db_DataSet_DbTableDataSet(); $dataSet->addTable($fooTable); - $xmlDataSet = new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet( + $xmlDataSet = new PHPUnit\DbUnit\DataSet\FlatXmlDataSet( dirname(__FILE__)."/_files/sqliteIntegrationFixture.xml" ); @@ -92,7 +92,7 @@ public function getConnection() public function testSimpleTesterSetupAndRowsetEquals() { - $dataSet = new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet( + $dataSet = new PHPUnit\DbUnit\DataSet\FlatXmlDataSet( dirname(__FILE__)."/_files/sqliteIntegrationFixture.xml" ); $fooDataTable = $dataSet->getTable("foo"); diff --git a/tests/Zend/Test/PHPUnit/Db/Metadata/GenericTest.php b/tests/Zend/Test/PHPUnit/Db/Metadata/GenericTest.php index 38f88d0f1b..1c250da147 100644 --- a/tests/Zend/Test/PHPUnit/Db/Metadata/GenericTest.php +++ b/tests/Zend/Test/PHPUnit/Db/Metadata/GenericTest.php @@ -31,7 +31,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Test */ -class Zend_Test_PHPUnit_Db_Metadata_GenericTest extends PHPUnit_Framework_TestCase +class Zend_Test_PHPUnit_Db_Metadata_GenericTest extends PHPUnit\Framework\TestCase { private $adapterMock = null; diff --git a/tests/Zend/Test/PHPUnit/Db/Operation/DeleteAllTest.php b/tests/Zend/Test/PHPUnit/Db/Operation/DeleteAllTest.php index d22e2c88ae..67e0735a89 100644 --- a/tests/Zend/Test/PHPUnit/Db/Operation/DeleteAllTest.php +++ b/tests/Zend/Test/PHPUnit/Db/Operation/DeleteAllTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Test */ -class Zend_Test_PHPUnit_Db_Operation_DeleteAllTest extends PHPUnit_Framework_TestCase +class Zend_Test_PHPUnit_Db_Operation_DeleteAllTest extends PHPUnit\Framework\TestCase { private $operation = null; @@ -43,7 +43,7 @@ public function setUp() public function testDeleteAll() { - $dataSet = new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(dirname(__FILE__)."/_files/truncateFixture.xml"); + $dataSet = new PHPUnit\DbUnit\DataSet\FlatXmlDataSet(dirname(__FILE__)."/_files/truncateFixture.xml"); $testAdapter = $this->getMockBuilder('Zend_Test_DbAdapter')->getMock(); $testAdapter->expects($this->at(0)) @@ -60,9 +60,9 @@ public function testDeleteAll() public function testDeleteQueryErrorTransformsException() { - $this->setExpectedException('PHPUnit_Extensions_Database_Operation_Exception'); + $this->expectException('PHPUnit\DbUnit\Operation\Exception'); - $dataSet = new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(dirname(__FILE__)."/_files/truncateFixture.xml"); + $dataSet = new PHPUnit\DbUnit\DataSet\FlatXmlDataSet(dirname(__FILE__)."/_files/truncateFixture.xml"); $testAdapter = $this->getMockBuilder('Zend_Test_DbAdapter')->getMock(); $testAdapter->expects($this->any()) @@ -76,10 +76,10 @@ public function testDeleteQueryErrorTransformsException() public function testInvalidConnectionGivenThrowsException() { - $this->setExpectedException("Zend_Test_PHPUnit_Db_Exception"); + $this->expectException("Zend_Test_PHPUnit_Db_Exception"); - $dataSet = $this->getMockBuilder('PHPUnit_Extensions_Database_DataSet_IDataSet')->getMock(); - $connection = $this->getMockBuilder('PHPUnit_Extensions_Database_DB_IDatabaseConnection')->getMock(); + $dataSet = $this->getMockBuilder('PHPUnit\DbUnit\DataSet\IDataSet')->getMock(); + $connection = $this->getMockBuilder('PHPUnit\DbUnit\Database\Connection')->getMock(); $this->operation->execute($connection, $dataSet); } diff --git a/tests/Zend/Test/PHPUnit/Db/Operation/InsertTest.php b/tests/Zend/Test/PHPUnit/Db/Operation/InsertTest.php index c0e2b6d586..f3e37dfba3 100644 --- a/tests/Zend/Test/PHPUnit/Db/Operation/InsertTest.php +++ b/tests/Zend/Test/PHPUnit/Db/Operation/InsertTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Test */ -class Zend_Test_PHPUnit_Db_Operation_InsertTest extends PHPUnit_Framework_TestCase +class Zend_Test_PHPUnit_Db_Operation_InsertTest extends PHPUnit\Framework\TestCase { private $operation = null; @@ -43,7 +43,7 @@ public function setUp() public function testInsertDataSetUsingAdapterInsert() { - $dataSet = new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(dirname(__FILE__)."/_files/insertFixture.xml"); + $dataSet = new PHPUnit\DbUnit\DataSet\FlatXmlDataSet(dirname(__FILE__)."/_files/insertFixture.xml"); $testAdapter = $this->getMockBuilder('Zend_Test_DbAdapter')->getMock(); $testAdapter->expects($this->at(0)) @@ -63,9 +63,9 @@ public function testInsertDataSetUsingAdapterInsert() public function testInsertExceptionIsTransformed() { - $this->setExpectedException('PHPUnit_Extensions_Database_Operation_Exception'); + $this->expectException('PHPUnit\DbUnit\Operation\Exception'); - $dataSet = new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(dirname(__FILE__)."/_files/insertFixture.xml"); + $dataSet = new PHPUnit\DbUnit\DataSet\FlatXmlDataSet(dirname(__FILE__)."/_files/insertFixture.xml"); $testAdapter = $this->getMockBuilder('Zend_Test_DbAdapter')->getMock(); $testAdapter->expects($this->any())->method('insert')->will($this->throwException(new Exception())); @@ -76,10 +76,10 @@ public function testInsertExceptionIsTransformed() public function testInvalidConnectionGivenThrowsException() { - $this->setExpectedException("Zend_Test_PHPUnit_Db_Exception"); + $this->expectException("Zend_Test_PHPUnit_Db_Exception"); - $dataSet = $this->getMockBuilder('PHPUnit_Extensions_Database_DataSet_IDataSet')->getMock(); - $connection = $this->getMockBuilder('PHPUnit_Extensions_Database_DB_IDatabaseConnection')->getMock(); + $dataSet = $this->getMockBuilder('PHPUnit\DbUnit\DataSet\IDataSet')->getMock(); + $connection = $this->getMockBuilder('PHPUnit\DbUnit\Database\Connection')->getMock(); $this->operation->execute($connection, $dataSet); } diff --git a/tests/Zend/Test/PHPUnit/Db/Operation/TruncateTest.php b/tests/Zend/Test/PHPUnit/Db/Operation/TruncateTest.php index 22289db90b..fe7de47cd2 100644 --- a/tests/Zend/Test/PHPUnit/Db/Operation/TruncateTest.php +++ b/tests/Zend/Test/PHPUnit/Db/Operation/TruncateTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Test */ -class Zend_Test_PHPUnit_Db_Operation_TruncateTest extends PHPUnit_Framework_TestCase +class Zend_Test_PHPUnit_Db_Operation_TruncateTest extends PHPUnit\Framework\TestCase { private $operation = null; @@ -43,7 +43,7 @@ public function setUp() public function testTruncateTablesExecutesAdapterQuery() { - $dataSet = new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(dirname(__FILE__)."/_files/truncateFixture.xml"); + $dataSet = new PHPUnit\DbUnit\DataSet\FlatXmlDataSet(dirname(__FILE__)."/_files/truncateFixture.xml"); $testAdapter = $this->getMockBuilder('Zend_Test_DbAdapter')->getMock(); $testAdapter->expects($this->at(0)) @@ -66,9 +66,9 @@ public function testTruncateTablesExecutesAdapterQuery() public function testTruncateTableInvalidQueryTransformsException() { - $this->setExpectedException('PHPUnit_Extensions_Database_Operation_Exception'); + $this->expectException('PHPUnit\DbUnit\Operation\Exception'); - $dataSet = new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(dirname(__FILE__)."/_files/insertFixture.xml"); + $dataSet = new PHPUnit\DbUnit\DataSet\FlatXmlDataSet(dirname(__FILE__)."/_files/insertFixture.xml"); $testAdapter = $this->getMockBuilder('Zend_Test_DbAdapter')->getMock(); $testAdapter->expects($this->any())->method('query')->will($this->throwException(new Exception())); @@ -80,10 +80,10 @@ public function testTruncateTableInvalidQueryTransformsException() public function testInvalidConnectionGivenThrowsException() { - $this->setExpectedException("Zend_Test_PHPUnit_Db_Exception"); + $this->expectException("Zend_Test_PHPUnit_Db_Exception"); - $dataSet = $this->getMockBuilder('PHPUnit_Extensions_Database_DataSet_IDataSet')->getMock(); - $connection = $this->getMockBuilder('PHPUnit_Extensions_Database_DB_IDatabaseConnection')->getMock(); + $dataSet = $this->getMockBuilder('PHPUnit\DbUnit\DataSet\IDataSet')->getMock(); + $connection = $this->getMockBuilder('PHPUnit\DbUnit\Database\Connection')->getMock(); $this->operation->execute($connection, $dataSet); } @@ -96,7 +96,7 @@ public function testTruncateAppliedToTablesInReverseOrder() $testAdapter = new Zend_Test_DbAdapter(); $connection = new Zend_Test_PHPUnit_Db_Connection($testAdapter, "schema"); - $dataSet = new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(dirname(__FILE__)."/_files/truncateFixture.xml"); + $dataSet = new PHPUnit\DbUnit\DataSet\FlatXmlDataSet(dirname(__FILE__)."/_files/truncateFixture.xml"); $this->operation->execute($connection, $dataSet); diff --git a/tests/Zend/Test/PHPUnit/Db/SimpleTesterTest.php b/tests/Zend/Test/PHPUnit/Db/SimpleTesterTest.php index d796938486..0b52dc1904 100644 --- a/tests/Zend/Test/PHPUnit/Db/SimpleTesterTest.php +++ b/tests/Zend/Test/PHPUnit/Db/SimpleTesterTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Test */ -class Zend_Test_PHPUnit_Db_SimpleTesterTest extends PHPUnit_Framework_TestCase +class Zend_Test_PHPUnit_Db_SimpleTesterTest extends PHPUnit\Framework\TestCase { public function testGetConnection() { @@ -60,7 +60,7 @@ public function testSetupDatabase() $databaseTester = new Zend_Test_PHPUnit_Db_SimpleTester($connection); - $dataSet = $this->getMockBuilder('PHPUnit_Extensions_Database_DataSet_IDataSet')->getMock(); + $dataSet = $this->getMockBuilder('PHPUnit\DbUnit\DataSet\IDataSet')->getMock(); $dataSet->expects($this->any()) ->method('getIterator') ->will($this->returnValue($this->getMockBuilder('Iterator')->getMock())); @@ -72,9 +72,9 @@ public function testSetupDatabase() public function testInvalidConnectionGivenThrowsException() { - $this->setExpectedException("Zend_Test_PHPUnit_Db_Exception"); + $this->expectException("Zend_Test_PHPUnit_Db_Exception"); - $connection = $this->getMockBuilder('PHPUnit_Extensions_Database_DB_IDatabaseConnection')->getMock(); + $connection = $this->getMockBuilder('PHPUnit\DbUnit\Database\Connection')->getMock(); $databaseTester = new Zend_Test_PHPUnit_Db_SimpleTester($connection); } diff --git a/tests/Zend/Test/PHPUnit/Db/TestCaseTest.php b/tests/Zend/Test/PHPUnit/Db/TestCaseTest.php index bbb4115f1d..bf4413a0c7 100644 --- a/tests/Zend/Test/PHPUnit/Db/TestCaseTest.php +++ b/tests/Zend/Test/PHPUnit/Db/TestCaseTest.php @@ -41,14 +41,14 @@ class Zend_Test_PHPUnit_Db_TestCaseTest extends Zend_Test_PHPUnit_DatabaseTestCa /** * Contains a Database Connection * - * @var PHPUnit_Extensions_Database_DB_IDatabaseConnection + * @var PHPUnit\DbUnit\Database\Connection */ protected $_connectionMock = null; /** * Returns the test database connection. * - * @return PHPUnit_Extensions_Database_DB_IDatabaseConnection + * @return PHPUnit\DbUnit\Database\Connection */ protected function getConnection() { @@ -63,21 +63,21 @@ protected function getConnection() /** * Returns the test dataset. * - * @return PHPUnit_Extensions_Database_DataSet_IDataSet + * @return PHPUnit\DbUnit\DataSet\IDataSet */ protected function getDataSet() { - return new PHPUnit_Extensions_Database_DataSet_CompositeDataSet(array()); + return new PHPUnit\DbUnit\DataSet\CompositeDataSet(array()); } public function testDatabaseTesterIsInitialized() { - $this->assertTrue($this->databaseTester instanceof PHPUnit_Extensions_Database_ITester); + $this->assertTrue($this->databaseTester instanceof PHPUnit\DbUnit\Tester); } public function testDatabaseTesterNestsDefaultConnection() { - $this->assertTrue($this->databaseTester->getConnection() instanceof PHPUnit_Extensions_Database_DB_IDatabaseConnection); + $this->assertTrue($this->databaseTester->getConnection() instanceof PHPUnit\DbUnit\Database\Connection); } public function testCheckZendDbConnectionConvenienceMethodReturnType() diff --git a/tests/Zend/Text/FigletTest.php b/tests/Zend/Text/FigletTest.php index 84e21c7667..a9efc45b26 100644 --- a/tests/Zend/Text/FigletTest.php +++ b/tests/Zend/Text/FigletTest.php @@ -39,7 +39,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Text */ -class Zend_Text_FigletTest extends PHPUnit_Framework_TestCase +class Zend_Text_FigletTest extends PHPUnit\Framework\TestCase { public function testStandardAlignLeft() { @@ -117,10 +117,11 @@ public function testCorrectEncodingISO885915() } /** - * @expectedException Zend_Text_Figlet_Exception */ public function testIncorrectEncoding() { + $this->expectException(\Zend_Text_Figlet_Exception::class); + $this->markTestSkipped('Test case not reproducible on all setups'); $figlet = new Zend_Text_Figlet(); diff --git a/tests/Zend/Text/MultiByteTest.php b/tests/Zend/Text/MultiByteTest.php index da0dabec9f..41cdc68bbf 100644 --- a/tests/Zend/Text/MultiByteTest.php +++ b/tests/Zend/Text/MultiByteTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Text */ -class Zend_Text_MultiByteTest extends PHPUnit_Framework_TestCase +class Zend_Text_MultiByteTest extends PHPUnit\Framework\TestCase { /** * Standard cut tests diff --git a/tests/Zend/Text/TableTest.php b/tests/Zend/Text/TableTest.php index a46b21962b..33c297982e 100644 --- a/tests/Zend/Text/TableTest.php +++ b/tests/Zend/Text/TableTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Text */ -class Zend_Text_TableTest extends PHPUnit_Framework_TestCase +class Zend_Text_TableTest extends PHPUnit\Framework\TestCase { public function tearDown() { diff --git a/tests/Zend/TimeSyncTest.php b/tests/Zend/TimeSyncTest.php index 2a98081daa..d0d043e9ee 100644 --- a/tests/Zend/TimeSyncTest.php +++ b/tests/Zend/TimeSyncTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_TimeSync */ -class Zend_TimeSyncTest extends PHPUnit_Framework_TestCase +class Zend_TimeSyncTest extends PHPUnit\Framework\TestCase { public $timeservers = array( // invalid servers diff --git a/tests/Zend/Tool/Framework/Action/BaseTest.php b/tests/Zend/Tool/Framework/Action/BaseTest.php index e1bc0021aa..dfede436b2 100644 --- a/tests/Zend/Tool/Framework/Action/BaseTest.php +++ b/tests/Zend/Tool/Framework/Action/BaseTest.php @@ -36,7 +36,7 @@ * @group Zend_Tool_Framework * @group Zend_Tool_Framework_Action */ -class Zend_Tool_Framework_Action_BaseTest extends PHPUnit_Framework_TestCase +class Zend_Tool_Framework_Action_BaseTest extends PHPUnit\Framework\TestCase { public function testBaseActionCanGetNameViaConstructor() diff --git a/tests/Zend/Tool/Framework/Action/RepositoryTest.php b/tests/Zend/Tool/Framework/Action/RepositoryTest.php index 352827fe53..dc55d08a83 100644 --- a/tests/Zend/Tool/Framework/Action/RepositoryTest.php +++ b/tests/Zend/Tool/Framework/Action/RepositoryTest.php @@ -39,7 +39,7 @@ * @group Zend_Tool_Framework * @group Zend_Tool_Framework_Action */ -class Zend_Tool_Framework_Action_RepositoryTest extends PHPUnit_Framework_TestCase +class Zend_Tool_Framework_Action_RepositoryTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Tool_Framework_Action_Repository @@ -78,19 +78,21 @@ public function testAddActionWillParseNameFromClassNameOnExtendedActions() } /** - * @expectedException Zend_Tool_Framework_Action_Exception */ public function testAddActionThrowsExceptionOnDuplicateNameAction() { + $this->expectException(\Zend_Tool_Framework_Action_Exception::class); + $this->_repository->addAction(new Zend_Tool_Framework_Action_Foo()); $this->_repository->addAction(new Zend_Tool_Framework_Action_Foo()); } /** - * @expectedException Zend_Tool_Framework_Action_Exception */ public function testAddActionThrowsExceptionOnActionWithNoName() { + $this->expectException(\Zend_Tool_Framework_Action_Exception::class); + $this->_repository->addAction(new Zend_Tool_Framework_Action_Base()); } diff --git a/tests/Zend/Tool/Framework/Client/RequestTest.php b/tests/Zend/Tool/Framework/Client/RequestTest.php index e9ef05d57a..439a7236ca 100644 --- a/tests/Zend/Tool/Framework/Client/RequestTest.php +++ b/tests/Zend/Tool/Framework/Client/RequestTest.php @@ -36,7 +36,7 @@ * @group Zend_Tool_Framework * @group Zend_Tool_Framework_Client */ -class Zend_Tool_Framework_Client_RequestTest extends PHPUnit_Framework_TestCase +class Zend_Tool_Framework_Client_RequestTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Tool/Framework/Client/ResponseTest.php b/tests/Zend/Tool/Framework/Client/ResponseTest.php index bf6d83598e..1a11ba1cc5 100644 --- a/tests/Zend/Tool/Framework/Client/ResponseTest.php +++ b/tests/Zend/Tool/Framework/Client/ResponseTest.php @@ -38,7 +38,7 @@ * @group Zend_Tool_Framework * @group Zend_Tool_Framework_Client */ -class Zend_Tool_Framework_Client_ResponseTest extends PHPUnit_Framework_TestCase +class Zend_Tool_Framework_Client_ResponseTest extends PHPUnit\Framework\TestCase { /** @@ -93,10 +93,11 @@ public function testExceptionHandling() } /** - * @expectedException Zend_Tool_Framework_Client_Exception */ public function testSetCallbackThrowsExceptionOnInvalidCallback() { + $this->expectException(\Zend_Tool_Framework_Client_Exception::class); + $this->_response->setContentCallback(5); } diff --git a/tests/Zend/Tool/Framework/Loader/IncludePathLoaderTest.php b/tests/Zend/Tool/Framework/Loader/IncludePathLoaderTest.php index ba9633e50c..2a97d222d2 100644 --- a/tests/Zend/Tool/Framework/Loader/IncludePathLoaderTest.php +++ b/tests/Zend/Tool/Framework/Loader/IncludePathLoaderTest.php @@ -36,7 +36,7 @@ * @group Zend_Tool_Framework * @group Zend_Tool_Framework_Loader */ -class Zend_Tool_Framework_Loader_IncludePathLoaderTest extends PHPUnit_Framework_TestCase +class Zend_Tool_Framework_Loader_IncludePathLoaderTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Tool/Framework/Manifest/ProviderMetadataTest.php b/tests/Zend/Tool/Framework/Manifest/ProviderMetadataTest.php index 2ae07e2ad9..4ff3b07d56 100644 --- a/tests/Zend/Tool/Framework/Manifest/ProviderMetadataTest.php +++ b/tests/Zend/Tool/Framework/Manifest/ProviderMetadataTest.php @@ -36,7 +36,7 @@ * @group Zend_Tool_Framework * @group Zend_Tool_Framework_Manifest */ -class Zend_Tool_Framework_Manifest_ProviderMetadataTest extends PHPUnit_Framework_TestCase +class Zend_Tool_Framework_Manifest_ProviderMetadataTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Tool/Framework/Manifest/RepositoryTest.php b/tests/Zend/Tool/Framework/Manifest/RepositoryTest.php index 39e2517982..edfa0b4459 100644 --- a/tests/Zend/Tool/Framework/Manifest/RepositoryTest.php +++ b/tests/Zend/Tool/Framework/Manifest/RepositoryTest.php @@ -46,7 +46,7 @@ * @group Zend_Tool_Framework * @group Zend_Tool_Framework_Manifest */ -class Zend_Tool_Framework_Manifest_RepositoryTest extends PHPUnit_Framework_TestCase +class Zend_Tool_Framework_Manifest_RepositoryTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Tool_Framework_Registry @@ -113,10 +113,11 @@ public function testAddManfestsWillPersistManifestsAndObeyIndex() } /** - * @expectedException Zend_Tool_Framework_Manifest_Exception */ public function testAddManifestThrowsExceptionOnBadGetProviders() { + $this->expectException(\Zend_Tool_Framework_Manifest_Exception::class); + $this->_repository->addManifest(new Zend_Tool_Framework_Manifest_ManifestBadProvider()); } @@ -132,10 +133,11 @@ public function testProcessAddsMetadataToManifest() } /** - * @expectedException Zend_Tool_Framework_Manifest_Exception */ public function testProcessThrowsExceptionOnBadMetadata() { + $this->expectException(\Zend_Tool_Framework_Manifest_Exception::class); + $this->_repository->addManifest(new Zend_Tool_Framework_Manifest_ManifestBadMetadata()); $this->_repository->process(); } diff --git a/tests/Zend/Tool/Framework/Metadata/ActionMetadataTest.php b/tests/Zend/Tool/Framework/Metadata/ActionMetadataTest.php index 0405e727a4..cef77f1c02 100644 --- a/tests/Zend/Tool/Framework/Metadata/ActionMetadataTest.php +++ b/tests/Zend/Tool/Framework/Metadata/ActionMetadataTest.php @@ -36,7 +36,7 @@ * @group Zend_Tool_Framework * @group Zend_Tool_Framework_Manifest */ -class Zend_Tool_Framework_Manifest_ActionMetadataTest extends PHPUnit_Framework_TestCase +class Zend_Tool_Framework_Manifest_ActionMetadataTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Tool/Framework/Metadata/MetadataTest.php b/tests/Zend/Tool/Framework/Metadata/MetadataTest.php index 39654fcd1c..afec9dfd86 100644 --- a/tests/Zend/Tool/Framework/Metadata/MetadataTest.php +++ b/tests/Zend/Tool/Framework/Metadata/MetadataTest.php @@ -36,7 +36,7 @@ * @group Zend_Tool_Framework * @group Zend_Tool_Framework_Manifest */ -class Zend_Tool_Framework_Manifest_MetadataTest extends PHPUnit_Framework_TestCase +class Zend_Tool_Framework_Manifest_MetadataTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Tool/Framework/Provider/AbstractTest.php b/tests/Zend/Tool/Framework/Provider/AbstractTest.php index b4ab8d0842..694cab6d68 100644 --- a/tests/Zend/Tool/Framework/Provider/AbstractTest.php +++ b/tests/Zend/Tool/Framework/Provider/AbstractTest.php @@ -37,7 +37,7 @@ * @group Zend_Tool_Framework * @group Zend_Tool_Framework_Provider */ -class Zend_Tool_Framework_Provider_AbstractTest extends PHPUnit_Framework_TestCase +class Zend_Tool_Framework_Provider_AbstractTest extends PHPUnit\Framework\TestCase { protected $_request = null; diff --git a/tests/Zend/Tool/Framework/Provider/RepositoryTest.php b/tests/Zend/Tool/Framework/Provider/RepositoryTest.php index b47ef2298e..8ecbe3d567 100644 --- a/tests/Zend/Tool/Framework/Provider/RepositoryTest.php +++ b/tests/Zend/Tool/Framework/Provider/RepositoryTest.php @@ -41,7 +41,7 @@ * @group Zend_Tool_Framework * @group Zend_Tool_Framework_Provider */ -class Zend_Tool_Framework_Provider_RepositoryTest extends PHPUnit_Framework_TestCase +class Zend_Tool_Framework_Provider_RepositoryTest extends PHPUnit\Framework\TestCase { /** @@ -89,10 +89,11 @@ public function testAddProviderCanHandleProviderWithAlternateName() } /** - * @expectedException Zend_Tool_Framework_Provider_Exception */ public function testAddProviderThrowsExceptionOnDuplicateName() { + $this->expectException(\Zend_Tool_Framework_Provider_Exception::class); + $this->_repository->addProvider(new Zend_Tool_Framework_Provider_ProviderOne()); $this->_repository->addProvider(new Zend_Tool_Framework_Provider_ProviderOne()); } diff --git a/tests/Zend/Tool/Framework/Provider/SignatureTest.php b/tests/Zend/Tool/Framework/Provider/SignatureTest.php index 2cdd848b75..f1be9fc9c1 100644 --- a/tests/Zend/Tool/Framework/Provider/SignatureTest.php +++ b/tests/Zend/Tool/Framework/Provider/SignatureTest.php @@ -46,7 +46,7 @@ * @group Zend_Tool_Framework * @group Zend_Tool_Framework_Provider */ -class Zend_Tool_Framework_Provider_SignatureTest extends PHPUnit_Framework_TestCase +class Zend_Tool_Framework_Provider_SignatureTest extends PHPUnit\Framework\TestCase { protected $_registry = null; @@ -118,20 +118,22 @@ public function testGetSpecialtiesReturnsParsedSpecialtiesFromMethodInsteadOfPro } /** - * @expectedException Zend_Tool_Framework_Provider_Exception */ public function testGetSpecialtiesReturnsParsedSpecialtiesThrowsExceptionOnBadPropertyValue() { + $this->expectException(\Zend_Tool_Framework_Provider_Exception::class); + $signature = new Zend_Tool_Framework_Provider_Signature(new Zend_Tool_Framework_Provider_ProviderFullFeaturedBadSpecialties()); $signature->setRegistry($this->_registry); $signature->process(); } /** - * @expectedException Zend_Tool_Framework_Provider_Exception */ public function testGetSpecialtiesReturnsParsedSpecialtiesThrowsExceptionOnBadReturnValue() { + $this->expectException(\Zend_Tool_Framework_Provider_Exception::class); + $signature = new Zend_Tool_Framework_Provider_Signature(new Zend_Tool_Framework_Provider_ProviderFullFeaturedBadSpecialties2()); $signature->setRegistry($this->_registry); $signature->process(); diff --git a/tests/Zend/Tool/Framework/RegistryTest.php b/tests/Zend/Tool/Framework/RegistryTest.php index 06b3913ec0..22b0e66649 100644 --- a/tests/Zend/Tool/Framework/RegistryTest.php +++ b/tests/Zend/Tool/Framework/RegistryTest.php @@ -44,7 +44,7 @@ * @group Zend_Tool * @group Zend_Tool_Framework */ -class Zend_Tool_Framework_RegistryTest extends PHPUnit_Framework_TestCase +class Zend_Tool_Framework_RegistryTest extends PHPUnit\Framework\TestCase { public function setup() @@ -114,34 +114,38 @@ public function testMagicGetAndSetOfRegistryItems() } /** - * @expectedException Zend_Tool_Framework_Exception */ public function testMagicGetThrowsExceptionOnNonExistentItem() { + $this->expectException(\Zend_Tool_Framework_Exception::class); + $foo = $this->_registry->foo; } /** - * @expectedException Zend_Tool_Framework_Exception */ public function testMagicSetThrowsExceptionOnNonExistentItem() { + $this->expectException(\Zend_Tool_Framework_Exception::class); + $this->_registry->foo = 'foo'; } /** - * @expectedException Zend_Tool_Framework_Exception */ public function testIsObjectRegistryEnablableWillThrowExceptionsOnNonObject() { + $this->expectException(\Zend_Tool_Framework_Exception::class); + $this->_registry->isObjectRegistryEnablable('foo'); } /** - * @expectedException Zend_Tool_Framework_Exception */ public function testEnableRegistryOnObjectWillThrowExceptionsOnNonObject() { + $this->expectException(\Zend_Tool_Framework_Exception::class); + $this->_registry->enableRegistryOnObject(new ArrayObject()); } diff --git a/tests/Zend/Tool/Project/Context/RegistryTest.php b/tests/Zend/Tool/Project/Context/RegistryTest.php index 57e598f253..29add52bcd 100644 --- a/tests/Zend/Tool/Project/Context/RegistryTest.php +++ b/tests/Zend/Tool/Project/Context/RegistryTest.php @@ -34,7 +34,7 @@ * @group Zend_Tool * @group Zend_Tool_Project */ -class Zend_Tool_Project_Context_RepositoryTest extends PHPUnit_Framework_TestCase +class Zend_Tool_Project_Context_RepositoryTest extends PHPUnit\Framework\TestCase { public function setUp() @@ -66,19 +66,21 @@ public function testRegistryLoadsZFContexts() } /** - * @expectedException Zend_Tool_Project_Context_Exception */ public function testRegistryThrowsExceptionOnUnallowedContextOverwrite() { + $this->expectException(\Zend_Tool_Project_Context_Exception::class); + Zend_Tool_Project_Context_Repository::getInstance()->addContextClass('Zend_Tool_Project_Context_System_ProjectDirectory'); } /** - * @expectedException Zend_Tool_Project_Context_Exception */ public function testRegistryThrowsExceptionOnUnknownContextRequest() { + $this->expectException(\Zend_Tool_Project_Context_Exception::class); + Zend_Tool_Project_Context_Repository::getInstance()->getContext('somethingUnknown'); } diff --git a/tests/Zend/Tool/Project/ProfileTest.php b/tests/Zend/Tool/Project/ProfileTest.php index 09ad6fa402..b50fd58288 100644 --- a/tests/Zend/Tool/Project/ProfileTest.php +++ b/tests/Zend/Tool/Project/ProfileTest.php @@ -33,7 +33,7 @@ * @group Zend_Tool_Framework * @group Zend_Tool_Framework_Action */ -class Zend_Tool_Project_ProfileTest extends PHPUnit_Framework_TestCase +class Zend_Tool_Project_ProfileTest extends PHPUnit\Framework\TestCase { protected $_projectDirectory = null; @@ -171,7 +171,7 @@ public function testProfileCanSaveStorageDataToFile() $this->_standardProfileFromData->loadFromData(); $this->_standardProfileFromData->setAttribute('projectProfileFile', $this->_projectDirectory . 'my-xml-file.xml'); $this->_standardProfileFromData->storeToFile(); - $this->assertTrue(file_exists($this->_projectDirectory . 'my-xml-file.xml')); + $this->assertFileExists($this->_projectDirectory . 'my-xml-file.xml'); } public function testProfileCanFindResource() @@ -202,7 +202,7 @@ public function testProfileCanRecursivelyCreateParentFirst() $resource->getContext()->create(); } - $this->assertTrue(file_exists($this->_projectDirectory . 'public/index.php')); + $this->assertFileExists($this->_projectDirectory . 'public/index.php'); } public function testProfileCanDelete() @@ -213,27 +213,28 @@ public function testProfileCanDelete() $resource->getContext()->create(); } - $this->assertTrue(file_exists($this->_projectDirectory . 'public/index.php')); + $this->assertFileExists($this->_projectDirectory . 'public/index.php'); $publicIndexFile = $this->_standardProfileFromData->search('publicIndexFile'); $publicIndexFile->getContext()->delete(); - $this->assertFalse(file_exists($this->_projectDirectory . 'public/index.php')); + $this->assertFileNotExists($this->_projectDirectory . 'public/index.php'); $appConfigFile = $this->_standardProfileFromData->search('applicationConfigFile'); $appConfigFile->getContext()->delete(); $configsDirectory = $this->_standardProfileFromData->search('configsDirectory'); $configsDirectory->getContext()->delete(); - $this->assertFalse(file_exists($this->_projectDirectory . 'application/configs')); + $this->assertFileNotExists($this->_projectDirectory . 'application/configs'); } /** * - * @expectedException Zend_Tool_Project_Exception */ public function testProfileThrowsExceptionOnLoadFromData() { + $this->expectException(\Zend_Tool_Project_Exception::class); + $profile = new Zend_Tool_Project_Profile(); // missing data from attributes should throw exception here @@ -242,10 +243,11 @@ public function testProfileThrowsExceptionOnLoadFromData() /** * - * @expectedException Zend_Tool_Project_Exception */ public function testProfileThrowsExceptionOnLoadFromFile() { + $this->expectException(\Zend_Tool_Project_Exception::class); + $profile = new Zend_Tool_Project_Profile(); // missing file path or project path @@ -254,10 +256,11 @@ public function testProfileThrowsExceptionOnLoadFromFile() /** * - * @expectedException Zend_Tool_Project_Exception */ public function testProfileThrowsExceptionOnStoreToFile() { + $this->expectException(\Zend_Tool_Project_Exception::class); + $profile = new Zend_Tool_Project_Profile(); // missing file path or project path @@ -266,10 +269,11 @@ public function testProfileThrowsExceptionOnStoreToFile() /** * - * @expectedException Zend_Tool_Project_Exception */ public function testProfileThrowsExceptionOnLoadFromFileWithBadPathForProfileFile() { + $this->expectException(\Zend_Tool_Project_Exception::class); + $profile = new Zend_Tool_Project_Profile(); $profile->setAttribute('projectProfileFile', '/path/should/not/exist'); diff --git a/tests/Zend/Tool/Project/Provider/ControllerTest.php b/tests/Zend/Tool/Project/Provider/ControllerTest.php index bd6e18f61d..9bc1a1a4f0 100644 --- a/tests/Zend/Tool/Project/Provider/ControllerTest.php +++ b/tests/Zend/Tool/Project/Provider/ControllerTest.php @@ -37,7 +37,7 @@ * @group Zend_Tool_Framework * @group Zend_Tool_Framework_Action */ -class Zend_Tool_Project_Provider_ControllerTest extends PHPUnit_Framework_TestCase +class Zend_Tool_Project_Provider_ControllerTest extends PHPUnit\Framework\TestCase { /** * diff --git a/tests/Zend/Tool/Project/_files/project1/.gitignore b/tests/Zend/Tool/Project/_files/project1/.gitignore deleted file mode 100644 index 593bcf0e80..0000000000 --- a/tests/Zend/Tool/Project/_files/project1/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -!.gitignore -* diff --git a/tests/Zend/Translate/Adapter/ArrayTest.php b/tests/Zend/Translate/Adapter/ArrayTest.php index f58f6ce544..ab10ca1575 100644 --- a/tests/Zend/Translate/Adapter/ArrayTest.php +++ b/tests/Zend/Translate/Adapter/ArrayTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Translate */ -class Zend_Translate_Adapter_ArrayTest extends PHPUnit_Framework_TestCase +class Zend_Translate_Adapter_ArrayTest extends PHPUnit\Framework\TestCase { /** * Error flag @@ -157,7 +157,7 @@ public function testOptions() } $this->assertEquals('testkey', $adapter->getOptions('testoption')); - $this->assertTrue(is_null($adapter->getOptions('nooption'))); + $this->assertNull($adapter->getOptions('nooption')); } public function testClearing() diff --git a/tests/Zend/Translate/Adapter/CsvTest.php b/tests/Zend/Translate/Adapter/CsvTest.php index 509eea629d..922f0493a0 100644 --- a/tests/Zend/Translate/Adapter/CsvTest.php +++ b/tests/Zend/Translate/Adapter/CsvTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Translate */ -class Zend_Translate_Adapter_CsvTest extends PHPUnit_Framework_TestCase +class Zend_Translate_Adapter_CsvTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -134,7 +134,7 @@ public function testOptions() } $this->assertEquals('testkey', $adapter->getOptions('testoption')); - $this->assertTrue(is_null($adapter->getOptions('nooption'))); + $this->assertNull($adapter->getOptions('nooption')); } public function testClearing() diff --git a/tests/Zend/Translate/Adapter/GettextTest.php b/tests/Zend/Translate/Adapter/GettextTest.php index 144010d034..185779a359 100644 --- a/tests/Zend/Translate/Adapter/GettextTest.php +++ b/tests/Zend/Translate/Adapter/GettextTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Translate */ -class Zend_Translate_Adapter_GettextTest extends PHPUnit_Framework_TestCase +class Zend_Translate_Adapter_GettextTest extends PHPUnit\Framework\TestCase { /** * Runs the test methods of this class. @@ -42,8 +42,8 @@ class Zend_Translate_Adapter_GettextTest extends PHPUnit_Framework_TestCase */ public static function main() { - $suite = new PHPUnit_Framework_TestSuite("Zend_Translate_Adapter_GettextTest"); - $result = PHPUnit_TextUI_TestRunner::run($suite); + $suite = new PHPUnit\Framework\TestSuite("Zend_Translate_Adapter_GettextTest"); + $result = PHPUnit\TextUI\TestRunner::run($suite); Zend_Translate_Adapter_Gettext::removeCache(); } @@ -146,7 +146,7 @@ public function testOptions() } $this->assertEquals('testkey', $adapter->getOptions('testoption')); - $this->assertTrue(is_null($adapter->getOptions('nooption'))); + $this->assertNull($adapter->getOptions('nooption')); } public function testClearing() diff --git a/tests/Zend/Translate/Adapter/IniTest.php b/tests/Zend/Translate/Adapter/IniTest.php index b8a2b6ce4e..338f24b0f1 100644 --- a/tests/Zend/Translate/Adapter/IniTest.php +++ b/tests/Zend/Translate/Adapter/IniTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Translate */ -class Zend_Translate_Adapter_IniTest extends PHPUnit_Framework_TestCase +class Zend_Translate_Adapter_IniTest extends PHPUnit\Framework\TestCase { public function testCreate() { @@ -128,7 +128,7 @@ public function testOptions() } $this->assertEquals('testkey', $adapter->getOptions('testoption')); - $this->assertTrue(is_null($adapter->getOptions('nooption'))); + $this->assertNull($adapter->getOptions('nooption')); } public function testClearing() diff --git a/tests/Zend/Translate/Adapter/QtTest.php b/tests/Zend/Translate/Adapter/QtTest.php index 1e83b5e7e1..5a8b3baef4 100644 --- a/tests/Zend/Translate/Adapter/QtTest.php +++ b/tests/Zend/Translate/Adapter/QtTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Translate */ -class Zend_Translate_Adapter_QtTest extends PHPUnit_Framework_TestCase +class Zend_Translate_Adapter_QtTest extends PHPUnit\Framework\TestCase { public function testCreate() { @@ -140,7 +140,7 @@ public function testOptions() } $this->assertEquals('testkey', $adapter->getOptions('testoption')); - $this->assertTrue(is_null($adapter->getOptions('nooption'))); + $this->assertNull($adapter->getOptions('nooption')); } public function testClearing() diff --git a/tests/Zend/Translate/Adapter/TbxTest.php b/tests/Zend/Translate/Adapter/TbxTest.php index 33558bd478..2d448a770f 100644 --- a/tests/Zend/Translate/Adapter/TbxTest.php +++ b/tests/Zend/Translate/Adapter/TbxTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Translate */ -class Zend_Translate_Adapter_TbxTest extends PHPUnit_Framework_TestCase +class Zend_Translate_Adapter_TbxTest extends PHPUnit\Framework\TestCase { public function testCreate() { @@ -139,7 +139,7 @@ public function testOptions() } $this->assertEquals('testkey', $adapter->getOptions('testoption')); - $this->assertTrue(is_null($adapter->getOptions('nooption'))); + $this->assertNull($adapter->getOptions('nooption')); } public function testClearing() diff --git a/tests/Zend/Translate/Adapter/TmxTest.php b/tests/Zend/Translate/Adapter/TmxTest.php index 44e6887568..377ac7de52 100644 --- a/tests/Zend/Translate/Adapter/TmxTest.php +++ b/tests/Zend/Translate/Adapter/TmxTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Translate */ -class Zend_Translate_Adapter_TmxTest extends PHPUnit_Framework_TestCase +class Zend_Translate_Adapter_TmxTest extends PHPUnit\Framework\TestCase { public function testCreate() { @@ -140,7 +140,7 @@ public function testOptions() } $this->assertEquals('testkey', $adapter->getOptions('testoption')); - $this->assertTrue(is_null($adapter->getOptions('nooption'))); + $this->assertNull($adapter->getOptions('nooption')); } public function testClearing() diff --git a/tests/Zend/Translate/Adapter/XliffTest.php b/tests/Zend/Translate/Adapter/XliffTest.php index 4eff9846b5..4847f948eb 100644 --- a/tests/Zend/Translate/Adapter/XliffTest.php +++ b/tests/Zend/Translate/Adapter/XliffTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Translate */ -class Zend_Translate_Adapter_XliffTest extends PHPUnit_Framework_TestCase +class Zend_Translate_Adapter_XliffTest extends PHPUnit\Framework\TestCase { public function testCreate() { @@ -140,7 +140,7 @@ public function testOptions() } $this->assertEquals('testkey', $adapter->getOptions('testoption')); - $this->assertTrue(is_null($adapter->getOptions('nooption'))); + $this->assertNull($adapter->getOptions('nooption')); } public function testClearing() diff --git a/tests/Zend/Translate/Adapter/XmlTmTest.php b/tests/Zend/Translate/Adapter/XmlTmTest.php index 76d2b365fd..484001df95 100644 --- a/tests/Zend/Translate/Adapter/XmlTmTest.php +++ b/tests/Zend/Translate/Adapter/XmlTmTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Translate */ -class Zend_Translate_Adapter_XmlTmTest extends PHPUnit_Framework_TestCase +class Zend_Translate_Adapter_XmlTmTest extends PHPUnit\Framework\TestCase { public function testCreate() { @@ -140,7 +140,7 @@ public function testOptions() } $this->assertEquals('testkey', $adapter->getOptions('testoption')); - $this->assertTrue(is_null($adapter->getOptions('nooption'))); + $this->assertNull($adapter->getOptions('nooption')); } public function testClearing() diff --git a/tests/Zend/TranslateTest.php b/tests/Zend/TranslateTest.php index ced8889c6a..6cbd1dae26 100644 --- a/tests/Zend/TranslateTest.php +++ b/tests/Zend/TranslateTest.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Translate */ -class Zend_TranslateTest extends PHPUnit_Framework_TestCase +class Zend_TranslateTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -416,7 +416,7 @@ public function testSetLocaleAsOption() public function testGettingAllOptions() { $lang = new Zend_Translate(Zend_Translate::AN_ARRAY, array('msg1' => 'Message 1'), 'en'); - $this->assertTrue(is_array($lang->getOptions())); + $this->assertInternalType('array', $lang->getOptions()); } /** @@ -690,8 +690,8 @@ public function testAddingAdapterToSourceUsingOwnRule() $translate->addTranslation($adapter2, 'fr'); $languages = $translate->getList(); - $this->assertFalse(array_key_exists('de_AT', $languages)); - $this->assertTrue(array_key_exists('fr', $languages)); + $this->assertArrayNotHasKey('de_AT', $languages); + $this->assertArrayHasKey('fr', $languages); } /** @@ -711,9 +711,9 @@ public function testIgnoreMultipleDirectories() ); $langs = $translate->getList(); - $this->assertFalse(array_key_exists('de_DE', $langs)); - $this->assertTrue(array_key_exists('ja', $langs)); - $this->assertTrue(array_key_exists('en_US', $langs)); + $this->assertArrayNotHasKey('de_DE', $langs); + $this->assertArrayHasKey('ja', $langs); + $this->assertArrayHasKey('en_US', $langs); $translate2 = new Zend_Translate( Zend_Translate::AN_ARRAY, @@ -728,9 +728,9 @@ public function testIgnoreMultipleDirectories() $langs = $translate2->getList(); - $this->assertFalse(array_key_exists('de_DE', $langs)); - $this->assertFalse(array_key_exists('ja', $langs)); - $this->assertTrue(array_key_exists('en_US', $langs)); + $this->assertArrayNotHasKey('de_DE', $langs); + $this->assertArrayNotHasKey('ja', $langs); + $this->assertArrayHasKey('en_US', $langs); } /** @@ -759,9 +759,9 @@ public function testReroutingForTranslations() $translate->addTranslation($translate2); $langs = $translate->getList(); - $this->assertFalse(array_key_exists('de_AT', $langs)); - $this->assertTrue(array_key_exists('ja', $langs)); - $this->assertTrue(array_key_exists('en_US', $langs)); + $this->assertArrayNotHasKey('de_AT', $langs); + $this->assertArrayHasKey('ja', $langs); + $this->assertArrayHasKey('en_US', $langs); $this->assertEquals('Message 5 (en)', $translate->translate('Message 5', 'ja')); } @@ -793,9 +793,9 @@ public function testCircleReroutingForTranslations() $translate->addTranslation($translate2); $langs = $translate->getList(); - $this->assertFalse(array_key_exists('de_DE', $langs)); - $this->assertTrue(array_key_exists('ja', $langs)); - $this->assertTrue(array_key_exists('en_US', $langs)); + $this->assertArrayNotHasKey('de_DE', $langs); + $this->assertArrayHasKey('ja', $langs); + $this->assertArrayHasKey('en_US', $langs); $this->assertEquals('Message 5 (en)', $translate->translate('Message 5', 'ja')); $this->assertEquals('Message 10', $translate->translate('Message 10', 'ja')); } @@ -828,9 +828,9 @@ public function testDoubleReroutingForTranslations() $translate->addTranslation($translate2); $langs = $translate->getList(); - $this->assertFalse(array_key_exists('de_DE', $langs)); - $this->assertTrue(array_key_exists('ja', $langs)); - $this->assertTrue(array_key_exists('en_US', $langs)); + $this->assertArrayNotHasKey('de_DE', $langs); + $this->assertArrayHasKey('ja', $langs); + $this->assertArrayHasKey('en_US', $langs); $this->assertEquals('Message 5 (en)', $translate->translate('Message 5', 'ja')); $this->assertEquals('Message 5 (en)', $translate->translate('Message 5', 'ja')); } diff --git a/tests/Zend/Uri/HttpTest.php b/tests/Zend/Uri/HttpTest.php index b6eab0c953..4e26ab5d31 100644 --- a/tests/Zend/Uri/HttpTest.php +++ b/tests/Zend/Uri/HttpTest.php @@ -39,7 +39,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Uri */ -class Zend_Uri_HttpTest extends PHPUnit_Framework_TestCase +class Zend_Uri_HttpTest extends PHPUnit\Framework\TestCase { public function setup() @@ -81,10 +81,11 @@ public function testSimpleFromString() * * @group ZF-4395 * - * @expectedException Zend_Uri_Exception */ public function testFromStringInvalidScheme() { + $this->expectException(\Zend_Uri_Exception::class); + Zend_Uri_Http::fromString('ftp://example.com/file'); } @@ -95,7 +96,7 @@ public function testFromStringInvalidScheme() */ public function testFromStringWithInvalidVariableType() { - $this->setExpectedException('Zend_Uri_Exception'); + $this->expectException('Zend_Uri_Exception'); Zend_Uri_Http::fromString(0); } @@ -362,14 +363,14 @@ public function testBuildCompleteUriFromScratch() public function testSetInvalidUsername() { $uri = Zend_Uri::factory('http://example.com'); - $this->setExpectedException('Zend_Uri_Exception'); + $this->expectException('Zend_Uri_Exception'); $uri->setUsername('alice?'); } public function testSetInvalidPassword() { $uri = Zend_Uri::factory('http://example.com'); - $this->setExpectedException('Zend_Uri_Exception'); + $this->expectException('Zend_Uri_Exception'); $uri->setUsername('alice'); $uri->setPassword('secret?'); } @@ -378,7 +379,7 @@ public function testSetEmptyHost() { $uri = Zend_Uri::factory('http://example.com'); $host = ''; - $this->setExpectedException('Zend_Uri_Exception'); + $this->expectException('Zend_Uri_Exception'); $uri->setHost($host); } @@ -386,7 +387,7 @@ public function testSetInvalidHost() { $uri = Zend_Uri::factory('http://example.com'); $host = 'example§com'; - $this->setExpectedException('Zend_Uri_Exception'); + $this->expectException('Zend_Uri_Exception'); $uri->setHost($host); } diff --git a/tests/Zend/UriTest.php b/tests/Zend/UriTest.php index 2f598627ef..08260dac82 100644 --- a/tests/Zend/UriTest.php +++ b/tests/Zend/UriTest.php @@ -38,7 +38,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Uri */ -class Zend_UriTest extends PHPUnit_Framework_TestCase +class Zend_UriTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -111,10 +111,11 @@ public function testSetConfigWithZendConfig() * nor Zend_Config is given as first parameter * * @group ZF-5578 - * @expectedException Zend_Uri_Exception */ public function testSetConfigInvalid() { + $this->expectException(\Zend_Uri_Exception::class); + Zend_Uri::setConfig('This should cause an exception'); } @@ -135,7 +136,7 @@ public function testToStringRaisesWarningWhenExceptionCaught() restore_error_handler(); - $this->assertTrue(empty($text)); + $this->assertEmpty($text); $this->assertTrue(isset($this->error)); $this->assertContains('Exception in getUri()', $this->error); @@ -184,13 +185,15 @@ protected function _testValidUri($uri, $className = null) public function testFactoryWithUnExistingClassThrowException() { - $this->setExpectedException('Zend_Uri_Exception', '"This_Is_An_Unknown_Class" not found'); + $this->expectException('Zend_Uri_Exception'); + $this->expectExceptionMessage('"This_Is_An_Unknown_Class" not found'); Zend_Uri::factory('http://example.net', 'This_Is_An_Unknown_Class'); } public function testFactoryWithExistingClassButNotImplementingZendUriThrowException() { - $this->setExpectedException('Zend_Uri_Exception', '"Fake_Zend_Uri" is not an instance of Zend_Uri'); + $this->expectException('Zend_Uri_Exception'); + $this->expectExceptionMessage('"Fake_Zend_Uri" is not an instance of Zend_Uri'); Zend_Uri::factory('http://example.net', 'Fake_Zend_Uri'); } diff --git a/tests/Zend/Validate/AbstractTest.php b/tests/Zend/Validate/AbstractTest.php index 677d21dcbe..fba87bc054 100644 --- a/tests/Zend/Validate/AbstractTest.php +++ b/tests/Zend/Validate/AbstractTest.php @@ -37,7 +37,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_AbstractTest extends PHPUnit_Framework_TestCase +class Zend_Validate_AbstractTest extends PHPUnit\Framework\TestCase { public function clearRegistry() { @@ -140,7 +140,7 @@ public function testErrorMessagesAreTranslatedWhenTranslatorPresent() $this->validator->setTranslator($translator); $this->assertFalse($this->validator->isValid('bar')); $messages = $this->validator->getMessages(); - $this->assertTrue(array_key_exists('fooMessage', $messages)); + $this->assertArrayHasKey('fooMessage', $messages); $this->assertContains('bar', $messages['fooMessage']); $this->assertContains('This is the translated message for ', $messages['fooMessage']); } @@ -155,7 +155,7 @@ public function testCanTranslateMessagesInsteadOfKeys() $this->validator->setTranslator($translator); $this->assertFalse($this->validator->isValid('bar')); $messages = $this->validator->getMessages(); - $this->assertTrue(array_key_exists('fooMessage', $messages)); + $this->assertArrayHasKey('fooMessage', $messages); $this->assertContains('bar', $messages['fooMessage']); $this->assertContains('This is the translated message for ', $messages['fooMessage']); } @@ -192,7 +192,7 @@ public function testDoesNotFailOnObjectInput() { $this->assertFalse($this->validator->isValid(new stdClass())); $messages = $this->validator->getMessages(); - $this->assertTrue(array_key_exists('fooMessage', $messages)); + $this->assertArrayHasKey('fooMessage', $messages); } public function testTranslatorEnabledPerDefault() @@ -217,7 +217,7 @@ public function testCanDisableTranslator() $this->assertFalse($this->validator->isValid('bar')); $messages = $this->validator->getMessages(); - $this->assertTrue(array_key_exists('fooMessage', $messages)); + $this->assertArrayHasKey('fooMessage', $messages); $this->assertContains('bar', $messages['fooMessage']); $this->assertContains('This is the translated message for ', $messages['fooMessage']); @@ -226,7 +226,7 @@ public function testCanDisableTranslator() $this->assertFalse($this->validator->isValid('bar')); $messages = $this->validator->getMessages(); - $this->assertTrue(array_key_exists('fooMessage', $messages)); + $this->assertArrayHasKey('fooMessage', $messages); $this->assertContains('bar', $messages['fooMessage']); $this->assertContains('bar was passed', $messages['fooMessage']); } @@ -257,7 +257,7 @@ public function testMaximumErrorMessageLength() $this->validator->setTranslator($translator); $this->assertFalse($this->validator->isValid('bar')); $messages = $this->validator->getMessages(); - $this->assertTrue(array_key_exists('fooMessage', $messages)); + $this->assertArrayHasKey('fooMessage', $messages); $this->assertEquals('This is...', $messages['fooMessage']); } diff --git a/tests/Zend/Validate/AlnumTest.php b/tests/Zend/Validate/AlnumTest.php index 3a5376c730..7ae213eb6c 100644 --- a/tests/Zend/Validate/AlnumTest.php +++ b/tests/Zend/Validate/AlnumTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_AlnumTest extends PHPUnit_Framework_TestCase +class Zend_Validate_AlnumTest extends PHPUnit\Framework\TestCase { /** * Zend_Validate_Alnum object diff --git a/tests/Zend/Validate/AlphaTest.php b/tests/Zend/Validate/AlphaTest.php index ba290a65db..dcb45eb343 100644 --- a/tests/Zend/Validate/AlphaTest.php +++ b/tests/Zend/Validate/AlphaTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_AlphaTest extends PHPUnit_Framework_TestCase +class Zend_Validate_AlphaTest extends PHPUnit\Framework\TestCase { /** * Zend_Validate_Alpha object diff --git a/tests/Zend/Validate/BarcodeTest.php b/tests/Zend/Validate/BarcodeTest.php index 1bb9ff6c3b..60946c963a 100644 --- a/tests/Zend/Validate/BarcodeTest.php +++ b/tests/Zend/Validate/BarcodeTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_BarcodeTest extends PHPUnit_Framework_TestCase +class Zend_Validate_BarcodeTest extends PHPUnit\Framework\TestCase { /** * Test if EAN-13 contains only numeric characters @@ -85,7 +85,7 @@ public function testInvalidChecksumAdapter() require_once dirname(__FILE__) . "/_files/MyBarcode1.php"; $barcode = new Zend_Validate_Barcode('MyBarcode1'); $this->assertFalse($barcode->isValid('0000000')); - $this->assertTrue(array_key_exists('barcodeFailed', $barcode->getMessages())); + $this->assertArrayHasKey('barcodeFailed', $barcode->getMessages()); $this->assertFalse($barcode->getAdapter()->checksum('0000000')); } @@ -436,7 +436,7 @@ public function testArrayLengthMessage() $barcode = new Zend_Validate_Barcode('ean8'); $this->assertFalse($barcode->isValid('123')); $message = $barcode->getMessages(); - $this->assertTrue(array_key_exists('barcodeInvalidLength', $message)); + $this->assertArrayHasKey('barcodeInvalidLength', $message); $this->assertContains("length of 7/8 characters", $message['barcodeInvalidLength']); } } diff --git a/tests/Zend/Validate/BetweenTest.php b/tests/Zend/Validate/BetweenTest.php index 6b88cbbf46..3d3b9810d6 100644 --- a/tests/Zend/Validate/BetweenTest.php +++ b/tests/Zend/Validate/BetweenTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_BetweenTest extends PHPUnit_Framework_TestCase +class Zend_Validate_BetweenTest extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior diff --git a/tests/Zend/Validate/CallbackTest.php b/tests/Zend/Validate/CallbackTest.php index 72eb1cb2c6..4f31015217 100644 --- a/tests/Zend/Validate/CallbackTest.php +++ b/tests/Zend/Validate/CallbackTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_CallbackTest extends PHPUnit_Framework_TestCase +class Zend_Validate_CallbackTest extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior diff --git a/tests/Zend/Validate/CcnumTest.php b/tests/Zend/Validate/CcnumTest.php index 80a746cb1d..bad7ce213c 100644 --- a/tests/Zend/Validate/CcnumTest.php +++ b/tests/Zend/Validate/CcnumTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_CcnumTest extends PHPUnit_Framework_TestCase +class Zend_Validate_CcnumTest extends PHPUnit\Framework\TestCase { /** * Zend_Validate_Ccnum object diff --git a/tests/Zend/Validate/CreditCardTest.php b/tests/Zend/Validate/CreditCardTest.php index 4aa8aaf013..55e12a3476 100644 --- a/tests/Zend/Validate/CreditCardTest.php +++ b/tests/Zend/Validate/CreditCardTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_CreditCardTest extends PHPUnit_Framework_TestCase +class Zend_Validate_CreditCardTest extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior diff --git a/tests/Zend/Validate/DateTest.php b/tests/Zend/Validate/DateTest.php index 574820248a..3d341cce9b 100644 --- a/tests/Zend/Validate/DateTest.php +++ b/tests/Zend/Validate/DateTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_DateTest extends PHPUnit_Framework_TestCase +class Zend_Validate_DateTest extends PHPUnit\Framework\TestCase { /** * Zend_Validate_Date object diff --git a/tests/Zend/Validate/Db/NoRecordExistsTest.php b/tests/Zend/Validate/Db/NoRecordExistsTest.php index 43b8d337c6..ca1d17b5e1 100644 --- a/tests/Zend/Validate/Db/NoRecordExistsTest.php +++ b/tests/Zend/Validate/Db/NoRecordExistsTest.php @@ -22,7 +22,7 @@ /** - * PHPUnit_Framework_TestCase + * PHPUnit\Framework\TestCase */ @@ -65,7 +65,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_Db_NoRecordExistsTest extends PHPUnit_Framework_TestCase +class Zend_Validate_Db_NoRecordExistsTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Validate/Db/RecordExistsTest.php b/tests/Zend/Validate/Db/RecordExistsTest.php index 582150d7b2..30bdd43a33 100644 --- a/tests/Zend/Validate/Db/RecordExistsTest.php +++ b/tests/Zend/Validate/Db/RecordExistsTest.php @@ -22,7 +22,7 @@ /** - * PHPUnit_Framework_TestCase + * PHPUnit\Framework\TestCase */ @@ -64,7 +64,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_Db_RecordExistsTest extends PHPUnit_Framework_TestCase +class Zend_Validate_Db_RecordExistsTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/Validate/DigitsTest.php b/tests/Zend/Validate/DigitsTest.php index aad6910197..8660ee1281 100644 --- a/tests/Zend/Validate/DigitsTest.php +++ b/tests/Zend/Validate/DigitsTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_DigitsTest extends PHPUnit_Framework_TestCase +class Zend_Validate_DigitsTest extends PHPUnit\Framework\TestCase { /** * Zend_Validate_Digits object diff --git a/tests/Zend/Validate/EmailAddressTest.php b/tests/Zend/Validate/EmailAddressTest.php index a43ec20836..3270fe5e0f 100644 --- a/tests/Zend/Validate/EmailAddressTest.php +++ b/tests/Zend/Validate/EmailAddressTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_EmailAddressTest extends PHPUnit_Framework_TestCase +class Zend_Validate_EmailAddressTest extends PHPUnit\Framework\TestCase { /** * Default instance created for all test methods @@ -150,7 +150,7 @@ public function testLocalPartQuotedString() $messages = $this->_validator->getMessages(); - $this->assertTrue(is_array($messages)); + $this->assertInternalType('array', $messages); $this->assertEquals(0, count($messages)); } diff --git a/tests/Zend/Validate/File/CountTest.php b/tests/Zend/Validate/File/CountTest.php index f6c10d9e67..76c786f523 100644 --- a/tests/Zend/Validate/File/CountTest.php +++ b/tests/Zend/Validate/File/CountTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_File_CountTest extends PHPUnit_Framework_TestCase +class Zend_Validate_File_CountTest extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior diff --git a/tests/Zend/Validate/File/Crc32Test.php b/tests/Zend/Validate/File/Crc32Test.php index f47a247886..a3ac56eb68 100644 --- a/tests/Zend/Validate/File/Crc32Test.php +++ b/tests/Zend/Validate/File/Crc32Test.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_File_Crc32Test extends PHPUnit_Framework_TestCase +class Zend_Validate_File_Crc32Test extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior @@ -62,7 +62,7 @@ public function testBasic() $validator = new Zend_Validate_File_Crc32('3f8d07e2'); $this->assertFalse($validator->isValid(dirname(__FILE__) . '/_files/nofile.mo')); - $this->assertTrue(array_key_exists('fileCrc32NotFound', $validator->getMessages())); + $this->assertArrayHasKey('fileCrc32NotFound', $validator->getMessages()); $files = array( 'name' => 'test1', @@ -73,7 +73,7 @@ public function testBasic() ); $validator = new Zend_Validate_File_Crc32('3f8d07e2'); $this->assertFalse($validator->isValid(dirname(__FILE__) . '/_files/nofile.mo', $files)); - $this->assertTrue(array_key_exists('fileCrc32NotFound', $validator->getMessages())); + $this->assertArrayHasKey('fileCrc32NotFound', $validator->getMessages()); $files = array( 'name' => 'testsize.mo', @@ -94,7 +94,7 @@ public function testBasic() ); $validator = new Zend_Validate_File_Crc32('9f8d07e2'); $this->assertFalse($validator->isValid(dirname(__FILE__) . '/_files/picture.jpg', $files)); - $this->assertTrue(array_key_exists('fileCrc32DoesNotMatch', $validator->getMessages())); + $this->assertArrayHasKey('fileCrc32DoesNotMatch', $validator->getMessages()); } /** diff --git a/tests/Zend/Validate/File/ExcludeExtensionTest.php b/tests/Zend/Validate/File/ExcludeExtensionTest.php index 49ba55fa50..e303e51f5e 100644 --- a/tests/Zend/Validate/File/ExcludeExtensionTest.php +++ b/tests/Zend/Validate/File/ExcludeExtensionTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_File_ExcludeExtensionTest extends PHPUnit_Framework_TestCase +class Zend_Validate_File_ExcludeExtensionTest extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior @@ -64,7 +64,7 @@ public function testBasic() $validator = new Zend_Validate_File_ExcludeExtension('mo'); $this->assertEquals(false, $validator->isValid(dirname(__FILE__) . '/_files/nofile.mo')); - $this->assertTrue(array_key_exists('fileExcludeExtensionNotFound', $validator->getMessages())); + $this->assertArrayHasKey('fileExcludeExtensionNotFound', $validator->getMessages()); $files = array( 'name' => 'test1', @@ -75,7 +75,7 @@ public function testBasic() ); $validator = new Zend_Validate_File_ExcludeExtension('mo'); $this->assertEquals(false, $validator->isValid(dirname(__FILE__) . '/_files/nofile.mo', $files)); - $this->assertTrue(array_key_exists('fileExcludeExtensionNotFound', $validator->getMessages())); + $this->assertArrayHasKey('fileExcludeExtensionNotFound', $validator->getMessages()); $files = array( 'name' => 'testsize.mo', @@ -86,7 +86,7 @@ public function testBasic() ); $validator = new Zend_Validate_File_ExcludeExtension('mo'); $this->assertEquals(false, $validator->isValid(dirname(__FILE__) . '/_files/testsize.mo', $files)); - $this->assertTrue(array_key_exists('fileExcludeExtensionFalse', $validator->getMessages())); + $this->assertArrayHasKey('fileExcludeExtensionFalse', $validator->getMessages()); $files = array( 'name' => 'testsize.mo', diff --git a/tests/Zend/Validate/File/ExcludeMimeTypeTest.php b/tests/Zend/Validate/File/ExcludeMimeTypeTest.php index dd7aabf90b..30929a3dd3 100644 --- a/tests/Zend/Validate/File/ExcludeMimeTypeTest.php +++ b/tests/Zend/Validate/File/ExcludeMimeTypeTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_File_ExcludeMimeTypeTest extends PHPUnit_Framework_TestCase +class Zend_Validate_File_ExcludeMimeTypeTest extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior diff --git a/tests/Zend/Validate/File/ExistsTest.php b/tests/Zend/Validate/File/ExistsTest.php index 008969294a..2d991b2ef6 100644 --- a/tests/Zend/Validate/File/ExistsTest.php +++ b/tests/Zend/Validate/File/ExistsTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_File_ExistsTest extends PHPUnit_Framework_TestCase +class Zend_Validate_File_ExistsTest extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior diff --git a/tests/Zend/Validate/File/ExtensionTest.php b/tests/Zend/Validate/File/ExtensionTest.php index c281b6a5bf..8b3194725b 100644 --- a/tests/Zend/Validate/File/ExtensionTest.php +++ b/tests/Zend/Validate/File/ExtensionTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_File_ExtensionTest extends PHPUnit_Framework_TestCase +class Zend_Validate_File_ExtensionTest extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior @@ -64,7 +64,7 @@ public function testBasic() $validator = new Zend_Validate_File_Extension('mo'); $this->assertEquals(false, $validator->isValid(dirname(__FILE__) . '/_files/nofile.mo')); - $this->assertTrue(array_key_exists('fileExtensionNotFound', $validator->getMessages())); + $this->assertArrayHasKey('fileExtensionNotFound', $validator->getMessages()); $files = array( 'name' => 'test1', @@ -75,7 +75,7 @@ public function testBasic() ); $validator = new Zend_Validate_File_Extension('mo'); $this->assertEquals(false, $validator->isValid(dirname(__FILE__) . '/_files/nofile.mo', $files)); - $this->assertTrue(array_key_exists('fileExtensionNotFound', $validator->getMessages())); + $this->assertArrayHasKey('fileExtensionNotFound', $validator->getMessages()); $files = array( 'name' => 'testsize.mo', @@ -96,7 +96,7 @@ public function testBasic() ); $validator = new Zend_Validate_File_Extension('gif'); $this->assertEquals(false, $validator->isValid(dirname(__FILE__) . '/_files/testsize.mo', $files)); - $this->assertTrue(array_key_exists('fileExtensionFalse', $validator->getMessages())); + $this->assertArrayHasKey('fileExtensionFalse', $validator->getMessages()); } /** diff --git a/tests/Zend/Validate/File/FilesSizeTest.php b/tests/Zend/Validate/File/FilesSizeTest.php index 653b81c33c..62a824c42d 100644 --- a/tests/Zend/Validate/File/FilesSizeTest.php +++ b/tests/Zend/Validate/File/FilesSizeTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_File_FilesSizeTest extends PHPUnit_Framework_TestCase +class Zend_Validate_File_FilesSizeTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -78,7 +78,7 @@ public function testBasic() $validator = new Zend_Validate_File_FilesSize(array('min' => 0, 'max' => 200)); $this->assertEquals(false, $validator->isValid(dirname(__FILE__) . '/_files/nofile.mo')); - $this->assertTrue(array_key_exists('fileFilesSizeNotReadable', $validator->getMessages())); + $this->assertArrayHasKey('fileFilesSizeNotReadable', $validator->getMessages()); $validator = new Zend_Validate_File_FilesSize(array('min' => 0, 'max' => 500000)); $this->assertEquals(true, $validator->isValid(array( diff --git a/tests/Zend/Validate/File/HashTest.php b/tests/Zend/Validate/File/HashTest.php index 5cd269b72c..a6dc8e0f92 100644 --- a/tests/Zend/Validate/File/HashTest.php +++ b/tests/Zend/Validate/File/HashTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_File_HashTest extends PHPUnit_Framework_TestCase +class Zend_Validate_File_HashTest extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior @@ -78,7 +78,7 @@ public function testBasic() $validator = new Zend_Validate_File_Hash('3f8d07e2'); $this->assertFalse($validator->isValid(dirname(__FILE__) . '/_files/nofile.mo')); - $this->assertTrue(array_key_exists('fileHashNotFound', $validator->getMessages())); + $this->assertArrayHasKey('fileHashNotFound', $validator->getMessages()); $files = array( 'name' => 'test1', @@ -89,7 +89,7 @@ public function testBasic() ); $validator = new Zend_Validate_File_Hash('3f8d07e2'); $this->assertFalse($validator->isValid(dirname(__FILE__) . '/_files/nofile.mo', $files)); - $this->assertTrue(array_key_exists('fileHashNotFound', $validator->getMessages())); + $this->assertArrayHasKey('fileHashNotFound', $validator->getMessages()); $files = array( 'name' => 'testsize.mo', @@ -110,7 +110,7 @@ public function testBasic() ); $validator = new Zend_Validate_File_Hash('9f8d07e2'); $this->assertFalse($validator->isValid(dirname(__FILE__) . '/_files/picture.jpg', $files)); - $this->assertTrue(array_key_exists('fileHashDoesNotMatch', $validator->getMessages())); + $this->assertArrayHasKey('fileHashDoesNotMatch', $validator->getMessages()); } /** diff --git a/tests/Zend/Validate/File/ImageSizeTest.php b/tests/Zend/Validate/File/ImageSizeTest.php index 397ef1fbbb..fc8f89aa21 100644 --- a/tests/Zend/Validate/File/ImageSizeTest.php +++ b/tests/Zend/Validate/File/ImageSizeTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_File_ImageSizeTest extends PHPUnit_Framework_TestCase +class Zend_Validate_File_ImageSizeTest extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior diff --git a/tests/Zend/Validate/File/IsCompressedTest.php b/tests/Zend/Validate/File/IsCompressedTest.php index 973dcbd08a..52f0c3f5a2 100644 --- a/tests/Zend/Validate/File/IsCompressedTest.php +++ b/tests/Zend/Validate/File/IsCompressedTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_File_IsCompressedTest extends PHPUnit_Framework_TestCase +class Zend_Validate_File_IsCompressedTest extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior @@ -174,7 +174,7 @@ public function testErrorMessages() $validator->enableHeaderCheck(); $this->assertFalse($validator->isValid(dirname(__FILE__) . '/_files/picture.jpg', $files)); $error = $validator->getMessages(); - $this->assertTrue(array_key_exists('fileIsCompressedFalseType', $error)); + $this->assertArrayHasKey('fileIsCompressedFalseType', $error); } public function testOptionsAtConstructor() diff --git a/tests/Zend/Validate/File/IsImageTest.php b/tests/Zend/Validate/File/IsImageTest.php index 697463b807..666f265520 100644 --- a/tests/Zend/Validate/File/IsImageTest.php +++ b/tests/Zend/Validate/File/IsImageTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_File_IsImageTest extends PHPUnit_Framework_TestCase +class Zend_Validate_File_IsImageTest extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior @@ -153,7 +153,7 @@ public function testErrorMessages() $validator->enableHeaderCheck(); $this->assertFalse($validator->isValid(dirname(__FILE__) . '/_files/picture.jpg', $files)); $error = $validator->getMessages(); - $this->assertTrue(array_key_exists('fileIsImageFalseType', $error)); + $this->assertArrayHasKey('fileIsImageFalseType', $error); } public function testOptionsAtConstructor() diff --git a/tests/Zend/Validate/File/Md5Test.php b/tests/Zend/Validate/File/Md5Test.php index 0f124cb51e..c82685cd6b 100644 --- a/tests/Zend/Validate/File/Md5Test.php +++ b/tests/Zend/Validate/File/Md5Test.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_File_Md5Test extends PHPUnit_Framework_TestCase +class Zend_Validate_File_Md5Test extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior @@ -62,7 +62,7 @@ public function testBasic() $validator = new Zend_Validate_File_Md5('ed74c22109fe9f110579f77b053b8bc3'); $this->assertFalse($validator->isValid(dirname(__FILE__) . '/_files/nofile.mo')); - $this->assertTrue(array_key_exists('fileMd5NotFound', $validator->getMessages())); + $this->assertArrayHasKey('fileMd5NotFound', $validator->getMessages()); $files = array( 'name' => 'test1', @@ -73,7 +73,7 @@ public function testBasic() ); $validator = new Zend_Validate_File_Md5('ed74c22109fe9f110579f77b053b8bc3'); $this->assertFalse($validator->isValid(dirname(__FILE__) . '/_files/nofile.mo', $files)); - $this->assertTrue(array_key_exists('fileMd5NotFound', $validator->getMessages())); + $this->assertArrayHasKey('fileMd5NotFound', $validator->getMessages()); $files = array( 'name' => 'testsize.mo', @@ -94,7 +94,7 @@ public function testBasic() ); $validator = new Zend_Validate_File_Md5('7d74c22109fe9f110579f77b053b8bc3'); $this->assertFalse($validator->isValid(dirname(__FILE__) . '/_files/picture.jpg', $files)); - $this->assertTrue(array_key_exists('fileMd5DoesNotMatch', $validator->getMessages())); + $this->assertArrayHasKey('fileMd5DoesNotMatch', $validator->getMessages()); } /** diff --git a/tests/Zend/Validate/File/MimeTypeTest.php b/tests/Zend/Validate/File/MimeTypeTest.php index 74657bbd5e..1c0dcb2685 100644 --- a/tests/Zend/Validate/File/MimeTypeTest.php +++ b/tests/Zend/Validate/File/MimeTypeTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_File_MimeTypeTest extends PHPUnit_Framework_TestCase +class Zend_Validate_File_MimeTypeTest extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior diff --git a/tests/Zend/Validate/File/NotExistsTest.php b/tests/Zend/Validate/File/NotExistsTest.php index 01744886c9..3a3ad25b5d 100644 --- a/tests/Zend/Validate/File/NotExistsTest.php +++ b/tests/Zend/Validate/File/NotExistsTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_File_NotExistsTest extends PHPUnit_Framework_TestCase +class Zend_Validate_File_NotExistsTest extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior diff --git a/tests/Zend/Validate/File/Sha1Test.php b/tests/Zend/Validate/File/Sha1Test.php index d17dd77531..3212d03f5f 100644 --- a/tests/Zend/Validate/File/Sha1Test.php +++ b/tests/Zend/Validate/File/Sha1Test.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_File_Sha1Test extends PHPUnit_Framework_TestCase +class Zend_Validate_File_Sha1Test extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior @@ -62,7 +62,7 @@ public function testBasic() $validator = new Zend_Validate_File_Sha1('b2a5334847b4328e7d19d9b41fd874dffa911c98'); $this->assertFalse($validator->isValid(dirname(__FILE__) . '/_files/nofile.mo')); - $this->assertTrue(array_key_exists('fileSha1NotFound', $validator->getMessages())); + $this->assertArrayHasKey('fileSha1NotFound', $validator->getMessages()); $files = array( 'name' => 'test1', @@ -73,7 +73,7 @@ public function testBasic() ); $validator = new Zend_Validate_File_Sha1('b2a5334847b4328e7d19d9b41fd874dffa911c98'); $this->assertFalse($validator->isValid(dirname(__FILE__) . '/_files/nofile.mo', $files)); - $this->assertTrue(array_key_exists('fileSha1NotFound', $validator->getMessages())); + $this->assertArrayHasKey('fileSha1NotFound', $validator->getMessages()); $files = array( 'name' => 'testsize.mo', @@ -94,7 +94,7 @@ public function testBasic() ); $validator = new Zend_Validate_File_Sha1('42a5334847b4328e7d19d9b41fd874dffa911c98'); $this->assertFalse($validator->isValid(dirname(__FILE__) . '/_files/picture.jpg', $files)); - $this->assertTrue(array_key_exists('fileSha1DoesNotMatch', $validator->getMessages())); + $this->assertArrayHasKey('fileSha1DoesNotMatch', $validator->getMessages()); } /** diff --git a/tests/Zend/Validate/File/SizeTest.php b/tests/Zend/Validate/File/SizeTest.php index 7aa125b4ea..be7ef9c402 100644 --- a/tests/Zend/Validate/File/SizeTest.php +++ b/tests/Zend/Validate/File/SizeTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_File_SizeTest extends PHPUnit_Framework_TestCase +class Zend_Validate_File_SizeTest extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior diff --git a/tests/Zend/Validate/File/UploadTest.php b/tests/Zend/Validate/File/UploadTest.php index 448a102719..e7ff99488f 100644 --- a/tests/Zend/Validate/File/UploadTest.php +++ b/tests/Zend/Validate/File/UploadTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_File_UploadTest extends PHPUnit_Framework_TestCase +class Zend_Validate_File_UploadTest extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior @@ -101,51 +101,51 @@ public function testBasic() $validator = new Zend_Validate_File_Upload(); $this->assertFalse($validator->isValid('test')); - $this->assertTrue(array_key_exists('fileUploadErrorAttack', $validator->getMessages())); + $this->assertArrayHasKey('fileUploadErrorAttack', $validator->getMessages()); $validator = new Zend_Validate_File_Upload(); $this->assertFalse($validator->isValid('test2')); - $this->assertTrue(array_key_exists('fileUploadErrorIniSize', $validator->getMessages())); + $this->assertArrayHasKey('fileUploadErrorIniSize', $validator->getMessages()); $validator = new Zend_Validate_File_Upload(); $this->assertFalse($validator->isValid('test3')); - $this->assertTrue(array_key_exists('fileUploadErrorFormSize', $validator->getMessages())); + $this->assertArrayHasKey('fileUploadErrorFormSize', $validator->getMessages()); $validator = new Zend_Validate_File_Upload(); $this->assertFalse($validator->isValid('test4')); - $this->assertTrue(array_key_exists('fileUploadErrorPartial', $validator->getMessages())); + $this->assertArrayHasKey('fileUploadErrorPartial', $validator->getMessages()); $validator = new Zend_Validate_File_Upload(); $this->assertFalse($validator->isValid('test5')); - $this->assertTrue(array_key_exists('fileUploadErrorNoFile', $validator->getMessages())); + $this->assertArrayHasKey('fileUploadErrorNoFile', $validator->getMessages()); $validator = new Zend_Validate_File_Upload(); $this->assertFalse($validator->isValid('test6')); - $this->assertTrue(array_key_exists('fileUploadErrorUnknown', $validator->getMessages())); + $this->assertArrayHasKey('fileUploadErrorUnknown', $validator->getMessages()); $validator = new Zend_Validate_File_Upload(); $this->assertFalse($validator->isValid('test7')); - $this->assertTrue(array_key_exists('fileUploadErrorNoTmpDir', $validator->getMessages())); + $this->assertArrayHasKey('fileUploadErrorNoTmpDir', $validator->getMessages()); $validator = new Zend_Validate_File_Upload(); $this->assertFalse($validator->isValid('test8')); - $this->assertTrue(array_key_exists('fileUploadErrorCantWrite', $validator->getMessages())); + $this->assertArrayHasKey('fileUploadErrorCantWrite', $validator->getMessages()); $validator = new Zend_Validate_File_Upload(); $this->assertFalse($validator->isValid('test9')); - $this->assertTrue(array_key_exists('fileUploadErrorExtension', $validator->getMessages())); + $this->assertArrayHasKey('fileUploadErrorExtension', $validator->getMessages()); $validator = new Zend_Validate_File_Upload(); $this->assertFalse($validator->isValid('test1')); - $this->assertTrue(array_key_exists('fileUploadErrorAttack', $validator->getMessages())); + $this->assertArrayHasKey('fileUploadErrorAttack', $validator->getMessages()); $validator = new Zend_Validate_File_Upload(); $this->assertFalse($validator->isValid('tmp_test1')); - $this->assertTrue(array_key_exists('fileUploadErrorAttack', $validator->getMessages())); + $this->assertArrayHasKey('fileUploadErrorAttack', $validator->getMessages()); $validator = new Zend_Validate_File_Upload(); $this->assertFalse($validator->isValid('test000')); - $this->assertTrue(array_key_exists('fileUploadErrorFileNotFound', $validator->getMessages())); + $this->assertArrayHasKey('fileUploadErrorFileNotFound', $validator->getMessages()); } /** diff --git a/tests/Zend/Validate/File/WordCountTest.php b/tests/Zend/Validate/File/WordCountTest.php index 6767be62fc..60a1c2b101 100644 --- a/tests/Zend/Validate/File/WordCountTest.php +++ b/tests/Zend/Validate/File/WordCountTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_File_WordCountTest extends PHPUnit_Framework_TestCase +class Zend_Validate_File_WordCountTest extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior diff --git a/tests/Zend/Validate/FloatTest.php b/tests/Zend/Validate/FloatTest.php index d4da25f0f0..484e506719 100644 --- a/tests/Zend/Validate/FloatTest.php +++ b/tests/Zend/Validate/FloatTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_FloatTest extends PHPUnit_Framework_TestCase +class Zend_Validate_FloatTest extends PHPUnit\Framework\TestCase { /** * Zend_Validate_Float object diff --git a/tests/Zend/Validate/GreaterThanTest.php b/tests/Zend/Validate/GreaterThanTest.php index 469534e619..cbc5bc1afb 100644 --- a/tests/Zend/Validate/GreaterThanTest.php +++ b/tests/Zend/Validate/GreaterThanTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_GreaterThanTest extends PHPUnit_Framework_TestCase +class Zend_Validate_GreaterThanTest extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior diff --git a/tests/Zend/Validate/HexTest.php b/tests/Zend/Validate/HexTest.php index f19e692c4b..f177f2fa95 100644 --- a/tests/Zend/Validate/HexTest.php +++ b/tests/Zend/Validate/HexTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_HexTest extends PHPUnit_Framework_TestCase +class Zend_Validate_HexTest extends PHPUnit\Framework\TestCase { /** * Zend_Validate_Hex object diff --git a/tests/Zend/Validate/HostnameTest.php b/tests/Zend/Validate/HostnameTest.php index d938e26778..841195aac2 100644 --- a/tests/Zend/Validate/HostnameTest.php +++ b/tests/Zend/Validate/HostnameTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_HostnameTest extends PHPUnit_Framework_TestCase +class Zend_Validate_HostnameTest extends PHPUnit\Framework\TestCase { /** * Default instance created for all test methods diff --git a/tests/Zend/Validate/IbanTest.php b/tests/Zend/Validate/IbanTest.php index 5ea5895d30..c00d4bf118 100644 --- a/tests/Zend/Validate/IbanTest.php +++ b/tests/Zend/Validate/IbanTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_IbanTest extends PHPUnit_Framework_TestCase +class Zend_Validate_IbanTest extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior diff --git a/tests/Zend/Validate/IdenticalTest.php b/tests/Zend/Validate/IdenticalTest.php index a0c64b314c..070b01d9e9 100644 --- a/tests/Zend/Validate/IdenticalTest.php +++ b/tests/Zend/Validate/IdenticalTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_IdenticalTest extends PHPUnit_Framework_TestCase +class Zend_Validate_IdenticalTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Validate_Identical @@ -73,7 +73,7 @@ public function testValidatingWhenTokenNullSetsMissingTokenMessage() { $this->testValidatingWhenTokenNullReturnsFalse(); $messages = $this->validator->getMessages(); - $this->assertTrue(array_key_exists('missingToken', $messages)); + $this->assertArrayHasKey('missingToken', $messages); } public function testValidatingAgainstTokenWithNonMatchingValueReturnsFalse() @@ -86,7 +86,7 @@ public function testValidatingAgainstTokenWithNonMatchingValueSetsNotSameMessage { $this->testValidatingAgainstTokenWithNonMatchingValueReturnsFalse(); $messages = $this->validator->getMessages(); - $this->assertTrue(array_key_exists('notSame', $messages)); + $this->assertArrayHasKey('notSame', $messages); } public function testValidatingAgainstTokenWithMatchingValueReturnsTrue() diff --git a/tests/Zend/Validate/InArrayTest.php b/tests/Zend/Validate/InArrayTest.php index e92dcebb09..b9de3e5aff 100644 --- a/tests/Zend/Validate/InArrayTest.php +++ b/tests/Zend/Validate/InArrayTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_InArrayTest extends PHPUnit_Framework_TestCase +class Zend_Validate_InArrayTest extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior diff --git a/tests/Zend/Validate/IntTest.php b/tests/Zend/Validate/IntTest.php index 2224ea7a90..ab75356941 100644 --- a/tests/Zend/Validate/IntTest.php +++ b/tests/Zend/Validate/IntTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_IntTest extends PHPUnit_Framework_TestCase +class Zend_Validate_IntTest extends PHPUnit\Framework\TestCase { /** * Zend_Validate_Int object diff --git a/tests/Zend/Validate/IpTest.php b/tests/Zend/Validate/IpTest.php index 69d0c5f91e..824fc8b483 100644 --- a/tests/Zend/Validate/IpTest.php +++ b/tests/Zend/Validate/IpTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_IpTest extends PHPUnit_Framework_TestCase +class Zend_Validate_IpTest extends PHPUnit\Framework\TestCase { /** * Zend_Validate_Ip object diff --git a/tests/Zend/Validate/IsbnTest.php b/tests/Zend/Validate/IsbnTest.php index 449061215e..b32284bcde 100644 --- a/tests/Zend/Validate/IsbnTest.php +++ b/tests/Zend/Validate/IsbnTest.php @@ -32,7 +32,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Validate_IsbnTest extends PHPUnit_Framework_TestCase +class Zend_Validate_IsbnTest extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior diff --git a/tests/Zend/Validate/LessThanTest.php b/tests/Zend/Validate/LessThanTest.php index db80605d9c..c1476d329a 100644 --- a/tests/Zend/Validate/LessThanTest.php +++ b/tests/Zend/Validate/LessThanTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_LessThanTest extends PHPUnit_Framework_TestCase +class Zend_Validate_LessThanTest extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior diff --git a/tests/Zend/Validate/MessageTest.php b/tests/Zend/Validate/MessageTest.php index 162693b72e..3b556073b7 100644 --- a/tests/Zend/Validate/MessageTest.php +++ b/tests/Zend/Validate/MessageTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_MessageTest extends PHPUnit_Framework_TestCase +class Zend_Validate_MessageTest extends PHPUnit\Framework\TestCase { /** * Default instance created for all test methods @@ -284,7 +284,7 @@ public function testGetMessageVariables() { $vars = $this->_validator->getMessageVariables(); - $this->assertTrue(is_array($vars)); + $this->assertInternalType('array', $vars); $this->assertEquals(array('min', 'max'), $vars); $message = 'variables: %notvar% '; foreach ($vars as $var) { diff --git a/tests/Zend/Validate/NotEmptyTest.php b/tests/Zend/Validate/NotEmptyTest.php index 806f78b6b2..dd7a82ccc8 100644 --- a/tests/Zend/Validate/NotEmptyTest.php +++ b/tests/Zend/Validate/NotEmptyTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_NotEmptyTest extends PHPUnit_Framework_TestCase +class Zend_Validate_NotEmptyTest extends PHPUnit\Framework\TestCase { /** * Zend_Validate_NotEmpty object @@ -551,7 +551,7 @@ public function testZF8767() $this->assertFalse($valid->isValid('')); $messages = $valid->getMessages(); - $this->assertTrue(array_key_exists('isEmpty', $messages)); + $this->assertArrayHasKey('isEmpty', $messages); $this->assertContains("can't be empty", $messages['isEmpty']); } diff --git a/tests/Zend/Validate/PostCodeTest.php b/tests/Zend/Validate/PostCodeTest.php index 14aa78caec..ea1f45dddd 100644 --- a/tests/Zend/Validate/PostCodeTest.php +++ b/tests/Zend/Validate/PostCodeTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_PostCodeTest extends PHPUnit_Framework_TestCase +class Zend_Validate_PostCodeTest extends PHPUnit\Framework\TestCase { /** * Zend_Validate_PostCode object diff --git a/tests/Zend/Validate/RegexTest.php b/tests/Zend/Validate/RegexTest.php index 795fd5cc4e..742413b715 100644 --- a/tests/Zend/Validate/RegexTest.php +++ b/tests/Zend/Validate/RegexTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_RegexTest extends PHPUnit_Framework_TestCase +class Zend_Validate_RegexTest extends PHPUnit\Framework\TestCase { /** * Ensures that the validator follows expected behavior diff --git a/tests/Zend/Validate/Sitemap/ChangefreqTest.php b/tests/Zend/Validate/Sitemap/ChangefreqTest.php index e1ec0bff34..51207f3a2b 100644 --- a/tests/Zend/Validate/Sitemap/ChangefreqTest.php +++ b/tests/Zend/Validate/Sitemap/ChangefreqTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_Sitemap_ChangefreqTest extends PHPUnit_Framework_TestCase +class Zend_Validate_Sitemap_ChangefreqTest extends PHPUnit\Framework\TestCase { /** * Validator diff --git a/tests/Zend/Validate/Sitemap/LastmodTest.php b/tests/Zend/Validate/Sitemap/LastmodTest.php index c0aef32a7e..2bce3f999e 100644 --- a/tests/Zend/Validate/Sitemap/LastmodTest.php +++ b/tests/Zend/Validate/Sitemap/LastmodTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_Sitemap_LastmodTest extends PHPUnit_Framework_TestCase +class Zend_Validate_Sitemap_LastmodTest extends PHPUnit\Framework\TestCase { /** * Validator diff --git a/tests/Zend/Validate/Sitemap/LocTest.php b/tests/Zend/Validate/Sitemap/LocTest.php index 1fa0d582f2..3a82c88b25 100644 --- a/tests/Zend/Validate/Sitemap/LocTest.php +++ b/tests/Zend/Validate/Sitemap/LocTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_Sitemap_LocTest extends PHPUnit_Framework_TestCase +class Zend_Validate_Sitemap_LocTest extends PHPUnit\Framework\TestCase { /** * Validator diff --git a/tests/Zend/Validate/Sitemap/PriorityTest.php b/tests/Zend/Validate/Sitemap/PriorityTest.php index 01a832c330..5d04b6c640 100644 --- a/tests/Zend/Validate/Sitemap/PriorityTest.php +++ b/tests/Zend/Validate/Sitemap/PriorityTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_Sitemap_PriorityTest extends PHPUnit_Framework_TestCase +class Zend_Validate_Sitemap_PriorityTest extends PHPUnit\Framework\TestCase { /** * Validator diff --git a/tests/Zend/Validate/StringLengthTest.php b/tests/Zend/Validate/StringLengthTest.php index 9e0bfe25d8..a2c5c6283b 100644 --- a/tests/Zend/Validate/StringLengthTest.php +++ b/tests/Zend/Validate/StringLengthTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_Validate_StringLengthTest extends PHPUnit_Framework_TestCase +class Zend_Validate_StringLengthTest extends PHPUnit\Framework\TestCase { /** * Default instance created for all test methods @@ -179,11 +179,12 @@ public function testDifferentEncodingWithValidator() } /** - * @expectedException Zend_Validate_Exception * @group GH-634 */ public function testWrongEncoding() { + $this->expectException(\Zend_Validate_Exception::class); + $this->_validator->setEncoding(''); } diff --git a/tests/Zend/ValidateTest.php b/tests/Zend/ValidateTest.php index 13f8cc80d5..ef790722b3 100644 --- a/tests/Zend/ValidateTest.php +++ b/tests/Zend/ValidateTest.php @@ -43,7 +43,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Validate */ -class Zend_ValidateTest extends PHPUnit_Framework_TestCase +class Zend_ValidateTest extends PHPUnit\Framework\TestCase { /** * Zend_Validate object @@ -152,10 +152,11 @@ public function testStaticFactoryWithConstructorArguments() * * @group ZF-2724 * @return void - * @expectedException Zend_Validate_Exception */ public function testStaticFactoryClassNotFound() { + $this->expectException(\Zend_Validate_Exception::class); + Zend_Validate::is('1234', 'UnknownValidator'); } diff --git a/tests/Zend/VersionTest.php b/tests/Zend/VersionTest.php index e076d5d4e7..5537f6ba2c 100644 --- a/tests/Zend/VersionTest.php +++ b/tests/Zend/VersionTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Version */ -class Zend_VersionTest extends PHPUnit_Framework_TestCase +class Zend_VersionTest extends PHPUnit\Framework\TestCase { /** * Tests that version_compare() and its "proxy" diff --git a/tests/Zend/View/Helper/ActionTest.php b/tests/Zend/View/Helper/ActionTest.php index f0469f4aa5..47f38b922e 100644 --- a/tests/Zend/View/Helper/ActionTest.php +++ b/tests/Zend/View/Helper/ActionTest.php @@ -46,7 +46,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_ActionTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_ActionTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -133,7 +133,7 @@ public function testResetObjectsClearsResponseBody() $this->helper->response->setBody('foobarbaz'); $this->helper->resetObjects(); $body = $this->helper->response->getBody(); - $this->assertTrue(empty($body)); + $this->assertEmpty($body); } /** @@ -146,8 +146,8 @@ public function testResetObjectsClearsResponseHeaders() $this->helper->resetObjects(); $headers = $this->helper->response->getHeaders(); $rawHeaders = $this->helper->response->getRawHeaders(); - $this->assertTrue(empty($headers)); - $this->assertTrue(empty($rawHeaders)); + $this->assertEmpty($headers); + $this->assertEmpty($rawHeaders); } /** diff --git a/tests/Zend/View/Helper/AttributeJsEscapingTest.php b/tests/Zend/View/Helper/AttributeJsEscapingTest.php index 8d0663e886..6f404b88fd 100644 --- a/tests/Zend/View/Helper/AttributeJsEscapingTest.php +++ b/tests/Zend/View/Helper/AttributeJsEscapingTest.php @@ -35,7 +35,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_AttributeJsEscapingTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_AttributeJsEscapingTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/View/Helper/BaseUrlTest.php b/tests/Zend/View/Helper/BaseUrlTest.php index 57dfd8a8ad..f09a734a8d 100644 --- a/tests/Zend/View/Helper/BaseUrlTest.php +++ b/tests/Zend/View/Helper/BaseUrlTest.php @@ -39,7 +39,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_BaseUrlTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_BaseUrlTest extends PHPUnit\Framework\TestCase { /** * Previous baseUrl before changing diff --git a/tests/Zend/View/Helper/CurrencyTest.php b/tests/Zend/View/Helper/CurrencyTest.php index db53ec116a..c9d6cf00de 100644 --- a/tests/Zend/View/Helper/CurrencyTest.php +++ b/tests/Zend/View/Helper/CurrencyTest.php @@ -40,7 +40,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_CurrencyTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_CurrencyTest extends PHPUnit\Framework\TestCase { /** * @var Zend_View_Helper_Currency diff --git a/tests/Zend/View/Helper/CycleTest.php b/tests/Zend/View/Helper/CycleTest.php index fd8092ccc3..1addbeee20 100644 --- a/tests/Zend/View/Helper/CycleTest.php +++ b/tests/Zend/View/Helper/CycleTest.php @@ -34,7 +34,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_CycleTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_CycleTest extends PHPUnit\Framework\TestCase { /** * @var Zend_View_Helper_Cycle diff --git a/tests/Zend/View/Helper/DeclareVarsTest.php b/tests/Zend/View/Helper/DeclareVarsTest.php index d051abc692..dcaa2ebea5 100644 --- a/tests/Zend/View/Helper/DeclareVarsTest.php +++ b/tests/Zend/View/Helper/DeclareVarsTest.php @@ -32,7 +32,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_DeclareVarsTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_DeclareVarsTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/View/Helper/DoctypeTest.php b/tests/Zend/View/Helper/DoctypeTest.php index 4e02f1c3e1..4fc253d928 100644 --- a/tests/Zend/View/Helper/DoctypeTest.php +++ b/tests/Zend/View/Helper/DoctypeTest.php @@ -37,7 +37,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_DoctypeTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_DoctypeTest extends PHPUnit\Framework\TestCase { /** * @var Zend_View_Helper_Doctype @@ -83,7 +83,7 @@ public function testRegistryEntryCreatedAfterInstantiation() $this->assertTrue($doctype instanceof ArrayObject); $this->assertTrue(isset($doctype['doctype'])); $this->assertTrue(isset($doctype['doctypes'])); - $this->assertTrue(is_array($doctype['doctypes'])); + $this->assertInternalType('array', $doctype['doctypes']); } public function testDoctypeMethodReturnsObjectInstance() diff --git a/tests/Zend/View/Helper/FieldsetTest.php b/tests/Zend/View/Helper/FieldsetTest.php index 5bf6472ece..7789585b66 100644 --- a/tests/Zend/View/Helper/FieldsetTest.php +++ b/tests/Zend/View/Helper/FieldsetTest.php @@ -34,7 +34,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_FieldsetTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_FieldsetTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/View/Helper/FormButtonTest.php b/tests/Zend/View/Helper/FormButtonTest.php index 1ced4e3516..e78fb2ae87 100644 --- a/tests/Zend/View/Helper/FormButtonTest.php +++ b/tests/Zend/View/Helper/FormButtonTest.php @@ -34,7 +34,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_FormButtonTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_FormButtonTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/View/Helper/FormCheckboxTest.php b/tests/Zend/View/Helper/FormCheckboxTest.php index f52812a8ee..41c0e460a1 100644 --- a/tests/Zend/View/Helper/FormCheckboxTest.php +++ b/tests/Zend/View/Helper/FormCheckboxTest.php @@ -37,7 +37,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_FormCheckboxTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_FormCheckboxTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/View/Helper/FormErrorsTest.php b/tests/Zend/View/Helper/FormErrorsTest.php index 6fab784b64..cc51e791c6 100644 --- a/tests/Zend/View/Helper/FormErrorsTest.php +++ b/tests/Zend/View/Helper/FormErrorsTest.php @@ -34,7 +34,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_FormErrorsTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_FormErrorsTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/View/Helper/FormFileTest.php b/tests/Zend/View/Helper/FormFileTest.php index 184ed86557..3cf4983e4f 100644 --- a/tests/Zend/View/Helper/FormFileTest.php +++ b/tests/Zend/View/Helper/FormFileTest.php @@ -37,7 +37,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_FormFileTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_FormFileTest extends PHPUnit\Framework\TestCase { /** * @var Zend_View diff --git a/tests/Zend/View/Helper/FormImageTest.php b/tests/Zend/View/Helper/FormImageTest.php index 0ede55e8a6..fd33f3121b 100644 --- a/tests/Zend/View/Helper/FormImageTest.php +++ b/tests/Zend/View/Helper/FormImageTest.php @@ -34,7 +34,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_FormImageTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_FormImageTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/View/Helper/FormLabelTest.php b/tests/Zend/View/Helper/FormLabelTest.php index 7bf9695ee1..c23f61d30a 100644 --- a/tests/Zend/View/Helper/FormLabelTest.php +++ b/tests/Zend/View/Helper/FormLabelTest.php @@ -35,7 +35,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_FormLabelTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_FormLabelTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/View/Helper/FormMultiCheckboxTest.php b/tests/Zend/View/Helper/FormMultiCheckboxTest.php index 0b16ddf322..6183036433 100644 --- a/tests/Zend/View/Helper/FormMultiCheckboxTest.php +++ b/tests/Zend/View/Helper/FormMultiCheckboxTest.php @@ -35,7 +35,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_FormMultiCheckboxTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_FormMultiCheckboxTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/View/Helper/FormPasswordTest.php b/tests/Zend/View/Helper/FormPasswordTest.php index 3d91401e29..9fad7b6322 100644 --- a/tests/Zend/View/Helper/FormPasswordTest.php +++ b/tests/Zend/View/Helper/FormPasswordTest.php @@ -37,7 +37,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_FormPasswordTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_FormPasswordTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/View/Helper/FormRadioTest.php b/tests/Zend/View/Helper/FormRadioTest.php index 3acf010d19..7e33f9698f 100644 --- a/tests/Zend/View/Helper/FormRadioTest.php +++ b/tests/Zend/View/Helper/FormRadioTest.php @@ -36,7 +36,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_FormRadioTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_FormRadioTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/View/Helper/FormResetTest.php b/tests/Zend/View/Helper/FormResetTest.php index f57d5c737c..8a9c2231cf 100644 --- a/tests/Zend/View/Helper/FormResetTest.php +++ b/tests/Zend/View/Helper/FormResetTest.php @@ -35,7 +35,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_FormResetTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_FormResetTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/View/Helper/FormSelectTest.php b/tests/Zend/View/Helper/FormSelectTest.php index c5abd5ed20..66203582cb 100644 --- a/tests/Zend/View/Helper/FormSelectTest.php +++ b/tests/Zend/View/Helper/FormSelectTest.php @@ -34,7 +34,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_FormSelectTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_FormSelectTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/View/Helper/FormSubmitTest.php b/tests/Zend/View/Helper/FormSubmitTest.php index 6bc4e3ee2f..3a362c2660 100644 --- a/tests/Zend/View/Helper/FormSubmitTest.php +++ b/tests/Zend/View/Helper/FormSubmitTest.php @@ -35,7 +35,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_FormSubmitTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_FormSubmitTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/View/Helper/FormTest.php b/tests/Zend/View/Helper/FormTest.php index 77e3a9f42f..82c4da7f49 100644 --- a/tests/Zend/View/Helper/FormTest.php +++ b/tests/Zend/View/Helper/FormTest.php @@ -34,7 +34,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_FormTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_FormTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/View/Helper/FormTextTest.php b/tests/Zend/View/Helper/FormTextTest.php index 6df42f2000..9227801ad5 100644 --- a/tests/Zend/View/Helper/FormTextTest.php +++ b/tests/Zend/View/Helper/FormTextTest.php @@ -36,7 +36,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_FormTextTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_FormTextTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/View/Helper/FormTextareaTest.php b/tests/Zend/View/Helper/FormTextareaTest.php index 531779d0a8..852fd256af 100644 --- a/tests/Zend/View/Helper/FormTextareaTest.php +++ b/tests/Zend/View/Helper/FormTextareaTest.php @@ -28,7 +28,7 @@ * * Tests formTextarea helper * - * @uses PHPUnit_Framework_TestCase + * @uses PHPUnit\Framework\TestCase * * @category Zend * @package Zend_View @@ -38,7 +38,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_FormTextareaTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_FormTextareaTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/View/Helper/GravatarTest.php b/tests/Zend/View/Helper/GravatarTest.php index d7e35926ce..e04bdb4136 100644 --- a/tests/Zend/View/Helper/GravatarTest.php +++ b/tests/Zend/View/Helper/GravatarTest.php @@ -39,7 +39,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_GravatarTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_GravatarTest extends PHPUnit\Framework\TestCase { /** * @var Zend_View_Helper_Gravatar @@ -138,14 +138,14 @@ public function testSetImgSize() $imgSizesRight = array(1, 500, "600"); foreach ($imgSizesRight as $value) { $this->_object->setImgSize($value); - $this->assertTrue(is_int($this->_object->getImgSize())); + $this->assertInternalType('int', $this->_object->getImgSize()); } } public function testInvalidRatingParametr() { $ratingsWrong = array( 'a', 'cs', 456); - $this->setExpectedException('Zend_View_Exception'); + $this->expectException('Zend_View_Exception'); foreach ($ratingsWrong as $value) { $this->_object->setRating($value); } @@ -165,7 +165,7 @@ public function testSetSecure() $values = array("true", "false", "text", $this->_view, 100, true, "", null, 0, false); foreach ($values as $value) { $this->_object->setSecure($value); - $this->assertTrue(is_bool($this->_object->getSecure())); + $this->assertInternalType('bool', $this->_object->getSecure()); } } diff --git a/tests/Zend/View/Helper/HeadLinkTest.php b/tests/Zend/View/Helper/HeadLinkTest.php index 3ade97bcf2..2bb8e6f2c7 100644 --- a/tests/Zend/View/Helper/HeadLinkTest.php +++ b/tests/Zend/View/Helper/HeadLinkTest.php @@ -43,7 +43,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_HeadLinkTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_HeadLinkTest extends PHPUnit\Framework\TestCase { /** * @var Zend_View_Helper_HeadLink diff --git a/tests/Zend/View/Helper/HeadMetaTest.php b/tests/Zend/View/Helper/HeadMetaTest.php index ee1e9ee83d..64e7037dc3 100644 --- a/tests/Zend/View/Helper/HeadMetaTest.php +++ b/tests/Zend/View/Helper/HeadMetaTest.php @@ -43,7 +43,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_HeadMetaTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_HeadMetaTest extends PHPUnit\Framework\TestCase { /** * @var Zend_View_Helper_HeadMeta @@ -259,9 +259,9 @@ public function testCanBuildMetaTagsWithAttributes() $this->assertObjectHasAttribute('modifiers', $value); $modifiers = $value->modifiers; - $this->assertTrue(array_key_exists('lang', $modifiers)); + $this->assertArrayHasKey('lang', $modifiers); $this->assertEquals('us_en', $modifiers['lang']); - $this->assertTrue(array_key_exists('scheme', $modifiers)); + $this->assertArrayHasKey('scheme', $modifiers); $this->assertEquals('foo', $modifiers['scheme']); } @@ -299,7 +299,7 @@ public function testToStringWhenInvalidKeyProvidedShouldConvertThrownException() set_error_handler(array($this, 'handleErrors')); $string = @$this->helper->toString(); $this->assertEquals('', $string); - $this->assertTrue(is_string($this->error)); + $this->assertInternalType('string', $this->error); } public function testHeadMetaHelperCreatesItemEntry() @@ -318,7 +318,7 @@ public function testOverloadingOffsetInsertsAtOffset() $this->helper->offsetSetName(100, 'keywords', 'foo'); $values = $this->helper->getArrayCopy(); $this->assertEquals(1, count($values)); - $this->assertTrue(array_key_exists(100, $values)); + $this->assertArrayHasKey(100, $values); $item = $values[100]; $this->assertEquals('foo', $item->content); $this->assertEquals('name', $item->type); diff --git a/tests/Zend/View/Helper/HeadScriptTest.php b/tests/Zend/View/Helper/HeadScriptTest.php index b41b2c08eb..205c343d28 100644 --- a/tests/Zend/View/Helper/HeadScriptTest.php +++ b/tests/Zend/View/Helper/HeadScriptTest.php @@ -40,7 +40,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_HeadScriptTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_HeadScriptTest extends PHPUnit\Framework\TestCase { /** * @var Zend_View_Helper_HeadScript diff --git a/tests/Zend/View/Helper/HeadStyleTest.php b/tests/Zend/View/Helper/HeadStyleTest.php index 89e600e0ad..eff33a0a1b 100644 --- a/tests/Zend/View/Helper/HeadStyleTest.php +++ b/tests/Zend/View/Helper/HeadStyleTest.php @@ -40,7 +40,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_HeadStyleTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_HeadStyleTest extends PHPUnit\Framework\TestCase { /** * @var Zend_View_Helper_HeadStyle diff --git a/tests/Zend/View/Helper/HeadTitleTest.php b/tests/Zend/View/Helper/HeadTitleTest.php index 2f805a7c9f..89582873bc 100644 --- a/tests/Zend/View/Helper/HeadTitleTest.php +++ b/tests/Zend/View/Helper/HeadTitleTest.php @@ -40,7 +40,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_HeadTitleTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_HeadTitleTest extends PHPUnit\Framework\TestCase { /** * @var Zend_View_Helper_HeadTitle diff --git a/tests/Zend/View/Helper/HtmlFlashTest.php b/tests/Zend/View/Helper/HtmlFlashTest.php index 0c995000e3..8973c44a05 100644 --- a/tests/Zend/View/Helper/HtmlFlashTest.php +++ b/tests/Zend/View/Helper/HtmlFlashTest.php @@ -32,7 +32,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_HtmlFlashTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_HtmlFlashTest extends PHPUnit\Framework\TestCase { /** * @var Zend_View_Helper_HtmlFlash diff --git a/tests/Zend/View/Helper/HtmlListTest.php b/tests/Zend/View/Helper/HtmlListTest.php index 78ea3268ba..88e4ff4500 100644 --- a/tests/Zend/View/Helper/HtmlListTest.php +++ b/tests/Zend/View/Helper/HtmlListTest.php @@ -32,7 +32,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_HtmlListTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_HtmlListTest extends PHPUnit\Framework\TestCase { /** * @var Zend_View_Helper_HtmlList diff --git a/tests/Zend/View/Helper/HtmlObjectTest.php b/tests/Zend/View/Helper/HtmlObjectTest.php index 58ecf99d38..f7058e918b 100644 --- a/tests/Zend/View/Helper/HtmlObjectTest.php +++ b/tests/Zend/View/Helper/HtmlObjectTest.php @@ -32,7 +32,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_HtmlObjectTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_HtmlObjectTest extends PHPUnit\Framework\TestCase { /** * @var Zend_View_Helper_HtmlObject diff --git a/tests/Zend/View/Helper/HtmlPageTest.php b/tests/Zend/View/Helper/HtmlPageTest.php index c733206d93..ab19b36424 100644 --- a/tests/Zend/View/Helper/HtmlPageTest.php +++ b/tests/Zend/View/Helper/HtmlPageTest.php @@ -32,7 +32,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_HtmlPageTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_HtmlPageTest extends PHPUnit\Framework\TestCase { /** * @var Zend_View_Helper_HtmlPage diff --git a/tests/Zend/View/Helper/HtmlQuicktimeTest.php b/tests/Zend/View/Helper/HtmlQuicktimeTest.php index 8293328af5..04267b5616 100644 --- a/tests/Zend/View/Helper/HtmlQuicktimeTest.php +++ b/tests/Zend/View/Helper/HtmlQuicktimeTest.php @@ -32,7 +32,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_HtmlQuicktimeTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_HtmlQuicktimeTest extends PHPUnit\Framework\TestCase { /** * @var Zend_View_Helper_HtmlQuicktime diff --git a/tests/Zend/View/Helper/InlineScriptTest.php b/tests/Zend/View/Helper/InlineScriptTest.php index 5b521a9029..b6374d92d9 100644 --- a/tests/Zend/View/Helper/InlineScriptTest.php +++ b/tests/Zend/View/Helper/InlineScriptTest.php @@ -40,7 +40,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_InlineScriptTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_InlineScriptTest extends PHPUnit\Framework\TestCase { /** * @var Zend_View_Helper_InlineScript diff --git a/tests/Zend/View/Helper/JsonTest.php b/tests/Zend/View/Helper/JsonTest.php index fdc243080d..4c6eca3be9 100644 --- a/tests/Zend/View/Helper/JsonTest.php +++ b/tests/Zend/View/Helper/JsonTest.php @@ -37,7 +37,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_JsonTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_JsonTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. @@ -107,7 +107,7 @@ public function testJsonHelperReplacesContentTypeReponseHeaderIfAlreadySet() public function testJsonHelperReturnsJsonEncodedString() { $data = $this->helper->json(array('foobar')); - $this->assertTrue(is_string($data)); + $this->assertInternalType('string', $data); $this->assertEquals(array('foobar'), Zend_Json::decode($data)); } diff --git a/tests/Zend/View/Helper/LayoutTest.php b/tests/Zend/View/Helper/LayoutTest.php index f4485c25f3..1962e1eb49 100644 --- a/tests/Zend/View/Helper/LayoutTest.php +++ b/tests/Zend/View/Helper/LayoutTest.php @@ -36,7 +36,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_LayoutTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_LayoutTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/View/Helper/Navigation/TestAbstract.php b/tests/Zend/View/Helper/Navigation/TestAbstract.php index d4c8fd9352..a67e76c72c 100644 --- a/tests/Zend/View/Helper/Navigation/TestAbstract.php +++ b/tests/Zend/View/Helper/Navigation/TestAbstract.php @@ -42,7 +42,7 @@ * @group Zend_View_Helper */ abstract class Zend_View_Helper_Navigation_TestAbstract - extends PHPUnit_Framework_TestCase + extends PHPUnit\Framework\TestCase { const REGISTRY_KEY = 'Zend_Navigation'; diff --git a/tests/Zend/View/Helper/PaginationControlTest.php b/tests/Zend/View/Helper/PaginationControlTest.php index 18e4d17807..77f797daa6 100644 --- a/tests/Zend/View/Helper/PaginationControlTest.php +++ b/tests/Zend/View/Helper/PaginationControlTest.php @@ -33,7 +33,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_PaginationControlTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_PaginationControlTest extends PHPUnit\Framework\TestCase { /** * @var Zend_View_Helper_PaginationControl diff --git a/tests/Zend/View/Helper/PartialLoopTest.php b/tests/Zend/View/Helper/PartialLoopTest.php index c58c42740a..08be150e11 100644 --- a/tests/Zend/View/Helper/PartialLoopTest.php +++ b/tests/Zend/View/Helper/PartialLoopTest.php @@ -40,7 +40,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_PartialLoopTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_PartialLoopTest extends PHPUnit\Framework\TestCase { /** * @var Zend_View_Helper_PartialLoop diff --git a/tests/Zend/View/Helper/PartialTest.php b/tests/Zend/View/Helper/PartialTest.php index d3ac790e89..39f78bea28 100644 --- a/tests/Zend/View/Helper/PartialTest.php +++ b/tests/Zend/View/Helper/PartialTest.php @@ -40,7 +40,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_PartialTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_PartialTest extends PHPUnit\Framework\TestCase { /** * @var Zend_View_Helper_Partial @@ -170,7 +170,7 @@ public function testCloneViewClearsViewVariables() $clone = $this->helper->cloneView(); $clonedVars = $clone->getVars(); - $this->assertTrue(empty($clonedVars)); + $this->assertEmpty($clonedVars); $this->assertNull($clone->foo); } diff --git a/tests/Zend/View/Helper/Placeholder/ContainerTest.php b/tests/Zend/View/Helper/Placeholder/ContainerTest.php index 1017a7e3df..d09e87d468 100644 --- a/tests/Zend/View/Helper/Placeholder/ContainerTest.php +++ b/tests/Zend/View/Helper/Placeholder/ContainerTest.php @@ -34,7 +34,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_Placeholder_ContainerTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_Placeholder_ContainerTest extends PHPUnit\Framework\TestCase { /** * @var Zend_View_Helper_Placeholder_Container diff --git a/tests/Zend/View/Helper/Placeholder/RegistryTest.php b/tests/Zend/View/Helper/Placeholder/RegistryTest.php index 8a1954906f..94bded6308 100644 --- a/tests/Zend/View/Helper/Placeholder/RegistryTest.php +++ b/tests/Zend/View/Helper/Placeholder/RegistryTest.php @@ -34,7 +34,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_Placeholder_RegistryTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_Placeholder_RegistryTest extends PHPUnit\Framework\TestCase { /** * @var Zend_View_Helper_Placeholder_Registry diff --git a/tests/Zend/View/Helper/Placeholder/StandaloneContainerTest.php b/tests/Zend/View/Helper/Placeholder/StandaloneContainerTest.php index 6452c136b3..d40a32f431 100644 --- a/tests/Zend/View/Helper/Placeholder/StandaloneContainerTest.php +++ b/tests/Zend/View/Helper/Placeholder/StandaloneContainerTest.php @@ -43,7 +43,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_Placeholder_StandaloneContainerTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_Placeholder_StandaloneContainerTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/View/Helper/PlaceholderTest.php b/tests/Zend/View/Helper/PlaceholderTest.php index 330fce3bd3..3ca048d9ea 100644 --- a/tests/Zend/View/Helper/PlaceholderTest.php +++ b/tests/Zend/View/Helper/PlaceholderTest.php @@ -40,7 +40,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_PlaceholderTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_PlaceholderTest extends PHPUnit\Framework\TestCase { /** * @var Zend_View_Helper_Placeholder diff --git a/tests/Zend/View/Helper/RenderToPlaceholderTest.php b/tests/Zend/View/Helper/RenderToPlaceholderTest.php index 837889d637..cf98c151ce 100644 --- a/tests/Zend/View/Helper/RenderToPlaceholderTest.php +++ b/tests/Zend/View/Helper/RenderToPlaceholderTest.php @@ -33,7 +33,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_RenderToPlaceholderTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_RenderToPlaceholderTest extends PHPUnit\Framework\TestCase { protected $_view = null; diff --git a/tests/Zend/View/Helper/ServerUrlTest.php b/tests/Zend/View/Helper/ServerUrlTest.php index df775d1227..9bcb5f5580 100644 --- a/tests/Zend/View/Helper/ServerUrlTest.php +++ b/tests/Zend/View/Helper/ServerUrlTest.php @@ -34,7 +34,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_ServerUrlTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_ServerUrlTest extends PHPUnit\Framework\TestCase { /** * Back up of $_SERVER diff --git a/tests/Zend/View/Helper/TranslateTest.php b/tests/Zend/View/Helper/TranslateTest.php index 800cf3b692..96d764163c 100644 --- a/tests/Zend/View/Helper/TranslateTest.php +++ b/tests/Zend/View/Helper/TranslateTest.php @@ -41,7 +41,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_TranslateTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_TranslateTest extends PHPUnit\Framework\TestCase { /** * @var Zend_View_Helper_Translate diff --git a/tests/Zend/View/Helper/UrlTest.php b/tests/Zend/View/Helper/UrlTest.php index 974052e05f..0f95ac266c 100644 --- a/tests/Zend/View/Helper/UrlTest.php +++ b/tests/Zend/View/Helper/UrlTest.php @@ -41,7 +41,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_UrlTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_UrlTest extends PHPUnit\Framework\TestCase { /** * Sets up the fixture, for example, open a network connection. diff --git a/tests/Zend/View/Helper/UserAgentTest.php b/tests/Zend/View/Helper/UserAgentTest.php index b72ab0c01b..fe0487d7e3 100644 --- a/tests/Zend/View/Helper/UserAgentTest.php +++ b/tests/Zend/View/Helper/UserAgentTest.php @@ -36,7 +36,7 @@ * @group Zend_View * @group Zend_View_Helper */ -class Zend_View_Helper_UserAgentTest extends PHPUnit_Framework_TestCase +class Zend_View_Helper_UserAgentTest extends PHPUnit\Framework\TestCase { /** diff --git a/tests/Zend/ViewTest.php b/tests/Zend/ViewTest.php index 7e4f53c2c4..e5e88161fe 100644 --- a/tests/Zend/ViewTest.php +++ b/tests/Zend/ViewTest.php @@ -43,7 +43,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_View */ -class Zend_ViewTest extends PHPUnit_Framework_TestCase +class Zend_ViewTest extends PHPUnit\Framework\TestCase { public function setUp() { @@ -126,14 +126,14 @@ protected function _testDefaultPath($pathType, $testReadability = true) $paths = $this->_filterPath($reflector[$pathType]); // test default helper path - $this->assertTrue(is_array($paths)); + $this->assertInternalType('array', $paths); if ('script' == $pathType) { $this->assertEquals(0, count($paths)); } else { $this->assertEquals(1, count($paths)); $prefix = 'Zend_View_' . ucfirst($pathType) . '_'; - $this->assertTrue(array_key_exists($prefix, $paths)); + $this->assertArrayHasKey($prefix, $paths); if ($testReadability) { $path = current($paths[$prefix]); @@ -141,7 +141,7 @@ protected function _testDefaultPath($pathType, $testReadability = true) if (substr(PHP_OS, 0, 3) != 'WIN') { $this->assertTrue(Zend_Loader::isReadable($path)); } else { - $this->assertTrue(is_dir($path)); + $this->assertDirectoryExists($path); } } } @@ -187,7 +187,7 @@ protected function _testAddPath($pathType) case 'helper': case 'filter': default: - $this->assertTrue(array_key_exists($prefix, $actualPaths)); + $this->assertArrayHasKey($prefix, $actualPaths); $this->assertSame($expectedPaths, $actualPaths[$prefix], 'Actual: ' . var_export($actualPaths, 1) . "\nExpected: " . var_export($expectedPaths, 1)); } } @@ -209,11 +209,11 @@ public function testIssetEmpty() { $view = new Zend_View(); $this->assertFalse(isset($view->foo)); - $this->assertTrue(empty($view->foo)); + $this->assertEmpty($view->foo); $view->foo = 'bar'; $this->assertTrue(isset($view->foo)); - $this->assertFalse(empty($view->foo)); + $this->assertNotEmpty($view->foo); } /** @@ -314,7 +314,7 @@ public function testRenderSubTemplates() $this->assertEquals('', $view->render('testParent.phtml')); $logFile = dirname(__FILE__) . '/View/_templates/view.log'; - $this->assertTrue(file_exists($logFile)); + $this->assertFileExists($logFile); $log = file_get_contents($logFile); unlink($logFile); // clean up... $this->assertContains('This text should not be displayed', $log); @@ -333,13 +333,13 @@ public function testSetArrayProperty() $foo = $view->foo; - $this->assertTrue(is_array($foo)); + $this->assertInternalType('array', $foo); $this->assertEquals(42, $foo[0], var_export($foo, 1)); $view->assign('bar', array()); $view->bar[] = 'life'; $bar = $view->bar; - $this->assertTrue(is_array($bar)); + $this->assertInternalType('array', $bar); $this->assertEquals('life', $bar[0], var_export($bar, 1)); $view->assign(array( @@ -347,7 +347,7 @@ public function testSetArrayProperty() )); $view->baz[] = 'everything'; $baz = $view->baz; - $this->assertTrue(is_array($baz)); + $this->assertInternalType('array', $baz); $this->assertEquals('universe', $baz[0]); $this->assertEquals('everything', $baz[1], var_export($baz, 1)); } @@ -361,7 +361,7 @@ public function testClearVars() $view->foo = array(); $view->content = 'content'; - $this->assertTrue(is_array($view->foo)); + $this->assertInternalType('array', $view->foo); $this->assertEquals('content', $view->content); $view->clearVars(); @@ -382,7 +382,7 @@ public function testClearScriptPath() // add a path $view->setScriptPath('foo'); $scriptPaths = $view->getScriptPaths(); - $this->assertTrue(is_array($scriptPaths)); + $this->assertInternalType('array', $scriptPaths); $this->assertEquals(1, count($scriptPaths)); // clear paths @@ -453,9 +453,9 @@ public function testEmptyPropertiesReturnAppropriately() $view->foo = false; $view->bar = null; $view->baz = ''; - $this->assertTrue(empty($view->foo)); - $this->assertTrue(empty($view->bar)); - $this->assertTrue(empty($view->baz)); + $this->assertEmpty($view->foo); + $this->assertEmpty($view->bar); + $this->assertEmpty($view->baz); } public function testFluentInterfaces() @@ -554,13 +554,13 @@ public function testHelperPathWithPrefix() $status = $view->addHelperPath(dirname(__FILE__) . '/View/_stubs/HelperDir1/', 'My_View_Helper'); $this->assertSame($view, $status); $helperPaths = $view->getHelperPaths(); - $this->assertTrue(array_key_exists('My_View_Helper_', $helperPaths)); + $this->assertArrayHasKey('My_View_Helper_', $helperPaths); $path = $this->_filterPath(current($helperPaths['My_View_Helper_'])); $this->assertEquals($this->_filterPath(dirname(__FILE__) . '/View/_stubs/HelperDir1/'), $path); $view->setHelperPath(dirname(__FILE__) . '/View/_stubs/HelperDir2/', 'Other_View_Helper'); $helperPaths = $view->getHelperPaths(); - $this->assertTrue(array_key_exists('Other_View_Helper_', $helperPaths)); + $this->assertArrayHasKey('Other_View_Helper_', $helperPaths); $path = $this->_filterPath(current($helperPaths['Other_View_Helper_'])); $this->assertEquals($this->_filterPath(dirname(__FILE__) . '/View/_stubs/HelperDir2/'), $path); } @@ -571,7 +571,7 @@ public function testHelperPathWithPrefixAndRelativePath() $status = $view->addHelperPath('Zend/View/_stubs/HelperDir1/', 'My_View_Helper'); $this->assertSame($view, $status); $helperPaths = $view->getHelperPaths(); - $this->assertTrue(array_key_exists('My_View_Helper_', $helperPaths)); + $this->assertArrayHasKey('My_View_Helper_', $helperPaths); $this->assertContains($this->_filterPath('Zend/View/_stubs/HelperDir1/'), $this->_filterPath(current($helperPaths['My_View_Helper_']))); } @@ -581,12 +581,12 @@ public function testFilterPathWithPrefix() $status = $view->addFilterPath(dirname(__FILE__) . '/View/_stubs/HelperDir1/', 'My_View_Filter'); $this->assertSame($view, $status); $filterPaths = $view->getFilterPaths(); - $this->assertTrue(array_key_exists('My_View_Filter_', $filterPaths)); + $this->assertArrayHasKey('My_View_Filter_', $filterPaths); $this->assertEquals($this->_filterPath(dirname(__FILE__) . '/View/_stubs/HelperDir1/'), $this->_filterPath(current($filterPaths['My_View_Filter_']))); $view->setFilterPath(dirname(__FILE__) . '/View/_stubs/HelperDir2/', 'Other_View_Filter'); $filterPaths = $view->getFilterPaths(); - $this->assertTrue(array_key_exists('Other_View_Filter_', $filterPaths)); + $this->assertArrayHasKey('Other_View_Filter_', $filterPaths); $this->assertEquals($this->_filterPath(dirname(__FILE__) . '/View/_stubs/HelperDir2/'), $this->_filterPath(current($filterPaths['Other_View_Filter_']))); } @@ -662,7 +662,7 @@ public function testZf995UndefinedPropertiesReturnNull() ob_start(); echo $view->render('testZf995.phtml'); $content = ob_get_flush(); - $this->assertTrue(empty($content)); + $this->assertEmpty($content); } public function testInit() @@ -1058,7 +1058,7 @@ public function testConstructorShouldAllowPassingArrayOfHelperPaths() ), )); $paths = $view->getHelperPaths(); - $this->assertTrue(array_key_exists('My_View_', $paths), var_export($paths, 1)); + $this->assertArrayHasKey('My_View_', $paths, var_export($paths, 1)); } /** @@ -1072,7 +1072,7 @@ public function testConstructorShouldAllowPassingArrayOfFilterPaths() ), )); $paths = $view->getFilterPaths(); - $this->assertTrue(array_key_exists('My_View_', $paths), var_export($paths, 1)); + $this->assertArrayHasKey('My_View_', $paths, var_export($paths, 1)); } /** @@ -1092,20 +1092,22 @@ public function testRegisterHelperShouldRegisterHelperWithView() /** * @group ZF-8177 - * @expectedException Zend_View_Exception */ public function testRegisterHelperShouldThrowExceptionIfNotProvidedAnObject() { + $this->expectException(\Zend_View_Exception::class); + $view = new Zend_View(); $view->registerHelper('Foo', 'foo'); } /** * @group ZF-8177 - * @expectedException Zend_View_Exception */ public function testRegisterHelperShouldThrowExceptionIfProvidedANonHelperObject() { + $this->expectException(\Zend_View_Exception::class); + $view = new Zend_View(); $helper = new stdClass; $view->registerHelper($helper, 'foo'); diff --git a/tests/Zend/Wildfire/WildfireTest.php b/tests/Zend/Wildfire/WildfireTest.php index 9c8ed9f906..f08c8d69d4 100644 --- a/tests/Zend/Wildfire/WildfireTest.php +++ b/tests/Zend/Wildfire/WildfireTest.php @@ -58,7 +58,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Wildfire */ -class Zend_Wildfire_WildfireTest extends PHPUnit_Framework_TestCase +class Zend_Wildfire_WildfireTest extends PHPUnit\Framework\TestCase { protected $_controller = null; diff --git a/tests/Zend/Xml/MultibyteTest.php b/tests/Zend/Xml/MultibyteTest.php index 4c056236cb..475c852327 100644 --- a/tests/Zend/Xml/MultibyteTest.php +++ b/tests/Zend/Xml/MultibyteTest.php @@ -39,7 +39,7 @@ * @group Zend_Xml * @group ZF2015-06 */ -class Zend_Xml_MultibyteTest extends PHPUnit_Framework_TestCase +class Zend_Xml_MultibyteTest extends PHPUnit\Framework\TestCase { public function multibyteEncodings() { @@ -86,7 +86,8 @@ public function testDetectsMultibyteXXEVectorsUnderFPMWithEncodedStringMissingBO $xml = str_replace('{ENCODING}', $encoding, $xml); $xml = iconv('UTF-8', $encoding, $xml); $this->assertNotSame(0, strncmp($xml, $bom, $bomLength)); - $this->setExpectedException('Zend_Xml_Exception', 'ENTITY'); + $this->expectException('Zend_Xml_Exception'); + $this->expectExceptionMessage('ENTITY'); $this->invokeHeuristicScan($xml); } @@ -99,7 +100,8 @@ public function testDetectsMultibyteXXEVectorsUnderFPMWithEncodedStringUsingBOM( $xml = str_replace('{ENCODING}', $encoding, $xml); $orig = iconv('UTF-8', $encoding, $xml); $xml = $bom . $orig; - $this->setExpectedException('Zend_Xml_Exception', 'ENTITY'); + $this->expectException('Zend_Xml_Exception'); + $this->expectExceptionMessage('ENTITY'); $this->invokeHeuristicScan($xml); } @@ -139,7 +141,8 @@ public function testDetectsXXEWhenXMLDocumentEncodingDiffersFromFileEncoding($en $xml = str_replace('{ENCODING}', 'UTF-8', $xml); $xml = iconv('UTF-8', $encoding, $xml); $xml = $bom . $xml; - $this->setExpectedException('Zend_Xml_Exception', 'ENTITY'); + $this->expectException('Zend_Xml_Exception'); + $this->expectExceptionMessage('ENTITY'); $this->invokeHeuristicScan($xml); } } diff --git a/tests/Zend/Xml/SecurityTest.php b/tests/Zend/Xml/SecurityTest.php index c482edd437..48b24d5a22 100644 --- a/tests/Zend/Xml/SecurityTest.php +++ b/tests/Zend/Xml/SecurityTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Xml */ -class Zend_Xml_SecurityTest extends PHPUnit_Framework_TestCase +class Zend_Xml_SecurityTest extends PHPUnit\Framework\TestCase { public function testScanForXEE() { @@ -47,7 +47,7 @@ public function testScanForXEE() XML; - $this->setExpectedException('Zend_Xml_Exception'); + $this->expectException('Zend_Xml_Exception'); $result = Zend_Xml_Security::scan($xml); } diff --git a/tests/Zend/XmlRpc/BigIntegerValueTest.php b/tests/Zend/XmlRpc/BigIntegerValueTest.php index 18e34f1f31..c28b18474a 100644 --- a/tests/Zend/XmlRpc/BigIntegerValueTest.php +++ b/tests/Zend/XmlRpc/BigIntegerValueTest.php @@ -47,7 +47,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_XmlRpc */ -class Zend_XmlRpc_BigIntegerValueTest extends PHPUnit_Framework_TestCase +class Zend_XmlRpc_BigIntegerValueTest extends PHPUnit\Framework\TestCase { public function setUp() { diff --git a/tests/Zend/XmlRpc/ClientTest.php b/tests/Zend/XmlRpc/ClientTest.php index 45d557c0ab..e673c4a710 100644 --- a/tests/Zend/XmlRpc/ClientTest.php +++ b/tests/Zend/XmlRpc/ClientTest.php @@ -42,7 +42,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_XmlRpc */ -class Zend_XmlRpc_ClientTest extends PHPUnit_Framework_TestCase +class Zend_XmlRpc_ClientTest extends PHPUnit\Framework\TestCase { /** * @var Zend_Http_Client_Adapter_Abstract diff --git a/tests/Zend/XmlRpc/FaultTest.php b/tests/Zend/XmlRpc/FaultTest.php index 1a0afcd8fe..efc8b8867a 100644 --- a/tests/Zend/XmlRpc/FaultTest.php +++ b/tests/Zend/XmlRpc/FaultTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_XmlRpc */ -class Zend_XmlRpc_FaultTest extends PHPUnit_Framework_TestCase +class Zend_XmlRpc_FaultTest extends PHPUnit\Framework\TestCase { /** * Zend_XmlRpc_Fault object diff --git a/tests/Zend/XmlRpc/GeneratorTest.php b/tests/Zend/XmlRpc/GeneratorTest.php index 3e5bce80b1..630f77c07d 100644 --- a/tests/Zend/XmlRpc/GeneratorTest.php +++ b/tests/Zend/XmlRpc/GeneratorTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_XmlRpc */ -class Zend_XmlRpc_GeneratorTest extends PHPUnit_Framework_TestCase +class Zend_XmlRpc_GeneratorTest extends PHPUnit\Framework\TestCase { /** * @dataProvider Zend_XmlRpc_TestProvider::provideGenerators @@ -92,7 +92,7 @@ public function testSpecialCharsAreEncoded(Zend_XmlRpc_Generator_GeneratorAbstra $variant2 = '<>&"\'€'; try { $this->assertXml($variant1, $generator); - } catch (PHPUnit_Framework_ExpectationFailedException $e) { + } catch (PHPUnit\Framework\ExpectationFailedException $e) { $this->assertXml($variant2, $generator); } } diff --git a/tests/Zend/XmlRpc/Request/HttpTest.php b/tests/Zend/XmlRpc/Request/HttpTest.php index 68a8a9f120..332e724b83 100644 --- a/tests/Zend/XmlRpc/Request/HttpTest.php +++ b/tests/Zend/XmlRpc/Request/HttpTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_XmlRpc */ -class Zend_XmlRpc_Request_HttpTest extends PHPUnit_Framework_TestCase +class Zend_XmlRpc_Request_HttpTest extends PHPUnit\Framework\TestCase { /** * Setup environment diff --git a/tests/Zend/XmlRpc/RequestTest.php b/tests/Zend/XmlRpc/RequestTest.php index 1513a359a4..8d8267a86b 100644 --- a/tests/Zend/XmlRpc/RequestTest.php +++ b/tests/Zend/XmlRpc/RequestTest.php @@ -35,7 +35,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_XmlRpc */ -class Zend_XmlRpc_RequestTest extends PHPUnit_Framework_TestCase +class Zend_XmlRpc_RequestTest extends PHPUnit\Framework\TestCase { /** * Zend_XmlRpc_Request object @@ -362,7 +362,7 @@ public function testDoesNotAllowExternalEntities() $payload = sprintf($payload, 'file://' . realpath(dirname(__FILE__) . '/_files/ZF12293-payload.txt')); $this->_request->loadXml($payload); $method = $this->_request->getMethod(); - $this->assertTrue(empty($method)); + $this->assertEmpty($method); if (is_string($method)) { $this->assertNotContains('Local file inclusion', $method); } diff --git a/tests/Zend/XmlRpc/ResponseTest.php b/tests/Zend/XmlRpc/ResponseTest.php index 0b256fd236..5123f9e73d 100644 --- a/tests/Zend/XmlRpc/ResponseTest.php +++ b/tests/Zend/XmlRpc/ResponseTest.php @@ -32,7 +32,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_XmlRpc */ -class Zend_XmlRpc_ResponseTest extends PHPUnit_Framework_TestCase +class Zend_XmlRpc_ResponseTest extends PHPUnit\Framework\TestCase { /** * Zend_XmlRpc_Response object @@ -262,7 +262,7 @@ public function testDoesNotAllowExternalEntities() $payload = sprintf($payload, 'file://' . realpath(dirname(__FILE__) . '/_files/ZF12293-payload.txt')); $this->_response->loadXml($payload); $value = $this->_response->getReturnValue(); - $this->assertTrue(empty($value)); + $this->assertEmpty($value); if (is_string($value)) { $this->assertNotContains('Local file inclusion', $value); } diff --git a/tests/Zend/XmlRpc/Server/CacheTest.php b/tests/Zend/XmlRpc/Server/CacheTest.php index ebfefdf3cb..eb14fb899e 100644 --- a/tests/Zend/XmlRpc/Server/CacheTest.php +++ b/tests/Zend/XmlRpc/Server/CacheTest.php @@ -33,7 +33,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_XmlRpc */ -class Zend_XmlRpc_Server_CacheTest extends PHPUnit_Framework_TestCase +class Zend_XmlRpc_Server_CacheTest extends PHPUnit\Framework\TestCase { /** * Zend_XmlRpc_Server object diff --git a/tests/Zend/XmlRpc/Server/FaultTest.php b/tests/Zend/XmlRpc/Server/FaultTest.php index 533416299d..97f91646e4 100644 --- a/tests/Zend/XmlRpc/Server/FaultTest.php +++ b/tests/Zend/XmlRpc/Server/FaultTest.php @@ -34,7 +34,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_XmlRpc */ -class Zend_XmlRpc_Server_FaultTest extends PHPUnit_Framework_TestCase +class Zend_XmlRpc_Server_FaultTest extends PHPUnit\Framework\TestCase { /** * Zend_XmlRpc_Server_Fault::getInstance() test @@ -160,7 +160,7 @@ public function testDetachObserver() $e = new Zend_XmlRpc_Server_Exception('Checking observers', 411); $fault = Zend_XmlRpc_Server_Fault::getInstance($e); $observed = zxrs_fault_observer::getObserved(); - $this->assertTrue(empty($observed)); + $this->assertEmpty($observed); $this->assertFalse(Zend_XmlRpc_Server_Fault::detachObserver('foo')); } diff --git a/tests/Zend/XmlRpc/ServerTest.php b/tests/Zend/XmlRpc/ServerTest.php index f45f1ab3f0..fd1f02ef9d 100644 --- a/tests/Zend/XmlRpc/ServerTest.php +++ b/tests/Zend/XmlRpc/ServerTest.php @@ -37,7 +37,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_XmlRpc */ -class Zend_XmlRpc_ServerTest extends PHPUnit_Framework_TestCase +class Zend_XmlRpc_ServerTest extends PHPUnit\Framework\TestCase { /** * Zend_XmlRpc_Server object @@ -225,7 +225,7 @@ public function testHandle() $this->assertTrue($response instanceof Zend_XmlRpc_Response); $return = $response->getReturnValue(); - $this->assertTrue(is_array($return)); + $this->assertInternalType('array', $return); $this->assertTrue(in_array('system.multicall', $return)); } @@ -284,7 +284,7 @@ public function testSetResponseClass() public function testListMethods() { $methods = $this->_server->listMethods(); - $this->assertTrue(is_array($methods)); + $this->assertInternalType('array', $methods); $this->assertTrue(in_array('system.listMethods', $methods)); $this->assertTrue(in_array('system.methodHelp', $methods)); $this->assertTrue(in_array('system.methodSignature', $methods)); @@ -306,7 +306,8 @@ 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->expectException('Zend_XmlRpc_Server_Exception'); + $this->expectExceptionMessage('Method "foo" does not exist'); $this->_server->methodHelp('foo'); } @@ -323,10 +324,11 @@ public function testMethodHelp() public function testMethodSignature() { $sig = $this->_server->methodSignature('system.methodSignature'); - $this->assertTrue(is_array($sig)); + $this->assertInternalType('array', $sig); $this->assertEquals(1, count($sig), var_export($sig, 1)); - $this->setExpectedException('Zend_XmlRpc_Server_Exception', 'Method "foo" does not exist'); + $this->expectException('Zend_XmlRpc_Server_Exception'); + $this->expectExceptionMessage('Method "foo" does not exist'); $this->_server->methodSignature('foo'); } @@ -359,10 +361,10 @@ public function testMulticall() $this->assertTrue($response instanceof Zend_XmlRpc_Response, $response->__toString() . "\n\n" . $request->__toString()); $returns = $response->getReturnValue(); - $this->assertTrue(is_array($returns)); + $this->assertInternalType('array', $returns); $this->assertEquals(2, count($returns), var_export($returns, 1)); - $this->assertTrue(is_array($returns[0]), var_export($returns[0], 1)); - $this->assertTrue(is_string($returns[1]), var_export($returns[1], 1)); + $this->assertInternalType('array', $returns[0], var_export($returns[0], 1)); + $this->assertInternalType('string', $returns[1], var_export($returns[1], 1)); } /** @@ -387,9 +389,9 @@ public function testMulticallHandlesFaults() $this->assertTrue($response instanceof Zend_XmlRpc_Response, $response->__toString() . "\n\n" . $request->__toString()); $returns = $response->getReturnValue(); - $this->assertTrue(is_array($returns)); + $this->assertInternalType('array', $returns); $this->assertEquals(2, count($returns), var_export($returns, 1)); - $this->assertTrue(is_array($returns[0]), var_export($returns[0], 1)); + $this->assertInternalType('array', $returns[0], var_export($returns[0], 1)); $this->assertSame(array( 'faultCode' => 620, 'faultString' => 'Method "undefined" does not exist'), $returns[1], var_export($returns[1], 1)); @@ -579,31 +581,31 @@ public function testMulticallReturnsFaultsWithBadData() ) ); $returned = $this->_server->multicall($try); - $this->assertTrue(is_array($returned)); + $this->assertInternalType('array', $returned); $this->assertEquals(5, count($returned)); $response = $returned[0]; - $this->assertTrue(is_array($response)); + $this->assertInternalType('array', $response); $this->assertTrue(isset($response['faultCode'])); $this->assertEquals(601, $response['faultCode']); $response = $returned[1]; - $this->assertTrue(is_array($response)); + $this->assertInternalType('array', $response); $this->assertTrue(isset($response['faultCode'])); $this->assertEquals(602, $response['faultCode']); $response = $returned[2]; - $this->assertTrue(is_array($response)); + $this->assertInternalType('array', $response); $this->assertTrue(isset($response['faultCode'])); $this->assertEquals(603, $response['faultCode']); $response = $returned[3]; - $this->assertTrue(is_array($response)); + $this->assertInternalType('array', $response); $this->assertTrue(isset($response['faultCode'])); $this->assertEquals(604, $response['faultCode']); $response = $returned[4]; - $this->assertTrue(is_array($response)); + $this->assertInternalType('array', $response); $this->assertTrue(isset($response['faultCode'])); $this->assertEquals(605, $response['faultCode']); } @@ -639,7 +641,9 @@ public function testPrototypeReturnValueMustReflectDocBlock() public function testCallingUnregisteredMethod() { - $this->setExpectedException('Zend_XmlRpc_Server_Exception', + $this->expectException('Zend_XmlRpc_Server_Exception' + ); + $this->expectExceptionMessage( 'Unknown instance method called on server: foobarbaz'); $this->_server->foobarbaz(); } @@ -652,13 +656,15 @@ public function testSetPersistenceDoesNothing() public function testPassingInvalidRequestClassThrowsException() { - $this->setExpectedException('Zend_XmlRpc_Server_Exception', 'Invalid request class'); + $this->expectException('Zend_XmlRpc_Server_Exception'); + $this->expectExceptionMessage('Invalid request class'); $this->_server->setRequest('stdClass'); } public function testPassingInvalidResponseClassThrowsException() { - $this->setExpectedException('Zend_XmlRpc_Server_Exception', 'Invalid response class'); + $this->expectException('Zend_XmlRpc_Server_Exception'); + $this->expectExceptionMessage('Invalid response class'); $this->_server->setResponseClass('stdClass'); } diff --git a/tests/Zend/XmlRpc/ValueTest.php b/tests/Zend/XmlRpc/ValueTest.php index 83a7c4204b..4c60e8a7ad 100644 --- a/tests/Zend/XmlRpc/ValueTest.php +++ b/tests/Zend/XmlRpc/ValueTest.php @@ -45,7 +45,7 @@ * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_XmlRpc */ -class Zend_XmlRpc_ValueTest extends PHPUnit_Framework_TestCase +class Zend_XmlRpc_ValueTest extends PHPUnit\Framework\TestCase { public $xmlRpcDateFormat = 'Ymd\\TH:i:s'; @@ -131,7 +131,8 @@ public function testMarshalIntegerFromXmlRpc(Zend_XmlRpc_Generator_GeneratorAbst */ public function testMarshalI4FromOverlongNativeThrowsException() { - $this->setExpectedException('Zend_XmlRpc_Value_Exception', 'Overlong integer given'); + $this->expectException('Zend_XmlRpc_Value_Exception'); + $this->expectExceptionMessage('Overlong integer given'); $x = Zend_XmlRpc_Value::getXmlRpcValue(PHP_INT_MAX + 5000, Zend_XmlRpc_Value::XMLRPC_TYPE_I4); } @@ -140,7 +141,8 @@ public function testMarshalI4FromOverlongNativeThrowsException() */ public function testMarshalIntegerFromOverlongNativeThrowsException() { - $this->setExpectedException('Zend_XmlRpc_Value_Exception', 'Overlong integer given'); + $this->expectException('Zend_XmlRpc_Value_Exception'); + $this->expectExceptionMessage('Overlong integer given'); Zend_XmlRpc_Value::getXmlRpcValue(PHP_INT_MAX + 5000, Zend_XmlRpc_Value::XMLRPC_TYPE_INTEGER); } @@ -390,7 +392,9 @@ public function testArrayMustContainDataElement(Zend_XmlRpc_Generator_GeneratorA $native = array(); $xml = ''; - $this->setExpectedException('Zend_XmlRpc_Value_Exception', + $this->expectException('Zend_XmlRpc_Value_Exception' + ); + $this->expectExceptionMessage( 'Invalid XML for XML-RPC native array type: ARRAY tag must contain DATA tag'); $val = Zend_XmlRpc_Value::getXmlRpcValue($xml, Zend_XmlRpc_Value::XML_STRING); @@ -611,12 +615,13 @@ public function testMarshalDateTimeFromNativeStringProducesIsoOutput() public function testMarshalDateTimeFromInvalidString() { - $phpunitVersion = PHPUnit_Runner_Version::id(); + $phpunitVersion = PHPUnit\Runner\Version::id(); if (version_compare($phpunitVersion, '3.7.0', '<=')) { $this->markTestSkipped('Cannot expect generic exceptions prior to PHPUnit 3.7.'); } - $this->setExpectedException('Exception', "foobarbaz"); + $this->expectException('Exception'); + $this->expectExceptionMessage("foobarbaz"); Zend_XmlRpc_Value::getXmlRpcValue('foobarbaz', Zend_XmlRpc_Value::XMLRPC_TYPE_DATETIME); } @@ -921,7 +926,7 @@ public function testGetXmlRpcTypeByValue() public function testGetXmlRpcTypeByValueThrowsExceptionOnInvalidValue() { - $this->setExpectedException('Zend_XmlRpc_Value_Exception'); + $this->expectException('Zend_XmlRpc_Value_Exception'); Zend_XmlRpc_Value::getXmlRpcTypeByValue(fopen(__FILE__, 'r')); } diff --git a/tests/phpunit.xml b/tests/phpunit.xml index a342753be3..c77a3c2564 100644 --- a/tests/phpunit.xml +++ b/tests/phpunit.xml @@ -1,4 +1,11 @@ - + ./Zend/Acl/AclTest.php diff --git a/tests/resources/languages/Zend_ValidateTest.php b/tests/resources/languages/Zend_ValidateTest.php index d94004d515..e3e748fe4a 100644 --- a/tests/resources/languages/Zend_ValidateTest.php +++ b/tests/resources/languages/Zend_ValidateTest.php @@ -33,7 +33,7 @@ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class resources_languages_Zend_ValidateTest extends PHPUnit_Framework_TestCase +class resources_languages_Zend_ValidateTest extends PHPUnit\Framework\TestCase { protected $_langDir = null; diff --git a/tests/runalltests.php b/tests/runalltests.php index 42058bc567..20c878e717 100755 --- a/tests/runalltests.php +++ b/tests/runalltests.php @@ -62,7 +62,7 @@ exit(1); } -$configuration = \PHPUnit_Util_Configuration::getInstance($phpUnitXml); +$configuration = \PHPUnit\Util\Configuration::getInstance($phpUnitXml); $testSuites = $configuration->getTestSuiteNames(); $result = 0;