From a9b83e8917aaaf1260b75e94adc4aa2aedad5a24 Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Sat, 3 Nov 2018 19:47:59 -0400 Subject: [PATCH 001/222] Moved tests to temp folder; Added initial boxfile with services --- codeception.yml => _toCheck/codeception.yml | 0 {tests => _toCheck/tests}/README.md | 0 {tests => _toCheck/tests}/_bootstrap.php | 0 {tests => _toCheck/tests}/_cache/.gitignore | 0 .../tests}/_ci/after-failure.sh | 0 {tests => _toCheck/tests}/_ci/appveyor.psm1 | 0 {tests => _toCheck/tests}/_ci/ci.ini | 0 {tests => _toCheck/tests}/_ci/environment | 0 .../tests}/_ci/install-prereqs.sh | 0 {tests => _toCheck/tests}/_ci/install-re2c.sh | 0 .../tests}/_ci/install-zephir-parser.sh | 0 {tests => _toCheck/tests}/_ci/pear-setup.sh | 0 {tests => _toCheck/tests}/_ci/phalcon.ini | 0 .../tests}/_ci/precompile-headers.sh | 0 {tests => _toCheck/tests}/_ci/setup-dbs.sh | 0 .../tests}/_config/bootstrap.php | 0 {tests => _toCheck/tests}/_config/global.php | 0 .../tests}/_data/acl/TestResourceAware.php | 0 .../tests}/_data/acl/TestRoleAware.php | 0 .../_data/acl/TestRoleResourceAware.php | 0 .../tests}/_data/annotations/TestClass.php | 0 .../tests}/_data/annotations/TestClassNs.php | 0 .../tests}/_data/annotations/TestInvalid.php | 0 .../tests}/_data/assets/1198.css | 0 .../tests}/_data/assets/assets-multiple-01.js | 0 .../tests}/_data/assets/assets-multiple-02.js | 0 .../tests}/_data/assets/cssmin-01-result.css | 0 .../tests}/_data/assets/cssmin-01.css | 0 {tests => _toCheck/tests}/_data/assets/gs.js | 0 .../tests}/_data/assets/jquery.js | 0 .../tests}/_data/assets/logo.png | Bin .../tests}/_data/assets/phalconphp.jpg | Bin .../tests}/_data/assets/signup.js | 0 .../_data/collections/Bookshelf/Books.php | 0 .../_data/collections/Bookshelf/Magazines.php | 0 .../collections/Bookshelf/NotACollection.php | 0 .../tests}/_data/collections/People.php | 0 .../tests}/_data/collections/Robots.php | 0 .../tests}/_data/collections/Songs.php | 0 .../tests}/_data/collections/Store/Songs.php | 0 .../tests}/_data/collections/Subs.php | 0 .../tests}/_data/collections/Users.php | 0 .../tests}/_data/config/callbacks.yml | 0 .../_data/config/config-with-constants.ini | 0 .../tests}/_data/config/config.ini | 0 .../tests}/_data/config/config.json | 0 .../tests}/_data/config/config.php | 0 .../tests}/_data/config/config.yml | 0 .../tests}/_data/config/directive.ini | 0 .../tests}/_data/config/factory.ini | 0 .../_data/controllers/AboutController.php | 0 .../_data/controllers/ControllerBase.php | 0 .../_data/controllers/ExceptionController.php | 0 .../_data/controllers/FailureController.php | 0 .../_data/controllers/MainController.php | 0 .../NamespacedAnnotationController.php | 0 .../_data/controllers/ProductsController.php | 0 .../_data/controllers/RobotsController.php | 0 .../_data/controllers/Test0Controller.php | 0 .../_data/controllers/Test10Controller.php | 0 .../_data/controllers/Test11Controller.php | 0 .../_data/controllers/Test12Controller.php | 0 .../_data/controllers/Test1Controller.php | 0 .../_data/controllers/Test2Controller.php | 0 .../_data/controllers/Test3Controller.php | 0 .../_data/controllers/Test4Controller.php | 0 .../_data/controllers/Test5Controller.php | 0 .../_data/controllers/Test6Controller.php | 0 .../_data/controllers/Test7Controller.php | 0 .../_data/controllers/Test8Controller.php | 0 .../_data/controllers/Test9Controller.php | 0 .../tests}/_data/debug/ClassProperties.php | 0 .../tests}/_data/di/InjectableComponent.php | 0 .../tests}/_data/di/SimpleComponent.php | 0 .../tests}/_data/di/SomeComponent.php | 0 .../tests}/_data/di/SomeService.php | 0 .../tests}/_data/di/SomeServiceProvider.php | 0 .../tests}/_data/di/services.php | 0 .../tests}/_data/di/services.yml | 0 .../tests}/_data/events/ComponentX.php | 0 .../tests}/_data/events/ComponentY.php | 0 .../listener/CustomAuthorizationListener.php | 0 .../tests}/_data/listener/FirstListener.php | 0 .../NegotiateAuthorizationListener.php | 0 .../tests}/_data/listener/SecondListener.php | 0 .../tests}/_data/listener/ThirdListener.php | 0 {tests => _toCheck/tests}/_data/logs/dummy | 0 .../tests}/_data/micro/MyMiddleware.php | 0 .../tests}/_data/micro/MyMiddlewareStop.php | 0 .../tests}/_data/micro/RestHandler.php | 0 .../tests}/_data/models/AlbumORama/Albums.php | 0 .../_data/models/AlbumORama/Artists.php | 0 .../tests}/_data/models/Annotations/Robot.php | 0 .../tests}/_data/models/BodyParts/Body.php | 0 .../tests}/_data/models/BodyParts/Head.php | 0 .../tests}/_data/models/Boutique/Robots.php | 0 .../_data/models/Boutique/Robotters.php | 0 .../tests}/_data/models/Customers.php | 0 .../tests}/_data/models/Deles.php | 0 .../tests}/_data/models/Dynamic/Personas.php | 0 .../tests}/_data/models/Dynamic/Personers.php | 0 .../tests}/_data/models/Dynamic/Robots.php | 0 .../tests}/_data/models/Language.php | 0 .../tests}/_data/models/LanguageI18n.php | 0 .../_data/models/ModelWithStringField.php | 0 .../tests}/_data/models/News/Subscribers.php | 0 .../tests}/_data/models/PackageDetails.php | 0 .../tests}/_data/models/Packages.php | 0 .../tests}/_data/models/Parts.php | 0 .../tests}/_data/models/People.php | 0 .../tests}/_data/models/Personas.php | 0 .../tests}/_data/models/Personers.php | 0 .../tests}/_data/models/Products.php | 0 .../_data/models/Relations/RelationsParts.php | 0 .../models/Relations/RelationsRobots.php | 0 .../models/Relations/RelationsRobotsParts.php | 0 .../tests}/_data/models/Relations/Robots.php | 0 .../_data/models/Relations/RobotsParts.php | 0 .../tests}/_data/models/Robos.php | 0 .../tests}/_data/models/Robots.php | 0 .../tests}/_data/models/RobotsParts.php | 0 .../tests}/_data/models/Robotters.php | 0 .../tests}/_data/models/RobottersDeles.php | 0 .../tests}/_data/models/Robotto.php | 0 .../tests}/_data/models/Select.php | 0 .../tests}/_data/models/Snapshot/Parts.php | 0 .../tests}/_data/models/Snapshot/Personas.php | 0 .../tests}/_data/models/Snapshot/Requests.php | 0 .../tests}/_data/models/Snapshot/Robots.php | 0 .../_data/models/Snapshot/RobotsParts.php | 0 .../_data/models/Snapshot/Robotters.php | 0 .../_data/models/Snapshot/Subscribers.php | 0 .../tests}/_data/models/Some/Deles.php | 0 .../tests}/_data/models/Some/Parts.php | 0 .../tests}/_data/models/Some/Products.php | 0 .../tests}/_data/models/Some/Robots.php | 0 .../tests}/_data/models/Some/RobotsParts.php | 0 .../tests}/_data/models/Some/Robotters.php | 0 .../_data/models/Some/RobottersDeles.php | 0 .../_data/models/Statistics/AgeStats.php | 0 .../_data/models/Statistics/CityStats.php | 0 .../_data/models/Statistics/CountryStats.php | 0 .../_data/models/Statistics/GenderStats.php | 0 .../tests}/_data/models/Stock.php | 0 .../tests}/_data/models/Users.php | 0 .../tests}/_data/models/Validation/Robots.php | 0 .../_data/models/Validation/Subscriptores.php | 0 .../tests}/_data/modules/backend/Module.php | 0 .../backend/controllers/LoginController.php | 0 .../_data/modules/backend/views/index.phtml | 0 .../tests}/_data/modules/frontend/Module.php | 0 .../frontend/controllers/IndexController.php | 0 .../modules/frontend/views/index/index.phtml | 0 .../objectsets/Mvc/View/IteratorObject.php | 0 .../tests}/_data/resultsets/Stats.php | 0 .../_data/schemas/mysql/phalcon_test.sql | 0 .../_data/schemas/postgresql/phalcon_test.sql | 0 .../_data/schemas/sqlite/phalcon_test.sql | 0 .../_data/schemas/sqlite/translations.sql | 0 .../tests}/_data/tasks/EchoTask.php | 0 .../tests}/_data/tasks/Issue787Task.php | 0 .../tests}/_data/tasks/MainTask.php | 0 .../tests}/_data/tasks/ParamsTask.php | 0 .../tests}/_data/translation/csv/ru_RU.csv | 0 .../en_US.utf8/LC_MESSAGES/messages.mo | Bin .../en_US.utf8/LC_MESSAGES/messages.po | 0 .../vendor/Example/Adapter/LeAnotherSome.inc | 0 .../vendor/Example/Adapter/LeCoolSome.php | 0 .../_data/vendor/Example/Adapter/LeSome.php | 0 .../_data/vendor/Example/Adapter/Some.php | 0 .../_data/vendor/Example/Adapter/SomeCool.php | 0 .../_data/vendor/Example/Adapter2/Another.php | 0 .../tests}/_data/vendor/Example/Base/Any.php | 0 .../vendor/Example/Dialects/LeDialect.php | 0 .../_data/vendor/Example/Engines/LeEngine.php | 0 .../vendor/Example/Engines/LeEngine2.php | 0 .../vendor/Example/Engines/LeOtherEngine.inc | 0 .../_data/vendor/Example/Example/Example.php | 0 .../_data/vendor/Example/Other/NoClass.php | 0 .../_data/vendor/Example/Other/NoClass1.php | 0 .../_data/vendor/Example/Other/NoClass2.php | 0 .../_data/vendor/Example/Other/NoClass3.php | 0 .../_data/vendor/Example/Other/VousTest.php | 0 .../_data/vendor/Example/Test/LeTest.php | 0 .../_data/vendor/Example/Test/MoiTest.php | 0 .../_data/vendor/Example/Types/SomeType.php | 0 .../tests}/_data/views/exception/index.phtml | 0 .../tests}/_data/views/exception/second.phtml | 0 .../tests}/_data/views/filters/.gitignore | 0 .../tests}/_data/views/filters/default.volt | 0 .../views/filters/default_json_encode.volt | 0 .../tests}/_data/views/html5.phtml | 0 .../tests}/_data/views/index.phtml | 0 .../tests}/_data/views/layouts/.gitignore | 0 .../tests}/_data/views/layouts/after.phtml | 0 .../tests}/_data/views/layouts/before.phtml | 0 .../tests}/_data/views/layouts/test.phtml | 0 .../tests}/_data/views/layouts/test10.volt | 0 .../tests}/_data/views/layouts/test12.phtml | 0 .../tests}/_data/views/layouts/test13.phtml | 0 .../tests}/_data/views/layouts/test3.phtml | 0 .../tests}/_data/views/layouts/test4.mhtml | 0 .../tests}/_data/views/layouts/test6.phtml | 0 .../tests}/_data/views/layouts/test7.twig | 0 .../_data/views/macro/conditionaldate.volt | 0 .../_data/views/macro/error_messages.volt | 0 .../tests}/_data/views/macro/form_row.volt | 0 .../tests}/_data/views/macro/hello.volt | 0 .../tests}/_data/views/macro/list.volt | 0 .../tests}/_data/views/macro/my_input.volt | 0 .../_data/views/macro/related_links.volt | 0 .../tests}/_data/views/macro/strtotime.volt | 0 .../tests}/_data/views/partials/.gitignore | 0 .../_data/views/partials/_partial1.phtml | 0 .../_data/views/partials/_partial2.phtml | 0 .../_data/views/partials/_partial3.phtml | 0 .../tests}/_data/views/partials/footer.volt | 0 .../tests}/_data/views/partials/header.mhtml | 0 .../tests}/_data/views/partials/header.twig | 0 .../tests}/_data/views/partials/header.volt | 0 .../tests}/_data/views/partials/header2.volt | 0 .../tests}/_data/views/partials/header3.volt | 0 .../tests}/_data/views/switch-case/.gitignore | 0 .../_data/views/switch-case/simple-usage.volt | 0 .../tests}/_data/views/templates/a.volt | 0 .../tests}/_data/views/templates/b.volt | 0 .../tests}/_data/views/templates/c.volt | 0 .../tests}/_data/views/test10/.gitignore | 0 .../_data/views/test10/children.extends.volt | 0 .../tests}/_data/views/test10/children.volt | 0 .../tests}/_data/views/test10/children2.volt | 0 .../tests}/_data/views/test10/import.volt | 0 .../tests}/_data/views/test10/import2.volt | 0 .../tests}/_data/views/test10/index.volt | 0 .../tests}/_data/views/test10/other.volt | 0 .../tests}/_data/views/test10/parent.volt | 0 .../tests}/_data/views/test10/partial.volt | 0 .../tests}/_data/views/test11/.gitignore | 0 .../tests}/_data/views/test11/index.volt | 0 .../tests}/_data/views/test12/index.twig | 0 .../tests}/_data/views/test12/info.phtml | 0 .../tests}/_data/views/test13/index.phtml | 0 .../tests}/_data/views/test14/loop1.volt | 0 .../tests}/_data/views/test15/index.phtml | 0 .../tests}/_data/views/test16/index.phtml | 0 .../tests}/_data/views/test2/index.phtml | 0 .../tests}/_data/views/test2/params.phtml | 0 .../tests}/_data/views/test3/another.phtml | 0 .../tests}/_data/views/test3/coolVar.phtml | 0 .../tests}/_data/views/test3/other.phtml | 0 .../tests}/_data/views/test3/query.phtml | 0 .../tests}/_data/views/test3/yup.phtml | 0 .../tests}/_data/views/test4/index.mhtml | 0 .../tests}/_data/views/test5/index.phtml | 0 .../tests}/_data/views/test5/missing.phtml | 0 .../tests}/_data/views/test5/subpartial.phtml | 0 .../tests}/_data/views/test6/index.mhtml | 0 .../tests}/_data/views/test6/info.phtml | 0 .../tests}/_data/views/test7/index.twig | 0 .../tests}/_data/views/test8/index.phtml | 0 .../tests}/_data/views/test8/leother.phtml | 0 .../tests}/_data/views/test8/other.phtml | 0 .../tests}/_data/views/test9/index.phtml | 0 .../_fixtures/dump/class_properties.txt | 0 .../tests}/_fixtures/metadata/robots.php | 0 .../metadata/test_describereference.php | 0 .../criteria_test/limit_offset_provider.php | 0 .../query_test/data_to_delete_parsing.php | 0 .../query_test/data_to_insert_parsing.php | 0 .../query_test/data_to_update_parsing.php | 0 .../data_to_regex_router_host_port.php | 0 .../mvc/router_test/data_to_router.php | 0 .../router_test/data_to_router_host_name.php | 0 .../mvc/router_test/data_to_router_http.php | 0 .../mvc/router_test/data_to_router_param.php | 0 .../data_to_router_with_hostname.php | 0 .../router_test/matching_with_converted.php | 0 .../matching_with_extra_slashes.php | 0 .../router_test/matching_with_got_router.php | 0 .../router_test/matching_with_host_name.php | 0 .../matching_with_hostname_regex.php | 0 .../matching_with_path_provider.php | 0 .../matching_with_regex_router_host_port.php | 0 .../mvc/router_test/matching_with_router.php | 0 .../router_test/matching_with_router_http.php | 0 .../_fixtures/mvc/url_test/data_to_set_di.php | 0 .../mvc/url_test/url_to_set_base_uri.php | 0 .../mvc/url_test/url_to_set_server.php | 0 .../mvc/url_test/url_to_set_without_di.php | 0 .../url_to_set_without_di_two_param.php | 0 .../_fixtures/mvc/view/engine/mustache.php | 0 .../tests}/_fixtures/mvc/view/engine/twig.php | 0 .../volt_compile_file_extends_multiple.php | 0 .../volt_compiler_extends_block.php | 0 .../volt_compiler_file.php | 0 .../view_built_in_function.php | 0 .../view_register_engines.php | 0 .../view_set_php_mustache.php | 0 .../view_set_php_mustache_partial.php | 0 .../view_engines_test/view_set_php_twig.php | 0 .../view_set_php_twig_partial.php | 0 .../tests}/_fixtures/mysql/example1.sql | 0 .../tests}/_fixtures/mysql/example2.sql | 0 .../tests}/_fixtures/mysql/example3.sql | 0 .../tests}/_fixtures/mysql/example4.sql | 0 .../tests}/_fixtures/mysql/example5.sql | 0 .../tests}/_fixtures/postgresql/example1.sql | 0 .../tests}/_fixtures/postgresql/example2.sql | 0 .../tests}/_fixtures/postgresql/example3.sql | 0 .../tests}/_fixtures/postgresql/example4.sql | 0 .../tests}/_fixtures/postgresql/example5.sql | 0 .../tests}/_fixtures/postgresql/example6.sql | 0 .../tests}/_fixtures/postgresql/example7.sql | 0 .../tests}/_fixtures/postgresql/example8.sql | 0 .../tests}/_fixtures/postgresql/example9.sql | 0 .../tests}/_fixtures/query/select_parsing.php | 0 .../tests}/_fixtures/sqlite/example1.sql | 0 .../tests}/_fixtures/sqlite/example2.sql | 0 .../tests}/_fixtures/sqlite/example3.sql | 0 .../tests}/_fixtures/sqlite/example4.sql | 0 .../tests}/_fixtures/sqlite/example5.sql | 0 .../tests}/_fixtures/sqlite/example6.sql | 0 .../tests}/_fixtures/sqlite/example7.sql | 0 .../tests}/_fixtures/sqlite/example8.sql | 0 .../volt_compile_string.php | 0 .../volt_extends_error.php | 0 .../volt_syntax_error.php | 0 .../volt/compilerTest/test_volt_parser.php | 0 .../volt/compilerTest/volt_closure_filter.php | 0 .../volt_compile_string_autoescape.php | 0 .../volt_compile_string_equals.php | 0 .../volt/compilerTest/volt_single_filter.php | 0 .../volt_users_function_with_closure.php | 0 .../volt_users_single_string_function.php | 0 {tests => _toCheck/tests}/_output/.gitignore | 0 .../_output/tests/annotations/.gitignore | 0 .../tests}/_output/tests/assets/.gitignore | 0 .../tests}/_output/tests/cache/.gitignore | 0 .../tests}/_output/tests/image/gd/.gitignore | 0 .../_output/tests/image/imagick/.gitignore | 0 .../tests}/_output/tests/logs/.gitignore | 0 .../tests}/_output/tests/session/.gitignore | 0 .../tests}/_output/tests/stream/.gitignore | 0 .../_support/Helper/CollectionTrait.php | 0 .../Helper/ConnectionCheckerTrait.php | 0 .../_support/Helper/CookieAwareTrait.php | 0 .../Helper/Db/Connection/AbstractFactory.php | 0 .../Helper/Db/Connection/MysqlFactory.php | 0 .../Db/Connection/PostgresqlFactory.php | 0 .../Helper/Db/Connection/SqliteFactory.php | 0 .../Connection/SqliteTranslationsFactory.php | 0 .../_support/Helper/Dialect/MysqlTrait.php | 0 .../Helper/Dialect/PostgresqlTrait.php | 0 .../_support/Helper/Dialect/SqliteTrait.php | 0 .../tests}/_support/Helper/DialectTrait.php | 0 .../tests}/_support/Helper/Http/PhpStream.php | 0 .../tests}/_support/Helper/Integration.php | 0 .../tests}/_support/Helper/ModelTrait.php | 0 .../_support/Helper/Mvc/RouterTrait.php | 0 .../_support/Helper/ResultsetHelperTrait.php | 0 .../tests}/_support/Helper/Unit.php | 0 .../tests}/_support/Helper/Unit5x.php | 0 .../tests}/_support/Helper/ViewTrait.php | 0 .../tests}/_support/IntegrationTester.php | 0 .../_support/Module/Cache/Backend/File.php | 0 .../tests}/_support/Module/Libmemcached.php | 0 .../tests}/_support/Module/UnitTest.php | 0 .../Module/View/AfterRenderListener.php | 0 .../_support/Module/View/Engine/Mustache.php | 0 .../_support/Module/View/Engine/Twig.php | 0 .../tests}/_support/Unit5xTester.php | 0 .../tests}/_support/UnitTester.php | 0 .../tests}/_support/_generated/.gitignore | 0 .../tests}/integration.suite.yml | 0 .../tests}/integration/Assets/ManagerCest.php | 0 .../tests}/integration/Forms/FormCest.php | 0 .../integration/Mvc/ApplicationCest.php | 0 .../Mvc/Collection/BehaviorCest.php | 0 .../integration/Mvc/ControllersCest.php | 0 .../Mvc/Dispatcher/ForwardCest.php | 0 .../integration/Mvc/Model/BinderCest.php | 0 .../Mvc/Model/Criteria/FromInputCest.php | 0 .../integration/Mvc/Model/CriteriaCest.php | 0 .../Mvc/Model/Query/BuilderCest.php | 0 .../Mvc/View/Engine/Volt/CompilerCest.php | 0 .../View/Engine/Volt/CompilerFilesCest.php | 0 .../integration/Mvc/View/Engine/VoltCest.php | 0 .../integration/Mvc/View/SimpleCest.php | 0 .../tests}/integration/Mvc/ViewCest.php | 0 .../tests}/integration/ValidationCest.php | 0 .../tests}/integration/_bootstrap.php | 0 {tests => _toCheck/tests}/shim.php | 0 .../tests}/syntax/bootstrap.inc | 0 .../tests/volt/statements/switchcase/001.phpt | 0 .../tests/volt/statements/switchcase/002.phpt | 0 .../tests/volt/statements/switchcase/003.phpt | 0 .../tests/volt/statements/switchcase/004.phpt | 0 .../tests/volt/statements/switchcase/005.phpt | 0 .../tests/volt/statements/switchcase/006.phpt | 0 .../tests/volt/statements/switchcase/007.phpt | 0 .../tests/volt/statements/switchcase/008.phpt | 0 .../tests/volt/statements/switchcase/009.phpt | 0 .../tests/volt/statements/switchcase/010.phpt | 0 {tests => _toCheck/tests}/unit.suite.yml | 0 .../tests}/unit/Acl/Adapter/MemoryTest.php | 0 .../tests}/unit/Acl/ResourceTest.php | 0 .../tests}/unit/Acl/RoleTest.php | 0 .../unit/Annotations/Adapter/ApcTest.php | 0 .../unit/Annotations/Adapter/ApcuTest.php | 0 .../unit/Annotations/Adapter/FilesTest.php | 0 .../unit/Annotations/Adapter/MemoryTest.php | 0 .../tests}/unit/Annotations/FactoryTest.php | 0 .../tests}/unit/Annotations/ReaderTest.php | 0 .../unit/Annotations/ReflectionTest.php | 0 .../tests}/unit/Assets/CollectionTest.php | 0 .../tests}/unit/Assets/Filters/CssMinTest.php | 0 .../tests}/unit/Assets/Filters/JsminTest.php | 0 .../tests}/unit/Assets/Filters/NoneTest.php | 0 .../tests}/unit/Assets/Helper/TrimFilter.php | 0 .../unit/Assets/Helper/UppercaseFilter.php | 0 .../tests}/unit/Assets/InlineTest.php | 0 .../tests}/unit/Assets/ManagerTest.php | 0 .../tests}/unit/Assets/Resource/CssTest.php | 0 .../tests}/unit/Assets/Resource/JsTest.php | 0 .../tests}/unit/Assets/ResourceTest.php | 0 .../tests}/unit/Cache/Backend/ApcCest.php | 0 .../tests}/unit/Cache/Backend/ApcuCest.php | 0 .../tests}/unit/Cache/Backend/FactoryTest.php | 0 .../tests}/unit/Cache/Backend/FileCest.php | 0 .../unit/Cache/Backend/LibmemcachedCest.php | 0 .../tests}/unit/Cache/Backend/MemoryCest.php | 0 .../tests}/unit/Cache/Backend/RedisCest.php | 0 .../unit/Cache/Frontend/FactoryTest.php | 0 .../tests}/unit/Cli/ConsoleTest.php | 0 .../tests}/unit/Cli/DispatcherTest.php | 0 .../tests}/unit/Cli/RouterTest.php | 0 .../tests}/unit/Cli/TaskTest.php | 0 .../unit/Config/Adapter/GroupedTest.php | 0 .../tests}/unit/Config/Adapter/IniTest.php | 0 .../tests}/unit/Config/Adapter/JsonTest.php | 0 .../tests}/unit/Config/Adapter/PhpTest.php | 0 .../tests}/unit/Config/Adapter/YamlTest.php | 0 .../tests}/unit/Config/FactoryTest.php | 0 .../tests}/unit/Config/Helper/ConfigBase.php | 0 {tests => _toCheck/tests}/unit/ConfigTest.php | 0 {tests => _toCheck/tests}/unit/CryptTest.php | 0 .../unit/Db/Adapter/Pdo/FactoryTest.php | 0 .../tests}/unit/Db/Adapter/Pdo/MysqlTest.php | 0 .../unit/Db/Adapter/Pdo/PostgresqlTest.php | 0 .../tests}/unit/Db/Column/PostgresqlTest.php | 0 .../tests}/unit/Db/ColumnTest.php | 0 .../tests}/unit/Db/Dialect/MysqlTest.php | 0 .../tests}/unit/Db/Dialect/PostgresqlTest.php | 0 .../tests}/unit/Db/Dialect/SqliteTest.php | 0 .../tests}/unit/Db/IndexTest.php | 0 .../tests}/unit/Db/ReferenceTest.php | 0 .../tests}/unit/Debug/DumpTest.php | 0 {tests => _toCheck/tests}/unit/DebugTest.php | 0 .../tests}/unit/Di/FactoryDefaultTest.php | 0 .../tests}/unit/Di/ServiceTest.php | 0 {tests => _toCheck/tests}/unit/DiTest.php | 0 .../tests}/unit/EscaperTest.php | 0 .../tests}/unit/Events/ManagerTest.php | 0 .../unit/Factory/Helper/FactoryBase.php | 0 .../tests}/unit/Filter/FilterAlphanumTest.php | 0 .../tests}/unit/Filter/FilterCustomTest.php | 0 .../tests}/unit/Filter/FilterEmailTest.php | 0 .../tests}/unit/Filter/FilterFloatTest.php | 0 .../tests}/unit/Filter/FilterIntegerTest.php | 0 .../tests}/unit/Filter/FilterMultipleTest.php | 0 .../unit/Filter/FilterSpecialCharsTest.php | 0 .../tests}/unit/Filter/FilterStringTest.php | 0 .../unit/Filter/FilterStriptagsTest.php | 0 .../tests}/unit/Filter/FilterTrimTest.php | 0 .../unit/Filter/FilterUpperLowerTest.php | 0 .../tests}/unit/Filter/FilterUrlTest.php | 0 .../tests}/unit/Filter/Helper/FilterBase.php | 0 .../tests}/unit/Filter/Helper/IPv4.php | 0 .../Flash/Direct/FlashDirectCustomCSSTest.php | 0 .../Flash/Direct/FlashDirectEmptyCSSTest.php | 0 .../unit/Flash/Direct/Helper/FlashBase.php | 0 .../tests}/unit/Flash/SessionTest.php | 0 .../tests}/unit/Forms/Element/TextTest.php | 0 .../tests}/unit/Forms/FormTest.php | 0 .../tests}/unit/Http/CookieTest.php | 0 .../tests}/unit/Http/Helper/HttpBase.php | 0 .../unit/Http/Request/AuthHeaderTest.php | 0 .../tests}/unit/Http/Request/FileTest.php | 0 .../tests}/unit/Http/RequestTest.php | 0 .../tests}/unit/Http/Response/CookiesTest.php | 0 .../tests}/unit/Http/Response/HeadersTest.php | 0 .../tests}/unit/Http/ResponseTest.php | 0 .../tests}/unit/Image/Adapter/GdTest.php | 0 .../tests}/unit/Image/Adapter/ImagickTest.php | 0 .../tests}/unit/Image/FactoryTest.php | 0 {tests => _toCheck/tests}/unit/LoaderTest.php | 0 .../tests}/unit/Logger/Adapter/FileTest.php | 0 .../unit/Logger/Adapter/FirephpTest.php | 0 .../tests}/unit/Logger/FactoryTest.php | 0 .../tests}/unit/Logger/Formatter/LineTest.php | 0 .../tests}/unit/Messages/MessagesTest.php | 0 .../DispatcherAfterDispatchLoopTest.php | 0 .../DispatcherAfterDispatchTest.php | 0 .../DispatcherAfterExecuteRouteMethodTest.php | 0 .../DispatcherAfterExecuteRouteTest.php | 0 .../DispatcherAfterInitializeTest.php | 0 .../DispatcherBeforeDispatchLoopTest.php | 0 .../DispatcherBeforeDispatchTest.php | 0 ...DispatcherBeforeExecuteRouteMethodTest.php | 0 .../DispatcherBeforeExecuteRouteTest.php | 0 .../DispatcherInitalizeMethodTest.php | 0 .../unit/Mvc/Dispatcher/DispatcherTest.php | 0 .../Mvc/Dispatcher/Helper/BaseDispatcher.php | 0 .../Dispatcher/Helper/DispatcherListener.php | 0 ...stAfterExecuteRouteExceptionController.php | 0 ...TestAfterExecuteRouteForwardController.php | 0 ...AfterExecuteRouteReturnFalseController.php | 0 ...tBeforeExecuteRouteExceptionController.php | 0 ...estBeforeExecuteRouteForwardController.php | 0 ...eforeExecuteRouteReturnFalseController.php | 0 .../DispatcherTestDefaultController.php | 0 ...atcherTestDefaultNoNamespaceController.php | 0 .../DispatcherTestDefaultSimpleController.php | 0 .../DispatcherTestDefaultTwoController.php | 0 ...tcherTestInitializeExceptionController.php | 0 ...patcherTestInitializeForwardController.php | 0 ...herTestInitializeReturnFalseController.php | 0 .../tests}/unit/Mvc/MicroTest.php | 0 .../tests}/unit/Mvc/Model/CriteriaTest.php | 0 .../unit/Mvc/Model/DynamicOperationsTest.php | 0 .../unit/Mvc/Model/Helpers/Validation.php | 0 .../unit/Mvc/Model/Manager/RelationsTest.php | 0 .../tests}/unit/Mvc/Model/ManagerTest.php | 0 .../unit/Mvc/Model/MetaData/ApcCest.php | 0 .../unit/Mvc/Model/MetaData/ApcuCest.php | 0 .../unit/Mvc/Model/MetaData/FilesCest.php | 0 .../Mvc/Model/MetaData/LibmemcachedCest.php | 0 .../unit/Mvc/Model/MetaData/MemoryCest.php | 0 .../unit/Mvc/Model/MetaData/RedisCest.php | 0 .../unit/Mvc/Model/MetaData/ResetCest.php | 0 .../unit/Mvc/Model/MetaData/SessionCest.php | 0 .../MetaData/Strategy/AnnotationsTest.php | 0 .../unit/Mvc/Model/Query/BuilderOrderTest.php | 0 .../unit/Mvc/Model/Query/BuilderTest.php | 0 .../tests}/unit/Mvc/Model/QueryTest.php | 0 .../tests}/unit/Mvc/Model/RelationsTest.php | 0 .../unit/Mvc/Model/Resultset/ComplexTest.php | 0 .../unit/Mvc/Model/Resultset/SimpleTest.php | 0 .../unit/Mvc/Model/ResultsetClassTest.php | 0 .../tests}/unit/Mvc/Model/SnapshotTest.php | 0 .../Mvc/Model/Transaction/ManagerTest.php | 0 .../tests}/unit/Mvc/Model/ValidationCest.php | 0 .../tests}/unit/Mvc/ModelCest.php | 0 .../tests}/unit/Mvc/ModelTest.php | 0 .../unit/Mvc/Router/AnnotationsTest.php | 0 .../tests}/unit/Mvc/Router/GroupTest.php | 0 .../tests}/unit/Mvc/RouterTest.php | 0 .../tests}/unit/Mvc/UrlTest.php | 0 .../Volt/Compiler/Filters/DefaultTest.php | 0 .../Compiler/Statements/SwitchCaseTest.php | 0 .../Engine/Volt/CompilerExceptionsTest.php | 0 .../View/Engine/Volt/CompilerFilesTest.php | 0 .../Mvc/View/Engine/Volt/CompilerTest.php | 0 .../Mvc/View/Engine/Volt/CompilerTrait.php | 0 .../tests}/unit/Mvc/View/SimpleTest.php | 0 .../tests}/unit/Mvc/ViewEnginesTest.php | 0 .../tests}/unit/Mvc/ViewTest.php | 0 .../Paginator/Adapter/NativeArrayTest.php | 0 .../Paginator/Adapter/QueryBuilderTest.php | 0 .../tests}/unit/Paginator/FactoryTest.php | 0 .../tests}/unit/Queue/Beanstalk/JobTest.php | 0 .../tests}/unit/Queue/BeanstalkTest.php | 0 .../unit/Queue/Helper/BeanstalkBase.php | 0 .../tests}/unit/Security/RandomTest.php | 0 .../tests}/unit/SecurityTest.php | 0 .../tests}/unit/Session/Adapter/FilesTest.php | 0 .../unit/Session/Adapter/LibmemcachedTest.php | 0 .../tests}/unit/Session/Adapter/RedisTest.php | 0 .../tests}/unit/Session/BagTest.php | 0 .../tests}/unit/Session/FactoryTest.php | 0 .../tests}/unit/Tag/TagCheckFieldTest.php | 0 .../tests}/unit/Tag/TagColorFieldTest.php | 0 .../tests}/unit/Tag/TagDateFieldTest.php | 0 .../tests}/unit/Tag/TagDateTimeFieldTest.php | 0 .../unit/Tag/TagDateTimeLocalFieldTest.php | 0 .../tests}/unit/Tag/TagDoctypeTest.php | 0 .../tests}/unit/Tag/TagEmailFieldTest.php | 0 .../tests}/unit/Tag/TagFileFieldTest.php | 0 .../tests}/unit/Tag/TagFriendlyTitleTest.php | 0 .../tests}/unit/Tag/TagHiddenFieldTest.php | 0 .../tests}/unit/Tag/TagImageInputTest.php | 0 .../tests}/unit/Tag/TagImageTest.php | 0 .../unit/Tag/TagJavascriptIncludeTest.php | 0 .../tests}/unit/Tag/TagLinkToTest.php | 0 .../tests}/unit/Tag/TagMonthFieldTest.php | 0 .../tests}/unit/Tag/TagNumericFieldTest.php | 0 .../tests}/unit/Tag/TagPasswordFieldTest.php | 0 .../tests}/unit/Tag/TagRadioFieldTest.php | 0 .../tests}/unit/Tag/TagRangeFieldTest.php | 0 .../tests}/unit/Tag/TagResetInputTest.php | 0 .../tests}/unit/Tag/TagSearchFieldTest.php | 0 .../tests}/unit/Tag/TagSelectStaticTest.php | 0 .../tests}/unit/Tag/TagSetDefaultTest.php | 0 .../tests}/unit/Tag/TagStylesheetlinkTest.php | 0 .../tests}/unit/Tag/TagSubmitButtonTest.php | 0 .../tests}/unit/Tag/TagTagHtmlTest.php | 0 .../tests}/unit/Tag/TagTelFieldTest.php | 0 .../tests}/unit/Tag/TagTextAreaTest.php | 0 .../tests}/unit/Tag/TagTextFieldTest.php | 0 .../tests}/unit/Tag/TagTimeFieldTest.php | 0 .../tests}/unit/Tag/TagTitleTest.php | 0 .../tests}/unit/Tag/TagUrlFieldTest.php | 0 .../tests}/unit/Tag/TagWeekFieldTest.php | 0 .../tests}/unit/Text/TextCamelizeTest.php | 0 .../tests}/unit/Text/TextConcatTest.php | 0 .../tests}/unit/Text/TextDynamicTest.php | 0 .../tests}/unit/Text/TextEndsWithTest.php | 0 .../tests}/unit/Text/TextHumanizeTest.php | 0 .../tests}/unit/Text/TextIncrementTest.php | 0 .../tests}/unit/Text/TextRandomTest.php | 0 .../unit/Text/TextReduceSlashesTest.php | 0 .../tests}/unit/Text/TextStartsWithTest.php | 0 .../tests}/unit/Text/TextUncamelizeTest.php | 0 .../tests}/unit/Text/TextUnderscoreTest.php | 0 .../tests}/unit/Text/TextUpperLowerTest.php | 0 .../tests}/unit/Translate/Adapter/CsvTest.php | 0 .../unit/Translate/Adapter/GettextCest.php | 0 .../Translate/Adapter/NativeArrayTest.php | 0 .../tests}/unit/Translate/FactoryTest.php | 0 .../Interpolator/AssociativeArrayTest.php | 0 .../Interpolator/IndexedArrayTest.php | 0 .../unit/Validation/Validator/AlnumTest.php | 0 .../unit/Validation/Validator/AlphaTest.php | 0 .../unit/Validation/Validator/BetweenTest.php | 0 .../Validation/Validator/CallbackTest.php | 0 .../Validation/Validator/ConfirmationTest.php | 0 .../Validation/Validator/CreditCardTest.php | 0 .../unit/Validation/Validator/DateTest.php | 0 .../unit/Validation/Validator/DigitTest.php | 0 .../unit/Validation/Validator/EmailTest.php | 0 .../Validation/Validator/ExclusionInTest.php | 0 .../Validation/Validator/IdenticalTest.php | 0 .../Validation/Validator/InclusionInTest.php | 0 .../Validation/Validator/NumericalityTest.php | 0 .../Validation/Validator/PresenceOfTest.php | 0 .../unit/Validation/Validator/RegexTest.php | 0 .../Validation/Validator/StringLengthTest.php | 0 .../Validation/Validator/UniquenessTest.php | 0 .../unit/Validation/Validator/UrlTest.php | 0 .../tests}/unit/ValidationTest.php | 0 {tests => _toCheck/tests}/unit/_bootstrap.php | 0 .../unit-tests}/.gitignore | 0 .../unit-tests}/CacheTest.php | 0 .../unit-tests}/DbBindTest.php | 0 .../unit-tests}/DbDescribeTest.php | 0 .../unit-tests}/DbProfilerTest.php | 0 .../unit-tests}/DbTest.php | 0 .../unit-tests}/FormsTest.php | 0 .../unit-tests}/MicroMvcCollectionsTest.php | 0 .../unit-tests}/ModelsCalculationsTest.php | 0 .../unit-tests}/ModelsEventsTest.php | 0 .../unit-tests}/ModelsForeignKeysTest.php | 0 .../unit-tests}/ModelsHydrationTest.php | 0 .../ModelsMetadataStrategyTest.php | 0 .../unit-tests}/ModelsMetadataTest.php | 0 .../unit-tests}/ModelsQueryExecuteTest.php | 0 .../unit-tests}/ModelsRelationsMagicTest.php | 0 .../unit-tests}/ModelsRelationsTest.php | 0 .../ModelsResultsetCacheStaticTest.php | 0 .../unit-tests}/ModelsResultsetCacheTest.php | 0 .../unit-tests}/ModelsResultsetTest.php | 0 .../unit-tests}/ModelsTest.php | 0 .../unit-tests}/ModelsValidatorsTest.php | 0 .../unit-tests}/PaginatorTest.php | 0 .../unit-tests}/cache/.gitignore | 0 .../unit-tests}/config.db.php | 0 .../controllers/ControllerBase.php | 0 .../controllers/FailureController.php | 0 .../controllers/Test0Controller.php | 0 .../controllers/Test1Controller.php | 0 .../controllers/Test2Controller.php | 0 .../controllers/Test3Controller.php | 0 .../controllers/Test5Controller.php | 0 .../controllers/Test6Controller.php | 0 .../controllers/Test7Controller.php | 0 .../controllers/Test8Controller.php | 0 .../unit-tests}/helpers/xcache.php | 0 .../unit-tests}/models/Abonnes.php | 0 .../unit-tests}/models/AlbumORama/Albums.php | 0 .../unit-tests}/models/AlbumORama/Artists.php | 0 .../unit-tests}/models/AlbumORama/Songs.php | 0 .../unit-tests}/models/Boutique/Robots.php | 0 .../unit-tests}/models/Boutique/Robotters.php | 0 .../unit-tests}/models/Cacheable/Model.php | 0 .../unit-tests}/models/Cacheable/Parts.php | 0 .../unit-tests}/models/Cacheable/Robots.php | 0 .../models/Cacheable/RobotsParts.php | 0 .../unit-tests}/models/Childs.php | 0 .../unit-tests}/models/Deles.php | 0 .../unit-tests}/models/GossipRobots.php | 0 .../unit-tests}/models/News/Subscribers.php | 0 .../unit-tests}/models/Parts.php | 0 .../unit-tests}/models/Parts2.php | 0 .../unit-tests}/models/People.php | 0 .../unit-tests}/models/Personas.php | 0 .../unit-tests}/models/Personers.php | 0 .../unit-tests}/models/Personnes.php | 0 .../unit-tests}/models/Pessoas.php | 0 .../unit-tests}/models/Products.php | 0 .../unit-tests}/models/Prueba.php | 0 .../unit-tests}/models/Relations/Deles.php | 0 .../unit-tests}/models/Relations/M2MParts.php | 0 .../models/Relations/M2MRobots.php | 0 .../models/Relations/M2MRobotsParts.php | 0 .../models/Relations/RelationsParts.php | 0 .../models/Relations/RelationsRobots.php | 0 .../models/Relations/RelationsRobotsParts.php | 0 .../models/Relations/Robotters.php | 0 .../models/Relations/RobottersDeles.php | 0 .../models/Relations/Some/Deles.php | 0 .../models/Relations/Some/Parts.php | 0 .../models/Relations/Some/Products.php | 0 .../models/Relations/Some/Robots.php | 0 .../models/Relations/Some/RobotsParts.php | 0 .../models/Relations/Some/Robotters.php | 0 .../models/Relations/Some/RobottersDeles.php | 0 .../unit-tests}/models/Robots.php | 0 .../unit-tests}/models/Robots2.php | 0 .../unit-tests}/models/RobotsParts.php | 0 .../unit-tests}/models/Robotters.php | 0 .../unit-tests}/models/RobottersDeles.php | 0 .../unit-tests}/models/Robotto.php | 0 .../unit-tests}/models/Snapshot/Parts.php | 0 .../unit-tests}/models/Snapshot/Robots.php | 0 .../models/Snapshot/RobotsParts.php | 0 .../unit-tests}/models/Snapshot/Robotters.php | 0 .../unit-tests}/models/Some/Deles.php | 0 .../unit-tests}/models/Some/Parts.php | 0 .../unit-tests}/models/Some/Products.php | 0 .../unit-tests}/models/Some/Robots.php | 0 .../unit-tests}/models/Some/RobotsParts.php | 0 .../unit-tests}/models/Some/Robotters.php | 0 .../models/Some/RobottersDeles.php | 0 .../unit-tests}/models/Store/Parts.php | 0 .../unit-tests}/models/Store/Robots.php | 0 .../unit-tests}/models/Store/RobotsParts.php | 0 .../unit-tests}/models/Subscribers.php | 0 .../unit-tests}/models/Subscriptores.php | 0 .../unit-tests}/views/index.phtml | 0 .../unit-tests}/views/layouts/after.phtml | 0 .../unit-tests}/views/layouts/before.phtml | 0 .../unit-tests}/views/layouts/test10.volt | 0 .../unit-tests}/views/layouts/test10.volt.php | 0 .../unit-tests}/views/layouts/test13.phtml | 0 .../views/macro/conditionaldate.volt | 0 .../views/macro/error_messages.volt | 0 .../unit-tests}/views/macro/form_row.volt | 0 .../unit-tests}/views/macro/hello.volt | 0 .../unit-tests}/views/macro/list.volt | 0 .../unit-tests}/views/macro/my_input.volt | 0 .../views/macro/related_links.volt | 0 .../unit-tests}/views/macro/strtotime.volt | 0 .../unit-tests}/views/partials/footer.volt | 0 .../views/partials/footer.volt.php | 0 .../unit-tests}/views/partials/header.volt | 0 .../views/partials/header.volt.php | 0 .../unit-tests}/views/partials/header2.volt | 0 .../views/partials/header2.volt.php | 0 .../unit-tests}/views/partials/header3.volt | 0 .../views/partials/header3.volt.php | 0 .../unit-tests}/views/templates/a.volt | 0 .../unit-tests}/views/templates/b.volt | 0 .../unit-tests}/views/templates/c.volt | 0 .../unit-tests}/views/test10/.gitignore | 0 .../views/test10/children.extends.volt | 0 .../unit-tests}/views/test10/children.volt | 0 .../unit-tests}/views/test10/children2.volt | 0 .../unit-tests}/views/test10/import.volt | 0 .../unit-tests}/views/test10/import2.volt | 0 .../unit-tests}/views/test10/index.volt | 0 .../unit-tests}/views/test10/other.volt | 0 .../unit-tests}/views/test10/parent.volt | 0 .../unit-tests}/views/test10/partial.volt | 0 .../unit-tests}/views/test11/index.volt | 0 .../unit-tests}/views/test11/index.volt.php | 0 .../unit-tests}/views/test13/index.phtml | 0 .../unit-tests}/views/test14/loop1.volt | 0 .../unit-tests}/views/test16/index.phtml | 0 .../unit-tests}/views/test3/query.phtml | 0 .../unit-tests}/views/test3/yup.phtml | 0 .../unit-tests}/views/test8/index.phtml | 0 .../unit-tests}/views/test8/leother.phtml | 0 .../unit-tests}/views/test8/other.phtml | 0 boxfile.yml | 73 +++++ tests/unit/VersionCest.php | 207 ++++++++++++ tests/unit/VersionTest.php | 310 ------------------ 796 files changed, 280 insertions(+), 310 deletions(-) rename codeception.yml => _toCheck/codeception.yml (100%) rename {tests => _toCheck/tests}/README.md (100%) rename {tests => _toCheck/tests}/_bootstrap.php (100%) rename {tests => _toCheck/tests}/_cache/.gitignore (100%) rename {tests => _toCheck/tests}/_ci/after-failure.sh (100%) rename {tests => _toCheck/tests}/_ci/appveyor.psm1 (100%) rename {tests => _toCheck/tests}/_ci/ci.ini (100%) rename {tests => _toCheck/tests}/_ci/environment (100%) rename {tests => _toCheck/tests}/_ci/install-prereqs.sh (100%) rename {tests => _toCheck/tests}/_ci/install-re2c.sh (100%) rename {tests => _toCheck/tests}/_ci/install-zephir-parser.sh (100%) rename {tests => _toCheck/tests}/_ci/pear-setup.sh (100%) rename {tests => _toCheck/tests}/_ci/phalcon.ini (100%) rename {tests => _toCheck/tests}/_ci/precompile-headers.sh (100%) rename {tests => _toCheck/tests}/_ci/setup-dbs.sh (100%) rename {tests => _toCheck/tests}/_config/bootstrap.php (100%) rename {tests => _toCheck/tests}/_config/global.php (100%) rename {tests => _toCheck/tests}/_data/acl/TestResourceAware.php (100%) rename {tests => _toCheck/tests}/_data/acl/TestRoleAware.php (100%) rename {tests => _toCheck/tests}/_data/acl/TestRoleResourceAware.php (100%) rename {tests => _toCheck/tests}/_data/annotations/TestClass.php (100%) rename {tests => _toCheck/tests}/_data/annotations/TestClassNs.php (100%) rename {tests => _toCheck/tests}/_data/annotations/TestInvalid.php (100%) rename {tests => _toCheck/tests}/_data/assets/1198.css (100%) rename {tests => _toCheck/tests}/_data/assets/assets-multiple-01.js (100%) rename {tests => _toCheck/tests}/_data/assets/assets-multiple-02.js (100%) rename {tests => _toCheck/tests}/_data/assets/cssmin-01-result.css (100%) rename {tests => _toCheck/tests}/_data/assets/cssmin-01.css (100%) rename {tests => _toCheck/tests}/_data/assets/gs.js (100%) rename {tests => _toCheck/tests}/_data/assets/jquery.js (100%) rename {tests => _toCheck/tests}/_data/assets/logo.png (100%) rename {tests => _toCheck/tests}/_data/assets/phalconphp.jpg (100%) rename {tests => _toCheck/tests}/_data/assets/signup.js (100%) rename {tests => _toCheck/tests}/_data/collections/Bookshelf/Books.php (100%) rename {tests => _toCheck/tests}/_data/collections/Bookshelf/Magazines.php (100%) rename {tests => _toCheck/tests}/_data/collections/Bookshelf/NotACollection.php (100%) rename {tests => _toCheck/tests}/_data/collections/People.php (100%) rename {tests => _toCheck/tests}/_data/collections/Robots.php (100%) rename {tests => _toCheck/tests}/_data/collections/Songs.php (100%) rename {tests => _toCheck/tests}/_data/collections/Store/Songs.php (100%) rename {tests => _toCheck/tests}/_data/collections/Subs.php (100%) rename {tests => _toCheck/tests}/_data/collections/Users.php (100%) rename {tests => _toCheck/tests}/_data/config/callbacks.yml (100%) rename {tests => _toCheck/tests}/_data/config/config-with-constants.ini (100%) rename {tests => _toCheck/tests}/_data/config/config.ini (100%) rename {tests => _toCheck/tests}/_data/config/config.json (100%) rename {tests => _toCheck/tests}/_data/config/config.php (100%) rename {tests => _toCheck/tests}/_data/config/config.yml (100%) rename {tests => _toCheck/tests}/_data/config/directive.ini (100%) rename {tests => _toCheck/tests}/_data/config/factory.ini (100%) rename {tests => _toCheck/tests}/_data/controllers/AboutController.php (100%) rename {tests => _toCheck/tests}/_data/controllers/ControllerBase.php (100%) rename {tests => _toCheck/tests}/_data/controllers/ExceptionController.php (100%) rename {tests => _toCheck/tests}/_data/controllers/FailureController.php (100%) rename {tests => _toCheck/tests}/_data/controllers/MainController.php (100%) rename {tests => _toCheck/tests}/_data/controllers/NamespacedAnnotationController.php (100%) rename {tests => _toCheck/tests}/_data/controllers/ProductsController.php (100%) rename {tests => _toCheck/tests}/_data/controllers/RobotsController.php (100%) rename {tests => _toCheck/tests}/_data/controllers/Test0Controller.php (100%) rename {tests => _toCheck/tests}/_data/controllers/Test10Controller.php (100%) rename {tests => _toCheck/tests}/_data/controllers/Test11Controller.php (100%) rename {tests => _toCheck/tests}/_data/controllers/Test12Controller.php (100%) rename {tests => _toCheck/tests}/_data/controllers/Test1Controller.php (100%) rename {tests => _toCheck/tests}/_data/controllers/Test2Controller.php (100%) rename {tests => _toCheck/tests}/_data/controllers/Test3Controller.php (100%) rename {tests => _toCheck/tests}/_data/controllers/Test4Controller.php (100%) rename {tests => _toCheck/tests}/_data/controllers/Test5Controller.php (100%) rename {tests => _toCheck/tests}/_data/controllers/Test6Controller.php (100%) rename {tests => _toCheck/tests}/_data/controllers/Test7Controller.php (100%) rename {tests => _toCheck/tests}/_data/controllers/Test8Controller.php (100%) rename {tests => _toCheck/tests}/_data/controllers/Test9Controller.php (100%) rename {tests => _toCheck/tests}/_data/debug/ClassProperties.php (100%) rename {tests => _toCheck/tests}/_data/di/InjectableComponent.php (100%) rename {tests => _toCheck/tests}/_data/di/SimpleComponent.php (100%) rename {tests => _toCheck/tests}/_data/di/SomeComponent.php (100%) rename {tests => _toCheck/tests}/_data/di/SomeService.php (100%) rename {tests => _toCheck/tests}/_data/di/SomeServiceProvider.php (100%) rename {tests => _toCheck/tests}/_data/di/services.php (100%) rename {tests => _toCheck/tests}/_data/di/services.yml (100%) rename {tests => _toCheck/tests}/_data/events/ComponentX.php (100%) rename {tests => _toCheck/tests}/_data/events/ComponentY.php (100%) rename {tests => _toCheck/tests}/_data/listener/CustomAuthorizationListener.php (100%) rename {tests => _toCheck/tests}/_data/listener/FirstListener.php (100%) rename {tests => _toCheck/tests}/_data/listener/NegotiateAuthorizationListener.php (100%) rename {tests => _toCheck/tests}/_data/listener/SecondListener.php (100%) rename {tests => _toCheck/tests}/_data/listener/ThirdListener.php (100%) rename {tests => _toCheck/tests}/_data/logs/dummy (100%) rename {tests => _toCheck/tests}/_data/micro/MyMiddleware.php (100%) rename {tests => _toCheck/tests}/_data/micro/MyMiddlewareStop.php (100%) rename {tests => _toCheck/tests}/_data/micro/RestHandler.php (100%) rename {tests => _toCheck/tests}/_data/models/AlbumORama/Albums.php (100%) rename {tests => _toCheck/tests}/_data/models/AlbumORama/Artists.php (100%) rename {tests => _toCheck/tests}/_data/models/Annotations/Robot.php (100%) rename {tests => _toCheck/tests}/_data/models/BodyParts/Body.php (100%) rename {tests => _toCheck/tests}/_data/models/BodyParts/Head.php (100%) rename {tests => _toCheck/tests}/_data/models/Boutique/Robots.php (100%) rename {tests => _toCheck/tests}/_data/models/Boutique/Robotters.php (100%) rename {tests => _toCheck/tests}/_data/models/Customers.php (100%) rename {tests => _toCheck/tests}/_data/models/Deles.php (100%) rename {tests => _toCheck/tests}/_data/models/Dynamic/Personas.php (100%) rename {tests => _toCheck/tests}/_data/models/Dynamic/Personers.php (100%) rename {tests => _toCheck/tests}/_data/models/Dynamic/Robots.php (100%) rename {tests => _toCheck/tests}/_data/models/Language.php (100%) rename {tests => _toCheck/tests}/_data/models/LanguageI18n.php (100%) rename {tests => _toCheck/tests}/_data/models/ModelWithStringField.php (100%) rename {tests => _toCheck/tests}/_data/models/News/Subscribers.php (100%) rename {tests => _toCheck/tests}/_data/models/PackageDetails.php (100%) rename {tests => _toCheck/tests}/_data/models/Packages.php (100%) rename {tests => _toCheck/tests}/_data/models/Parts.php (100%) rename {tests => _toCheck/tests}/_data/models/People.php (100%) rename {tests => _toCheck/tests}/_data/models/Personas.php (100%) rename {tests => _toCheck/tests}/_data/models/Personers.php (100%) rename {tests => _toCheck/tests}/_data/models/Products.php (100%) rename {tests => _toCheck/tests}/_data/models/Relations/RelationsParts.php (100%) rename {tests => _toCheck/tests}/_data/models/Relations/RelationsRobots.php (100%) rename {tests => _toCheck/tests}/_data/models/Relations/RelationsRobotsParts.php (100%) rename {tests => _toCheck/tests}/_data/models/Relations/Robots.php (100%) rename {tests => _toCheck/tests}/_data/models/Relations/RobotsParts.php (100%) rename {tests => _toCheck/tests}/_data/models/Robos.php (100%) rename {tests => _toCheck/tests}/_data/models/Robots.php (100%) rename {tests => _toCheck/tests}/_data/models/RobotsParts.php (100%) rename {tests => _toCheck/tests}/_data/models/Robotters.php (100%) rename {tests => _toCheck/tests}/_data/models/RobottersDeles.php (100%) rename {tests => _toCheck/tests}/_data/models/Robotto.php (100%) rename {tests => _toCheck/tests}/_data/models/Select.php (100%) rename {tests => _toCheck/tests}/_data/models/Snapshot/Parts.php (100%) rename {tests => _toCheck/tests}/_data/models/Snapshot/Personas.php (100%) rename {tests => _toCheck/tests}/_data/models/Snapshot/Requests.php (100%) rename {tests => _toCheck/tests}/_data/models/Snapshot/Robots.php (100%) rename {tests => _toCheck/tests}/_data/models/Snapshot/RobotsParts.php (100%) rename {tests => _toCheck/tests}/_data/models/Snapshot/Robotters.php (100%) rename {tests => _toCheck/tests}/_data/models/Snapshot/Subscribers.php (100%) rename {tests => _toCheck/tests}/_data/models/Some/Deles.php (100%) rename {tests => _toCheck/tests}/_data/models/Some/Parts.php (100%) rename {tests => _toCheck/tests}/_data/models/Some/Products.php (100%) rename {tests => _toCheck/tests}/_data/models/Some/Robots.php (100%) rename {tests => _toCheck/tests}/_data/models/Some/RobotsParts.php (100%) rename {tests => _toCheck/tests}/_data/models/Some/Robotters.php (100%) rename {tests => _toCheck/tests}/_data/models/Some/RobottersDeles.php (100%) rename {tests => _toCheck/tests}/_data/models/Statistics/AgeStats.php (100%) rename {tests => _toCheck/tests}/_data/models/Statistics/CityStats.php (100%) rename {tests => _toCheck/tests}/_data/models/Statistics/CountryStats.php (100%) rename {tests => _toCheck/tests}/_data/models/Statistics/GenderStats.php (100%) rename {tests => _toCheck/tests}/_data/models/Stock.php (100%) rename {tests => _toCheck/tests}/_data/models/Users.php (100%) rename {tests => _toCheck/tests}/_data/models/Validation/Robots.php (100%) rename {tests => _toCheck/tests}/_data/models/Validation/Subscriptores.php (100%) rename {tests => _toCheck/tests}/_data/modules/backend/Module.php (100%) rename {tests => _toCheck/tests}/_data/modules/backend/controllers/LoginController.php (100%) rename {tests => _toCheck/tests}/_data/modules/backend/views/index.phtml (100%) rename {tests => _toCheck/tests}/_data/modules/frontend/Module.php (100%) rename {tests => _toCheck/tests}/_data/modules/frontend/controllers/IndexController.php (100%) rename {tests => _toCheck/tests}/_data/modules/frontend/views/index/index.phtml (100%) rename {tests => _toCheck/tests}/_data/objectsets/Mvc/View/IteratorObject.php (100%) rename {tests => _toCheck/tests}/_data/resultsets/Stats.php (100%) rename {tests => _toCheck/tests}/_data/schemas/mysql/phalcon_test.sql (100%) rename {tests => _toCheck/tests}/_data/schemas/postgresql/phalcon_test.sql (100%) rename {tests => _toCheck/tests}/_data/schemas/sqlite/phalcon_test.sql (100%) rename {tests => _toCheck/tests}/_data/schemas/sqlite/translations.sql (100%) rename {tests => _toCheck/tests}/_data/tasks/EchoTask.php (100%) rename {tests => _toCheck/tests}/_data/tasks/Issue787Task.php (100%) rename {tests => _toCheck/tests}/_data/tasks/MainTask.php (100%) rename {tests => _toCheck/tests}/_data/tasks/ParamsTask.php (100%) rename {tests => _toCheck/tests}/_data/translation/csv/ru_RU.csv (100%) rename {tests => _toCheck/tests}/_data/translation/gettext/en_US.utf8/LC_MESSAGES/messages.mo (100%) rename {tests => _toCheck/tests}/_data/translation/gettext/en_US.utf8/LC_MESSAGES/messages.po (100%) rename {tests => _toCheck/tests}/_data/vendor/Example/Adapter/LeAnotherSome.inc (100%) rename {tests => _toCheck/tests}/_data/vendor/Example/Adapter/LeCoolSome.php (100%) rename {tests => _toCheck/tests}/_data/vendor/Example/Adapter/LeSome.php (100%) rename {tests => _toCheck/tests}/_data/vendor/Example/Adapter/Some.php (100%) rename {tests => _toCheck/tests}/_data/vendor/Example/Adapter/SomeCool.php (100%) rename {tests => _toCheck/tests}/_data/vendor/Example/Adapter2/Another.php (100%) rename {tests => _toCheck/tests}/_data/vendor/Example/Base/Any.php (100%) rename {tests => _toCheck/tests}/_data/vendor/Example/Dialects/LeDialect.php (100%) rename {tests => _toCheck/tests}/_data/vendor/Example/Engines/LeEngine.php (100%) rename {tests => _toCheck/tests}/_data/vendor/Example/Engines/LeEngine2.php (100%) rename {tests => _toCheck/tests}/_data/vendor/Example/Engines/LeOtherEngine.inc (100%) rename {tests => _toCheck/tests}/_data/vendor/Example/Example/Example.php (100%) rename {tests => _toCheck/tests}/_data/vendor/Example/Other/NoClass.php (100%) rename {tests => _toCheck/tests}/_data/vendor/Example/Other/NoClass1.php (100%) rename {tests => _toCheck/tests}/_data/vendor/Example/Other/NoClass2.php (100%) rename {tests => _toCheck/tests}/_data/vendor/Example/Other/NoClass3.php (100%) rename {tests => _toCheck/tests}/_data/vendor/Example/Other/VousTest.php (100%) rename {tests => _toCheck/tests}/_data/vendor/Example/Test/LeTest.php (100%) rename {tests => _toCheck/tests}/_data/vendor/Example/Test/MoiTest.php (100%) rename {tests => _toCheck/tests}/_data/vendor/Example/Types/SomeType.php (100%) rename {tests => _toCheck/tests}/_data/views/exception/index.phtml (100%) rename {tests => _toCheck/tests}/_data/views/exception/second.phtml (100%) rename {tests => _toCheck/tests}/_data/views/filters/.gitignore (100%) rename {tests => _toCheck/tests}/_data/views/filters/default.volt (100%) rename {tests => _toCheck/tests}/_data/views/filters/default_json_encode.volt (100%) rename {tests => _toCheck/tests}/_data/views/html5.phtml (100%) rename {tests => _toCheck/tests}/_data/views/index.phtml (100%) rename {tests => _toCheck/tests}/_data/views/layouts/.gitignore (100%) rename {tests => _toCheck/tests}/_data/views/layouts/after.phtml (100%) rename {tests => _toCheck/tests}/_data/views/layouts/before.phtml (100%) rename {tests => _toCheck/tests}/_data/views/layouts/test.phtml (100%) rename {tests => _toCheck/tests}/_data/views/layouts/test10.volt (100%) rename {tests => _toCheck/tests}/_data/views/layouts/test12.phtml (100%) rename {tests => _toCheck/tests}/_data/views/layouts/test13.phtml (100%) rename {tests => _toCheck/tests}/_data/views/layouts/test3.phtml (100%) rename {tests => _toCheck/tests}/_data/views/layouts/test4.mhtml (100%) rename {tests => _toCheck/tests}/_data/views/layouts/test6.phtml (100%) rename {tests => _toCheck/tests}/_data/views/layouts/test7.twig (100%) rename {tests => _toCheck/tests}/_data/views/macro/conditionaldate.volt (100%) rename {tests => _toCheck/tests}/_data/views/macro/error_messages.volt (100%) rename {tests => _toCheck/tests}/_data/views/macro/form_row.volt (100%) rename {tests => _toCheck/tests}/_data/views/macro/hello.volt (100%) rename {tests => _toCheck/tests}/_data/views/macro/list.volt (100%) rename {tests => _toCheck/tests}/_data/views/macro/my_input.volt (100%) rename {tests => _toCheck/tests}/_data/views/macro/related_links.volt (100%) rename {tests => _toCheck/tests}/_data/views/macro/strtotime.volt (100%) rename {tests => _toCheck/tests}/_data/views/partials/.gitignore (100%) rename {tests => _toCheck/tests}/_data/views/partials/_partial1.phtml (100%) rename {tests => _toCheck/tests}/_data/views/partials/_partial2.phtml (100%) rename {tests => _toCheck/tests}/_data/views/partials/_partial3.phtml (100%) rename {tests => _toCheck/tests}/_data/views/partials/footer.volt (100%) rename {tests => _toCheck/tests}/_data/views/partials/header.mhtml (100%) rename {tests => _toCheck/tests}/_data/views/partials/header.twig (100%) rename {tests => _toCheck/tests}/_data/views/partials/header.volt (100%) rename {tests => _toCheck/tests}/_data/views/partials/header2.volt (100%) rename {tests => _toCheck/tests}/_data/views/partials/header3.volt (100%) rename {tests => _toCheck/tests}/_data/views/switch-case/.gitignore (100%) rename {tests => _toCheck/tests}/_data/views/switch-case/simple-usage.volt (100%) rename {tests => _toCheck/tests}/_data/views/templates/a.volt (100%) rename {tests => _toCheck/tests}/_data/views/templates/b.volt (100%) rename {tests => _toCheck/tests}/_data/views/templates/c.volt (100%) rename {tests => _toCheck/tests}/_data/views/test10/.gitignore (100%) rename {tests => _toCheck/tests}/_data/views/test10/children.extends.volt (100%) rename {tests => _toCheck/tests}/_data/views/test10/children.volt (100%) rename {tests => _toCheck/tests}/_data/views/test10/children2.volt (100%) rename {tests => _toCheck/tests}/_data/views/test10/import.volt (100%) rename {tests => _toCheck/tests}/_data/views/test10/import2.volt (100%) rename {tests => _toCheck/tests}/_data/views/test10/index.volt (100%) rename {tests => _toCheck/tests}/_data/views/test10/other.volt (100%) rename {tests => _toCheck/tests}/_data/views/test10/parent.volt (100%) rename {tests => _toCheck/tests}/_data/views/test10/partial.volt (100%) rename {tests => _toCheck/tests}/_data/views/test11/.gitignore (100%) rename {tests => _toCheck/tests}/_data/views/test11/index.volt (100%) rename {tests => _toCheck/tests}/_data/views/test12/index.twig (100%) rename {tests => _toCheck/tests}/_data/views/test12/info.phtml (100%) rename {tests => _toCheck/tests}/_data/views/test13/index.phtml (100%) rename {tests => _toCheck/tests}/_data/views/test14/loop1.volt (100%) rename {tests => _toCheck/tests}/_data/views/test15/index.phtml (100%) rename {tests => _toCheck/tests}/_data/views/test16/index.phtml (100%) rename {tests => _toCheck/tests}/_data/views/test2/index.phtml (100%) rename {tests => _toCheck/tests}/_data/views/test2/params.phtml (100%) rename {tests => _toCheck/tests}/_data/views/test3/another.phtml (100%) rename {tests => _toCheck/tests}/_data/views/test3/coolVar.phtml (100%) rename {tests => _toCheck/tests}/_data/views/test3/other.phtml (100%) rename {tests => _toCheck/tests}/_data/views/test3/query.phtml (100%) rename {tests => _toCheck/tests}/_data/views/test3/yup.phtml (100%) rename {tests => _toCheck/tests}/_data/views/test4/index.mhtml (100%) rename {tests => _toCheck/tests}/_data/views/test5/index.phtml (100%) rename {tests => _toCheck/tests}/_data/views/test5/missing.phtml (100%) rename {tests => _toCheck/tests}/_data/views/test5/subpartial.phtml (100%) rename {tests => _toCheck/tests}/_data/views/test6/index.mhtml (100%) rename {tests => _toCheck/tests}/_data/views/test6/info.phtml (100%) rename {tests => _toCheck/tests}/_data/views/test7/index.twig (100%) rename {tests => _toCheck/tests}/_data/views/test8/index.phtml (100%) rename {tests => _toCheck/tests}/_data/views/test8/leother.phtml (100%) rename {tests => _toCheck/tests}/_data/views/test8/other.phtml (100%) rename {tests => _toCheck/tests}/_data/views/test9/index.phtml (100%) rename {tests => _toCheck/tests}/_fixtures/dump/class_properties.txt (100%) rename {tests => _toCheck/tests}/_fixtures/metadata/robots.php (100%) rename {tests => _toCheck/tests}/_fixtures/metadata/test_describereference.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/model/criteria_test/limit_offset_provider.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/model/query_test/data_to_delete_parsing.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/model/query_test/data_to_insert_parsing.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/model/query_test/data_to_update_parsing.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/router_test/data_to_regex_router_host_port.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/router_test/data_to_router.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/router_test/data_to_router_host_name.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/router_test/data_to_router_http.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/router_test/data_to_router_param.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/router_test/data_to_router_with_hostname.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/router_test/matching_with_converted.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/router_test/matching_with_extra_slashes.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/router_test/matching_with_got_router.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/router_test/matching_with_host_name.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/router_test/matching_with_hostname_regex.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/router_test/matching_with_path_provider.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/router_test/matching_with_regex_router_host_port.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/router_test/matching_with_router.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/router_test/matching_with_router_http.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/url_test/data_to_set_di.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/url_test/url_to_set_base_uri.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/url_test/url_to_set_server.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/url_test/url_to_set_without_di.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/url_test/url_to_set_without_di_two_param.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/view/engine/mustache.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/view/engine/twig.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/view/engine/volt/compiler_files_test/volt_compile_file_extends_multiple.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/view/engine/volt/compiler_files_test/volt_compiler_extends_block.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/view/engine/volt/compiler_files_test/volt_compiler_file.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/view_engines_test/view_built_in_function.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/view_engines_test/view_register_engines.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/view_engines_test/view_set_php_mustache.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/view_engines_test/view_set_php_mustache_partial.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/view_engines_test/view_set_php_twig.php (100%) rename {tests => _toCheck/tests}/_fixtures/mvc/view_engines_test/view_set_php_twig_partial.php (100%) rename {tests => _toCheck/tests}/_fixtures/mysql/example1.sql (100%) rename {tests => _toCheck/tests}/_fixtures/mysql/example2.sql (100%) rename {tests => _toCheck/tests}/_fixtures/mysql/example3.sql (100%) rename {tests => _toCheck/tests}/_fixtures/mysql/example4.sql (100%) rename {tests => _toCheck/tests}/_fixtures/mysql/example5.sql (100%) rename {tests => _toCheck/tests}/_fixtures/postgresql/example1.sql (100%) rename {tests => _toCheck/tests}/_fixtures/postgresql/example2.sql (100%) rename {tests => _toCheck/tests}/_fixtures/postgresql/example3.sql (100%) rename {tests => _toCheck/tests}/_fixtures/postgresql/example4.sql (100%) rename {tests => _toCheck/tests}/_fixtures/postgresql/example5.sql (100%) rename {tests => _toCheck/tests}/_fixtures/postgresql/example6.sql (100%) rename {tests => _toCheck/tests}/_fixtures/postgresql/example7.sql (100%) rename {tests => _toCheck/tests}/_fixtures/postgresql/example8.sql (100%) rename {tests => _toCheck/tests}/_fixtures/postgresql/example9.sql (100%) rename {tests => _toCheck/tests}/_fixtures/query/select_parsing.php (100%) rename {tests => _toCheck/tests}/_fixtures/sqlite/example1.sql (100%) rename {tests => _toCheck/tests}/_fixtures/sqlite/example2.sql (100%) rename {tests => _toCheck/tests}/_fixtures/sqlite/example3.sql (100%) rename {tests => _toCheck/tests}/_fixtures/sqlite/example4.sql (100%) rename {tests => _toCheck/tests}/_fixtures/sqlite/example5.sql (100%) rename {tests => _toCheck/tests}/_fixtures/sqlite/example6.sql (100%) rename {tests => _toCheck/tests}/_fixtures/sqlite/example7.sql (100%) rename {tests => _toCheck/tests}/_fixtures/sqlite/example8.sql (100%) rename {tests => _toCheck/tests}/_fixtures/volt/compilerExceptionsTest/volt_compile_string.php (100%) rename {tests => _toCheck/tests}/_fixtures/volt/compilerExceptionsTest/volt_extends_error.php (100%) rename {tests => _toCheck/tests}/_fixtures/volt/compilerExceptionsTest/volt_syntax_error.php (100%) rename {tests => _toCheck/tests}/_fixtures/volt/compilerTest/test_volt_parser.php (100%) rename {tests => _toCheck/tests}/_fixtures/volt/compilerTest/volt_closure_filter.php (100%) rename {tests => _toCheck/tests}/_fixtures/volt/compilerTest/volt_compile_string_autoescape.php (100%) rename {tests => _toCheck/tests}/_fixtures/volt/compilerTest/volt_compile_string_equals.php (100%) rename {tests => _toCheck/tests}/_fixtures/volt/compilerTest/volt_single_filter.php (100%) rename {tests => _toCheck/tests}/_fixtures/volt/compilerTest/volt_users_function_with_closure.php (100%) rename {tests => _toCheck/tests}/_fixtures/volt/compilerTest/volt_users_single_string_function.php (100%) rename {tests => _toCheck/tests}/_output/.gitignore (100%) rename {tests => _toCheck/tests}/_output/tests/annotations/.gitignore (100%) rename {tests => _toCheck/tests}/_output/tests/assets/.gitignore (100%) rename {tests => _toCheck/tests}/_output/tests/cache/.gitignore (100%) rename {tests => _toCheck/tests}/_output/tests/image/gd/.gitignore (100%) rename {tests => _toCheck/tests}/_output/tests/image/imagick/.gitignore (100%) rename {tests => _toCheck/tests}/_output/tests/logs/.gitignore (100%) rename {tests => _toCheck/tests}/_output/tests/session/.gitignore (100%) rename {tests => _toCheck/tests}/_output/tests/stream/.gitignore (100%) rename {tests => _toCheck/tests}/_support/Helper/CollectionTrait.php (100%) rename {tests => _toCheck/tests}/_support/Helper/ConnectionCheckerTrait.php (100%) rename {tests => _toCheck/tests}/_support/Helper/CookieAwareTrait.php (100%) rename {tests => _toCheck/tests}/_support/Helper/Db/Connection/AbstractFactory.php (100%) rename {tests => _toCheck/tests}/_support/Helper/Db/Connection/MysqlFactory.php (100%) rename {tests => _toCheck/tests}/_support/Helper/Db/Connection/PostgresqlFactory.php (100%) rename {tests => _toCheck/tests}/_support/Helper/Db/Connection/SqliteFactory.php (100%) rename {tests => _toCheck/tests}/_support/Helper/Db/Connection/SqliteTranslationsFactory.php (100%) rename {tests => _toCheck/tests}/_support/Helper/Dialect/MysqlTrait.php (100%) rename {tests => _toCheck/tests}/_support/Helper/Dialect/PostgresqlTrait.php (100%) rename {tests => _toCheck/tests}/_support/Helper/Dialect/SqliteTrait.php (100%) rename {tests => _toCheck/tests}/_support/Helper/DialectTrait.php (100%) rename {tests => _toCheck/tests}/_support/Helper/Http/PhpStream.php (100%) rename {tests => _toCheck/tests}/_support/Helper/Integration.php (100%) rename {tests => _toCheck/tests}/_support/Helper/ModelTrait.php (100%) rename {tests => _toCheck/tests}/_support/Helper/Mvc/RouterTrait.php (100%) rename {tests => _toCheck/tests}/_support/Helper/ResultsetHelperTrait.php (100%) rename {tests => _toCheck/tests}/_support/Helper/Unit.php (100%) rename {tests => _toCheck/tests}/_support/Helper/Unit5x.php (100%) rename {tests => _toCheck/tests}/_support/Helper/ViewTrait.php (100%) rename {tests => _toCheck/tests}/_support/IntegrationTester.php (100%) rename {tests => _toCheck/tests}/_support/Module/Cache/Backend/File.php (100%) rename {tests => _toCheck/tests}/_support/Module/Libmemcached.php (100%) rename {tests => _toCheck/tests}/_support/Module/UnitTest.php (100%) rename {tests => _toCheck/tests}/_support/Module/View/AfterRenderListener.php (100%) rename {tests => _toCheck/tests}/_support/Module/View/Engine/Mustache.php (100%) rename {tests => _toCheck/tests}/_support/Module/View/Engine/Twig.php (100%) rename {tests => _toCheck/tests}/_support/Unit5xTester.php (100%) rename {tests => _toCheck/tests}/_support/UnitTester.php (100%) rename {tests => _toCheck/tests}/_support/_generated/.gitignore (100%) rename {tests => _toCheck/tests}/integration.suite.yml (100%) rename {tests => _toCheck/tests}/integration/Assets/ManagerCest.php (100%) rename {tests => _toCheck/tests}/integration/Forms/FormCest.php (100%) rename {tests => _toCheck/tests}/integration/Mvc/ApplicationCest.php (100%) rename {tests => _toCheck/tests}/integration/Mvc/Collection/BehaviorCest.php (100%) rename {tests => _toCheck/tests}/integration/Mvc/ControllersCest.php (100%) rename {tests => _toCheck/tests}/integration/Mvc/Dispatcher/ForwardCest.php (100%) rename {tests => _toCheck/tests}/integration/Mvc/Model/BinderCest.php (100%) rename {tests => _toCheck/tests}/integration/Mvc/Model/Criteria/FromInputCest.php (100%) rename {tests => _toCheck/tests}/integration/Mvc/Model/CriteriaCest.php (100%) rename {tests => _toCheck/tests}/integration/Mvc/Model/Query/BuilderCest.php (100%) rename {tests => _toCheck/tests}/integration/Mvc/View/Engine/Volt/CompilerCest.php (100%) rename {tests => _toCheck/tests}/integration/Mvc/View/Engine/Volt/CompilerFilesCest.php (100%) rename {tests => _toCheck/tests}/integration/Mvc/View/Engine/VoltCest.php (100%) rename {tests => _toCheck/tests}/integration/Mvc/View/SimpleCest.php (100%) rename {tests => _toCheck/tests}/integration/Mvc/ViewCest.php (100%) rename {tests => _toCheck/tests}/integration/ValidationCest.php (100%) rename {tests => _toCheck/tests}/integration/_bootstrap.php (100%) rename {tests => _toCheck/tests}/shim.php (100%) rename {tests => _toCheck/tests}/syntax/bootstrap.inc (100%) rename {tests => _toCheck/tests}/syntax/tests/volt/statements/switchcase/001.phpt (100%) rename {tests => _toCheck/tests}/syntax/tests/volt/statements/switchcase/002.phpt (100%) rename {tests => _toCheck/tests}/syntax/tests/volt/statements/switchcase/003.phpt (100%) rename {tests => _toCheck/tests}/syntax/tests/volt/statements/switchcase/004.phpt (100%) rename {tests => _toCheck/tests}/syntax/tests/volt/statements/switchcase/005.phpt (100%) rename {tests => _toCheck/tests}/syntax/tests/volt/statements/switchcase/006.phpt (100%) rename {tests => _toCheck/tests}/syntax/tests/volt/statements/switchcase/007.phpt (100%) rename {tests => _toCheck/tests}/syntax/tests/volt/statements/switchcase/008.phpt (100%) rename {tests => _toCheck/tests}/syntax/tests/volt/statements/switchcase/009.phpt (100%) rename {tests => _toCheck/tests}/syntax/tests/volt/statements/switchcase/010.phpt (100%) rename {tests => _toCheck/tests}/unit.suite.yml (100%) rename {tests => _toCheck/tests}/unit/Acl/Adapter/MemoryTest.php (100%) rename {tests => _toCheck/tests}/unit/Acl/ResourceTest.php (100%) rename {tests => _toCheck/tests}/unit/Acl/RoleTest.php (100%) rename {tests => _toCheck/tests}/unit/Annotations/Adapter/ApcTest.php (100%) rename {tests => _toCheck/tests}/unit/Annotations/Adapter/ApcuTest.php (100%) rename {tests => _toCheck/tests}/unit/Annotations/Adapter/FilesTest.php (100%) rename {tests => _toCheck/tests}/unit/Annotations/Adapter/MemoryTest.php (100%) rename {tests => _toCheck/tests}/unit/Annotations/FactoryTest.php (100%) rename {tests => _toCheck/tests}/unit/Annotations/ReaderTest.php (100%) rename {tests => _toCheck/tests}/unit/Annotations/ReflectionTest.php (100%) rename {tests => _toCheck/tests}/unit/Assets/CollectionTest.php (100%) rename {tests => _toCheck/tests}/unit/Assets/Filters/CssMinTest.php (100%) rename {tests => _toCheck/tests}/unit/Assets/Filters/JsminTest.php (100%) rename {tests => _toCheck/tests}/unit/Assets/Filters/NoneTest.php (100%) rename {tests => _toCheck/tests}/unit/Assets/Helper/TrimFilter.php (100%) rename {tests => _toCheck/tests}/unit/Assets/Helper/UppercaseFilter.php (100%) rename {tests => _toCheck/tests}/unit/Assets/InlineTest.php (100%) rename {tests => _toCheck/tests}/unit/Assets/ManagerTest.php (100%) rename {tests => _toCheck/tests}/unit/Assets/Resource/CssTest.php (100%) rename {tests => _toCheck/tests}/unit/Assets/Resource/JsTest.php (100%) rename {tests => _toCheck/tests}/unit/Assets/ResourceTest.php (100%) rename {tests => _toCheck/tests}/unit/Cache/Backend/ApcCest.php (100%) rename {tests => _toCheck/tests}/unit/Cache/Backend/ApcuCest.php (100%) rename {tests => _toCheck/tests}/unit/Cache/Backend/FactoryTest.php (100%) rename {tests => _toCheck/tests}/unit/Cache/Backend/FileCest.php (100%) rename {tests => _toCheck/tests}/unit/Cache/Backend/LibmemcachedCest.php (100%) rename {tests => _toCheck/tests}/unit/Cache/Backend/MemoryCest.php (100%) rename {tests => _toCheck/tests}/unit/Cache/Backend/RedisCest.php (100%) rename {tests => _toCheck/tests}/unit/Cache/Frontend/FactoryTest.php (100%) rename {tests => _toCheck/tests}/unit/Cli/ConsoleTest.php (100%) rename {tests => _toCheck/tests}/unit/Cli/DispatcherTest.php (100%) rename {tests => _toCheck/tests}/unit/Cli/RouterTest.php (100%) rename {tests => _toCheck/tests}/unit/Cli/TaskTest.php (100%) rename {tests => _toCheck/tests}/unit/Config/Adapter/GroupedTest.php (100%) rename {tests => _toCheck/tests}/unit/Config/Adapter/IniTest.php (100%) rename {tests => _toCheck/tests}/unit/Config/Adapter/JsonTest.php (100%) rename {tests => _toCheck/tests}/unit/Config/Adapter/PhpTest.php (100%) rename {tests => _toCheck/tests}/unit/Config/Adapter/YamlTest.php (100%) rename {tests => _toCheck/tests}/unit/Config/FactoryTest.php (100%) rename {tests => _toCheck/tests}/unit/Config/Helper/ConfigBase.php (100%) rename {tests => _toCheck/tests}/unit/ConfigTest.php (100%) rename {tests => _toCheck/tests}/unit/CryptTest.php (100%) rename {tests => _toCheck/tests}/unit/Db/Adapter/Pdo/FactoryTest.php (100%) rename {tests => _toCheck/tests}/unit/Db/Adapter/Pdo/MysqlTest.php (100%) rename {tests => _toCheck/tests}/unit/Db/Adapter/Pdo/PostgresqlTest.php (100%) rename {tests => _toCheck/tests}/unit/Db/Column/PostgresqlTest.php (100%) rename {tests => _toCheck/tests}/unit/Db/ColumnTest.php (100%) rename {tests => _toCheck/tests}/unit/Db/Dialect/MysqlTest.php (100%) rename {tests => _toCheck/tests}/unit/Db/Dialect/PostgresqlTest.php (100%) rename {tests => _toCheck/tests}/unit/Db/Dialect/SqliteTest.php (100%) rename {tests => _toCheck/tests}/unit/Db/IndexTest.php (100%) rename {tests => _toCheck/tests}/unit/Db/ReferenceTest.php (100%) rename {tests => _toCheck/tests}/unit/Debug/DumpTest.php (100%) rename {tests => _toCheck/tests}/unit/DebugTest.php (100%) rename {tests => _toCheck/tests}/unit/Di/FactoryDefaultTest.php (100%) rename {tests => _toCheck/tests}/unit/Di/ServiceTest.php (100%) rename {tests => _toCheck/tests}/unit/DiTest.php (100%) rename {tests => _toCheck/tests}/unit/EscaperTest.php (100%) rename {tests => _toCheck/tests}/unit/Events/ManagerTest.php (100%) rename {tests => _toCheck/tests}/unit/Factory/Helper/FactoryBase.php (100%) rename {tests => _toCheck/tests}/unit/Filter/FilterAlphanumTest.php (100%) rename {tests => _toCheck/tests}/unit/Filter/FilterCustomTest.php (100%) rename {tests => _toCheck/tests}/unit/Filter/FilterEmailTest.php (100%) rename {tests => _toCheck/tests}/unit/Filter/FilterFloatTest.php (100%) rename {tests => _toCheck/tests}/unit/Filter/FilterIntegerTest.php (100%) rename {tests => _toCheck/tests}/unit/Filter/FilterMultipleTest.php (100%) rename {tests => _toCheck/tests}/unit/Filter/FilterSpecialCharsTest.php (100%) rename {tests => _toCheck/tests}/unit/Filter/FilterStringTest.php (100%) rename {tests => _toCheck/tests}/unit/Filter/FilterStriptagsTest.php (100%) rename {tests => _toCheck/tests}/unit/Filter/FilterTrimTest.php (100%) rename {tests => _toCheck/tests}/unit/Filter/FilterUpperLowerTest.php (100%) rename {tests => _toCheck/tests}/unit/Filter/FilterUrlTest.php (100%) rename {tests => _toCheck/tests}/unit/Filter/Helper/FilterBase.php (100%) rename {tests => _toCheck/tests}/unit/Filter/Helper/IPv4.php (100%) rename {tests => _toCheck/tests}/unit/Flash/Direct/FlashDirectCustomCSSTest.php (100%) rename {tests => _toCheck/tests}/unit/Flash/Direct/FlashDirectEmptyCSSTest.php (100%) rename {tests => _toCheck/tests}/unit/Flash/Direct/Helper/FlashBase.php (100%) rename {tests => _toCheck/tests}/unit/Flash/SessionTest.php (100%) rename {tests => _toCheck/tests}/unit/Forms/Element/TextTest.php (100%) rename {tests => _toCheck/tests}/unit/Forms/FormTest.php (100%) rename {tests => _toCheck/tests}/unit/Http/CookieTest.php (100%) rename {tests => _toCheck/tests}/unit/Http/Helper/HttpBase.php (100%) rename {tests => _toCheck/tests}/unit/Http/Request/AuthHeaderTest.php (100%) rename {tests => _toCheck/tests}/unit/Http/Request/FileTest.php (100%) rename {tests => _toCheck/tests}/unit/Http/RequestTest.php (100%) rename {tests => _toCheck/tests}/unit/Http/Response/CookiesTest.php (100%) rename {tests => _toCheck/tests}/unit/Http/Response/HeadersTest.php (100%) rename {tests => _toCheck/tests}/unit/Http/ResponseTest.php (100%) rename {tests => _toCheck/tests}/unit/Image/Adapter/GdTest.php (100%) rename {tests => _toCheck/tests}/unit/Image/Adapter/ImagickTest.php (100%) rename {tests => _toCheck/tests}/unit/Image/FactoryTest.php (100%) rename {tests => _toCheck/tests}/unit/LoaderTest.php (100%) rename {tests => _toCheck/tests}/unit/Logger/Adapter/FileTest.php (100%) rename {tests => _toCheck/tests}/unit/Logger/Adapter/FirephpTest.php (100%) rename {tests => _toCheck/tests}/unit/Logger/FactoryTest.php (100%) rename {tests => _toCheck/tests}/unit/Logger/Formatter/LineTest.php (100%) rename {tests => _toCheck/tests}/unit/Messages/MessagesTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/DispatcherAfterDispatchLoopTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/DispatcherAfterDispatchTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/DispatcherAfterExecuteRouteMethodTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/DispatcherAfterExecuteRouteTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/DispatcherAfterInitializeTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/DispatcherBeforeDispatchLoopTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/DispatcherBeforeDispatchTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/DispatcherBeforeExecuteRouteMethodTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/DispatcherBeforeExecuteRouteTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/DispatcherInitalizeMethodTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/DispatcherTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/Helper/BaseDispatcher.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/Helper/DispatcherListener.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/Helper/DispatcherTestAfterExecuteRouteExceptionController.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/Helper/DispatcherTestAfterExecuteRouteForwardController.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/Helper/DispatcherTestAfterExecuteRouteReturnFalseController.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/Helper/DispatcherTestBeforeExecuteRouteExceptionController.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/Helper/DispatcherTestBeforeExecuteRouteForwardController.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/Helper/DispatcherTestBeforeExecuteRouteReturnFalseController.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/Helper/DispatcherTestDefaultController.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/Helper/DispatcherTestDefaultNoNamespaceController.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/Helper/DispatcherTestDefaultSimpleController.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/Helper/DispatcherTestDefaultTwoController.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/Helper/DispatcherTestInitializeExceptionController.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/Helper/DispatcherTestInitializeForwardController.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Dispatcher/Helper/DispatcherTestInitializeReturnFalseController.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/MicroTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/CriteriaTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/DynamicOperationsTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/Helpers/Validation.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/Manager/RelationsTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/ManagerTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/MetaData/ApcCest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/MetaData/ApcuCest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/MetaData/FilesCest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/MetaData/LibmemcachedCest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/MetaData/MemoryCest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/MetaData/RedisCest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/MetaData/ResetCest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/MetaData/SessionCest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/MetaData/Strategy/AnnotationsTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/Query/BuilderOrderTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/Query/BuilderTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/QueryTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/RelationsTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/Resultset/ComplexTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/Resultset/SimpleTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/ResultsetClassTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/SnapshotTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/Transaction/ManagerTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Model/ValidationCest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/ModelCest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/ModelTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Router/AnnotationsTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/Router/GroupTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/RouterTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/UrlTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/View/Engine/Volt/Compiler/Filters/DefaultTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/View/Engine/Volt/Compiler/Statements/SwitchCaseTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/View/Engine/Volt/CompilerExceptionsTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/View/Engine/Volt/CompilerFilesTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/View/Engine/Volt/CompilerTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/View/Engine/Volt/CompilerTrait.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/View/SimpleTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/ViewEnginesTest.php (100%) rename {tests => _toCheck/tests}/unit/Mvc/ViewTest.php (100%) rename {tests => _toCheck/tests}/unit/Paginator/Adapter/NativeArrayTest.php (100%) rename {tests => _toCheck/tests}/unit/Paginator/Adapter/QueryBuilderTest.php (100%) rename {tests => _toCheck/tests}/unit/Paginator/FactoryTest.php (100%) rename {tests => _toCheck/tests}/unit/Queue/Beanstalk/JobTest.php (100%) rename {tests => _toCheck/tests}/unit/Queue/BeanstalkTest.php (100%) rename {tests => _toCheck/tests}/unit/Queue/Helper/BeanstalkBase.php (100%) rename {tests => _toCheck/tests}/unit/Security/RandomTest.php (100%) rename {tests => _toCheck/tests}/unit/SecurityTest.php (100%) rename {tests => _toCheck/tests}/unit/Session/Adapter/FilesTest.php (100%) rename {tests => _toCheck/tests}/unit/Session/Adapter/LibmemcachedTest.php (100%) rename {tests => _toCheck/tests}/unit/Session/Adapter/RedisTest.php (100%) rename {tests => _toCheck/tests}/unit/Session/BagTest.php (100%) rename {tests => _toCheck/tests}/unit/Session/FactoryTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagCheckFieldTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagColorFieldTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagDateFieldTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagDateTimeFieldTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagDateTimeLocalFieldTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagDoctypeTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagEmailFieldTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagFileFieldTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagFriendlyTitleTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagHiddenFieldTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagImageInputTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagImageTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagJavascriptIncludeTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagLinkToTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagMonthFieldTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagNumericFieldTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagPasswordFieldTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagRadioFieldTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagRangeFieldTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagResetInputTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagSearchFieldTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagSelectStaticTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagSetDefaultTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagStylesheetlinkTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagSubmitButtonTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagTagHtmlTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagTelFieldTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagTextAreaTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagTextFieldTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagTimeFieldTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagTitleTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagUrlFieldTest.php (100%) rename {tests => _toCheck/tests}/unit/Tag/TagWeekFieldTest.php (100%) rename {tests => _toCheck/tests}/unit/Text/TextCamelizeTest.php (100%) rename {tests => _toCheck/tests}/unit/Text/TextConcatTest.php (100%) rename {tests => _toCheck/tests}/unit/Text/TextDynamicTest.php (100%) rename {tests => _toCheck/tests}/unit/Text/TextEndsWithTest.php (100%) rename {tests => _toCheck/tests}/unit/Text/TextHumanizeTest.php (100%) rename {tests => _toCheck/tests}/unit/Text/TextIncrementTest.php (100%) rename {tests => _toCheck/tests}/unit/Text/TextRandomTest.php (100%) rename {tests => _toCheck/tests}/unit/Text/TextReduceSlashesTest.php (100%) rename {tests => _toCheck/tests}/unit/Text/TextStartsWithTest.php (100%) rename {tests => _toCheck/tests}/unit/Text/TextUncamelizeTest.php (100%) rename {tests => _toCheck/tests}/unit/Text/TextUnderscoreTest.php (100%) rename {tests => _toCheck/tests}/unit/Text/TextUpperLowerTest.php (100%) rename {tests => _toCheck/tests}/unit/Translate/Adapter/CsvTest.php (100%) rename {tests => _toCheck/tests}/unit/Translate/Adapter/GettextCest.php (100%) rename {tests => _toCheck/tests}/unit/Translate/Adapter/NativeArrayTest.php (100%) rename {tests => _toCheck/tests}/unit/Translate/FactoryTest.php (100%) rename {tests => _toCheck/tests}/unit/Translate/Interpolator/AssociativeArrayTest.php (100%) rename {tests => _toCheck/tests}/unit/Translate/Interpolator/IndexedArrayTest.php (100%) rename {tests => _toCheck/tests}/unit/Validation/Validator/AlnumTest.php (100%) rename {tests => _toCheck/tests}/unit/Validation/Validator/AlphaTest.php (100%) rename {tests => _toCheck/tests}/unit/Validation/Validator/BetweenTest.php (100%) rename {tests => _toCheck/tests}/unit/Validation/Validator/CallbackTest.php (100%) rename {tests => _toCheck/tests}/unit/Validation/Validator/ConfirmationTest.php (100%) rename {tests => _toCheck/tests}/unit/Validation/Validator/CreditCardTest.php (100%) rename {tests => _toCheck/tests}/unit/Validation/Validator/DateTest.php (100%) rename {tests => _toCheck/tests}/unit/Validation/Validator/DigitTest.php (100%) rename {tests => _toCheck/tests}/unit/Validation/Validator/EmailTest.php (100%) rename {tests => _toCheck/tests}/unit/Validation/Validator/ExclusionInTest.php (100%) rename {tests => _toCheck/tests}/unit/Validation/Validator/IdenticalTest.php (100%) rename {tests => _toCheck/tests}/unit/Validation/Validator/InclusionInTest.php (100%) rename {tests => _toCheck/tests}/unit/Validation/Validator/NumericalityTest.php (100%) rename {tests => _toCheck/tests}/unit/Validation/Validator/PresenceOfTest.php (100%) rename {tests => _toCheck/tests}/unit/Validation/Validator/RegexTest.php (100%) rename {tests => _toCheck/tests}/unit/Validation/Validator/StringLengthTest.php (100%) rename {tests => _toCheck/tests}/unit/Validation/Validator/UniquenessTest.php (100%) rename {tests => _toCheck/tests}/unit/Validation/Validator/UrlTest.php (100%) rename {tests => _toCheck/tests}/unit/ValidationTest.php (100%) rename {tests => _toCheck/tests}/unit/_bootstrap.php (100%) rename {unit-tests => _toCheck/unit-tests}/.gitignore (100%) rename {unit-tests => _toCheck/unit-tests}/CacheTest.php (100%) rename {unit-tests => _toCheck/unit-tests}/DbBindTest.php (100%) rename {unit-tests => _toCheck/unit-tests}/DbDescribeTest.php (100%) rename {unit-tests => _toCheck/unit-tests}/DbProfilerTest.php (100%) rename {unit-tests => _toCheck/unit-tests}/DbTest.php (100%) rename {unit-tests => _toCheck/unit-tests}/FormsTest.php (100%) rename {unit-tests => _toCheck/unit-tests}/MicroMvcCollectionsTest.php (100%) rename {unit-tests => _toCheck/unit-tests}/ModelsCalculationsTest.php (100%) rename {unit-tests => _toCheck/unit-tests}/ModelsEventsTest.php (100%) rename {unit-tests => _toCheck/unit-tests}/ModelsForeignKeysTest.php (100%) rename {unit-tests => _toCheck/unit-tests}/ModelsHydrationTest.php (100%) rename {unit-tests => _toCheck/unit-tests}/ModelsMetadataStrategyTest.php (100%) rename {unit-tests => _toCheck/unit-tests}/ModelsMetadataTest.php (100%) rename {unit-tests => _toCheck/unit-tests}/ModelsQueryExecuteTest.php (100%) rename {unit-tests => _toCheck/unit-tests}/ModelsRelationsMagicTest.php (100%) rename {unit-tests => _toCheck/unit-tests}/ModelsRelationsTest.php (100%) rename {unit-tests => _toCheck/unit-tests}/ModelsResultsetCacheStaticTest.php (100%) rename {unit-tests => _toCheck/unit-tests}/ModelsResultsetCacheTest.php (100%) rename {unit-tests => _toCheck/unit-tests}/ModelsResultsetTest.php (100%) rename {unit-tests => _toCheck/unit-tests}/ModelsTest.php (100%) rename {unit-tests => _toCheck/unit-tests}/ModelsValidatorsTest.php (100%) rename {unit-tests => _toCheck/unit-tests}/PaginatorTest.php (100%) rename {unit-tests => _toCheck/unit-tests}/cache/.gitignore (100%) rename {unit-tests => _toCheck/unit-tests}/config.db.php (100%) rename {unit-tests => _toCheck/unit-tests}/controllers/ControllerBase.php (100%) rename {unit-tests => _toCheck/unit-tests}/controllers/FailureController.php (100%) rename {unit-tests => _toCheck/unit-tests}/controllers/Test0Controller.php (100%) rename {unit-tests => _toCheck/unit-tests}/controllers/Test1Controller.php (100%) rename {unit-tests => _toCheck/unit-tests}/controllers/Test2Controller.php (100%) rename {unit-tests => _toCheck/unit-tests}/controllers/Test3Controller.php (100%) rename {unit-tests => _toCheck/unit-tests}/controllers/Test5Controller.php (100%) rename {unit-tests => _toCheck/unit-tests}/controllers/Test6Controller.php (100%) rename {unit-tests => _toCheck/unit-tests}/controllers/Test7Controller.php (100%) rename {unit-tests => _toCheck/unit-tests}/controllers/Test8Controller.php (100%) rename {unit-tests => _toCheck/unit-tests}/helpers/xcache.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Abonnes.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/AlbumORama/Albums.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/AlbumORama/Artists.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/AlbumORama/Songs.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Boutique/Robots.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Boutique/Robotters.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Cacheable/Model.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Cacheable/Parts.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Cacheable/Robots.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Cacheable/RobotsParts.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Childs.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Deles.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/GossipRobots.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/News/Subscribers.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Parts.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Parts2.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/People.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Personas.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Personers.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Personnes.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Pessoas.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Products.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Prueba.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Relations/Deles.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Relations/M2MParts.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Relations/M2MRobots.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Relations/M2MRobotsParts.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Relations/RelationsParts.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Relations/RelationsRobots.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Relations/RelationsRobotsParts.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Relations/Robotters.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Relations/RobottersDeles.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Relations/Some/Deles.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Relations/Some/Parts.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Relations/Some/Products.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Relations/Some/Robots.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Relations/Some/RobotsParts.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Relations/Some/Robotters.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Relations/Some/RobottersDeles.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Robots.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Robots2.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/RobotsParts.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Robotters.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/RobottersDeles.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Robotto.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Snapshot/Parts.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Snapshot/Robots.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Snapshot/RobotsParts.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Snapshot/Robotters.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Some/Deles.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Some/Parts.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Some/Products.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Some/Robots.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Some/RobotsParts.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Some/Robotters.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Some/RobottersDeles.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Store/Parts.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Store/Robots.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Store/RobotsParts.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Subscribers.php (100%) rename {unit-tests => _toCheck/unit-tests}/models/Subscriptores.php (100%) rename {unit-tests => _toCheck/unit-tests}/views/index.phtml (100%) rename {unit-tests => _toCheck/unit-tests}/views/layouts/after.phtml (100%) rename {unit-tests => _toCheck/unit-tests}/views/layouts/before.phtml (100%) rename {unit-tests => _toCheck/unit-tests}/views/layouts/test10.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/layouts/test10.volt.php (100%) rename {unit-tests => _toCheck/unit-tests}/views/layouts/test13.phtml (100%) rename {unit-tests => _toCheck/unit-tests}/views/macro/conditionaldate.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/macro/error_messages.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/macro/form_row.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/macro/hello.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/macro/list.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/macro/my_input.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/macro/related_links.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/macro/strtotime.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/partials/footer.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/partials/footer.volt.php (100%) rename {unit-tests => _toCheck/unit-tests}/views/partials/header.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/partials/header.volt.php (100%) rename {unit-tests => _toCheck/unit-tests}/views/partials/header2.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/partials/header2.volt.php (100%) rename {unit-tests => _toCheck/unit-tests}/views/partials/header3.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/partials/header3.volt.php (100%) rename {unit-tests => _toCheck/unit-tests}/views/templates/a.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/templates/b.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/templates/c.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/test10/.gitignore (100%) rename {unit-tests => _toCheck/unit-tests}/views/test10/children.extends.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/test10/children.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/test10/children2.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/test10/import.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/test10/import2.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/test10/index.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/test10/other.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/test10/parent.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/test10/partial.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/test11/index.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/test11/index.volt.php (100%) rename {unit-tests => _toCheck/unit-tests}/views/test13/index.phtml (100%) rename {unit-tests => _toCheck/unit-tests}/views/test14/loop1.volt (100%) rename {unit-tests => _toCheck/unit-tests}/views/test16/index.phtml (100%) rename {unit-tests => _toCheck/unit-tests}/views/test3/query.phtml (100%) rename {unit-tests => _toCheck/unit-tests}/views/test3/yup.phtml (100%) rename {unit-tests => _toCheck/unit-tests}/views/test8/index.phtml (100%) rename {unit-tests => _toCheck/unit-tests}/views/test8/leother.phtml (100%) rename {unit-tests => _toCheck/unit-tests}/views/test8/other.phtml (100%) create mode 100644 boxfile.yml create mode 100644 tests/unit/VersionCest.php delete mode 100644 tests/unit/VersionTest.php diff --git a/codeception.yml b/_toCheck/codeception.yml similarity index 100% rename from codeception.yml rename to _toCheck/codeception.yml diff --git a/tests/README.md b/_toCheck/tests/README.md similarity index 100% rename from tests/README.md rename to _toCheck/tests/README.md diff --git a/tests/_bootstrap.php b/_toCheck/tests/_bootstrap.php similarity index 100% rename from tests/_bootstrap.php rename to _toCheck/tests/_bootstrap.php diff --git a/tests/_cache/.gitignore b/_toCheck/tests/_cache/.gitignore similarity index 100% rename from tests/_cache/.gitignore rename to _toCheck/tests/_cache/.gitignore diff --git a/tests/_ci/after-failure.sh b/_toCheck/tests/_ci/after-failure.sh similarity index 100% rename from tests/_ci/after-failure.sh rename to _toCheck/tests/_ci/after-failure.sh diff --git a/tests/_ci/appveyor.psm1 b/_toCheck/tests/_ci/appveyor.psm1 similarity index 100% rename from tests/_ci/appveyor.psm1 rename to _toCheck/tests/_ci/appveyor.psm1 diff --git a/tests/_ci/ci.ini b/_toCheck/tests/_ci/ci.ini similarity index 100% rename from tests/_ci/ci.ini rename to _toCheck/tests/_ci/ci.ini diff --git a/tests/_ci/environment b/_toCheck/tests/_ci/environment similarity index 100% rename from tests/_ci/environment rename to _toCheck/tests/_ci/environment diff --git a/tests/_ci/install-prereqs.sh b/_toCheck/tests/_ci/install-prereqs.sh similarity index 100% rename from tests/_ci/install-prereqs.sh rename to _toCheck/tests/_ci/install-prereqs.sh diff --git a/tests/_ci/install-re2c.sh b/_toCheck/tests/_ci/install-re2c.sh similarity index 100% rename from tests/_ci/install-re2c.sh rename to _toCheck/tests/_ci/install-re2c.sh diff --git a/tests/_ci/install-zephir-parser.sh b/_toCheck/tests/_ci/install-zephir-parser.sh similarity index 100% rename from tests/_ci/install-zephir-parser.sh rename to _toCheck/tests/_ci/install-zephir-parser.sh diff --git a/tests/_ci/pear-setup.sh b/_toCheck/tests/_ci/pear-setup.sh similarity index 100% rename from tests/_ci/pear-setup.sh rename to _toCheck/tests/_ci/pear-setup.sh diff --git a/tests/_ci/phalcon.ini b/_toCheck/tests/_ci/phalcon.ini similarity index 100% rename from tests/_ci/phalcon.ini rename to _toCheck/tests/_ci/phalcon.ini diff --git a/tests/_ci/precompile-headers.sh b/_toCheck/tests/_ci/precompile-headers.sh similarity index 100% rename from tests/_ci/precompile-headers.sh rename to _toCheck/tests/_ci/precompile-headers.sh diff --git a/tests/_ci/setup-dbs.sh b/_toCheck/tests/_ci/setup-dbs.sh similarity index 100% rename from tests/_ci/setup-dbs.sh rename to _toCheck/tests/_ci/setup-dbs.sh diff --git a/tests/_config/bootstrap.php b/_toCheck/tests/_config/bootstrap.php similarity index 100% rename from tests/_config/bootstrap.php rename to _toCheck/tests/_config/bootstrap.php diff --git a/tests/_config/global.php b/_toCheck/tests/_config/global.php similarity index 100% rename from tests/_config/global.php rename to _toCheck/tests/_config/global.php diff --git a/tests/_data/acl/TestResourceAware.php b/_toCheck/tests/_data/acl/TestResourceAware.php similarity index 100% rename from tests/_data/acl/TestResourceAware.php rename to _toCheck/tests/_data/acl/TestResourceAware.php diff --git a/tests/_data/acl/TestRoleAware.php b/_toCheck/tests/_data/acl/TestRoleAware.php similarity index 100% rename from tests/_data/acl/TestRoleAware.php rename to _toCheck/tests/_data/acl/TestRoleAware.php diff --git a/tests/_data/acl/TestRoleResourceAware.php b/_toCheck/tests/_data/acl/TestRoleResourceAware.php similarity index 100% rename from tests/_data/acl/TestRoleResourceAware.php rename to _toCheck/tests/_data/acl/TestRoleResourceAware.php diff --git a/tests/_data/annotations/TestClass.php b/_toCheck/tests/_data/annotations/TestClass.php similarity index 100% rename from tests/_data/annotations/TestClass.php rename to _toCheck/tests/_data/annotations/TestClass.php diff --git a/tests/_data/annotations/TestClassNs.php b/_toCheck/tests/_data/annotations/TestClassNs.php similarity index 100% rename from tests/_data/annotations/TestClassNs.php rename to _toCheck/tests/_data/annotations/TestClassNs.php diff --git a/tests/_data/annotations/TestInvalid.php b/_toCheck/tests/_data/annotations/TestInvalid.php similarity index 100% rename from tests/_data/annotations/TestInvalid.php rename to _toCheck/tests/_data/annotations/TestInvalid.php diff --git a/tests/_data/assets/1198.css b/_toCheck/tests/_data/assets/1198.css similarity index 100% rename from tests/_data/assets/1198.css rename to _toCheck/tests/_data/assets/1198.css diff --git a/tests/_data/assets/assets-multiple-01.js b/_toCheck/tests/_data/assets/assets-multiple-01.js similarity index 100% rename from tests/_data/assets/assets-multiple-01.js rename to _toCheck/tests/_data/assets/assets-multiple-01.js diff --git a/tests/_data/assets/assets-multiple-02.js b/_toCheck/tests/_data/assets/assets-multiple-02.js similarity index 100% rename from tests/_data/assets/assets-multiple-02.js rename to _toCheck/tests/_data/assets/assets-multiple-02.js diff --git a/tests/_data/assets/cssmin-01-result.css b/_toCheck/tests/_data/assets/cssmin-01-result.css similarity index 100% rename from tests/_data/assets/cssmin-01-result.css rename to _toCheck/tests/_data/assets/cssmin-01-result.css diff --git a/tests/_data/assets/cssmin-01.css b/_toCheck/tests/_data/assets/cssmin-01.css similarity index 100% rename from tests/_data/assets/cssmin-01.css rename to _toCheck/tests/_data/assets/cssmin-01.css diff --git a/tests/_data/assets/gs.js b/_toCheck/tests/_data/assets/gs.js similarity index 100% rename from tests/_data/assets/gs.js rename to _toCheck/tests/_data/assets/gs.js diff --git a/tests/_data/assets/jquery.js b/_toCheck/tests/_data/assets/jquery.js similarity index 100% rename from tests/_data/assets/jquery.js rename to _toCheck/tests/_data/assets/jquery.js diff --git a/tests/_data/assets/logo.png b/_toCheck/tests/_data/assets/logo.png similarity index 100% rename from tests/_data/assets/logo.png rename to _toCheck/tests/_data/assets/logo.png diff --git a/tests/_data/assets/phalconphp.jpg b/_toCheck/tests/_data/assets/phalconphp.jpg similarity index 100% rename from tests/_data/assets/phalconphp.jpg rename to _toCheck/tests/_data/assets/phalconphp.jpg diff --git a/tests/_data/assets/signup.js b/_toCheck/tests/_data/assets/signup.js similarity index 100% rename from tests/_data/assets/signup.js rename to _toCheck/tests/_data/assets/signup.js diff --git a/tests/_data/collections/Bookshelf/Books.php b/_toCheck/tests/_data/collections/Bookshelf/Books.php similarity index 100% rename from tests/_data/collections/Bookshelf/Books.php rename to _toCheck/tests/_data/collections/Bookshelf/Books.php diff --git a/tests/_data/collections/Bookshelf/Magazines.php b/_toCheck/tests/_data/collections/Bookshelf/Magazines.php similarity index 100% rename from tests/_data/collections/Bookshelf/Magazines.php rename to _toCheck/tests/_data/collections/Bookshelf/Magazines.php diff --git a/tests/_data/collections/Bookshelf/NotACollection.php b/_toCheck/tests/_data/collections/Bookshelf/NotACollection.php similarity index 100% rename from tests/_data/collections/Bookshelf/NotACollection.php rename to _toCheck/tests/_data/collections/Bookshelf/NotACollection.php diff --git a/tests/_data/collections/People.php b/_toCheck/tests/_data/collections/People.php similarity index 100% rename from tests/_data/collections/People.php rename to _toCheck/tests/_data/collections/People.php diff --git a/tests/_data/collections/Robots.php b/_toCheck/tests/_data/collections/Robots.php similarity index 100% rename from tests/_data/collections/Robots.php rename to _toCheck/tests/_data/collections/Robots.php diff --git a/tests/_data/collections/Songs.php b/_toCheck/tests/_data/collections/Songs.php similarity index 100% rename from tests/_data/collections/Songs.php rename to _toCheck/tests/_data/collections/Songs.php diff --git a/tests/_data/collections/Store/Songs.php b/_toCheck/tests/_data/collections/Store/Songs.php similarity index 100% rename from tests/_data/collections/Store/Songs.php rename to _toCheck/tests/_data/collections/Store/Songs.php diff --git a/tests/_data/collections/Subs.php b/_toCheck/tests/_data/collections/Subs.php similarity index 100% rename from tests/_data/collections/Subs.php rename to _toCheck/tests/_data/collections/Subs.php diff --git a/tests/_data/collections/Users.php b/_toCheck/tests/_data/collections/Users.php similarity index 100% rename from tests/_data/collections/Users.php rename to _toCheck/tests/_data/collections/Users.php diff --git a/tests/_data/config/callbacks.yml b/_toCheck/tests/_data/config/callbacks.yml similarity index 100% rename from tests/_data/config/callbacks.yml rename to _toCheck/tests/_data/config/callbacks.yml diff --git a/tests/_data/config/config-with-constants.ini b/_toCheck/tests/_data/config/config-with-constants.ini similarity index 100% rename from tests/_data/config/config-with-constants.ini rename to _toCheck/tests/_data/config/config-with-constants.ini diff --git a/tests/_data/config/config.ini b/_toCheck/tests/_data/config/config.ini similarity index 100% rename from tests/_data/config/config.ini rename to _toCheck/tests/_data/config/config.ini diff --git a/tests/_data/config/config.json b/_toCheck/tests/_data/config/config.json similarity index 100% rename from tests/_data/config/config.json rename to _toCheck/tests/_data/config/config.json diff --git a/tests/_data/config/config.php b/_toCheck/tests/_data/config/config.php similarity index 100% rename from tests/_data/config/config.php rename to _toCheck/tests/_data/config/config.php diff --git a/tests/_data/config/config.yml b/_toCheck/tests/_data/config/config.yml similarity index 100% rename from tests/_data/config/config.yml rename to _toCheck/tests/_data/config/config.yml diff --git a/tests/_data/config/directive.ini b/_toCheck/tests/_data/config/directive.ini similarity index 100% rename from tests/_data/config/directive.ini rename to _toCheck/tests/_data/config/directive.ini diff --git a/tests/_data/config/factory.ini b/_toCheck/tests/_data/config/factory.ini similarity index 100% rename from tests/_data/config/factory.ini rename to _toCheck/tests/_data/config/factory.ini diff --git a/tests/_data/controllers/AboutController.php b/_toCheck/tests/_data/controllers/AboutController.php similarity index 100% rename from tests/_data/controllers/AboutController.php rename to _toCheck/tests/_data/controllers/AboutController.php diff --git a/tests/_data/controllers/ControllerBase.php b/_toCheck/tests/_data/controllers/ControllerBase.php similarity index 100% rename from tests/_data/controllers/ControllerBase.php rename to _toCheck/tests/_data/controllers/ControllerBase.php diff --git a/tests/_data/controllers/ExceptionController.php b/_toCheck/tests/_data/controllers/ExceptionController.php similarity index 100% rename from tests/_data/controllers/ExceptionController.php rename to _toCheck/tests/_data/controllers/ExceptionController.php diff --git a/tests/_data/controllers/FailureController.php b/_toCheck/tests/_data/controllers/FailureController.php similarity index 100% rename from tests/_data/controllers/FailureController.php rename to _toCheck/tests/_data/controllers/FailureController.php diff --git a/tests/_data/controllers/MainController.php b/_toCheck/tests/_data/controllers/MainController.php similarity index 100% rename from tests/_data/controllers/MainController.php rename to _toCheck/tests/_data/controllers/MainController.php diff --git a/tests/_data/controllers/NamespacedAnnotationController.php b/_toCheck/tests/_data/controllers/NamespacedAnnotationController.php similarity index 100% rename from tests/_data/controllers/NamespacedAnnotationController.php rename to _toCheck/tests/_data/controllers/NamespacedAnnotationController.php diff --git a/tests/_data/controllers/ProductsController.php b/_toCheck/tests/_data/controllers/ProductsController.php similarity index 100% rename from tests/_data/controllers/ProductsController.php rename to _toCheck/tests/_data/controllers/ProductsController.php diff --git a/tests/_data/controllers/RobotsController.php b/_toCheck/tests/_data/controllers/RobotsController.php similarity index 100% rename from tests/_data/controllers/RobotsController.php rename to _toCheck/tests/_data/controllers/RobotsController.php diff --git a/tests/_data/controllers/Test0Controller.php b/_toCheck/tests/_data/controllers/Test0Controller.php similarity index 100% rename from tests/_data/controllers/Test0Controller.php rename to _toCheck/tests/_data/controllers/Test0Controller.php diff --git a/tests/_data/controllers/Test10Controller.php b/_toCheck/tests/_data/controllers/Test10Controller.php similarity index 100% rename from tests/_data/controllers/Test10Controller.php rename to _toCheck/tests/_data/controllers/Test10Controller.php diff --git a/tests/_data/controllers/Test11Controller.php b/_toCheck/tests/_data/controllers/Test11Controller.php similarity index 100% rename from tests/_data/controllers/Test11Controller.php rename to _toCheck/tests/_data/controllers/Test11Controller.php diff --git a/tests/_data/controllers/Test12Controller.php b/_toCheck/tests/_data/controllers/Test12Controller.php similarity index 100% rename from tests/_data/controllers/Test12Controller.php rename to _toCheck/tests/_data/controllers/Test12Controller.php diff --git a/tests/_data/controllers/Test1Controller.php b/_toCheck/tests/_data/controllers/Test1Controller.php similarity index 100% rename from tests/_data/controllers/Test1Controller.php rename to _toCheck/tests/_data/controllers/Test1Controller.php diff --git a/tests/_data/controllers/Test2Controller.php b/_toCheck/tests/_data/controllers/Test2Controller.php similarity index 100% rename from tests/_data/controllers/Test2Controller.php rename to _toCheck/tests/_data/controllers/Test2Controller.php diff --git a/tests/_data/controllers/Test3Controller.php b/_toCheck/tests/_data/controllers/Test3Controller.php similarity index 100% rename from tests/_data/controllers/Test3Controller.php rename to _toCheck/tests/_data/controllers/Test3Controller.php diff --git a/tests/_data/controllers/Test4Controller.php b/_toCheck/tests/_data/controllers/Test4Controller.php similarity index 100% rename from tests/_data/controllers/Test4Controller.php rename to _toCheck/tests/_data/controllers/Test4Controller.php diff --git a/tests/_data/controllers/Test5Controller.php b/_toCheck/tests/_data/controllers/Test5Controller.php similarity index 100% rename from tests/_data/controllers/Test5Controller.php rename to _toCheck/tests/_data/controllers/Test5Controller.php diff --git a/tests/_data/controllers/Test6Controller.php b/_toCheck/tests/_data/controllers/Test6Controller.php similarity index 100% rename from tests/_data/controllers/Test6Controller.php rename to _toCheck/tests/_data/controllers/Test6Controller.php diff --git a/tests/_data/controllers/Test7Controller.php b/_toCheck/tests/_data/controllers/Test7Controller.php similarity index 100% rename from tests/_data/controllers/Test7Controller.php rename to _toCheck/tests/_data/controllers/Test7Controller.php diff --git a/tests/_data/controllers/Test8Controller.php b/_toCheck/tests/_data/controllers/Test8Controller.php similarity index 100% rename from tests/_data/controllers/Test8Controller.php rename to _toCheck/tests/_data/controllers/Test8Controller.php diff --git a/tests/_data/controllers/Test9Controller.php b/_toCheck/tests/_data/controllers/Test9Controller.php similarity index 100% rename from tests/_data/controllers/Test9Controller.php rename to _toCheck/tests/_data/controllers/Test9Controller.php diff --git a/tests/_data/debug/ClassProperties.php b/_toCheck/tests/_data/debug/ClassProperties.php similarity index 100% rename from tests/_data/debug/ClassProperties.php rename to _toCheck/tests/_data/debug/ClassProperties.php diff --git a/tests/_data/di/InjectableComponent.php b/_toCheck/tests/_data/di/InjectableComponent.php similarity index 100% rename from tests/_data/di/InjectableComponent.php rename to _toCheck/tests/_data/di/InjectableComponent.php diff --git a/tests/_data/di/SimpleComponent.php b/_toCheck/tests/_data/di/SimpleComponent.php similarity index 100% rename from tests/_data/di/SimpleComponent.php rename to _toCheck/tests/_data/di/SimpleComponent.php diff --git a/tests/_data/di/SomeComponent.php b/_toCheck/tests/_data/di/SomeComponent.php similarity index 100% rename from tests/_data/di/SomeComponent.php rename to _toCheck/tests/_data/di/SomeComponent.php diff --git a/tests/_data/di/SomeService.php b/_toCheck/tests/_data/di/SomeService.php similarity index 100% rename from tests/_data/di/SomeService.php rename to _toCheck/tests/_data/di/SomeService.php diff --git a/tests/_data/di/SomeServiceProvider.php b/_toCheck/tests/_data/di/SomeServiceProvider.php similarity index 100% rename from tests/_data/di/SomeServiceProvider.php rename to _toCheck/tests/_data/di/SomeServiceProvider.php diff --git a/tests/_data/di/services.php b/_toCheck/tests/_data/di/services.php similarity index 100% rename from tests/_data/di/services.php rename to _toCheck/tests/_data/di/services.php diff --git a/tests/_data/di/services.yml b/_toCheck/tests/_data/di/services.yml similarity index 100% rename from tests/_data/di/services.yml rename to _toCheck/tests/_data/di/services.yml diff --git a/tests/_data/events/ComponentX.php b/_toCheck/tests/_data/events/ComponentX.php similarity index 100% rename from tests/_data/events/ComponentX.php rename to _toCheck/tests/_data/events/ComponentX.php diff --git a/tests/_data/events/ComponentY.php b/_toCheck/tests/_data/events/ComponentY.php similarity index 100% rename from tests/_data/events/ComponentY.php rename to _toCheck/tests/_data/events/ComponentY.php diff --git a/tests/_data/listener/CustomAuthorizationListener.php b/_toCheck/tests/_data/listener/CustomAuthorizationListener.php similarity index 100% rename from tests/_data/listener/CustomAuthorizationListener.php rename to _toCheck/tests/_data/listener/CustomAuthorizationListener.php diff --git a/tests/_data/listener/FirstListener.php b/_toCheck/tests/_data/listener/FirstListener.php similarity index 100% rename from tests/_data/listener/FirstListener.php rename to _toCheck/tests/_data/listener/FirstListener.php diff --git a/tests/_data/listener/NegotiateAuthorizationListener.php b/_toCheck/tests/_data/listener/NegotiateAuthorizationListener.php similarity index 100% rename from tests/_data/listener/NegotiateAuthorizationListener.php rename to _toCheck/tests/_data/listener/NegotiateAuthorizationListener.php diff --git a/tests/_data/listener/SecondListener.php b/_toCheck/tests/_data/listener/SecondListener.php similarity index 100% rename from tests/_data/listener/SecondListener.php rename to _toCheck/tests/_data/listener/SecondListener.php diff --git a/tests/_data/listener/ThirdListener.php b/_toCheck/tests/_data/listener/ThirdListener.php similarity index 100% rename from tests/_data/listener/ThirdListener.php rename to _toCheck/tests/_data/listener/ThirdListener.php diff --git a/tests/_data/logs/dummy b/_toCheck/tests/_data/logs/dummy similarity index 100% rename from tests/_data/logs/dummy rename to _toCheck/tests/_data/logs/dummy diff --git a/tests/_data/micro/MyMiddleware.php b/_toCheck/tests/_data/micro/MyMiddleware.php similarity index 100% rename from tests/_data/micro/MyMiddleware.php rename to _toCheck/tests/_data/micro/MyMiddleware.php diff --git a/tests/_data/micro/MyMiddlewareStop.php b/_toCheck/tests/_data/micro/MyMiddlewareStop.php similarity index 100% rename from tests/_data/micro/MyMiddlewareStop.php rename to _toCheck/tests/_data/micro/MyMiddlewareStop.php diff --git a/tests/_data/micro/RestHandler.php b/_toCheck/tests/_data/micro/RestHandler.php similarity index 100% rename from tests/_data/micro/RestHandler.php rename to _toCheck/tests/_data/micro/RestHandler.php diff --git a/tests/_data/models/AlbumORama/Albums.php b/_toCheck/tests/_data/models/AlbumORama/Albums.php similarity index 100% rename from tests/_data/models/AlbumORama/Albums.php rename to _toCheck/tests/_data/models/AlbumORama/Albums.php diff --git a/tests/_data/models/AlbumORama/Artists.php b/_toCheck/tests/_data/models/AlbumORama/Artists.php similarity index 100% rename from tests/_data/models/AlbumORama/Artists.php rename to _toCheck/tests/_data/models/AlbumORama/Artists.php diff --git a/tests/_data/models/Annotations/Robot.php b/_toCheck/tests/_data/models/Annotations/Robot.php similarity index 100% rename from tests/_data/models/Annotations/Robot.php rename to _toCheck/tests/_data/models/Annotations/Robot.php diff --git a/tests/_data/models/BodyParts/Body.php b/_toCheck/tests/_data/models/BodyParts/Body.php similarity index 100% rename from tests/_data/models/BodyParts/Body.php rename to _toCheck/tests/_data/models/BodyParts/Body.php diff --git a/tests/_data/models/BodyParts/Head.php b/_toCheck/tests/_data/models/BodyParts/Head.php similarity index 100% rename from tests/_data/models/BodyParts/Head.php rename to _toCheck/tests/_data/models/BodyParts/Head.php diff --git a/tests/_data/models/Boutique/Robots.php b/_toCheck/tests/_data/models/Boutique/Robots.php similarity index 100% rename from tests/_data/models/Boutique/Robots.php rename to _toCheck/tests/_data/models/Boutique/Robots.php diff --git a/tests/_data/models/Boutique/Robotters.php b/_toCheck/tests/_data/models/Boutique/Robotters.php similarity index 100% rename from tests/_data/models/Boutique/Robotters.php rename to _toCheck/tests/_data/models/Boutique/Robotters.php diff --git a/tests/_data/models/Customers.php b/_toCheck/tests/_data/models/Customers.php similarity index 100% rename from tests/_data/models/Customers.php rename to _toCheck/tests/_data/models/Customers.php diff --git a/tests/_data/models/Deles.php b/_toCheck/tests/_data/models/Deles.php similarity index 100% rename from tests/_data/models/Deles.php rename to _toCheck/tests/_data/models/Deles.php diff --git a/tests/_data/models/Dynamic/Personas.php b/_toCheck/tests/_data/models/Dynamic/Personas.php similarity index 100% rename from tests/_data/models/Dynamic/Personas.php rename to _toCheck/tests/_data/models/Dynamic/Personas.php diff --git a/tests/_data/models/Dynamic/Personers.php b/_toCheck/tests/_data/models/Dynamic/Personers.php similarity index 100% rename from tests/_data/models/Dynamic/Personers.php rename to _toCheck/tests/_data/models/Dynamic/Personers.php diff --git a/tests/_data/models/Dynamic/Robots.php b/_toCheck/tests/_data/models/Dynamic/Robots.php similarity index 100% rename from tests/_data/models/Dynamic/Robots.php rename to _toCheck/tests/_data/models/Dynamic/Robots.php diff --git a/tests/_data/models/Language.php b/_toCheck/tests/_data/models/Language.php similarity index 100% rename from tests/_data/models/Language.php rename to _toCheck/tests/_data/models/Language.php diff --git a/tests/_data/models/LanguageI18n.php b/_toCheck/tests/_data/models/LanguageI18n.php similarity index 100% rename from tests/_data/models/LanguageI18n.php rename to _toCheck/tests/_data/models/LanguageI18n.php diff --git a/tests/_data/models/ModelWithStringField.php b/_toCheck/tests/_data/models/ModelWithStringField.php similarity index 100% rename from tests/_data/models/ModelWithStringField.php rename to _toCheck/tests/_data/models/ModelWithStringField.php diff --git a/tests/_data/models/News/Subscribers.php b/_toCheck/tests/_data/models/News/Subscribers.php similarity index 100% rename from tests/_data/models/News/Subscribers.php rename to _toCheck/tests/_data/models/News/Subscribers.php diff --git a/tests/_data/models/PackageDetails.php b/_toCheck/tests/_data/models/PackageDetails.php similarity index 100% rename from tests/_data/models/PackageDetails.php rename to _toCheck/tests/_data/models/PackageDetails.php diff --git a/tests/_data/models/Packages.php b/_toCheck/tests/_data/models/Packages.php similarity index 100% rename from tests/_data/models/Packages.php rename to _toCheck/tests/_data/models/Packages.php diff --git a/tests/_data/models/Parts.php b/_toCheck/tests/_data/models/Parts.php similarity index 100% rename from tests/_data/models/Parts.php rename to _toCheck/tests/_data/models/Parts.php diff --git a/tests/_data/models/People.php b/_toCheck/tests/_data/models/People.php similarity index 100% rename from tests/_data/models/People.php rename to _toCheck/tests/_data/models/People.php diff --git a/tests/_data/models/Personas.php b/_toCheck/tests/_data/models/Personas.php similarity index 100% rename from tests/_data/models/Personas.php rename to _toCheck/tests/_data/models/Personas.php diff --git a/tests/_data/models/Personers.php b/_toCheck/tests/_data/models/Personers.php similarity index 100% rename from tests/_data/models/Personers.php rename to _toCheck/tests/_data/models/Personers.php diff --git a/tests/_data/models/Products.php b/_toCheck/tests/_data/models/Products.php similarity index 100% rename from tests/_data/models/Products.php rename to _toCheck/tests/_data/models/Products.php diff --git a/tests/_data/models/Relations/RelationsParts.php b/_toCheck/tests/_data/models/Relations/RelationsParts.php similarity index 100% rename from tests/_data/models/Relations/RelationsParts.php rename to _toCheck/tests/_data/models/Relations/RelationsParts.php diff --git a/tests/_data/models/Relations/RelationsRobots.php b/_toCheck/tests/_data/models/Relations/RelationsRobots.php similarity index 100% rename from tests/_data/models/Relations/RelationsRobots.php rename to _toCheck/tests/_data/models/Relations/RelationsRobots.php diff --git a/tests/_data/models/Relations/RelationsRobotsParts.php b/_toCheck/tests/_data/models/Relations/RelationsRobotsParts.php similarity index 100% rename from tests/_data/models/Relations/RelationsRobotsParts.php rename to _toCheck/tests/_data/models/Relations/RelationsRobotsParts.php diff --git a/tests/_data/models/Relations/Robots.php b/_toCheck/tests/_data/models/Relations/Robots.php similarity index 100% rename from tests/_data/models/Relations/Robots.php rename to _toCheck/tests/_data/models/Relations/Robots.php diff --git a/tests/_data/models/Relations/RobotsParts.php b/_toCheck/tests/_data/models/Relations/RobotsParts.php similarity index 100% rename from tests/_data/models/Relations/RobotsParts.php rename to _toCheck/tests/_data/models/Relations/RobotsParts.php diff --git a/tests/_data/models/Robos.php b/_toCheck/tests/_data/models/Robos.php similarity index 100% rename from tests/_data/models/Robos.php rename to _toCheck/tests/_data/models/Robos.php diff --git a/tests/_data/models/Robots.php b/_toCheck/tests/_data/models/Robots.php similarity index 100% rename from tests/_data/models/Robots.php rename to _toCheck/tests/_data/models/Robots.php diff --git a/tests/_data/models/RobotsParts.php b/_toCheck/tests/_data/models/RobotsParts.php similarity index 100% rename from tests/_data/models/RobotsParts.php rename to _toCheck/tests/_data/models/RobotsParts.php diff --git a/tests/_data/models/Robotters.php b/_toCheck/tests/_data/models/Robotters.php similarity index 100% rename from tests/_data/models/Robotters.php rename to _toCheck/tests/_data/models/Robotters.php diff --git a/tests/_data/models/RobottersDeles.php b/_toCheck/tests/_data/models/RobottersDeles.php similarity index 100% rename from tests/_data/models/RobottersDeles.php rename to _toCheck/tests/_data/models/RobottersDeles.php diff --git a/tests/_data/models/Robotto.php b/_toCheck/tests/_data/models/Robotto.php similarity index 100% rename from tests/_data/models/Robotto.php rename to _toCheck/tests/_data/models/Robotto.php diff --git a/tests/_data/models/Select.php b/_toCheck/tests/_data/models/Select.php similarity index 100% rename from tests/_data/models/Select.php rename to _toCheck/tests/_data/models/Select.php diff --git a/tests/_data/models/Snapshot/Parts.php b/_toCheck/tests/_data/models/Snapshot/Parts.php similarity index 100% rename from tests/_data/models/Snapshot/Parts.php rename to _toCheck/tests/_data/models/Snapshot/Parts.php diff --git a/tests/_data/models/Snapshot/Personas.php b/_toCheck/tests/_data/models/Snapshot/Personas.php similarity index 100% rename from tests/_data/models/Snapshot/Personas.php rename to _toCheck/tests/_data/models/Snapshot/Personas.php diff --git a/tests/_data/models/Snapshot/Requests.php b/_toCheck/tests/_data/models/Snapshot/Requests.php similarity index 100% rename from tests/_data/models/Snapshot/Requests.php rename to _toCheck/tests/_data/models/Snapshot/Requests.php diff --git a/tests/_data/models/Snapshot/Robots.php b/_toCheck/tests/_data/models/Snapshot/Robots.php similarity index 100% rename from tests/_data/models/Snapshot/Robots.php rename to _toCheck/tests/_data/models/Snapshot/Robots.php diff --git a/tests/_data/models/Snapshot/RobotsParts.php b/_toCheck/tests/_data/models/Snapshot/RobotsParts.php similarity index 100% rename from tests/_data/models/Snapshot/RobotsParts.php rename to _toCheck/tests/_data/models/Snapshot/RobotsParts.php diff --git a/tests/_data/models/Snapshot/Robotters.php b/_toCheck/tests/_data/models/Snapshot/Robotters.php similarity index 100% rename from tests/_data/models/Snapshot/Robotters.php rename to _toCheck/tests/_data/models/Snapshot/Robotters.php diff --git a/tests/_data/models/Snapshot/Subscribers.php b/_toCheck/tests/_data/models/Snapshot/Subscribers.php similarity index 100% rename from tests/_data/models/Snapshot/Subscribers.php rename to _toCheck/tests/_data/models/Snapshot/Subscribers.php diff --git a/tests/_data/models/Some/Deles.php b/_toCheck/tests/_data/models/Some/Deles.php similarity index 100% rename from tests/_data/models/Some/Deles.php rename to _toCheck/tests/_data/models/Some/Deles.php diff --git a/tests/_data/models/Some/Parts.php b/_toCheck/tests/_data/models/Some/Parts.php similarity index 100% rename from tests/_data/models/Some/Parts.php rename to _toCheck/tests/_data/models/Some/Parts.php diff --git a/tests/_data/models/Some/Products.php b/_toCheck/tests/_data/models/Some/Products.php similarity index 100% rename from tests/_data/models/Some/Products.php rename to _toCheck/tests/_data/models/Some/Products.php diff --git a/tests/_data/models/Some/Robots.php b/_toCheck/tests/_data/models/Some/Robots.php similarity index 100% rename from tests/_data/models/Some/Robots.php rename to _toCheck/tests/_data/models/Some/Robots.php diff --git a/tests/_data/models/Some/RobotsParts.php b/_toCheck/tests/_data/models/Some/RobotsParts.php similarity index 100% rename from tests/_data/models/Some/RobotsParts.php rename to _toCheck/tests/_data/models/Some/RobotsParts.php diff --git a/tests/_data/models/Some/Robotters.php b/_toCheck/tests/_data/models/Some/Robotters.php similarity index 100% rename from tests/_data/models/Some/Robotters.php rename to _toCheck/tests/_data/models/Some/Robotters.php diff --git a/tests/_data/models/Some/RobottersDeles.php b/_toCheck/tests/_data/models/Some/RobottersDeles.php similarity index 100% rename from tests/_data/models/Some/RobottersDeles.php rename to _toCheck/tests/_data/models/Some/RobottersDeles.php diff --git a/tests/_data/models/Statistics/AgeStats.php b/_toCheck/tests/_data/models/Statistics/AgeStats.php similarity index 100% rename from tests/_data/models/Statistics/AgeStats.php rename to _toCheck/tests/_data/models/Statistics/AgeStats.php diff --git a/tests/_data/models/Statistics/CityStats.php b/_toCheck/tests/_data/models/Statistics/CityStats.php similarity index 100% rename from tests/_data/models/Statistics/CityStats.php rename to _toCheck/tests/_data/models/Statistics/CityStats.php diff --git a/tests/_data/models/Statistics/CountryStats.php b/_toCheck/tests/_data/models/Statistics/CountryStats.php similarity index 100% rename from tests/_data/models/Statistics/CountryStats.php rename to _toCheck/tests/_data/models/Statistics/CountryStats.php diff --git a/tests/_data/models/Statistics/GenderStats.php b/_toCheck/tests/_data/models/Statistics/GenderStats.php similarity index 100% rename from tests/_data/models/Statistics/GenderStats.php rename to _toCheck/tests/_data/models/Statistics/GenderStats.php diff --git a/tests/_data/models/Stock.php b/_toCheck/tests/_data/models/Stock.php similarity index 100% rename from tests/_data/models/Stock.php rename to _toCheck/tests/_data/models/Stock.php diff --git a/tests/_data/models/Users.php b/_toCheck/tests/_data/models/Users.php similarity index 100% rename from tests/_data/models/Users.php rename to _toCheck/tests/_data/models/Users.php diff --git a/tests/_data/models/Validation/Robots.php b/_toCheck/tests/_data/models/Validation/Robots.php similarity index 100% rename from tests/_data/models/Validation/Robots.php rename to _toCheck/tests/_data/models/Validation/Robots.php diff --git a/tests/_data/models/Validation/Subscriptores.php b/_toCheck/tests/_data/models/Validation/Subscriptores.php similarity index 100% rename from tests/_data/models/Validation/Subscriptores.php rename to _toCheck/tests/_data/models/Validation/Subscriptores.php diff --git a/tests/_data/modules/backend/Module.php b/_toCheck/tests/_data/modules/backend/Module.php similarity index 100% rename from tests/_data/modules/backend/Module.php rename to _toCheck/tests/_data/modules/backend/Module.php diff --git a/tests/_data/modules/backend/controllers/LoginController.php b/_toCheck/tests/_data/modules/backend/controllers/LoginController.php similarity index 100% rename from tests/_data/modules/backend/controllers/LoginController.php rename to _toCheck/tests/_data/modules/backend/controllers/LoginController.php diff --git a/tests/_data/modules/backend/views/index.phtml b/_toCheck/tests/_data/modules/backend/views/index.phtml similarity index 100% rename from tests/_data/modules/backend/views/index.phtml rename to _toCheck/tests/_data/modules/backend/views/index.phtml diff --git a/tests/_data/modules/frontend/Module.php b/_toCheck/tests/_data/modules/frontend/Module.php similarity index 100% rename from tests/_data/modules/frontend/Module.php rename to _toCheck/tests/_data/modules/frontend/Module.php diff --git a/tests/_data/modules/frontend/controllers/IndexController.php b/_toCheck/tests/_data/modules/frontend/controllers/IndexController.php similarity index 100% rename from tests/_data/modules/frontend/controllers/IndexController.php rename to _toCheck/tests/_data/modules/frontend/controllers/IndexController.php diff --git a/tests/_data/modules/frontend/views/index/index.phtml b/_toCheck/tests/_data/modules/frontend/views/index/index.phtml similarity index 100% rename from tests/_data/modules/frontend/views/index/index.phtml rename to _toCheck/tests/_data/modules/frontend/views/index/index.phtml diff --git a/tests/_data/objectsets/Mvc/View/IteratorObject.php b/_toCheck/tests/_data/objectsets/Mvc/View/IteratorObject.php similarity index 100% rename from tests/_data/objectsets/Mvc/View/IteratorObject.php rename to _toCheck/tests/_data/objectsets/Mvc/View/IteratorObject.php diff --git a/tests/_data/resultsets/Stats.php b/_toCheck/tests/_data/resultsets/Stats.php similarity index 100% rename from tests/_data/resultsets/Stats.php rename to _toCheck/tests/_data/resultsets/Stats.php diff --git a/tests/_data/schemas/mysql/phalcon_test.sql b/_toCheck/tests/_data/schemas/mysql/phalcon_test.sql similarity index 100% rename from tests/_data/schemas/mysql/phalcon_test.sql rename to _toCheck/tests/_data/schemas/mysql/phalcon_test.sql diff --git a/tests/_data/schemas/postgresql/phalcon_test.sql b/_toCheck/tests/_data/schemas/postgresql/phalcon_test.sql similarity index 100% rename from tests/_data/schemas/postgresql/phalcon_test.sql rename to _toCheck/tests/_data/schemas/postgresql/phalcon_test.sql diff --git a/tests/_data/schemas/sqlite/phalcon_test.sql b/_toCheck/tests/_data/schemas/sqlite/phalcon_test.sql similarity index 100% rename from tests/_data/schemas/sqlite/phalcon_test.sql rename to _toCheck/tests/_data/schemas/sqlite/phalcon_test.sql diff --git a/tests/_data/schemas/sqlite/translations.sql b/_toCheck/tests/_data/schemas/sqlite/translations.sql similarity index 100% rename from tests/_data/schemas/sqlite/translations.sql rename to _toCheck/tests/_data/schemas/sqlite/translations.sql diff --git a/tests/_data/tasks/EchoTask.php b/_toCheck/tests/_data/tasks/EchoTask.php similarity index 100% rename from tests/_data/tasks/EchoTask.php rename to _toCheck/tests/_data/tasks/EchoTask.php diff --git a/tests/_data/tasks/Issue787Task.php b/_toCheck/tests/_data/tasks/Issue787Task.php similarity index 100% rename from tests/_data/tasks/Issue787Task.php rename to _toCheck/tests/_data/tasks/Issue787Task.php diff --git a/tests/_data/tasks/MainTask.php b/_toCheck/tests/_data/tasks/MainTask.php similarity index 100% rename from tests/_data/tasks/MainTask.php rename to _toCheck/tests/_data/tasks/MainTask.php diff --git a/tests/_data/tasks/ParamsTask.php b/_toCheck/tests/_data/tasks/ParamsTask.php similarity index 100% rename from tests/_data/tasks/ParamsTask.php rename to _toCheck/tests/_data/tasks/ParamsTask.php diff --git a/tests/_data/translation/csv/ru_RU.csv b/_toCheck/tests/_data/translation/csv/ru_RU.csv similarity index 100% rename from tests/_data/translation/csv/ru_RU.csv rename to _toCheck/tests/_data/translation/csv/ru_RU.csv diff --git a/tests/_data/translation/gettext/en_US.utf8/LC_MESSAGES/messages.mo b/_toCheck/tests/_data/translation/gettext/en_US.utf8/LC_MESSAGES/messages.mo similarity index 100% rename from tests/_data/translation/gettext/en_US.utf8/LC_MESSAGES/messages.mo rename to _toCheck/tests/_data/translation/gettext/en_US.utf8/LC_MESSAGES/messages.mo diff --git a/tests/_data/translation/gettext/en_US.utf8/LC_MESSAGES/messages.po b/_toCheck/tests/_data/translation/gettext/en_US.utf8/LC_MESSAGES/messages.po similarity index 100% rename from tests/_data/translation/gettext/en_US.utf8/LC_MESSAGES/messages.po rename to _toCheck/tests/_data/translation/gettext/en_US.utf8/LC_MESSAGES/messages.po diff --git a/tests/_data/vendor/Example/Adapter/LeAnotherSome.inc b/_toCheck/tests/_data/vendor/Example/Adapter/LeAnotherSome.inc similarity index 100% rename from tests/_data/vendor/Example/Adapter/LeAnotherSome.inc rename to _toCheck/tests/_data/vendor/Example/Adapter/LeAnotherSome.inc diff --git a/tests/_data/vendor/Example/Adapter/LeCoolSome.php b/_toCheck/tests/_data/vendor/Example/Adapter/LeCoolSome.php similarity index 100% rename from tests/_data/vendor/Example/Adapter/LeCoolSome.php rename to _toCheck/tests/_data/vendor/Example/Adapter/LeCoolSome.php diff --git a/tests/_data/vendor/Example/Adapter/LeSome.php b/_toCheck/tests/_data/vendor/Example/Adapter/LeSome.php similarity index 100% rename from tests/_data/vendor/Example/Adapter/LeSome.php rename to _toCheck/tests/_data/vendor/Example/Adapter/LeSome.php diff --git a/tests/_data/vendor/Example/Adapter/Some.php b/_toCheck/tests/_data/vendor/Example/Adapter/Some.php similarity index 100% rename from tests/_data/vendor/Example/Adapter/Some.php rename to _toCheck/tests/_data/vendor/Example/Adapter/Some.php diff --git a/tests/_data/vendor/Example/Adapter/SomeCool.php b/_toCheck/tests/_data/vendor/Example/Adapter/SomeCool.php similarity index 100% rename from tests/_data/vendor/Example/Adapter/SomeCool.php rename to _toCheck/tests/_data/vendor/Example/Adapter/SomeCool.php diff --git a/tests/_data/vendor/Example/Adapter2/Another.php b/_toCheck/tests/_data/vendor/Example/Adapter2/Another.php similarity index 100% rename from tests/_data/vendor/Example/Adapter2/Another.php rename to _toCheck/tests/_data/vendor/Example/Adapter2/Another.php diff --git a/tests/_data/vendor/Example/Base/Any.php b/_toCheck/tests/_data/vendor/Example/Base/Any.php similarity index 100% rename from tests/_data/vendor/Example/Base/Any.php rename to _toCheck/tests/_data/vendor/Example/Base/Any.php diff --git a/tests/_data/vendor/Example/Dialects/LeDialect.php b/_toCheck/tests/_data/vendor/Example/Dialects/LeDialect.php similarity index 100% rename from tests/_data/vendor/Example/Dialects/LeDialect.php rename to _toCheck/tests/_data/vendor/Example/Dialects/LeDialect.php diff --git a/tests/_data/vendor/Example/Engines/LeEngine.php b/_toCheck/tests/_data/vendor/Example/Engines/LeEngine.php similarity index 100% rename from tests/_data/vendor/Example/Engines/LeEngine.php rename to _toCheck/tests/_data/vendor/Example/Engines/LeEngine.php diff --git a/tests/_data/vendor/Example/Engines/LeEngine2.php b/_toCheck/tests/_data/vendor/Example/Engines/LeEngine2.php similarity index 100% rename from tests/_data/vendor/Example/Engines/LeEngine2.php rename to _toCheck/tests/_data/vendor/Example/Engines/LeEngine2.php diff --git a/tests/_data/vendor/Example/Engines/LeOtherEngine.inc b/_toCheck/tests/_data/vendor/Example/Engines/LeOtherEngine.inc similarity index 100% rename from tests/_data/vendor/Example/Engines/LeOtherEngine.inc rename to _toCheck/tests/_data/vendor/Example/Engines/LeOtherEngine.inc diff --git a/tests/_data/vendor/Example/Example/Example.php b/_toCheck/tests/_data/vendor/Example/Example/Example.php similarity index 100% rename from tests/_data/vendor/Example/Example/Example.php rename to _toCheck/tests/_data/vendor/Example/Example/Example.php diff --git a/tests/_data/vendor/Example/Other/NoClass.php b/_toCheck/tests/_data/vendor/Example/Other/NoClass.php similarity index 100% rename from tests/_data/vendor/Example/Other/NoClass.php rename to _toCheck/tests/_data/vendor/Example/Other/NoClass.php diff --git a/tests/_data/vendor/Example/Other/NoClass1.php b/_toCheck/tests/_data/vendor/Example/Other/NoClass1.php similarity index 100% rename from tests/_data/vendor/Example/Other/NoClass1.php rename to _toCheck/tests/_data/vendor/Example/Other/NoClass1.php diff --git a/tests/_data/vendor/Example/Other/NoClass2.php b/_toCheck/tests/_data/vendor/Example/Other/NoClass2.php similarity index 100% rename from tests/_data/vendor/Example/Other/NoClass2.php rename to _toCheck/tests/_data/vendor/Example/Other/NoClass2.php diff --git a/tests/_data/vendor/Example/Other/NoClass3.php b/_toCheck/tests/_data/vendor/Example/Other/NoClass3.php similarity index 100% rename from tests/_data/vendor/Example/Other/NoClass3.php rename to _toCheck/tests/_data/vendor/Example/Other/NoClass3.php diff --git a/tests/_data/vendor/Example/Other/VousTest.php b/_toCheck/tests/_data/vendor/Example/Other/VousTest.php similarity index 100% rename from tests/_data/vendor/Example/Other/VousTest.php rename to _toCheck/tests/_data/vendor/Example/Other/VousTest.php diff --git a/tests/_data/vendor/Example/Test/LeTest.php b/_toCheck/tests/_data/vendor/Example/Test/LeTest.php similarity index 100% rename from tests/_data/vendor/Example/Test/LeTest.php rename to _toCheck/tests/_data/vendor/Example/Test/LeTest.php diff --git a/tests/_data/vendor/Example/Test/MoiTest.php b/_toCheck/tests/_data/vendor/Example/Test/MoiTest.php similarity index 100% rename from tests/_data/vendor/Example/Test/MoiTest.php rename to _toCheck/tests/_data/vendor/Example/Test/MoiTest.php diff --git a/tests/_data/vendor/Example/Types/SomeType.php b/_toCheck/tests/_data/vendor/Example/Types/SomeType.php similarity index 100% rename from tests/_data/vendor/Example/Types/SomeType.php rename to _toCheck/tests/_data/vendor/Example/Types/SomeType.php diff --git a/tests/_data/views/exception/index.phtml b/_toCheck/tests/_data/views/exception/index.phtml similarity index 100% rename from tests/_data/views/exception/index.phtml rename to _toCheck/tests/_data/views/exception/index.phtml diff --git a/tests/_data/views/exception/second.phtml b/_toCheck/tests/_data/views/exception/second.phtml similarity index 100% rename from tests/_data/views/exception/second.phtml rename to _toCheck/tests/_data/views/exception/second.phtml diff --git a/tests/_data/views/filters/.gitignore b/_toCheck/tests/_data/views/filters/.gitignore similarity index 100% rename from tests/_data/views/filters/.gitignore rename to _toCheck/tests/_data/views/filters/.gitignore diff --git a/tests/_data/views/filters/default.volt b/_toCheck/tests/_data/views/filters/default.volt similarity index 100% rename from tests/_data/views/filters/default.volt rename to _toCheck/tests/_data/views/filters/default.volt diff --git a/tests/_data/views/filters/default_json_encode.volt b/_toCheck/tests/_data/views/filters/default_json_encode.volt similarity index 100% rename from tests/_data/views/filters/default_json_encode.volt rename to _toCheck/tests/_data/views/filters/default_json_encode.volt diff --git a/tests/_data/views/html5.phtml b/_toCheck/tests/_data/views/html5.phtml similarity index 100% rename from tests/_data/views/html5.phtml rename to _toCheck/tests/_data/views/html5.phtml diff --git a/tests/_data/views/index.phtml b/_toCheck/tests/_data/views/index.phtml similarity index 100% rename from tests/_data/views/index.phtml rename to _toCheck/tests/_data/views/index.phtml diff --git a/tests/_data/views/layouts/.gitignore b/_toCheck/tests/_data/views/layouts/.gitignore similarity index 100% rename from tests/_data/views/layouts/.gitignore rename to _toCheck/tests/_data/views/layouts/.gitignore diff --git a/tests/_data/views/layouts/after.phtml b/_toCheck/tests/_data/views/layouts/after.phtml similarity index 100% rename from tests/_data/views/layouts/after.phtml rename to _toCheck/tests/_data/views/layouts/after.phtml diff --git a/tests/_data/views/layouts/before.phtml b/_toCheck/tests/_data/views/layouts/before.phtml similarity index 100% rename from tests/_data/views/layouts/before.phtml rename to _toCheck/tests/_data/views/layouts/before.phtml diff --git a/tests/_data/views/layouts/test.phtml b/_toCheck/tests/_data/views/layouts/test.phtml similarity index 100% rename from tests/_data/views/layouts/test.phtml rename to _toCheck/tests/_data/views/layouts/test.phtml diff --git a/tests/_data/views/layouts/test10.volt b/_toCheck/tests/_data/views/layouts/test10.volt similarity index 100% rename from tests/_data/views/layouts/test10.volt rename to _toCheck/tests/_data/views/layouts/test10.volt diff --git a/tests/_data/views/layouts/test12.phtml b/_toCheck/tests/_data/views/layouts/test12.phtml similarity index 100% rename from tests/_data/views/layouts/test12.phtml rename to _toCheck/tests/_data/views/layouts/test12.phtml diff --git a/tests/_data/views/layouts/test13.phtml b/_toCheck/tests/_data/views/layouts/test13.phtml similarity index 100% rename from tests/_data/views/layouts/test13.phtml rename to _toCheck/tests/_data/views/layouts/test13.phtml diff --git a/tests/_data/views/layouts/test3.phtml b/_toCheck/tests/_data/views/layouts/test3.phtml similarity index 100% rename from tests/_data/views/layouts/test3.phtml rename to _toCheck/tests/_data/views/layouts/test3.phtml diff --git a/tests/_data/views/layouts/test4.mhtml b/_toCheck/tests/_data/views/layouts/test4.mhtml similarity index 100% rename from tests/_data/views/layouts/test4.mhtml rename to _toCheck/tests/_data/views/layouts/test4.mhtml diff --git a/tests/_data/views/layouts/test6.phtml b/_toCheck/tests/_data/views/layouts/test6.phtml similarity index 100% rename from tests/_data/views/layouts/test6.phtml rename to _toCheck/tests/_data/views/layouts/test6.phtml diff --git a/tests/_data/views/layouts/test7.twig b/_toCheck/tests/_data/views/layouts/test7.twig similarity index 100% rename from tests/_data/views/layouts/test7.twig rename to _toCheck/tests/_data/views/layouts/test7.twig diff --git a/tests/_data/views/macro/conditionaldate.volt b/_toCheck/tests/_data/views/macro/conditionaldate.volt similarity index 100% rename from tests/_data/views/macro/conditionaldate.volt rename to _toCheck/tests/_data/views/macro/conditionaldate.volt diff --git a/tests/_data/views/macro/error_messages.volt b/_toCheck/tests/_data/views/macro/error_messages.volt similarity index 100% rename from tests/_data/views/macro/error_messages.volt rename to _toCheck/tests/_data/views/macro/error_messages.volt diff --git a/tests/_data/views/macro/form_row.volt b/_toCheck/tests/_data/views/macro/form_row.volt similarity index 100% rename from tests/_data/views/macro/form_row.volt rename to _toCheck/tests/_data/views/macro/form_row.volt diff --git a/tests/_data/views/macro/hello.volt b/_toCheck/tests/_data/views/macro/hello.volt similarity index 100% rename from tests/_data/views/macro/hello.volt rename to _toCheck/tests/_data/views/macro/hello.volt diff --git a/tests/_data/views/macro/list.volt b/_toCheck/tests/_data/views/macro/list.volt similarity index 100% rename from tests/_data/views/macro/list.volt rename to _toCheck/tests/_data/views/macro/list.volt diff --git a/tests/_data/views/macro/my_input.volt b/_toCheck/tests/_data/views/macro/my_input.volt similarity index 100% rename from tests/_data/views/macro/my_input.volt rename to _toCheck/tests/_data/views/macro/my_input.volt diff --git a/tests/_data/views/macro/related_links.volt b/_toCheck/tests/_data/views/macro/related_links.volt similarity index 100% rename from tests/_data/views/macro/related_links.volt rename to _toCheck/tests/_data/views/macro/related_links.volt diff --git a/tests/_data/views/macro/strtotime.volt b/_toCheck/tests/_data/views/macro/strtotime.volt similarity index 100% rename from tests/_data/views/macro/strtotime.volt rename to _toCheck/tests/_data/views/macro/strtotime.volt diff --git a/tests/_data/views/partials/.gitignore b/_toCheck/tests/_data/views/partials/.gitignore similarity index 100% rename from tests/_data/views/partials/.gitignore rename to _toCheck/tests/_data/views/partials/.gitignore diff --git a/tests/_data/views/partials/_partial1.phtml b/_toCheck/tests/_data/views/partials/_partial1.phtml similarity index 100% rename from tests/_data/views/partials/_partial1.phtml rename to _toCheck/tests/_data/views/partials/_partial1.phtml diff --git a/tests/_data/views/partials/_partial2.phtml b/_toCheck/tests/_data/views/partials/_partial2.phtml similarity index 100% rename from tests/_data/views/partials/_partial2.phtml rename to _toCheck/tests/_data/views/partials/_partial2.phtml diff --git a/tests/_data/views/partials/_partial3.phtml b/_toCheck/tests/_data/views/partials/_partial3.phtml similarity index 100% rename from tests/_data/views/partials/_partial3.phtml rename to _toCheck/tests/_data/views/partials/_partial3.phtml diff --git a/tests/_data/views/partials/footer.volt b/_toCheck/tests/_data/views/partials/footer.volt similarity index 100% rename from tests/_data/views/partials/footer.volt rename to _toCheck/tests/_data/views/partials/footer.volt diff --git a/tests/_data/views/partials/header.mhtml b/_toCheck/tests/_data/views/partials/header.mhtml similarity index 100% rename from tests/_data/views/partials/header.mhtml rename to _toCheck/tests/_data/views/partials/header.mhtml diff --git a/tests/_data/views/partials/header.twig b/_toCheck/tests/_data/views/partials/header.twig similarity index 100% rename from tests/_data/views/partials/header.twig rename to _toCheck/tests/_data/views/partials/header.twig diff --git a/tests/_data/views/partials/header.volt b/_toCheck/tests/_data/views/partials/header.volt similarity index 100% rename from tests/_data/views/partials/header.volt rename to _toCheck/tests/_data/views/partials/header.volt diff --git a/tests/_data/views/partials/header2.volt b/_toCheck/tests/_data/views/partials/header2.volt similarity index 100% rename from tests/_data/views/partials/header2.volt rename to _toCheck/tests/_data/views/partials/header2.volt diff --git a/tests/_data/views/partials/header3.volt b/_toCheck/tests/_data/views/partials/header3.volt similarity index 100% rename from tests/_data/views/partials/header3.volt rename to _toCheck/tests/_data/views/partials/header3.volt diff --git a/tests/_data/views/switch-case/.gitignore b/_toCheck/tests/_data/views/switch-case/.gitignore similarity index 100% rename from tests/_data/views/switch-case/.gitignore rename to _toCheck/tests/_data/views/switch-case/.gitignore diff --git a/tests/_data/views/switch-case/simple-usage.volt b/_toCheck/tests/_data/views/switch-case/simple-usage.volt similarity index 100% rename from tests/_data/views/switch-case/simple-usage.volt rename to _toCheck/tests/_data/views/switch-case/simple-usage.volt diff --git a/tests/_data/views/templates/a.volt b/_toCheck/tests/_data/views/templates/a.volt similarity index 100% rename from tests/_data/views/templates/a.volt rename to _toCheck/tests/_data/views/templates/a.volt diff --git a/tests/_data/views/templates/b.volt b/_toCheck/tests/_data/views/templates/b.volt similarity index 100% rename from tests/_data/views/templates/b.volt rename to _toCheck/tests/_data/views/templates/b.volt diff --git a/tests/_data/views/templates/c.volt b/_toCheck/tests/_data/views/templates/c.volt similarity index 100% rename from tests/_data/views/templates/c.volt rename to _toCheck/tests/_data/views/templates/c.volt diff --git a/tests/_data/views/test10/.gitignore b/_toCheck/tests/_data/views/test10/.gitignore similarity index 100% rename from tests/_data/views/test10/.gitignore rename to _toCheck/tests/_data/views/test10/.gitignore diff --git a/tests/_data/views/test10/children.extends.volt b/_toCheck/tests/_data/views/test10/children.extends.volt similarity index 100% rename from tests/_data/views/test10/children.extends.volt rename to _toCheck/tests/_data/views/test10/children.extends.volt diff --git a/tests/_data/views/test10/children.volt b/_toCheck/tests/_data/views/test10/children.volt similarity index 100% rename from tests/_data/views/test10/children.volt rename to _toCheck/tests/_data/views/test10/children.volt diff --git a/tests/_data/views/test10/children2.volt b/_toCheck/tests/_data/views/test10/children2.volt similarity index 100% rename from tests/_data/views/test10/children2.volt rename to _toCheck/tests/_data/views/test10/children2.volt diff --git a/tests/_data/views/test10/import.volt b/_toCheck/tests/_data/views/test10/import.volt similarity index 100% rename from tests/_data/views/test10/import.volt rename to _toCheck/tests/_data/views/test10/import.volt diff --git a/tests/_data/views/test10/import2.volt b/_toCheck/tests/_data/views/test10/import2.volt similarity index 100% rename from tests/_data/views/test10/import2.volt rename to _toCheck/tests/_data/views/test10/import2.volt diff --git a/tests/_data/views/test10/index.volt b/_toCheck/tests/_data/views/test10/index.volt similarity index 100% rename from tests/_data/views/test10/index.volt rename to _toCheck/tests/_data/views/test10/index.volt diff --git a/tests/_data/views/test10/other.volt b/_toCheck/tests/_data/views/test10/other.volt similarity index 100% rename from tests/_data/views/test10/other.volt rename to _toCheck/tests/_data/views/test10/other.volt diff --git a/tests/_data/views/test10/parent.volt b/_toCheck/tests/_data/views/test10/parent.volt similarity index 100% rename from tests/_data/views/test10/parent.volt rename to _toCheck/tests/_data/views/test10/parent.volt diff --git a/tests/_data/views/test10/partial.volt b/_toCheck/tests/_data/views/test10/partial.volt similarity index 100% rename from tests/_data/views/test10/partial.volt rename to _toCheck/tests/_data/views/test10/partial.volt diff --git a/tests/_data/views/test11/.gitignore b/_toCheck/tests/_data/views/test11/.gitignore similarity index 100% rename from tests/_data/views/test11/.gitignore rename to _toCheck/tests/_data/views/test11/.gitignore diff --git a/tests/_data/views/test11/index.volt b/_toCheck/tests/_data/views/test11/index.volt similarity index 100% rename from tests/_data/views/test11/index.volt rename to _toCheck/tests/_data/views/test11/index.volt diff --git a/tests/_data/views/test12/index.twig b/_toCheck/tests/_data/views/test12/index.twig similarity index 100% rename from tests/_data/views/test12/index.twig rename to _toCheck/tests/_data/views/test12/index.twig diff --git a/tests/_data/views/test12/info.phtml b/_toCheck/tests/_data/views/test12/info.phtml similarity index 100% rename from tests/_data/views/test12/info.phtml rename to _toCheck/tests/_data/views/test12/info.phtml diff --git a/tests/_data/views/test13/index.phtml b/_toCheck/tests/_data/views/test13/index.phtml similarity index 100% rename from tests/_data/views/test13/index.phtml rename to _toCheck/tests/_data/views/test13/index.phtml diff --git a/tests/_data/views/test14/loop1.volt b/_toCheck/tests/_data/views/test14/loop1.volt similarity index 100% rename from tests/_data/views/test14/loop1.volt rename to _toCheck/tests/_data/views/test14/loop1.volt diff --git a/tests/_data/views/test15/index.phtml b/_toCheck/tests/_data/views/test15/index.phtml similarity index 100% rename from tests/_data/views/test15/index.phtml rename to _toCheck/tests/_data/views/test15/index.phtml diff --git a/tests/_data/views/test16/index.phtml b/_toCheck/tests/_data/views/test16/index.phtml similarity index 100% rename from tests/_data/views/test16/index.phtml rename to _toCheck/tests/_data/views/test16/index.phtml diff --git a/tests/_data/views/test2/index.phtml b/_toCheck/tests/_data/views/test2/index.phtml similarity index 100% rename from tests/_data/views/test2/index.phtml rename to _toCheck/tests/_data/views/test2/index.phtml diff --git a/tests/_data/views/test2/params.phtml b/_toCheck/tests/_data/views/test2/params.phtml similarity index 100% rename from tests/_data/views/test2/params.phtml rename to _toCheck/tests/_data/views/test2/params.phtml diff --git a/tests/_data/views/test3/another.phtml b/_toCheck/tests/_data/views/test3/another.phtml similarity index 100% rename from tests/_data/views/test3/another.phtml rename to _toCheck/tests/_data/views/test3/another.phtml diff --git a/tests/_data/views/test3/coolVar.phtml b/_toCheck/tests/_data/views/test3/coolVar.phtml similarity index 100% rename from tests/_data/views/test3/coolVar.phtml rename to _toCheck/tests/_data/views/test3/coolVar.phtml diff --git a/tests/_data/views/test3/other.phtml b/_toCheck/tests/_data/views/test3/other.phtml similarity index 100% rename from tests/_data/views/test3/other.phtml rename to _toCheck/tests/_data/views/test3/other.phtml diff --git a/tests/_data/views/test3/query.phtml b/_toCheck/tests/_data/views/test3/query.phtml similarity index 100% rename from tests/_data/views/test3/query.phtml rename to _toCheck/tests/_data/views/test3/query.phtml diff --git a/tests/_data/views/test3/yup.phtml b/_toCheck/tests/_data/views/test3/yup.phtml similarity index 100% rename from tests/_data/views/test3/yup.phtml rename to _toCheck/tests/_data/views/test3/yup.phtml diff --git a/tests/_data/views/test4/index.mhtml b/_toCheck/tests/_data/views/test4/index.mhtml similarity index 100% rename from tests/_data/views/test4/index.mhtml rename to _toCheck/tests/_data/views/test4/index.mhtml diff --git a/tests/_data/views/test5/index.phtml b/_toCheck/tests/_data/views/test5/index.phtml similarity index 100% rename from tests/_data/views/test5/index.phtml rename to _toCheck/tests/_data/views/test5/index.phtml diff --git a/tests/_data/views/test5/missing.phtml b/_toCheck/tests/_data/views/test5/missing.phtml similarity index 100% rename from tests/_data/views/test5/missing.phtml rename to _toCheck/tests/_data/views/test5/missing.phtml diff --git a/tests/_data/views/test5/subpartial.phtml b/_toCheck/tests/_data/views/test5/subpartial.phtml similarity index 100% rename from tests/_data/views/test5/subpartial.phtml rename to _toCheck/tests/_data/views/test5/subpartial.phtml diff --git a/tests/_data/views/test6/index.mhtml b/_toCheck/tests/_data/views/test6/index.mhtml similarity index 100% rename from tests/_data/views/test6/index.mhtml rename to _toCheck/tests/_data/views/test6/index.mhtml diff --git a/tests/_data/views/test6/info.phtml b/_toCheck/tests/_data/views/test6/info.phtml similarity index 100% rename from tests/_data/views/test6/info.phtml rename to _toCheck/tests/_data/views/test6/info.phtml diff --git a/tests/_data/views/test7/index.twig b/_toCheck/tests/_data/views/test7/index.twig similarity index 100% rename from tests/_data/views/test7/index.twig rename to _toCheck/tests/_data/views/test7/index.twig diff --git a/tests/_data/views/test8/index.phtml b/_toCheck/tests/_data/views/test8/index.phtml similarity index 100% rename from tests/_data/views/test8/index.phtml rename to _toCheck/tests/_data/views/test8/index.phtml diff --git a/tests/_data/views/test8/leother.phtml b/_toCheck/tests/_data/views/test8/leother.phtml similarity index 100% rename from tests/_data/views/test8/leother.phtml rename to _toCheck/tests/_data/views/test8/leother.phtml diff --git a/tests/_data/views/test8/other.phtml b/_toCheck/tests/_data/views/test8/other.phtml similarity index 100% rename from tests/_data/views/test8/other.phtml rename to _toCheck/tests/_data/views/test8/other.phtml diff --git a/tests/_data/views/test9/index.phtml b/_toCheck/tests/_data/views/test9/index.phtml similarity index 100% rename from tests/_data/views/test9/index.phtml rename to _toCheck/tests/_data/views/test9/index.phtml diff --git a/tests/_fixtures/dump/class_properties.txt b/_toCheck/tests/_fixtures/dump/class_properties.txt similarity index 100% rename from tests/_fixtures/dump/class_properties.txt rename to _toCheck/tests/_fixtures/dump/class_properties.txt diff --git a/tests/_fixtures/metadata/robots.php b/_toCheck/tests/_fixtures/metadata/robots.php similarity index 100% rename from tests/_fixtures/metadata/robots.php rename to _toCheck/tests/_fixtures/metadata/robots.php diff --git a/tests/_fixtures/metadata/test_describereference.php b/_toCheck/tests/_fixtures/metadata/test_describereference.php similarity index 100% rename from tests/_fixtures/metadata/test_describereference.php rename to _toCheck/tests/_fixtures/metadata/test_describereference.php diff --git a/tests/_fixtures/mvc/model/criteria_test/limit_offset_provider.php b/_toCheck/tests/_fixtures/mvc/model/criteria_test/limit_offset_provider.php similarity index 100% rename from tests/_fixtures/mvc/model/criteria_test/limit_offset_provider.php rename to _toCheck/tests/_fixtures/mvc/model/criteria_test/limit_offset_provider.php diff --git a/tests/_fixtures/mvc/model/query_test/data_to_delete_parsing.php b/_toCheck/tests/_fixtures/mvc/model/query_test/data_to_delete_parsing.php similarity index 100% rename from tests/_fixtures/mvc/model/query_test/data_to_delete_parsing.php rename to _toCheck/tests/_fixtures/mvc/model/query_test/data_to_delete_parsing.php diff --git a/tests/_fixtures/mvc/model/query_test/data_to_insert_parsing.php b/_toCheck/tests/_fixtures/mvc/model/query_test/data_to_insert_parsing.php similarity index 100% rename from tests/_fixtures/mvc/model/query_test/data_to_insert_parsing.php rename to _toCheck/tests/_fixtures/mvc/model/query_test/data_to_insert_parsing.php diff --git a/tests/_fixtures/mvc/model/query_test/data_to_update_parsing.php b/_toCheck/tests/_fixtures/mvc/model/query_test/data_to_update_parsing.php similarity index 100% rename from tests/_fixtures/mvc/model/query_test/data_to_update_parsing.php rename to _toCheck/tests/_fixtures/mvc/model/query_test/data_to_update_parsing.php diff --git a/tests/_fixtures/mvc/router_test/data_to_regex_router_host_port.php b/_toCheck/tests/_fixtures/mvc/router_test/data_to_regex_router_host_port.php similarity index 100% rename from tests/_fixtures/mvc/router_test/data_to_regex_router_host_port.php rename to _toCheck/tests/_fixtures/mvc/router_test/data_to_regex_router_host_port.php diff --git a/tests/_fixtures/mvc/router_test/data_to_router.php b/_toCheck/tests/_fixtures/mvc/router_test/data_to_router.php similarity index 100% rename from tests/_fixtures/mvc/router_test/data_to_router.php rename to _toCheck/tests/_fixtures/mvc/router_test/data_to_router.php diff --git a/tests/_fixtures/mvc/router_test/data_to_router_host_name.php b/_toCheck/tests/_fixtures/mvc/router_test/data_to_router_host_name.php similarity index 100% rename from tests/_fixtures/mvc/router_test/data_to_router_host_name.php rename to _toCheck/tests/_fixtures/mvc/router_test/data_to_router_host_name.php diff --git a/tests/_fixtures/mvc/router_test/data_to_router_http.php b/_toCheck/tests/_fixtures/mvc/router_test/data_to_router_http.php similarity index 100% rename from tests/_fixtures/mvc/router_test/data_to_router_http.php rename to _toCheck/tests/_fixtures/mvc/router_test/data_to_router_http.php diff --git a/tests/_fixtures/mvc/router_test/data_to_router_param.php b/_toCheck/tests/_fixtures/mvc/router_test/data_to_router_param.php similarity index 100% rename from tests/_fixtures/mvc/router_test/data_to_router_param.php rename to _toCheck/tests/_fixtures/mvc/router_test/data_to_router_param.php diff --git a/tests/_fixtures/mvc/router_test/data_to_router_with_hostname.php b/_toCheck/tests/_fixtures/mvc/router_test/data_to_router_with_hostname.php similarity index 100% rename from tests/_fixtures/mvc/router_test/data_to_router_with_hostname.php rename to _toCheck/tests/_fixtures/mvc/router_test/data_to_router_with_hostname.php diff --git a/tests/_fixtures/mvc/router_test/matching_with_converted.php b/_toCheck/tests/_fixtures/mvc/router_test/matching_with_converted.php similarity index 100% rename from tests/_fixtures/mvc/router_test/matching_with_converted.php rename to _toCheck/tests/_fixtures/mvc/router_test/matching_with_converted.php diff --git a/tests/_fixtures/mvc/router_test/matching_with_extra_slashes.php b/_toCheck/tests/_fixtures/mvc/router_test/matching_with_extra_slashes.php similarity index 100% rename from tests/_fixtures/mvc/router_test/matching_with_extra_slashes.php rename to _toCheck/tests/_fixtures/mvc/router_test/matching_with_extra_slashes.php diff --git a/tests/_fixtures/mvc/router_test/matching_with_got_router.php b/_toCheck/tests/_fixtures/mvc/router_test/matching_with_got_router.php similarity index 100% rename from tests/_fixtures/mvc/router_test/matching_with_got_router.php rename to _toCheck/tests/_fixtures/mvc/router_test/matching_with_got_router.php diff --git a/tests/_fixtures/mvc/router_test/matching_with_host_name.php b/_toCheck/tests/_fixtures/mvc/router_test/matching_with_host_name.php similarity index 100% rename from tests/_fixtures/mvc/router_test/matching_with_host_name.php rename to _toCheck/tests/_fixtures/mvc/router_test/matching_with_host_name.php diff --git a/tests/_fixtures/mvc/router_test/matching_with_hostname_regex.php b/_toCheck/tests/_fixtures/mvc/router_test/matching_with_hostname_regex.php similarity index 100% rename from tests/_fixtures/mvc/router_test/matching_with_hostname_regex.php rename to _toCheck/tests/_fixtures/mvc/router_test/matching_with_hostname_regex.php diff --git a/tests/_fixtures/mvc/router_test/matching_with_path_provider.php b/_toCheck/tests/_fixtures/mvc/router_test/matching_with_path_provider.php similarity index 100% rename from tests/_fixtures/mvc/router_test/matching_with_path_provider.php rename to _toCheck/tests/_fixtures/mvc/router_test/matching_with_path_provider.php diff --git a/tests/_fixtures/mvc/router_test/matching_with_regex_router_host_port.php b/_toCheck/tests/_fixtures/mvc/router_test/matching_with_regex_router_host_port.php similarity index 100% rename from tests/_fixtures/mvc/router_test/matching_with_regex_router_host_port.php rename to _toCheck/tests/_fixtures/mvc/router_test/matching_with_regex_router_host_port.php diff --git a/tests/_fixtures/mvc/router_test/matching_with_router.php b/_toCheck/tests/_fixtures/mvc/router_test/matching_with_router.php similarity index 100% rename from tests/_fixtures/mvc/router_test/matching_with_router.php rename to _toCheck/tests/_fixtures/mvc/router_test/matching_with_router.php diff --git a/tests/_fixtures/mvc/router_test/matching_with_router_http.php b/_toCheck/tests/_fixtures/mvc/router_test/matching_with_router_http.php similarity index 100% rename from tests/_fixtures/mvc/router_test/matching_with_router_http.php rename to _toCheck/tests/_fixtures/mvc/router_test/matching_with_router_http.php diff --git a/tests/_fixtures/mvc/url_test/data_to_set_di.php b/_toCheck/tests/_fixtures/mvc/url_test/data_to_set_di.php similarity index 100% rename from tests/_fixtures/mvc/url_test/data_to_set_di.php rename to _toCheck/tests/_fixtures/mvc/url_test/data_to_set_di.php diff --git a/tests/_fixtures/mvc/url_test/url_to_set_base_uri.php b/_toCheck/tests/_fixtures/mvc/url_test/url_to_set_base_uri.php similarity index 100% rename from tests/_fixtures/mvc/url_test/url_to_set_base_uri.php rename to _toCheck/tests/_fixtures/mvc/url_test/url_to_set_base_uri.php diff --git a/tests/_fixtures/mvc/url_test/url_to_set_server.php b/_toCheck/tests/_fixtures/mvc/url_test/url_to_set_server.php similarity index 100% rename from tests/_fixtures/mvc/url_test/url_to_set_server.php rename to _toCheck/tests/_fixtures/mvc/url_test/url_to_set_server.php diff --git a/tests/_fixtures/mvc/url_test/url_to_set_without_di.php b/_toCheck/tests/_fixtures/mvc/url_test/url_to_set_without_di.php similarity index 100% rename from tests/_fixtures/mvc/url_test/url_to_set_without_di.php rename to _toCheck/tests/_fixtures/mvc/url_test/url_to_set_without_di.php diff --git a/tests/_fixtures/mvc/url_test/url_to_set_without_di_two_param.php b/_toCheck/tests/_fixtures/mvc/url_test/url_to_set_without_di_two_param.php similarity index 100% rename from tests/_fixtures/mvc/url_test/url_to_set_without_di_two_param.php rename to _toCheck/tests/_fixtures/mvc/url_test/url_to_set_without_di_two_param.php diff --git a/tests/_fixtures/mvc/view/engine/mustache.php b/_toCheck/tests/_fixtures/mvc/view/engine/mustache.php similarity index 100% rename from tests/_fixtures/mvc/view/engine/mustache.php rename to _toCheck/tests/_fixtures/mvc/view/engine/mustache.php diff --git a/tests/_fixtures/mvc/view/engine/twig.php b/_toCheck/tests/_fixtures/mvc/view/engine/twig.php similarity index 100% rename from tests/_fixtures/mvc/view/engine/twig.php rename to _toCheck/tests/_fixtures/mvc/view/engine/twig.php diff --git a/tests/_fixtures/mvc/view/engine/volt/compiler_files_test/volt_compile_file_extends_multiple.php b/_toCheck/tests/_fixtures/mvc/view/engine/volt/compiler_files_test/volt_compile_file_extends_multiple.php similarity index 100% rename from tests/_fixtures/mvc/view/engine/volt/compiler_files_test/volt_compile_file_extends_multiple.php rename to _toCheck/tests/_fixtures/mvc/view/engine/volt/compiler_files_test/volt_compile_file_extends_multiple.php diff --git a/tests/_fixtures/mvc/view/engine/volt/compiler_files_test/volt_compiler_extends_block.php b/_toCheck/tests/_fixtures/mvc/view/engine/volt/compiler_files_test/volt_compiler_extends_block.php similarity index 100% rename from tests/_fixtures/mvc/view/engine/volt/compiler_files_test/volt_compiler_extends_block.php rename to _toCheck/tests/_fixtures/mvc/view/engine/volt/compiler_files_test/volt_compiler_extends_block.php diff --git a/tests/_fixtures/mvc/view/engine/volt/compiler_files_test/volt_compiler_file.php b/_toCheck/tests/_fixtures/mvc/view/engine/volt/compiler_files_test/volt_compiler_file.php similarity index 100% rename from tests/_fixtures/mvc/view/engine/volt/compiler_files_test/volt_compiler_file.php rename to _toCheck/tests/_fixtures/mvc/view/engine/volt/compiler_files_test/volt_compiler_file.php diff --git a/tests/_fixtures/mvc/view_engines_test/view_built_in_function.php b/_toCheck/tests/_fixtures/mvc/view_engines_test/view_built_in_function.php similarity index 100% rename from tests/_fixtures/mvc/view_engines_test/view_built_in_function.php rename to _toCheck/tests/_fixtures/mvc/view_engines_test/view_built_in_function.php diff --git a/tests/_fixtures/mvc/view_engines_test/view_register_engines.php b/_toCheck/tests/_fixtures/mvc/view_engines_test/view_register_engines.php similarity index 100% rename from tests/_fixtures/mvc/view_engines_test/view_register_engines.php rename to _toCheck/tests/_fixtures/mvc/view_engines_test/view_register_engines.php diff --git a/tests/_fixtures/mvc/view_engines_test/view_set_php_mustache.php b/_toCheck/tests/_fixtures/mvc/view_engines_test/view_set_php_mustache.php similarity index 100% rename from tests/_fixtures/mvc/view_engines_test/view_set_php_mustache.php rename to _toCheck/tests/_fixtures/mvc/view_engines_test/view_set_php_mustache.php diff --git a/tests/_fixtures/mvc/view_engines_test/view_set_php_mustache_partial.php b/_toCheck/tests/_fixtures/mvc/view_engines_test/view_set_php_mustache_partial.php similarity index 100% rename from tests/_fixtures/mvc/view_engines_test/view_set_php_mustache_partial.php rename to _toCheck/tests/_fixtures/mvc/view_engines_test/view_set_php_mustache_partial.php diff --git a/tests/_fixtures/mvc/view_engines_test/view_set_php_twig.php b/_toCheck/tests/_fixtures/mvc/view_engines_test/view_set_php_twig.php similarity index 100% rename from tests/_fixtures/mvc/view_engines_test/view_set_php_twig.php rename to _toCheck/tests/_fixtures/mvc/view_engines_test/view_set_php_twig.php diff --git a/tests/_fixtures/mvc/view_engines_test/view_set_php_twig_partial.php b/_toCheck/tests/_fixtures/mvc/view_engines_test/view_set_php_twig_partial.php similarity index 100% rename from tests/_fixtures/mvc/view_engines_test/view_set_php_twig_partial.php rename to _toCheck/tests/_fixtures/mvc/view_engines_test/view_set_php_twig_partial.php diff --git a/tests/_fixtures/mysql/example1.sql b/_toCheck/tests/_fixtures/mysql/example1.sql similarity index 100% rename from tests/_fixtures/mysql/example1.sql rename to _toCheck/tests/_fixtures/mysql/example1.sql diff --git a/tests/_fixtures/mysql/example2.sql b/_toCheck/tests/_fixtures/mysql/example2.sql similarity index 100% rename from tests/_fixtures/mysql/example2.sql rename to _toCheck/tests/_fixtures/mysql/example2.sql diff --git a/tests/_fixtures/mysql/example3.sql b/_toCheck/tests/_fixtures/mysql/example3.sql similarity index 100% rename from tests/_fixtures/mysql/example3.sql rename to _toCheck/tests/_fixtures/mysql/example3.sql diff --git a/tests/_fixtures/mysql/example4.sql b/_toCheck/tests/_fixtures/mysql/example4.sql similarity index 100% rename from tests/_fixtures/mysql/example4.sql rename to _toCheck/tests/_fixtures/mysql/example4.sql diff --git a/tests/_fixtures/mysql/example5.sql b/_toCheck/tests/_fixtures/mysql/example5.sql similarity index 100% rename from tests/_fixtures/mysql/example5.sql rename to _toCheck/tests/_fixtures/mysql/example5.sql diff --git a/tests/_fixtures/postgresql/example1.sql b/_toCheck/tests/_fixtures/postgresql/example1.sql similarity index 100% rename from tests/_fixtures/postgresql/example1.sql rename to _toCheck/tests/_fixtures/postgresql/example1.sql diff --git a/tests/_fixtures/postgresql/example2.sql b/_toCheck/tests/_fixtures/postgresql/example2.sql similarity index 100% rename from tests/_fixtures/postgresql/example2.sql rename to _toCheck/tests/_fixtures/postgresql/example2.sql diff --git a/tests/_fixtures/postgresql/example3.sql b/_toCheck/tests/_fixtures/postgresql/example3.sql similarity index 100% rename from tests/_fixtures/postgresql/example3.sql rename to _toCheck/tests/_fixtures/postgresql/example3.sql diff --git a/tests/_fixtures/postgresql/example4.sql b/_toCheck/tests/_fixtures/postgresql/example4.sql similarity index 100% rename from tests/_fixtures/postgresql/example4.sql rename to _toCheck/tests/_fixtures/postgresql/example4.sql diff --git a/tests/_fixtures/postgresql/example5.sql b/_toCheck/tests/_fixtures/postgresql/example5.sql similarity index 100% rename from tests/_fixtures/postgresql/example5.sql rename to _toCheck/tests/_fixtures/postgresql/example5.sql diff --git a/tests/_fixtures/postgresql/example6.sql b/_toCheck/tests/_fixtures/postgresql/example6.sql similarity index 100% rename from tests/_fixtures/postgresql/example6.sql rename to _toCheck/tests/_fixtures/postgresql/example6.sql diff --git a/tests/_fixtures/postgresql/example7.sql b/_toCheck/tests/_fixtures/postgresql/example7.sql similarity index 100% rename from tests/_fixtures/postgresql/example7.sql rename to _toCheck/tests/_fixtures/postgresql/example7.sql diff --git a/tests/_fixtures/postgresql/example8.sql b/_toCheck/tests/_fixtures/postgresql/example8.sql similarity index 100% rename from tests/_fixtures/postgresql/example8.sql rename to _toCheck/tests/_fixtures/postgresql/example8.sql diff --git a/tests/_fixtures/postgresql/example9.sql b/_toCheck/tests/_fixtures/postgresql/example9.sql similarity index 100% rename from tests/_fixtures/postgresql/example9.sql rename to _toCheck/tests/_fixtures/postgresql/example9.sql diff --git a/tests/_fixtures/query/select_parsing.php b/_toCheck/tests/_fixtures/query/select_parsing.php similarity index 100% rename from tests/_fixtures/query/select_parsing.php rename to _toCheck/tests/_fixtures/query/select_parsing.php diff --git a/tests/_fixtures/sqlite/example1.sql b/_toCheck/tests/_fixtures/sqlite/example1.sql similarity index 100% rename from tests/_fixtures/sqlite/example1.sql rename to _toCheck/tests/_fixtures/sqlite/example1.sql diff --git a/tests/_fixtures/sqlite/example2.sql b/_toCheck/tests/_fixtures/sqlite/example2.sql similarity index 100% rename from tests/_fixtures/sqlite/example2.sql rename to _toCheck/tests/_fixtures/sqlite/example2.sql diff --git a/tests/_fixtures/sqlite/example3.sql b/_toCheck/tests/_fixtures/sqlite/example3.sql similarity index 100% rename from tests/_fixtures/sqlite/example3.sql rename to _toCheck/tests/_fixtures/sqlite/example3.sql diff --git a/tests/_fixtures/sqlite/example4.sql b/_toCheck/tests/_fixtures/sqlite/example4.sql similarity index 100% rename from tests/_fixtures/sqlite/example4.sql rename to _toCheck/tests/_fixtures/sqlite/example4.sql diff --git a/tests/_fixtures/sqlite/example5.sql b/_toCheck/tests/_fixtures/sqlite/example5.sql similarity index 100% rename from tests/_fixtures/sqlite/example5.sql rename to _toCheck/tests/_fixtures/sqlite/example5.sql diff --git a/tests/_fixtures/sqlite/example6.sql b/_toCheck/tests/_fixtures/sqlite/example6.sql similarity index 100% rename from tests/_fixtures/sqlite/example6.sql rename to _toCheck/tests/_fixtures/sqlite/example6.sql diff --git a/tests/_fixtures/sqlite/example7.sql b/_toCheck/tests/_fixtures/sqlite/example7.sql similarity index 100% rename from tests/_fixtures/sqlite/example7.sql rename to _toCheck/tests/_fixtures/sqlite/example7.sql diff --git a/tests/_fixtures/sqlite/example8.sql b/_toCheck/tests/_fixtures/sqlite/example8.sql similarity index 100% rename from tests/_fixtures/sqlite/example8.sql rename to _toCheck/tests/_fixtures/sqlite/example8.sql diff --git a/tests/_fixtures/volt/compilerExceptionsTest/volt_compile_string.php b/_toCheck/tests/_fixtures/volt/compilerExceptionsTest/volt_compile_string.php similarity index 100% rename from tests/_fixtures/volt/compilerExceptionsTest/volt_compile_string.php rename to _toCheck/tests/_fixtures/volt/compilerExceptionsTest/volt_compile_string.php diff --git a/tests/_fixtures/volt/compilerExceptionsTest/volt_extends_error.php b/_toCheck/tests/_fixtures/volt/compilerExceptionsTest/volt_extends_error.php similarity index 100% rename from tests/_fixtures/volt/compilerExceptionsTest/volt_extends_error.php rename to _toCheck/tests/_fixtures/volt/compilerExceptionsTest/volt_extends_error.php diff --git a/tests/_fixtures/volt/compilerExceptionsTest/volt_syntax_error.php b/_toCheck/tests/_fixtures/volt/compilerExceptionsTest/volt_syntax_error.php similarity index 100% rename from tests/_fixtures/volt/compilerExceptionsTest/volt_syntax_error.php rename to _toCheck/tests/_fixtures/volt/compilerExceptionsTest/volt_syntax_error.php diff --git a/tests/_fixtures/volt/compilerTest/test_volt_parser.php b/_toCheck/tests/_fixtures/volt/compilerTest/test_volt_parser.php similarity index 100% rename from tests/_fixtures/volt/compilerTest/test_volt_parser.php rename to _toCheck/tests/_fixtures/volt/compilerTest/test_volt_parser.php diff --git a/tests/_fixtures/volt/compilerTest/volt_closure_filter.php b/_toCheck/tests/_fixtures/volt/compilerTest/volt_closure_filter.php similarity index 100% rename from tests/_fixtures/volt/compilerTest/volt_closure_filter.php rename to _toCheck/tests/_fixtures/volt/compilerTest/volt_closure_filter.php diff --git a/tests/_fixtures/volt/compilerTest/volt_compile_string_autoescape.php b/_toCheck/tests/_fixtures/volt/compilerTest/volt_compile_string_autoescape.php similarity index 100% rename from tests/_fixtures/volt/compilerTest/volt_compile_string_autoescape.php rename to _toCheck/tests/_fixtures/volt/compilerTest/volt_compile_string_autoescape.php diff --git a/tests/_fixtures/volt/compilerTest/volt_compile_string_equals.php b/_toCheck/tests/_fixtures/volt/compilerTest/volt_compile_string_equals.php similarity index 100% rename from tests/_fixtures/volt/compilerTest/volt_compile_string_equals.php rename to _toCheck/tests/_fixtures/volt/compilerTest/volt_compile_string_equals.php diff --git a/tests/_fixtures/volt/compilerTest/volt_single_filter.php b/_toCheck/tests/_fixtures/volt/compilerTest/volt_single_filter.php similarity index 100% rename from tests/_fixtures/volt/compilerTest/volt_single_filter.php rename to _toCheck/tests/_fixtures/volt/compilerTest/volt_single_filter.php diff --git a/tests/_fixtures/volt/compilerTest/volt_users_function_with_closure.php b/_toCheck/tests/_fixtures/volt/compilerTest/volt_users_function_with_closure.php similarity index 100% rename from tests/_fixtures/volt/compilerTest/volt_users_function_with_closure.php rename to _toCheck/tests/_fixtures/volt/compilerTest/volt_users_function_with_closure.php diff --git a/tests/_fixtures/volt/compilerTest/volt_users_single_string_function.php b/_toCheck/tests/_fixtures/volt/compilerTest/volt_users_single_string_function.php similarity index 100% rename from tests/_fixtures/volt/compilerTest/volt_users_single_string_function.php rename to _toCheck/tests/_fixtures/volt/compilerTest/volt_users_single_string_function.php diff --git a/tests/_output/.gitignore b/_toCheck/tests/_output/.gitignore similarity index 100% rename from tests/_output/.gitignore rename to _toCheck/tests/_output/.gitignore diff --git a/tests/_output/tests/annotations/.gitignore b/_toCheck/tests/_output/tests/annotations/.gitignore similarity index 100% rename from tests/_output/tests/annotations/.gitignore rename to _toCheck/tests/_output/tests/annotations/.gitignore diff --git a/tests/_output/tests/assets/.gitignore b/_toCheck/tests/_output/tests/assets/.gitignore similarity index 100% rename from tests/_output/tests/assets/.gitignore rename to _toCheck/tests/_output/tests/assets/.gitignore diff --git a/tests/_output/tests/cache/.gitignore b/_toCheck/tests/_output/tests/cache/.gitignore similarity index 100% rename from tests/_output/tests/cache/.gitignore rename to _toCheck/tests/_output/tests/cache/.gitignore diff --git a/tests/_output/tests/image/gd/.gitignore b/_toCheck/tests/_output/tests/image/gd/.gitignore similarity index 100% rename from tests/_output/tests/image/gd/.gitignore rename to _toCheck/tests/_output/tests/image/gd/.gitignore diff --git a/tests/_output/tests/image/imagick/.gitignore b/_toCheck/tests/_output/tests/image/imagick/.gitignore similarity index 100% rename from tests/_output/tests/image/imagick/.gitignore rename to _toCheck/tests/_output/tests/image/imagick/.gitignore diff --git a/tests/_output/tests/logs/.gitignore b/_toCheck/tests/_output/tests/logs/.gitignore similarity index 100% rename from tests/_output/tests/logs/.gitignore rename to _toCheck/tests/_output/tests/logs/.gitignore diff --git a/tests/_output/tests/session/.gitignore b/_toCheck/tests/_output/tests/session/.gitignore similarity index 100% rename from tests/_output/tests/session/.gitignore rename to _toCheck/tests/_output/tests/session/.gitignore diff --git a/tests/_output/tests/stream/.gitignore b/_toCheck/tests/_output/tests/stream/.gitignore similarity index 100% rename from tests/_output/tests/stream/.gitignore rename to _toCheck/tests/_output/tests/stream/.gitignore diff --git a/tests/_support/Helper/CollectionTrait.php b/_toCheck/tests/_support/Helper/CollectionTrait.php similarity index 100% rename from tests/_support/Helper/CollectionTrait.php rename to _toCheck/tests/_support/Helper/CollectionTrait.php diff --git a/tests/_support/Helper/ConnectionCheckerTrait.php b/_toCheck/tests/_support/Helper/ConnectionCheckerTrait.php similarity index 100% rename from tests/_support/Helper/ConnectionCheckerTrait.php rename to _toCheck/tests/_support/Helper/ConnectionCheckerTrait.php diff --git a/tests/_support/Helper/CookieAwareTrait.php b/_toCheck/tests/_support/Helper/CookieAwareTrait.php similarity index 100% rename from tests/_support/Helper/CookieAwareTrait.php rename to _toCheck/tests/_support/Helper/CookieAwareTrait.php diff --git a/tests/_support/Helper/Db/Connection/AbstractFactory.php b/_toCheck/tests/_support/Helper/Db/Connection/AbstractFactory.php similarity index 100% rename from tests/_support/Helper/Db/Connection/AbstractFactory.php rename to _toCheck/tests/_support/Helper/Db/Connection/AbstractFactory.php diff --git a/tests/_support/Helper/Db/Connection/MysqlFactory.php b/_toCheck/tests/_support/Helper/Db/Connection/MysqlFactory.php similarity index 100% rename from tests/_support/Helper/Db/Connection/MysqlFactory.php rename to _toCheck/tests/_support/Helper/Db/Connection/MysqlFactory.php diff --git a/tests/_support/Helper/Db/Connection/PostgresqlFactory.php b/_toCheck/tests/_support/Helper/Db/Connection/PostgresqlFactory.php similarity index 100% rename from tests/_support/Helper/Db/Connection/PostgresqlFactory.php rename to _toCheck/tests/_support/Helper/Db/Connection/PostgresqlFactory.php diff --git a/tests/_support/Helper/Db/Connection/SqliteFactory.php b/_toCheck/tests/_support/Helper/Db/Connection/SqliteFactory.php similarity index 100% rename from tests/_support/Helper/Db/Connection/SqliteFactory.php rename to _toCheck/tests/_support/Helper/Db/Connection/SqliteFactory.php diff --git a/tests/_support/Helper/Db/Connection/SqliteTranslationsFactory.php b/_toCheck/tests/_support/Helper/Db/Connection/SqliteTranslationsFactory.php similarity index 100% rename from tests/_support/Helper/Db/Connection/SqliteTranslationsFactory.php rename to _toCheck/tests/_support/Helper/Db/Connection/SqliteTranslationsFactory.php diff --git a/tests/_support/Helper/Dialect/MysqlTrait.php b/_toCheck/tests/_support/Helper/Dialect/MysqlTrait.php similarity index 100% rename from tests/_support/Helper/Dialect/MysqlTrait.php rename to _toCheck/tests/_support/Helper/Dialect/MysqlTrait.php diff --git a/tests/_support/Helper/Dialect/PostgresqlTrait.php b/_toCheck/tests/_support/Helper/Dialect/PostgresqlTrait.php similarity index 100% rename from tests/_support/Helper/Dialect/PostgresqlTrait.php rename to _toCheck/tests/_support/Helper/Dialect/PostgresqlTrait.php diff --git a/tests/_support/Helper/Dialect/SqliteTrait.php b/_toCheck/tests/_support/Helper/Dialect/SqliteTrait.php similarity index 100% rename from tests/_support/Helper/Dialect/SqliteTrait.php rename to _toCheck/tests/_support/Helper/Dialect/SqliteTrait.php diff --git a/tests/_support/Helper/DialectTrait.php b/_toCheck/tests/_support/Helper/DialectTrait.php similarity index 100% rename from tests/_support/Helper/DialectTrait.php rename to _toCheck/tests/_support/Helper/DialectTrait.php diff --git a/tests/_support/Helper/Http/PhpStream.php b/_toCheck/tests/_support/Helper/Http/PhpStream.php similarity index 100% rename from tests/_support/Helper/Http/PhpStream.php rename to _toCheck/tests/_support/Helper/Http/PhpStream.php diff --git a/tests/_support/Helper/Integration.php b/_toCheck/tests/_support/Helper/Integration.php similarity index 100% rename from tests/_support/Helper/Integration.php rename to _toCheck/tests/_support/Helper/Integration.php diff --git a/tests/_support/Helper/ModelTrait.php b/_toCheck/tests/_support/Helper/ModelTrait.php similarity index 100% rename from tests/_support/Helper/ModelTrait.php rename to _toCheck/tests/_support/Helper/ModelTrait.php diff --git a/tests/_support/Helper/Mvc/RouterTrait.php b/_toCheck/tests/_support/Helper/Mvc/RouterTrait.php similarity index 100% rename from tests/_support/Helper/Mvc/RouterTrait.php rename to _toCheck/tests/_support/Helper/Mvc/RouterTrait.php diff --git a/tests/_support/Helper/ResultsetHelperTrait.php b/_toCheck/tests/_support/Helper/ResultsetHelperTrait.php similarity index 100% rename from tests/_support/Helper/ResultsetHelperTrait.php rename to _toCheck/tests/_support/Helper/ResultsetHelperTrait.php diff --git a/tests/_support/Helper/Unit.php b/_toCheck/tests/_support/Helper/Unit.php similarity index 100% rename from tests/_support/Helper/Unit.php rename to _toCheck/tests/_support/Helper/Unit.php diff --git a/tests/_support/Helper/Unit5x.php b/_toCheck/tests/_support/Helper/Unit5x.php similarity index 100% rename from tests/_support/Helper/Unit5x.php rename to _toCheck/tests/_support/Helper/Unit5x.php diff --git a/tests/_support/Helper/ViewTrait.php b/_toCheck/tests/_support/Helper/ViewTrait.php similarity index 100% rename from tests/_support/Helper/ViewTrait.php rename to _toCheck/tests/_support/Helper/ViewTrait.php diff --git a/tests/_support/IntegrationTester.php b/_toCheck/tests/_support/IntegrationTester.php similarity index 100% rename from tests/_support/IntegrationTester.php rename to _toCheck/tests/_support/IntegrationTester.php diff --git a/tests/_support/Module/Cache/Backend/File.php b/_toCheck/tests/_support/Module/Cache/Backend/File.php similarity index 100% rename from tests/_support/Module/Cache/Backend/File.php rename to _toCheck/tests/_support/Module/Cache/Backend/File.php diff --git a/tests/_support/Module/Libmemcached.php b/_toCheck/tests/_support/Module/Libmemcached.php similarity index 100% rename from tests/_support/Module/Libmemcached.php rename to _toCheck/tests/_support/Module/Libmemcached.php diff --git a/tests/_support/Module/UnitTest.php b/_toCheck/tests/_support/Module/UnitTest.php similarity index 100% rename from tests/_support/Module/UnitTest.php rename to _toCheck/tests/_support/Module/UnitTest.php diff --git a/tests/_support/Module/View/AfterRenderListener.php b/_toCheck/tests/_support/Module/View/AfterRenderListener.php similarity index 100% rename from tests/_support/Module/View/AfterRenderListener.php rename to _toCheck/tests/_support/Module/View/AfterRenderListener.php diff --git a/tests/_support/Module/View/Engine/Mustache.php b/_toCheck/tests/_support/Module/View/Engine/Mustache.php similarity index 100% rename from tests/_support/Module/View/Engine/Mustache.php rename to _toCheck/tests/_support/Module/View/Engine/Mustache.php diff --git a/tests/_support/Module/View/Engine/Twig.php b/_toCheck/tests/_support/Module/View/Engine/Twig.php similarity index 100% rename from tests/_support/Module/View/Engine/Twig.php rename to _toCheck/tests/_support/Module/View/Engine/Twig.php diff --git a/tests/_support/Unit5xTester.php b/_toCheck/tests/_support/Unit5xTester.php similarity index 100% rename from tests/_support/Unit5xTester.php rename to _toCheck/tests/_support/Unit5xTester.php diff --git a/tests/_support/UnitTester.php b/_toCheck/tests/_support/UnitTester.php similarity index 100% rename from tests/_support/UnitTester.php rename to _toCheck/tests/_support/UnitTester.php diff --git a/tests/_support/_generated/.gitignore b/_toCheck/tests/_support/_generated/.gitignore similarity index 100% rename from tests/_support/_generated/.gitignore rename to _toCheck/tests/_support/_generated/.gitignore diff --git a/tests/integration.suite.yml b/_toCheck/tests/integration.suite.yml similarity index 100% rename from tests/integration.suite.yml rename to _toCheck/tests/integration.suite.yml diff --git a/tests/integration/Assets/ManagerCest.php b/_toCheck/tests/integration/Assets/ManagerCest.php similarity index 100% rename from tests/integration/Assets/ManagerCest.php rename to _toCheck/tests/integration/Assets/ManagerCest.php diff --git a/tests/integration/Forms/FormCest.php b/_toCheck/tests/integration/Forms/FormCest.php similarity index 100% rename from tests/integration/Forms/FormCest.php rename to _toCheck/tests/integration/Forms/FormCest.php diff --git a/tests/integration/Mvc/ApplicationCest.php b/_toCheck/tests/integration/Mvc/ApplicationCest.php similarity index 100% rename from tests/integration/Mvc/ApplicationCest.php rename to _toCheck/tests/integration/Mvc/ApplicationCest.php diff --git a/tests/integration/Mvc/Collection/BehaviorCest.php b/_toCheck/tests/integration/Mvc/Collection/BehaviorCest.php similarity index 100% rename from tests/integration/Mvc/Collection/BehaviorCest.php rename to _toCheck/tests/integration/Mvc/Collection/BehaviorCest.php diff --git a/tests/integration/Mvc/ControllersCest.php b/_toCheck/tests/integration/Mvc/ControllersCest.php similarity index 100% rename from tests/integration/Mvc/ControllersCest.php rename to _toCheck/tests/integration/Mvc/ControllersCest.php diff --git a/tests/integration/Mvc/Dispatcher/ForwardCest.php b/_toCheck/tests/integration/Mvc/Dispatcher/ForwardCest.php similarity index 100% rename from tests/integration/Mvc/Dispatcher/ForwardCest.php rename to _toCheck/tests/integration/Mvc/Dispatcher/ForwardCest.php diff --git a/tests/integration/Mvc/Model/BinderCest.php b/_toCheck/tests/integration/Mvc/Model/BinderCest.php similarity index 100% rename from tests/integration/Mvc/Model/BinderCest.php rename to _toCheck/tests/integration/Mvc/Model/BinderCest.php diff --git a/tests/integration/Mvc/Model/Criteria/FromInputCest.php b/_toCheck/tests/integration/Mvc/Model/Criteria/FromInputCest.php similarity index 100% rename from tests/integration/Mvc/Model/Criteria/FromInputCest.php rename to _toCheck/tests/integration/Mvc/Model/Criteria/FromInputCest.php diff --git a/tests/integration/Mvc/Model/CriteriaCest.php b/_toCheck/tests/integration/Mvc/Model/CriteriaCest.php similarity index 100% rename from tests/integration/Mvc/Model/CriteriaCest.php rename to _toCheck/tests/integration/Mvc/Model/CriteriaCest.php diff --git a/tests/integration/Mvc/Model/Query/BuilderCest.php b/_toCheck/tests/integration/Mvc/Model/Query/BuilderCest.php similarity index 100% rename from tests/integration/Mvc/Model/Query/BuilderCest.php rename to _toCheck/tests/integration/Mvc/Model/Query/BuilderCest.php diff --git a/tests/integration/Mvc/View/Engine/Volt/CompilerCest.php b/_toCheck/tests/integration/Mvc/View/Engine/Volt/CompilerCest.php similarity index 100% rename from tests/integration/Mvc/View/Engine/Volt/CompilerCest.php rename to _toCheck/tests/integration/Mvc/View/Engine/Volt/CompilerCest.php diff --git a/tests/integration/Mvc/View/Engine/Volt/CompilerFilesCest.php b/_toCheck/tests/integration/Mvc/View/Engine/Volt/CompilerFilesCest.php similarity index 100% rename from tests/integration/Mvc/View/Engine/Volt/CompilerFilesCest.php rename to _toCheck/tests/integration/Mvc/View/Engine/Volt/CompilerFilesCest.php diff --git a/tests/integration/Mvc/View/Engine/VoltCest.php b/_toCheck/tests/integration/Mvc/View/Engine/VoltCest.php similarity index 100% rename from tests/integration/Mvc/View/Engine/VoltCest.php rename to _toCheck/tests/integration/Mvc/View/Engine/VoltCest.php diff --git a/tests/integration/Mvc/View/SimpleCest.php b/_toCheck/tests/integration/Mvc/View/SimpleCest.php similarity index 100% rename from tests/integration/Mvc/View/SimpleCest.php rename to _toCheck/tests/integration/Mvc/View/SimpleCest.php diff --git a/tests/integration/Mvc/ViewCest.php b/_toCheck/tests/integration/Mvc/ViewCest.php similarity index 100% rename from tests/integration/Mvc/ViewCest.php rename to _toCheck/tests/integration/Mvc/ViewCest.php diff --git a/tests/integration/ValidationCest.php b/_toCheck/tests/integration/ValidationCest.php similarity index 100% rename from tests/integration/ValidationCest.php rename to _toCheck/tests/integration/ValidationCest.php diff --git a/tests/integration/_bootstrap.php b/_toCheck/tests/integration/_bootstrap.php similarity index 100% rename from tests/integration/_bootstrap.php rename to _toCheck/tests/integration/_bootstrap.php diff --git a/tests/shim.php b/_toCheck/tests/shim.php similarity index 100% rename from tests/shim.php rename to _toCheck/tests/shim.php diff --git a/tests/syntax/bootstrap.inc b/_toCheck/tests/syntax/bootstrap.inc similarity index 100% rename from tests/syntax/bootstrap.inc rename to _toCheck/tests/syntax/bootstrap.inc diff --git a/tests/syntax/tests/volt/statements/switchcase/001.phpt b/_toCheck/tests/syntax/tests/volt/statements/switchcase/001.phpt similarity index 100% rename from tests/syntax/tests/volt/statements/switchcase/001.phpt rename to _toCheck/tests/syntax/tests/volt/statements/switchcase/001.phpt diff --git a/tests/syntax/tests/volt/statements/switchcase/002.phpt b/_toCheck/tests/syntax/tests/volt/statements/switchcase/002.phpt similarity index 100% rename from tests/syntax/tests/volt/statements/switchcase/002.phpt rename to _toCheck/tests/syntax/tests/volt/statements/switchcase/002.phpt diff --git a/tests/syntax/tests/volt/statements/switchcase/003.phpt b/_toCheck/tests/syntax/tests/volt/statements/switchcase/003.phpt similarity index 100% rename from tests/syntax/tests/volt/statements/switchcase/003.phpt rename to _toCheck/tests/syntax/tests/volt/statements/switchcase/003.phpt diff --git a/tests/syntax/tests/volt/statements/switchcase/004.phpt b/_toCheck/tests/syntax/tests/volt/statements/switchcase/004.phpt similarity index 100% rename from tests/syntax/tests/volt/statements/switchcase/004.phpt rename to _toCheck/tests/syntax/tests/volt/statements/switchcase/004.phpt diff --git a/tests/syntax/tests/volt/statements/switchcase/005.phpt b/_toCheck/tests/syntax/tests/volt/statements/switchcase/005.phpt similarity index 100% rename from tests/syntax/tests/volt/statements/switchcase/005.phpt rename to _toCheck/tests/syntax/tests/volt/statements/switchcase/005.phpt diff --git a/tests/syntax/tests/volt/statements/switchcase/006.phpt b/_toCheck/tests/syntax/tests/volt/statements/switchcase/006.phpt similarity index 100% rename from tests/syntax/tests/volt/statements/switchcase/006.phpt rename to _toCheck/tests/syntax/tests/volt/statements/switchcase/006.phpt diff --git a/tests/syntax/tests/volt/statements/switchcase/007.phpt b/_toCheck/tests/syntax/tests/volt/statements/switchcase/007.phpt similarity index 100% rename from tests/syntax/tests/volt/statements/switchcase/007.phpt rename to _toCheck/tests/syntax/tests/volt/statements/switchcase/007.phpt diff --git a/tests/syntax/tests/volt/statements/switchcase/008.phpt b/_toCheck/tests/syntax/tests/volt/statements/switchcase/008.phpt similarity index 100% rename from tests/syntax/tests/volt/statements/switchcase/008.phpt rename to _toCheck/tests/syntax/tests/volt/statements/switchcase/008.phpt diff --git a/tests/syntax/tests/volt/statements/switchcase/009.phpt b/_toCheck/tests/syntax/tests/volt/statements/switchcase/009.phpt similarity index 100% rename from tests/syntax/tests/volt/statements/switchcase/009.phpt rename to _toCheck/tests/syntax/tests/volt/statements/switchcase/009.phpt diff --git a/tests/syntax/tests/volt/statements/switchcase/010.phpt b/_toCheck/tests/syntax/tests/volt/statements/switchcase/010.phpt similarity index 100% rename from tests/syntax/tests/volt/statements/switchcase/010.phpt rename to _toCheck/tests/syntax/tests/volt/statements/switchcase/010.phpt diff --git a/tests/unit.suite.yml b/_toCheck/tests/unit.suite.yml similarity index 100% rename from tests/unit.suite.yml rename to _toCheck/tests/unit.suite.yml diff --git a/tests/unit/Acl/Adapter/MemoryTest.php b/_toCheck/tests/unit/Acl/Adapter/MemoryTest.php similarity index 100% rename from tests/unit/Acl/Adapter/MemoryTest.php rename to _toCheck/tests/unit/Acl/Adapter/MemoryTest.php diff --git a/tests/unit/Acl/ResourceTest.php b/_toCheck/tests/unit/Acl/ResourceTest.php similarity index 100% rename from tests/unit/Acl/ResourceTest.php rename to _toCheck/tests/unit/Acl/ResourceTest.php diff --git a/tests/unit/Acl/RoleTest.php b/_toCheck/tests/unit/Acl/RoleTest.php similarity index 100% rename from tests/unit/Acl/RoleTest.php rename to _toCheck/tests/unit/Acl/RoleTest.php diff --git a/tests/unit/Annotations/Adapter/ApcTest.php b/_toCheck/tests/unit/Annotations/Adapter/ApcTest.php similarity index 100% rename from tests/unit/Annotations/Adapter/ApcTest.php rename to _toCheck/tests/unit/Annotations/Adapter/ApcTest.php diff --git a/tests/unit/Annotations/Adapter/ApcuTest.php b/_toCheck/tests/unit/Annotations/Adapter/ApcuTest.php similarity index 100% rename from tests/unit/Annotations/Adapter/ApcuTest.php rename to _toCheck/tests/unit/Annotations/Adapter/ApcuTest.php diff --git a/tests/unit/Annotations/Adapter/FilesTest.php b/_toCheck/tests/unit/Annotations/Adapter/FilesTest.php similarity index 100% rename from tests/unit/Annotations/Adapter/FilesTest.php rename to _toCheck/tests/unit/Annotations/Adapter/FilesTest.php diff --git a/tests/unit/Annotations/Adapter/MemoryTest.php b/_toCheck/tests/unit/Annotations/Adapter/MemoryTest.php similarity index 100% rename from tests/unit/Annotations/Adapter/MemoryTest.php rename to _toCheck/tests/unit/Annotations/Adapter/MemoryTest.php diff --git a/tests/unit/Annotations/FactoryTest.php b/_toCheck/tests/unit/Annotations/FactoryTest.php similarity index 100% rename from tests/unit/Annotations/FactoryTest.php rename to _toCheck/tests/unit/Annotations/FactoryTest.php diff --git a/tests/unit/Annotations/ReaderTest.php b/_toCheck/tests/unit/Annotations/ReaderTest.php similarity index 100% rename from tests/unit/Annotations/ReaderTest.php rename to _toCheck/tests/unit/Annotations/ReaderTest.php diff --git a/tests/unit/Annotations/ReflectionTest.php b/_toCheck/tests/unit/Annotations/ReflectionTest.php similarity index 100% rename from tests/unit/Annotations/ReflectionTest.php rename to _toCheck/tests/unit/Annotations/ReflectionTest.php diff --git a/tests/unit/Assets/CollectionTest.php b/_toCheck/tests/unit/Assets/CollectionTest.php similarity index 100% rename from tests/unit/Assets/CollectionTest.php rename to _toCheck/tests/unit/Assets/CollectionTest.php diff --git a/tests/unit/Assets/Filters/CssMinTest.php b/_toCheck/tests/unit/Assets/Filters/CssMinTest.php similarity index 100% rename from tests/unit/Assets/Filters/CssMinTest.php rename to _toCheck/tests/unit/Assets/Filters/CssMinTest.php diff --git a/tests/unit/Assets/Filters/JsminTest.php b/_toCheck/tests/unit/Assets/Filters/JsminTest.php similarity index 100% rename from tests/unit/Assets/Filters/JsminTest.php rename to _toCheck/tests/unit/Assets/Filters/JsminTest.php diff --git a/tests/unit/Assets/Filters/NoneTest.php b/_toCheck/tests/unit/Assets/Filters/NoneTest.php similarity index 100% rename from tests/unit/Assets/Filters/NoneTest.php rename to _toCheck/tests/unit/Assets/Filters/NoneTest.php diff --git a/tests/unit/Assets/Helper/TrimFilter.php b/_toCheck/tests/unit/Assets/Helper/TrimFilter.php similarity index 100% rename from tests/unit/Assets/Helper/TrimFilter.php rename to _toCheck/tests/unit/Assets/Helper/TrimFilter.php diff --git a/tests/unit/Assets/Helper/UppercaseFilter.php b/_toCheck/tests/unit/Assets/Helper/UppercaseFilter.php similarity index 100% rename from tests/unit/Assets/Helper/UppercaseFilter.php rename to _toCheck/tests/unit/Assets/Helper/UppercaseFilter.php diff --git a/tests/unit/Assets/InlineTest.php b/_toCheck/tests/unit/Assets/InlineTest.php similarity index 100% rename from tests/unit/Assets/InlineTest.php rename to _toCheck/tests/unit/Assets/InlineTest.php diff --git a/tests/unit/Assets/ManagerTest.php b/_toCheck/tests/unit/Assets/ManagerTest.php similarity index 100% rename from tests/unit/Assets/ManagerTest.php rename to _toCheck/tests/unit/Assets/ManagerTest.php diff --git a/tests/unit/Assets/Resource/CssTest.php b/_toCheck/tests/unit/Assets/Resource/CssTest.php similarity index 100% rename from tests/unit/Assets/Resource/CssTest.php rename to _toCheck/tests/unit/Assets/Resource/CssTest.php diff --git a/tests/unit/Assets/Resource/JsTest.php b/_toCheck/tests/unit/Assets/Resource/JsTest.php similarity index 100% rename from tests/unit/Assets/Resource/JsTest.php rename to _toCheck/tests/unit/Assets/Resource/JsTest.php diff --git a/tests/unit/Assets/ResourceTest.php b/_toCheck/tests/unit/Assets/ResourceTest.php similarity index 100% rename from tests/unit/Assets/ResourceTest.php rename to _toCheck/tests/unit/Assets/ResourceTest.php diff --git a/tests/unit/Cache/Backend/ApcCest.php b/_toCheck/tests/unit/Cache/Backend/ApcCest.php similarity index 100% rename from tests/unit/Cache/Backend/ApcCest.php rename to _toCheck/tests/unit/Cache/Backend/ApcCest.php diff --git a/tests/unit/Cache/Backend/ApcuCest.php b/_toCheck/tests/unit/Cache/Backend/ApcuCest.php similarity index 100% rename from tests/unit/Cache/Backend/ApcuCest.php rename to _toCheck/tests/unit/Cache/Backend/ApcuCest.php diff --git a/tests/unit/Cache/Backend/FactoryTest.php b/_toCheck/tests/unit/Cache/Backend/FactoryTest.php similarity index 100% rename from tests/unit/Cache/Backend/FactoryTest.php rename to _toCheck/tests/unit/Cache/Backend/FactoryTest.php diff --git a/tests/unit/Cache/Backend/FileCest.php b/_toCheck/tests/unit/Cache/Backend/FileCest.php similarity index 100% rename from tests/unit/Cache/Backend/FileCest.php rename to _toCheck/tests/unit/Cache/Backend/FileCest.php diff --git a/tests/unit/Cache/Backend/LibmemcachedCest.php b/_toCheck/tests/unit/Cache/Backend/LibmemcachedCest.php similarity index 100% rename from tests/unit/Cache/Backend/LibmemcachedCest.php rename to _toCheck/tests/unit/Cache/Backend/LibmemcachedCest.php diff --git a/tests/unit/Cache/Backend/MemoryCest.php b/_toCheck/tests/unit/Cache/Backend/MemoryCest.php similarity index 100% rename from tests/unit/Cache/Backend/MemoryCest.php rename to _toCheck/tests/unit/Cache/Backend/MemoryCest.php diff --git a/tests/unit/Cache/Backend/RedisCest.php b/_toCheck/tests/unit/Cache/Backend/RedisCest.php similarity index 100% rename from tests/unit/Cache/Backend/RedisCest.php rename to _toCheck/tests/unit/Cache/Backend/RedisCest.php diff --git a/tests/unit/Cache/Frontend/FactoryTest.php b/_toCheck/tests/unit/Cache/Frontend/FactoryTest.php similarity index 100% rename from tests/unit/Cache/Frontend/FactoryTest.php rename to _toCheck/tests/unit/Cache/Frontend/FactoryTest.php diff --git a/tests/unit/Cli/ConsoleTest.php b/_toCheck/tests/unit/Cli/ConsoleTest.php similarity index 100% rename from tests/unit/Cli/ConsoleTest.php rename to _toCheck/tests/unit/Cli/ConsoleTest.php diff --git a/tests/unit/Cli/DispatcherTest.php b/_toCheck/tests/unit/Cli/DispatcherTest.php similarity index 100% rename from tests/unit/Cli/DispatcherTest.php rename to _toCheck/tests/unit/Cli/DispatcherTest.php diff --git a/tests/unit/Cli/RouterTest.php b/_toCheck/tests/unit/Cli/RouterTest.php similarity index 100% rename from tests/unit/Cli/RouterTest.php rename to _toCheck/tests/unit/Cli/RouterTest.php diff --git a/tests/unit/Cli/TaskTest.php b/_toCheck/tests/unit/Cli/TaskTest.php similarity index 100% rename from tests/unit/Cli/TaskTest.php rename to _toCheck/tests/unit/Cli/TaskTest.php diff --git a/tests/unit/Config/Adapter/GroupedTest.php b/_toCheck/tests/unit/Config/Adapter/GroupedTest.php similarity index 100% rename from tests/unit/Config/Adapter/GroupedTest.php rename to _toCheck/tests/unit/Config/Adapter/GroupedTest.php diff --git a/tests/unit/Config/Adapter/IniTest.php b/_toCheck/tests/unit/Config/Adapter/IniTest.php similarity index 100% rename from tests/unit/Config/Adapter/IniTest.php rename to _toCheck/tests/unit/Config/Adapter/IniTest.php diff --git a/tests/unit/Config/Adapter/JsonTest.php b/_toCheck/tests/unit/Config/Adapter/JsonTest.php similarity index 100% rename from tests/unit/Config/Adapter/JsonTest.php rename to _toCheck/tests/unit/Config/Adapter/JsonTest.php diff --git a/tests/unit/Config/Adapter/PhpTest.php b/_toCheck/tests/unit/Config/Adapter/PhpTest.php similarity index 100% rename from tests/unit/Config/Adapter/PhpTest.php rename to _toCheck/tests/unit/Config/Adapter/PhpTest.php diff --git a/tests/unit/Config/Adapter/YamlTest.php b/_toCheck/tests/unit/Config/Adapter/YamlTest.php similarity index 100% rename from tests/unit/Config/Adapter/YamlTest.php rename to _toCheck/tests/unit/Config/Adapter/YamlTest.php diff --git a/tests/unit/Config/FactoryTest.php b/_toCheck/tests/unit/Config/FactoryTest.php similarity index 100% rename from tests/unit/Config/FactoryTest.php rename to _toCheck/tests/unit/Config/FactoryTest.php diff --git a/tests/unit/Config/Helper/ConfigBase.php b/_toCheck/tests/unit/Config/Helper/ConfigBase.php similarity index 100% rename from tests/unit/Config/Helper/ConfigBase.php rename to _toCheck/tests/unit/Config/Helper/ConfigBase.php diff --git a/tests/unit/ConfigTest.php b/_toCheck/tests/unit/ConfigTest.php similarity index 100% rename from tests/unit/ConfigTest.php rename to _toCheck/tests/unit/ConfigTest.php diff --git a/tests/unit/CryptTest.php b/_toCheck/tests/unit/CryptTest.php similarity index 100% rename from tests/unit/CryptTest.php rename to _toCheck/tests/unit/CryptTest.php diff --git a/tests/unit/Db/Adapter/Pdo/FactoryTest.php b/_toCheck/tests/unit/Db/Adapter/Pdo/FactoryTest.php similarity index 100% rename from tests/unit/Db/Adapter/Pdo/FactoryTest.php rename to _toCheck/tests/unit/Db/Adapter/Pdo/FactoryTest.php diff --git a/tests/unit/Db/Adapter/Pdo/MysqlTest.php b/_toCheck/tests/unit/Db/Adapter/Pdo/MysqlTest.php similarity index 100% rename from tests/unit/Db/Adapter/Pdo/MysqlTest.php rename to _toCheck/tests/unit/Db/Adapter/Pdo/MysqlTest.php diff --git a/tests/unit/Db/Adapter/Pdo/PostgresqlTest.php b/_toCheck/tests/unit/Db/Adapter/Pdo/PostgresqlTest.php similarity index 100% rename from tests/unit/Db/Adapter/Pdo/PostgresqlTest.php rename to _toCheck/tests/unit/Db/Adapter/Pdo/PostgresqlTest.php diff --git a/tests/unit/Db/Column/PostgresqlTest.php b/_toCheck/tests/unit/Db/Column/PostgresqlTest.php similarity index 100% rename from tests/unit/Db/Column/PostgresqlTest.php rename to _toCheck/tests/unit/Db/Column/PostgresqlTest.php diff --git a/tests/unit/Db/ColumnTest.php b/_toCheck/tests/unit/Db/ColumnTest.php similarity index 100% rename from tests/unit/Db/ColumnTest.php rename to _toCheck/tests/unit/Db/ColumnTest.php diff --git a/tests/unit/Db/Dialect/MysqlTest.php b/_toCheck/tests/unit/Db/Dialect/MysqlTest.php similarity index 100% rename from tests/unit/Db/Dialect/MysqlTest.php rename to _toCheck/tests/unit/Db/Dialect/MysqlTest.php diff --git a/tests/unit/Db/Dialect/PostgresqlTest.php b/_toCheck/tests/unit/Db/Dialect/PostgresqlTest.php similarity index 100% rename from tests/unit/Db/Dialect/PostgresqlTest.php rename to _toCheck/tests/unit/Db/Dialect/PostgresqlTest.php diff --git a/tests/unit/Db/Dialect/SqliteTest.php b/_toCheck/tests/unit/Db/Dialect/SqliteTest.php similarity index 100% rename from tests/unit/Db/Dialect/SqliteTest.php rename to _toCheck/tests/unit/Db/Dialect/SqliteTest.php diff --git a/tests/unit/Db/IndexTest.php b/_toCheck/tests/unit/Db/IndexTest.php similarity index 100% rename from tests/unit/Db/IndexTest.php rename to _toCheck/tests/unit/Db/IndexTest.php diff --git a/tests/unit/Db/ReferenceTest.php b/_toCheck/tests/unit/Db/ReferenceTest.php similarity index 100% rename from tests/unit/Db/ReferenceTest.php rename to _toCheck/tests/unit/Db/ReferenceTest.php diff --git a/tests/unit/Debug/DumpTest.php b/_toCheck/tests/unit/Debug/DumpTest.php similarity index 100% rename from tests/unit/Debug/DumpTest.php rename to _toCheck/tests/unit/Debug/DumpTest.php diff --git a/tests/unit/DebugTest.php b/_toCheck/tests/unit/DebugTest.php similarity index 100% rename from tests/unit/DebugTest.php rename to _toCheck/tests/unit/DebugTest.php diff --git a/tests/unit/Di/FactoryDefaultTest.php b/_toCheck/tests/unit/Di/FactoryDefaultTest.php similarity index 100% rename from tests/unit/Di/FactoryDefaultTest.php rename to _toCheck/tests/unit/Di/FactoryDefaultTest.php diff --git a/tests/unit/Di/ServiceTest.php b/_toCheck/tests/unit/Di/ServiceTest.php similarity index 100% rename from tests/unit/Di/ServiceTest.php rename to _toCheck/tests/unit/Di/ServiceTest.php diff --git a/tests/unit/DiTest.php b/_toCheck/tests/unit/DiTest.php similarity index 100% rename from tests/unit/DiTest.php rename to _toCheck/tests/unit/DiTest.php diff --git a/tests/unit/EscaperTest.php b/_toCheck/tests/unit/EscaperTest.php similarity index 100% rename from tests/unit/EscaperTest.php rename to _toCheck/tests/unit/EscaperTest.php diff --git a/tests/unit/Events/ManagerTest.php b/_toCheck/tests/unit/Events/ManagerTest.php similarity index 100% rename from tests/unit/Events/ManagerTest.php rename to _toCheck/tests/unit/Events/ManagerTest.php diff --git a/tests/unit/Factory/Helper/FactoryBase.php b/_toCheck/tests/unit/Factory/Helper/FactoryBase.php similarity index 100% rename from tests/unit/Factory/Helper/FactoryBase.php rename to _toCheck/tests/unit/Factory/Helper/FactoryBase.php diff --git a/tests/unit/Filter/FilterAlphanumTest.php b/_toCheck/tests/unit/Filter/FilterAlphanumTest.php similarity index 100% rename from tests/unit/Filter/FilterAlphanumTest.php rename to _toCheck/tests/unit/Filter/FilterAlphanumTest.php diff --git a/tests/unit/Filter/FilterCustomTest.php b/_toCheck/tests/unit/Filter/FilterCustomTest.php similarity index 100% rename from tests/unit/Filter/FilterCustomTest.php rename to _toCheck/tests/unit/Filter/FilterCustomTest.php diff --git a/tests/unit/Filter/FilterEmailTest.php b/_toCheck/tests/unit/Filter/FilterEmailTest.php similarity index 100% rename from tests/unit/Filter/FilterEmailTest.php rename to _toCheck/tests/unit/Filter/FilterEmailTest.php diff --git a/tests/unit/Filter/FilterFloatTest.php b/_toCheck/tests/unit/Filter/FilterFloatTest.php similarity index 100% rename from tests/unit/Filter/FilterFloatTest.php rename to _toCheck/tests/unit/Filter/FilterFloatTest.php diff --git a/tests/unit/Filter/FilterIntegerTest.php b/_toCheck/tests/unit/Filter/FilterIntegerTest.php similarity index 100% rename from tests/unit/Filter/FilterIntegerTest.php rename to _toCheck/tests/unit/Filter/FilterIntegerTest.php diff --git a/tests/unit/Filter/FilterMultipleTest.php b/_toCheck/tests/unit/Filter/FilterMultipleTest.php similarity index 100% rename from tests/unit/Filter/FilterMultipleTest.php rename to _toCheck/tests/unit/Filter/FilterMultipleTest.php diff --git a/tests/unit/Filter/FilterSpecialCharsTest.php b/_toCheck/tests/unit/Filter/FilterSpecialCharsTest.php similarity index 100% rename from tests/unit/Filter/FilterSpecialCharsTest.php rename to _toCheck/tests/unit/Filter/FilterSpecialCharsTest.php diff --git a/tests/unit/Filter/FilterStringTest.php b/_toCheck/tests/unit/Filter/FilterStringTest.php similarity index 100% rename from tests/unit/Filter/FilterStringTest.php rename to _toCheck/tests/unit/Filter/FilterStringTest.php diff --git a/tests/unit/Filter/FilterStriptagsTest.php b/_toCheck/tests/unit/Filter/FilterStriptagsTest.php similarity index 100% rename from tests/unit/Filter/FilterStriptagsTest.php rename to _toCheck/tests/unit/Filter/FilterStriptagsTest.php diff --git a/tests/unit/Filter/FilterTrimTest.php b/_toCheck/tests/unit/Filter/FilterTrimTest.php similarity index 100% rename from tests/unit/Filter/FilterTrimTest.php rename to _toCheck/tests/unit/Filter/FilterTrimTest.php diff --git a/tests/unit/Filter/FilterUpperLowerTest.php b/_toCheck/tests/unit/Filter/FilterUpperLowerTest.php similarity index 100% rename from tests/unit/Filter/FilterUpperLowerTest.php rename to _toCheck/tests/unit/Filter/FilterUpperLowerTest.php diff --git a/tests/unit/Filter/FilterUrlTest.php b/_toCheck/tests/unit/Filter/FilterUrlTest.php similarity index 100% rename from tests/unit/Filter/FilterUrlTest.php rename to _toCheck/tests/unit/Filter/FilterUrlTest.php diff --git a/tests/unit/Filter/Helper/FilterBase.php b/_toCheck/tests/unit/Filter/Helper/FilterBase.php similarity index 100% rename from tests/unit/Filter/Helper/FilterBase.php rename to _toCheck/tests/unit/Filter/Helper/FilterBase.php diff --git a/tests/unit/Filter/Helper/IPv4.php b/_toCheck/tests/unit/Filter/Helper/IPv4.php similarity index 100% rename from tests/unit/Filter/Helper/IPv4.php rename to _toCheck/tests/unit/Filter/Helper/IPv4.php diff --git a/tests/unit/Flash/Direct/FlashDirectCustomCSSTest.php b/_toCheck/tests/unit/Flash/Direct/FlashDirectCustomCSSTest.php similarity index 100% rename from tests/unit/Flash/Direct/FlashDirectCustomCSSTest.php rename to _toCheck/tests/unit/Flash/Direct/FlashDirectCustomCSSTest.php diff --git a/tests/unit/Flash/Direct/FlashDirectEmptyCSSTest.php b/_toCheck/tests/unit/Flash/Direct/FlashDirectEmptyCSSTest.php similarity index 100% rename from tests/unit/Flash/Direct/FlashDirectEmptyCSSTest.php rename to _toCheck/tests/unit/Flash/Direct/FlashDirectEmptyCSSTest.php diff --git a/tests/unit/Flash/Direct/Helper/FlashBase.php b/_toCheck/tests/unit/Flash/Direct/Helper/FlashBase.php similarity index 100% rename from tests/unit/Flash/Direct/Helper/FlashBase.php rename to _toCheck/tests/unit/Flash/Direct/Helper/FlashBase.php diff --git a/tests/unit/Flash/SessionTest.php b/_toCheck/tests/unit/Flash/SessionTest.php similarity index 100% rename from tests/unit/Flash/SessionTest.php rename to _toCheck/tests/unit/Flash/SessionTest.php diff --git a/tests/unit/Forms/Element/TextTest.php b/_toCheck/tests/unit/Forms/Element/TextTest.php similarity index 100% rename from tests/unit/Forms/Element/TextTest.php rename to _toCheck/tests/unit/Forms/Element/TextTest.php diff --git a/tests/unit/Forms/FormTest.php b/_toCheck/tests/unit/Forms/FormTest.php similarity index 100% rename from tests/unit/Forms/FormTest.php rename to _toCheck/tests/unit/Forms/FormTest.php diff --git a/tests/unit/Http/CookieTest.php b/_toCheck/tests/unit/Http/CookieTest.php similarity index 100% rename from tests/unit/Http/CookieTest.php rename to _toCheck/tests/unit/Http/CookieTest.php diff --git a/tests/unit/Http/Helper/HttpBase.php b/_toCheck/tests/unit/Http/Helper/HttpBase.php similarity index 100% rename from tests/unit/Http/Helper/HttpBase.php rename to _toCheck/tests/unit/Http/Helper/HttpBase.php diff --git a/tests/unit/Http/Request/AuthHeaderTest.php b/_toCheck/tests/unit/Http/Request/AuthHeaderTest.php similarity index 100% rename from tests/unit/Http/Request/AuthHeaderTest.php rename to _toCheck/tests/unit/Http/Request/AuthHeaderTest.php diff --git a/tests/unit/Http/Request/FileTest.php b/_toCheck/tests/unit/Http/Request/FileTest.php similarity index 100% rename from tests/unit/Http/Request/FileTest.php rename to _toCheck/tests/unit/Http/Request/FileTest.php diff --git a/tests/unit/Http/RequestTest.php b/_toCheck/tests/unit/Http/RequestTest.php similarity index 100% rename from tests/unit/Http/RequestTest.php rename to _toCheck/tests/unit/Http/RequestTest.php diff --git a/tests/unit/Http/Response/CookiesTest.php b/_toCheck/tests/unit/Http/Response/CookiesTest.php similarity index 100% rename from tests/unit/Http/Response/CookiesTest.php rename to _toCheck/tests/unit/Http/Response/CookiesTest.php diff --git a/tests/unit/Http/Response/HeadersTest.php b/_toCheck/tests/unit/Http/Response/HeadersTest.php similarity index 100% rename from tests/unit/Http/Response/HeadersTest.php rename to _toCheck/tests/unit/Http/Response/HeadersTest.php diff --git a/tests/unit/Http/ResponseTest.php b/_toCheck/tests/unit/Http/ResponseTest.php similarity index 100% rename from tests/unit/Http/ResponseTest.php rename to _toCheck/tests/unit/Http/ResponseTest.php diff --git a/tests/unit/Image/Adapter/GdTest.php b/_toCheck/tests/unit/Image/Adapter/GdTest.php similarity index 100% rename from tests/unit/Image/Adapter/GdTest.php rename to _toCheck/tests/unit/Image/Adapter/GdTest.php diff --git a/tests/unit/Image/Adapter/ImagickTest.php b/_toCheck/tests/unit/Image/Adapter/ImagickTest.php similarity index 100% rename from tests/unit/Image/Adapter/ImagickTest.php rename to _toCheck/tests/unit/Image/Adapter/ImagickTest.php diff --git a/tests/unit/Image/FactoryTest.php b/_toCheck/tests/unit/Image/FactoryTest.php similarity index 100% rename from tests/unit/Image/FactoryTest.php rename to _toCheck/tests/unit/Image/FactoryTest.php diff --git a/tests/unit/LoaderTest.php b/_toCheck/tests/unit/LoaderTest.php similarity index 100% rename from tests/unit/LoaderTest.php rename to _toCheck/tests/unit/LoaderTest.php diff --git a/tests/unit/Logger/Adapter/FileTest.php b/_toCheck/tests/unit/Logger/Adapter/FileTest.php similarity index 100% rename from tests/unit/Logger/Adapter/FileTest.php rename to _toCheck/tests/unit/Logger/Adapter/FileTest.php diff --git a/tests/unit/Logger/Adapter/FirephpTest.php b/_toCheck/tests/unit/Logger/Adapter/FirephpTest.php similarity index 100% rename from tests/unit/Logger/Adapter/FirephpTest.php rename to _toCheck/tests/unit/Logger/Adapter/FirephpTest.php diff --git a/tests/unit/Logger/FactoryTest.php b/_toCheck/tests/unit/Logger/FactoryTest.php similarity index 100% rename from tests/unit/Logger/FactoryTest.php rename to _toCheck/tests/unit/Logger/FactoryTest.php diff --git a/tests/unit/Logger/Formatter/LineTest.php b/_toCheck/tests/unit/Logger/Formatter/LineTest.php similarity index 100% rename from tests/unit/Logger/Formatter/LineTest.php rename to _toCheck/tests/unit/Logger/Formatter/LineTest.php diff --git a/tests/unit/Messages/MessagesTest.php b/_toCheck/tests/unit/Messages/MessagesTest.php similarity index 100% rename from tests/unit/Messages/MessagesTest.php rename to _toCheck/tests/unit/Messages/MessagesTest.php diff --git a/tests/unit/Mvc/Dispatcher/DispatcherAfterDispatchLoopTest.php b/_toCheck/tests/unit/Mvc/Dispatcher/DispatcherAfterDispatchLoopTest.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/DispatcherAfterDispatchLoopTest.php rename to _toCheck/tests/unit/Mvc/Dispatcher/DispatcherAfterDispatchLoopTest.php diff --git a/tests/unit/Mvc/Dispatcher/DispatcherAfterDispatchTest.php b/_toCheck/tests/unit/Mvc/Dispatcher/DispatcherAfterDispatchTest.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/DispatcherAfterDispatchTest.php rename to _toCheck/tests/unit/Mvc/Dispatcher/DispatcherAfterDispatchTest.php diff --git a/tests/unit/Mvc/Dispatcher/DispatcherAfterExecuteRouteMethodTest.php b/_toCheck/tests/unit/Mvc/Dispatcher/DispatcherAfterExecuteRouteMethodTest.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/DispatcherAfterExecuteRouteMethodTest.php rename to _toCheck/tests/unit/Mvc/Dispatcher/DispatcherAfterExecuteRouteMethodTest.php diff --git a/tests/unit/Mvc/Dispatcher/DispatcherAfterExecuteRouteTest.php b/_toCheck/tests/unit/Mvc/Dispatcher/DispatcherAfterExecuteRouteTest.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/DispatcherAfterExecuteRouteTest.php rename to _toCheck/tests/unit/Mvc/Dispatcher/DispatcherAfterExecuteRouteTest.php diff --git a/tests/unit/Mvc/Dispatcher/DispatcherAfterInitializeTest.php b/_toCheck/tests/unit/Mvc/Dispatcher/DispatcherAfterInitializeTest.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/DispatcherAfterInitializeTest.php rename to _toCheck/tests/unit/Mvc/Dispatcher/DispatcherAfterInitializeTest.php diff --git a/tests/unit/Mvc/Dispatcher/DispatcherBeforeDispatchLoopTest.php b/_toCheck/tests/unit/Mvc/Dispatcher/DispatcherBeforeDispatchLoopTest.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/DispatcherBeforeDispatchLoopTest.php rename to _toCheck/tests/unit/Mvc/Dispatcher/DispatcherBeforeDispatchLoopTest.php diff --git a/tests/unit/Mvc/Dispatcher/DispatcherBeforeDispatchTest.php b/_toCheck/tests/unit/Mvc/Dispatcher/DispatcherBeforeDispatchTest.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/DispatcherBeforeDispatchTest.php rename to _toCheck/tests/unit/Mvc/Dispatcher/DispatcherBeforeDispatchTest.php diff --git a/tests/unit/Mvc/Dispatcher/DispatcherBeforeExecuteRouteMethodTest.php b/_toCheck/tests/unit/Mvc/Dispatcher/DispatcherBeforeExecuteRouteMethodTest.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/DispatcherBeforeExecuteRouteMethodTest.php rename to _toCheck/tests/unit/Mvc/Dispatcher/DispatcherBeforeExecuteRouteMethodTest.php diff --git a/tests/unit/Mvc/Dispatcher/DispatcherBeforeExecuteRouteTest.php b/_toCheck/tests/unit/Mvc/Dispatcher/DispatcherBeforeExecuteRouteTest.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/DispatcherBeforeExecuteRouteTest.php rename to _toCheck/tests/unit/Mvc/Dispatcher/DispatcherBeforeExecuteRouteTest.php diff --git a/tests/unit/Mvc/Dispatcher/DispatcherInitalizeMethodTest.php b/_toCheck/tests/unit/Mvc/Dispatcher/DispatcherInitalizeMethodTest.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/DispatcherInitalizeMethodTest.php rename to _toCheck/tests/unit/Mvc/Dispatcher/DispatcherInitalizeMethodTest.php diff --git a/tests/unit/Mvc/Dispatcher/DispatcherTest.php b/_toCheck/tests/unit/Mvc/Dispatcher/DispatcherTest.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/DispatcherTest.php rename to _toCheck/tests/unit/Mvc/Dispatcher/DispatcherTest.php diff --git a/tests/unit/Mvc/Dispatcher/Helper/BaseDispatcher.php b/_toCheck/tests/unit/Mvc/Dispatcher/Helper/BaseDispatcher.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/Helper/BaseDispatcher.php rename to _toCheck/tests/unit/Mvc/Dispatcher/Helper/BaseDispatcher.php diff --git a/tests/unit/Mvc/Dispatcher/Helper/DispatcherListener.php b/_toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherListener.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/Helper/DispatcherListener.php rename to _toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherListener.php diff --git a/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestAfterExecuteRouteExceptionController.php b/_toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestAfterExecuteRouteExceptionController.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/Helper/DispatcherTestAfterExecuteRouteExceptionController.php rename to _toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestAfterExecuteRouteExceptionController.php diff --git a/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestAfterExecuteRouteForwardController.php b/_toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestAfterExecuteRouteForwardController.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/Helper/DispatcherTestAfterExecuteRouteForwardController.php rename to _toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestAfterExecuteRouteForwardController.php diff --git a/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestAfterExecuteRouteReturnFalseController.php b/_toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestAfterExecuteRouteReturnFalseController.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/Helper/DispatcherTestAfterExecuteRouteReturnFalseController.php rename to _toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestAfterExecuteRouteReturnFalseController.php diff --git a/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestBeforeExecuteRouteExceptionController.php b/_toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestBeforeExecuteRouteExceptionController.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/Helper/DispatcherTestBeforeExecuteRouteExceptionController.php rename to _toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestBeforeExecuteRouteExceptionController.php diff --git a/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestBeforeExecuteRouteForwardController.php b/_toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestBeforeExecuteRouteForwardController.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/Helper/DispatcherTestBeforeExecuteRouteForwardController.php rename to _toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestBeforeExecuteRouteForwardController.php diff --git a/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestBeforeExecuteRouteReturnFalseController.php b/_toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestBeforeExecuteRouteReturnFalseController.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/Helper/DispatcherTestBeforeExecuteRouteReturnFalseController.php rename to _toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestBeforeExecuteRouteReturnFalseController.php diff --git a/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestDefaultController.php b/_toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestDefaultController.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/Helper/DispatcherTestDefaultController.php rename to _toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestDefaultController.php diff --git a/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestDefaultNoNamespaceController.php b/_toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestDefaultNoNamespaceController.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/Helper/DispatcherTestDefaultNoNamespaceController.php rename to _toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestDefaultNoNamespaceController.php diff --git a/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestDefaultSimpleController.php b/_toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestDefaultSimpleController.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/Helper/DispatcherTestDefaultSimpleController.php rename to _toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestDefaultSimpleController.php diff --git a/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestDefaultTwoController.php b/_toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestDefaultTwoController.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/Helper/DispatcherTestDefaultTwoController.php rename to _toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestDefaultTwoController.php diff --git a/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestInitializeExceptionController.php b/_toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestInitializeExceptionController.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/Helper/DispatcherTestInitializeExceptionController.php rename to _toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestInitializeExceptionController.php diff --git a/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestInitializeForwardController.php b/_toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestInitializeForwardController.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/Helper/DispatcherTestInitializeForwardController.php rename to _toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestInitializeForwardController.php diff --git a/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestInitializeReturnFalseController.php b/_toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestInitializeReturnFalseController.php similarity index 100% rename from tests/unit/Mvc/Dispatcher/Helper/DispatcherTestInitializeReturnFalseController.php rename to _toCheck/tests/unit/Mvc/Dispatcher/Helper/DispatcherTestInitializeReturnFalseController.php diff --git a/tests/unit/Mvc/MicroTest.php b/_toCheck/tests/unit/Mvc/MicroTest.php similarity index 100% rename from tests/unit/Mvc/MicroTest.php rename to _toCheck/tests/unit/Mvc/MicroTest.php diff --git a/tests/unit/Mvc/Model/CriteriaTest.php b/_toCheck/tests/unit/Mvc/Model/CriteriaTest.php similarity index 100% rename from tests/unit/Mvc/Model/CriteriaTest.php rename to _toCheck/tests/unit/Mvc/Model/CriteriaTest.php diff --git a/tests/unit/Mvc/Model/DynamicOperationsTest.php b/_toCheck/tests/unit/Mvc/Model/DynamicOperationsTest.php similarity index 100% rename from tests/unit/Mvc/Model/DynamicOperationsTest.php rename to _toCheck/tests/unit/Mvc/Model/DynamicOperationsTest.php diff --git a/tests/unit/Mvc/Model/Helpers/Validation.php b/_toCheck/tests/unit/Mvc/Model/Helpers/Validation.php similarity index 100% rename from tests/unit/Mvc/Model/Helpers/Validation.php rename to _toCheck/tests/unit/Mvc/Model/Helpers/Validation.php diff --git a/tests/unit/Mvc/Model/Manager/RelationsTest.php b/_toCheck/tests/unit/Mvc/Model/Manager/RelationsTest.php similarity index 100% rename from tests/unit/Mvc/Model/Manager/RelationsTest.php rename to _toCheck/tests/unit/Mvc/Model/Manager/RelationsTest.php diff --git a/tests/unit/Mvc/Model/ManagerTest.php b/_toCheck/tests/unit/Mvc/Model/ManagerTest.php similarity index 100% rename from tests/unit/Mvc/Model/ManagerTest.php rename to _toCheck/tests/unit/Mvc/Model/ManagerTest.php diff --git a/tests/unit/Mvc/Model/MetaData/ApcCest.php b/_toCheck/tests/unit/Mvc/Model/MetaData/ApcCest.php similarity index 100% rename from tests/unit/Mvc/Model/MetaData/ApcCest.php rename to _toCheck/tests/unit/Mvc/Model/MetaData/ApcCest.php diff --git a/tests/unit/Mvc/Model/MetaData/ApcuCest.php b/_toCheck/tests/unit/Mvc/Model/MetaData/ApcuCest.php similarity index 100% rename from tests/unit/Mvc/Model/MetaData/ApcuCest.php rename to _toCheck/tests/unit/Mvc/Model/MetaData/ApcuCest.php diff --git a/tests/unit/Mvc/Model/MetaData/FilesCest.php b/_toCheck/tests/unit/Mvc/Model/MetaData/FilesCest.php similarity index 100% rename from tests/unit/Mvc/Model/MetaData/FilesCest.php rename to _toCheck/tests/unit/Mvc/Model/MetaData/FilesCest.php diff --git a/tests/unit/Mvc/Model/MetaData/LibmemcachedCest.php b/_toCheck/tests/unit/Mvc/Model/MetaData/LibmemcachedCest.php similarity index 100% rename from tests/unit/Mvc/Model/MetaData/LibmemcachedCest.php rename to _toCheck/tests/unit/Mvc/Model/MetaData/LibmemcachedCest.php diff --git a/tests/unit/Mvc/Model/MetaData/MemoryCest.php b/_toCheck/tests/unit/Mvc/Model/MetaData/MemoryCest.php similarity index 100% rename from tests/unit/Mvc/Model/MetaData/MemoryCest.php rename to _toCheck/tests/unit/Mvc/Model/MetaData/MemoryCest.php diff --git a/tests/unit/Mvc/Model/MetaData/RedisCest.php b/_toCheck/tests/unit/Mvc/Model/MetaData/RedisCest.php similarity index 100% rename from tests/unit/Mvc/Model/MetaData/RedisCest.php rename to _toCheck/tests/unit/Mvc/Model/MetaData/RedisCest.php diff --git a/tests/unit/Mvc/Model/MetaData/ResetCest.php b/_toCheck/tests/unit/Mvc/Model/MetaData/ResetCest.php similarity index 100% rename from tests/unit/Mvc/Model/MetaData/ResetCest.php rename to _toCheck/tests/unit/Mvc/Model/MetaData/ResetCest.php diff --git a/tests/unit/Mvc/Model/MetaData/SessionCest.php b/_toCheck/tests/unit/Mvc/Model/MetaData/SessionCest.php similarity index 100% rename from tests/unit/Mvc/Model/MetaData/SessionCest.php rename to _toCheck/tests/unit/Mvc/Model/MetaData/SessionCest.php diff --git a/tests/unit/Mvc/Model/MetaData/Strategy/AnnotationsTest.php b/_toCheck/tests/unit/Mvc/Model/MetaData/Strategy/AnnotationsTest.php similarity index 100% rename from tests/unit/Mvc/Model/MetaData/Strategy/AnnotationsTest.php rename to _toCheck/tests/unit/Mvc/Model/MetaData/Strategy/AnnotationsTest.php diff --git a/tests/unit/Mvc/Model/Query/BuilderOrderTest.php b/_toCheck/tests/unit/Mvc/Model/Query/BuilderOrderTest.php similarity index 100% rename from tests/unit/Mvc/Model/Query/BuilderOrderTest.php rename to _toCheck/tests/unit/Mvc/Model/Query/BuilderOrderTest.php diff --git a/tests/unit/Mvc/Model/Query/BuilderTest.php b/_toCheck/tests/unit/Mvc/Model/Query/BuilderTest.php similarity index 100% rename from tests/unit/Mvc/Model/Query/BuilderTest.php rename to _toCheck/tests/unit/Mvc/Model/Query/BuilderTest.php diff --git a/tests/unit/Mvc/Model/QueryTest.php b/_toCheck/tests/unit/Mvc/Model/QueryTest.php similarity index 100% rename from tests/unit/Mvc/Model/QueryTest.php rename to _toCheck/tests/unit/Mvc/Model/QueryTest.php diff --git a/tests/unit/Mvc/Model/RelationsTest.php b/_toCheck/tests/unit/Mvc/Model/RelationsTest.php similarity index 100% rename from tests/unit/Mvc/Model/RelationsTest.php rename to _toCheck/tests/unit/Mvc/Model/RelationsTest.php diff --git a/tests/unit/Mvc/Model/Resultset/ComplexTest.php b/_toCheck/tests/unit/Mvc/Model/Resultset/ComplexTest.php similarity index 100% rename from tests/unit/Mvc/Model/Resultset/ComplexTest.php rename to _toCheck/tests/unit/Mvc/Model/Resultset/ComplexTest.php diff --git a/tests/unit/Mvc/Model/Resultset/SimpleTest.php b/_toCheck/tests/unit/Mvc/Model/Resultset/SimpleTest.php similarity index 100% rename from tests/unit/Mvc/Model/Resultset/SimpleTest.php rename to _toCheck/tests/unit/Mvc/Model/Resultset/SimpleTest.php diff --git a/tests/unit/Mvc/Model/ResultsetClassTest.php b/_toCheck/tests/unit/Mvc/Model/ResultsetClassTest.php similarity index 100% rename from tests/unit/Mvc/Model/ResultsetClassTest.php rename to _toCheck/tests/unit/Mvc/Model/ResultsetClassTest.php diff --git a/tests/unit/Mvc/Model/SnapshotTest.php b/_toCheck/tests/unit/Mvc/Model/SnapshotTest.php similarity index 100% rename from tests/unit/Mvc/Model/SnapshotTest.php rename to _toCheck/tests/unit/Mvc/Model/SnapshotTest.php diff --git a/tests/unit/Mvc/Model/Transaction/ManagerTest.php b/_toCheck/tests/unit/Mvc/Model/Transaction/ManagerTest.php similarity index 100% rename from tests/unit/Mvc/Model/Transaction/ManagerTest.php rename to _toCheck/tests/unit/Mvc/Model/Transaction/ManagerTest.php diff --git a/tests/unit/Mvc/Model/ValidationCest.php b/_toCheck/tests/unit/Mvc/Model/ValidationCest.php similarity index 100% rename from tests/unit/Mvc/Model/ValidationCest.php rename to _toCheck/tests/unit/Mvc/Model/ValidationCest.php diff --git a/tests/unit/Mvc/ModelCest.php b/_toCheck/tests/unit/Mvc/ModelCest.php similarity index 100% rename from tests/unit/Mvc/ModelCest.php rename to _toCheck/tests/unit/Mvc/ModelCest.php diff --git a/tests/unit/Mvc/ModelTest.php b/_toCheck/tests/unit/Mvc/ModelTest.php similarity index 100% rename from tests/unit/Mvc/ModelTest.php rename to _toCheck/tests/unit/Mvc/ModelTest.php diff --git a/tests/unit/Mvc/Router/AnnotationsTest.php b/_toCheck/tests/unit/Mvc/Router/AnnotationsTest.php similarity index 100% rename from tests/unit/Mvc/Router/AnnotationsTest.php rename to _toCheck/tests/unit/Mvc/Router/AnnotationsTest.php diff --git a/tests/unit/Mvc/Router/GroupTest.php b/_toCheck/tests/unit/Mvc/Router/GroupTest.php similarity index 100% rename from tests/unit/Mvc/Router/GroupTest.php rename to _toCheck/tests/unit/Mvc/Router/GroupTest.php diff --git a/tests/unit/Mvc/RouterTest.php b/_toCheck/tests/unit/Mvc/RouterTest.php similarity index 100% rename from tests/unit/Mvc/RouterTest.php rename to _toCheck/tests/unit/Mvc/RouterTest.php diff --git a/tests/unit/Mvc/UrlTest.php b/_toCheck/tests/unit/Mvc/UrlTest.php similarity index 100% rename from tests/unit/Mvc/UrlTest.php rename to _toCheck/tests/unit/Mvc/UrlTest.php diff --git a/tests/unit/Mvc/View/Engine/Volt/Compiler/Filters/DefaultTest.php b/_toCheck/tests/unit/Mvc/View/Engine/Volt/Compiler/Filters/DefaultTest.php similarity index 100% rename from tests/unit/Mvc/View/Engine/Volt/Compiler/Filters/DefaultTest.php rename to _toCheck/tests/unit/Mvc/View/Engine/Volt/Compiler/Filters/DefaultTest.php diff --git a/tests/unit/Mvc/View/Engine/Volt/Compiler/Statements/SwitchCaseTest.php b/_toCheck/tests/unit/Mvc/View/Engine/Volt/Compiler/Statements/SwitchCaseTest.php similarity index 100% rename from tests/unit/Mvc/View/Engine/Volt/Compiler/Statements/SwitchCaseTest.php rename to _toCheck/tests/unit/Mvc/View/Engine/Volt/Compiler/Statements/SwitchCaseTest.php diff --git a/tests/unit/Mvc/View/Engine/Volt/CompilerExceptionsTest.php b/_toCheck/tests/unit/Mvc/View/Engine/Volt/CompilerExceptionsTest.php similarity index 100% rename from tests/unit/Mvc/View/Engine/Volt/CompilerExceptionsTest.php rename to _toCheck/tests/unit/Mvc/View/Engine/Volt/CompilerExceptionsTest.php diff --git a/tests/unit/Mvc/View/Engine/Volt/CompilerFilesTest.php b/_toCheck/tests/unit/Mvc/View/Engine/Volt/CompilerFilesTest.php similarity index 100% rename from tests/unit/Mvc/View/Engine/Volt/CompilerFilesTest.php rename to _toCheck/tests/unit/Mvc/View/Engine/Volt/CompilerFilesTest.php diff --git a/tests/unit/Mvc/View/Engine/Volt/CompilerTest.php b/_toCheck/tests/unit/Mvc/View/Engine/Volt/CompilerTest.php similarity index 100% rename from tests/unit/Mvc/View/Engine/Volt/CompilerTest.php rename to _toCheck/tests/unit/Mvc/View/Engine/Volt/CompilerTest.php diff --git a/tests/unit/Mvc/View/Engine/Volt/CompilerTrait.php b/_toCheck/tests/unit/Mvc/View/Engine/Volt/CompilerTrait.php similarity index 100% rename from tests/unit/Mvc/View/Engine/Volt/CompilerTrait.php rename to _toCheck/tests/unit/Mvc/View/Engine/Volt/CompilerTrait.php diff --git a/tests/unit/Mvc/View/SimpleTest.php b/_toCheck/tests/unit/Mvc/View/SimpleTest.php similarity index 100% rename from tests/unit/Mvc/View/SimpleTest.php rename to _toCheck/tests/unit/Mvc/View/SimpleTest.php diff --git a/tests/unit/Mvc/ViewEnginesTest.php b/_toCheck/tests/unit/Mvc/ViewEnginesTest.php similarity index 100% rename from tests/unit/Mvc/ViewEnginesTest.php rename to _toCheck/tests/unit/Mvc/ViewEnginesTest.php diff --git a/tests/unit/Mvc/ViewTest.php b/_toCheck/tests/unit/Mvc/ViewTest.php similarity index 100% rename from tests/unit/Mvc/ViewTest.php rename to _toCheck/tests/unit/Mvc/ViewTest.php diff --git a/tests/unit/Paginator/Adapter/NativeArrayTest.php b/_toCheck/tests/unit/Paginator/Adapter/NativeArrayTest.php similarity index 100% rename from tests/unit/Paginator/Adapter/NativeArrayTest.php rename to _toCheck/tests/unit/Paginator/Adapter/NativeArrayTest.php diff --git a/tests/unit/Paginator/Adapter/QueryBuilderTest.php b/_toCheck/tests/unit/Paginator/Adapter/QueryBuilderTest.php similarity index 100% rename from tests/unit/Paginator/Adapter/QueryBuilderTest.php rename to _toCheck/tests/unit/Paginator/Adapter/QueryBuilderTest.php diff --git a/tests/unit/Paginator/FactoryTest.php b/_toCheck/tests/unit/Paginator/FactoryTest.php similarity index 100% rename from tests/unit/Paginator/FactoryTest.php rename to _toCheck/tests/unit/Paginator/FactoryTest.php diff --git a/tests/unit/Queue/Beanstalk/JobTest.php b/_toCheck/tests/unit/Queue/Beanstalk/JobTest.php similarity index 100% rename from tests/unit/Queue/Beanstalk/JobTest.php rename to _toCheck/tests/unit/Queue/Beanstalk/JobTest.php diff --git a/tests/unit/Queue/BeanstalkTest.php b/_toCheck/tests/unit/Queue/BeanstalkTest.php similarity index 100% rename from tests/unit/Queue/BeanstalkTest.php rename to _toCheck/tests/unit/Queue/BeanstalkTest.php diff --git a/tests/unit/Queue/Helper/BeanstalkBase.php b/_toCheck/tests/unit/Queue/Helper/BeanstalkBase.php similarity index 100% rename from tests/unit/Queue/Helper/BeanstalkBase.php rename to _toCheck/tests/unit/Queue/Helper/BeanstalkBase.php diff --git a/tests/unit/Security/RandomTest.php b/_toCheck/tests/unit/Security/RandomTest.php similarity index 100% rename from tests/unit/Security/RandomTest.php rename to _toCheck/tests/unit/Security/RandomTest.php diff --git a/tests/unit/SecurityTest.php b/_toCheck/tests/unit/SecurityTest.php similarity index 100% rename from tests/unit/SecurityTest.php rename to _toCheck/tests/unit/SecurityTest.php diff --git a/tests/unit/Session/Adapter/FilesTest.php b/_toCheck/tests/unit/Session/Adapter/FilesTest.php similarity index 100% rename from tests/unit/Session/Adapter/FilesTest.php rename to _toCheck/tests/unit/Session/Adapter/FilesTest.php diff --git a/tests/unit/Session/Adapter/LibmemcachedTest.php b/_toCheck/tests/unit/Session/Adapter/LibmemcachedTest.php similarity index 100% rename from tests/unit/Session/Adapter/LibmemcachedTest.php rename to _toCheck/tests/unit/Session/Adapter/LibmemcachedTest.php diff --git a/tests/unit/Session/Adapter/RedisTest.php b/_toCheck/tests/unit/Session/Adapter/RedisTest.php similarity index 100% rename from tests/unit/Session/Adapter/RedisTest.php rename to _toCheck/tests/unit/Session/Adapter/RedisTest.php diff --git a/tests/unit/Session/BagTest.php b/_toCheck/tests/unit/Session/BagTest.php similarity index 100% rename from tests/unit/Session/BagTest.php rename to _toCheck/tests/unit/Session/BagTest.php diff --git a/tests/unit/Session/FactoryTest.php b/_toCheck/tests/unit/Session/FactoryTest.php similarity index 100% rename from tests/unit/Session/FactoryTest.php rename to _toCheck/tests/unit/Session/FactoryTest.php diff --git a/tests/unit/Tag/TagCheckFieldTest.php b/_toCheck/tests/unit/Tag/TagCheckFieldTest.php similarity index 100% rename from tests/unit/Tag/TagCheckFieldTest.php rename to _toCheck/tests/unit/Tag/TagCheckFieldTest.php diff --git a/tests/unit/Tag/TagColorFieldTest.php b/_toCheck/tests/unit/Tag/TagColorFieldTest.php similarity index 100% rename from tests/unit/Tag/TagColorFieldTest.php rename to _toCheck/tests/unit/Tag/TagColorFieldTest.php diff --git a/tests/unit/Tag/TagDateFieldTest.php b/_toCheck/tests/unit/Tag/TagDateFieldTest.php similarity index 100% rename from tests/unit/Tag/TagDateFieldTest.php rename to _toCheck/tests/unit/Tag/TagDateFieldTest.php diff --git a/tests/unit/Tag/TagDateTimeFieldTest.php b/_toCheck/tests/unit/Tag/TagDateTimeFieldTest.php similarity index 100% rename from tests/unit/Tag/TagDateTimeFieldTest.php rename to _toCheck/tests/unit/Tag/TagDateTimeFieldTest.php diff --git a/tests/unit/Tag/TagDateTimeLocalFieldTest.php b/_toCheck/tests/unit/Tag/TagDateTimeLocalFieldTest.php similarity index 100% rename from tests/unit/Tag/TagDateTimeLocalFieldTest.php rename to _toCheck/tests/unit/Tag/TagDateTimeLocalFieldTest.php diff --git a/tests/unit/Tag/TagDoctypeTest.php b/_toCheck/tests/unit/Tag/TagDoctypeTest.php similarity index 100% rename from tests/unit/Tag/TagDoctypeTest.php rename to _toCheck/tests/unit/Tag/TagDoctypeTest.php diff --git a/tests/unit/Tag/TagEmailFieldTest.php b/_toCheck/tests/unit/Tag/TagEmailFieldTest.php similarity index 100% rename from tests/unit/Tag/TagEmailFieldTest.php rename to _toCheck/tests/unit/Tag/TagEmailFieldTest.php diff --git a/tests/unit/Tag/TagFileFieldTest.php b/_toCheck/tests/unit/Tag/TagFileFieldTest.php similarity index 100% rename from tests/unit/Tag/TagFileFieldTest.php rename to _toCheck/tests/unit/Tag/TagFileFieldTest.php diff --git a/tests/unit/Tag/TagFriendlyTitleTest.php b/_toCheck/tests/unit/Tag/TagFriendlyTitleTest.php similarity index 100% rename from tests/unit/Tag/TagFriendlyTitleTest.php rename to _toCheck/tests/unit/Tag/TagFriendlyTitleTest.php diff --git a/tests/unit/Tag/TagHiddenFieldTest.php b/_toCheck/tests/unit/Tag/TagHiddenFieldTest.php similarity index 100% rename from tests/unit/Tag/TagHiddenFieldTest.php rename to _toCheck/tests/unit/Tag/TagHiddenFieldTest.php diff --git a/tests/unit/Tag/TagImageInputTest.php b/_toCheck/tests/unit/Tag/TagImageInputTest.php similarity index 100% rename from tests/unit/Tag/TagImageInputTest.php rename to _toCheck/tests/unit/Tag/TagImageInputTest.php diff --git a/tests/unit/Tag/TagImageTest.php b/_toCheck/tests/unit/Tag/TagImageTest.php similarity index 100% rename from tests/unit/Tag/TagImageTest.php rename to _toCheck/tests/unit/Tag/TagImageTest.php diff --git a/tests/unit/Tag/TagJavascriptIncludeTest.php b/_toCheck/tests/unit/Tag/TagJavascriptIncludeTest.php similarity index 100% rename from tests/unit/Tag/TagJavascriptIncludeTest.php rename to _toCheck/tests/unit/Tag/TagJavascriptIncludeTest.php diff --git a/tests/unit/Tag/TagLinkToTest.php b/_toCheck/tests/unit/Tag/TagLinkToTest.php similarity index 100% rename from tests/unit/Tag/TagLinkToTest.php rename to _toCheck/tests/unit/Tag/TagLinkToTest.php diff --git a/tests/unit/Tag/TagMonthFieldTest.php b/_toCheck/tests/unit/Tag/TagMonthFieldTest.php similarity index 100% rename from tests/unit/Tag/TagMonthFieldTest.php rename to _toCheck/tests/unit/Tag/TagMonthFieldTest.php diff --git a/tests/unit/Tag/TagNumericFieldTest.php b/_toCheck/tests/unit/Tag/TagNumericFieldTest.php similarity index 100% rename from tests/unit/Tag/TagNumericFieldTest.php rename to _toCheck/tests/unit/Tag/TagNumericFieldTest.php diff --git a/tests/unit/Tag/TagPasswordFieldTest.php b/_toCheck/tests/unit/Tag/TagPasswordFieldTest.php similarity index 100% rename from tests/unit/Tag/TagPasswordFieldTest.php rename to _toCheck/tests/unit/Tag/TagPasswordFieldTest.php diff --git a/tests/unit/Tag/TagRadioFieldTest.php b/_toCheck/tests/unit/Tag/TagRadioFieldTest.php similarity index 100% rename from tests/unit/Tag/TagRadioFieldTest.php rename to _toCheck/tests/unit/Tag/TagRadioFieldTest.php diff --git a/tests/unit/Tag/TagRangeFieldTest.php b/_toCheck/tests/unit/Tag/TagRangeFieldTest.php similarity index 100% rename from tests/unit/Tag/TagRangeFieldTest.php rename to _toCheck/tests/unit/Tag/TagRangeFieldTest.php diff --git a/tests/unit/Tag/TagResetInputTest.php b/_toCheck/tests/unit/Tag/TagResetInputTest.php similarity index 100% rename from tests/unit/Tag/TagResetInputTest.php rename to _toCheck/tests/unit/Tag/TagResetInputTest.php diff --git a/tests/unit/Tag/TagSearchFieldTest.php b/_toCheck/tests/unit/Tag/TagSearchFieldTest.php similarity index 100% rename from tests/unit/Tag/TagSearchFieldTest.php rename to _toCheck/tests/unit/Tag/TagSearchFieldTest.php diff --git a/tests/unit/Tag/TagSelectStaticTest.php b/_toCheck/tests/unit/Tag/TagSelectStaticTest.php similarity index 100% rename from tests/unit/Tag/TagSelectStaticTest.php rename to _toCheck/tests/unit/Tag/TagSelectStaticTest.php diff --git a/tests/unit/Tag/TagSetDefaultTest.php b/_toCheck/tests/unit/Tag/TagSetDefaultTest.php similarity index 100% rename from tests/unit/Tag/TagSetDefaultTest.php rename to _toCheck/tests/unit/Tag/TagSetDefaultTest.php diff --git a/tests/unit/Tag/TagStylesheetlinkTest.php b/_toCheck/tests/unit/Tag/TagStylesheetlinkTest.php similarity index 100% rename from tests/unit/Tag/TagStylesheetlinkTest.php rename to _toCheck/tests/unit/Tag/TagStylesheetlinkTest.php diff --git a/tests/unit/Tag/TagSubmitButtonTest.php b/_toCheck/tests/unit/Tag/TagSubmitButtonTest.php similarity index 100% rename from tests/unit/Tag/TagSubmitButtonTest.php rename to _toCheck/tests/unit/Tag/TagSubmitButtonTest.php diff --git a/tests/unit/Tag/TagTagHtmlTest.php b/_toCheck/tests/unit/Tag/TagTagHtmlTest.php similarity index 100% rename from tests/unit/Tag/TagTagHtmlTest.php rename to _toCheck/tests/unit/Tag/TagTagHtmlTest.php diff --git a/tests/unit/Tag/TagTelFieldTest.php b/_toCheck/tests/unit/Tag/TagTelFieldTest.php similarity index 100% rename from tests/unit/Tag/TagTelFieldTest.php rename to _toCheck/tests/unit/Tag/TagTelFieldTest.php diff --git a/tests/unit/Tag/TagTextAreaTest.php b/_toCheck/tests/unit/Tag/TagTextAreaTest.php similarity index 100% rename from tests/unit/Tag/TagTextAreaTest.php rename to _toCheck/tests/unit/Tag/TagTextAreaTest.php diff --git a/tests/unit/Tag/TagTextFieldTest.php b/_toCheck/tests/unit/Tag/TagTextFieldTest.php similarity index 100% rename from tests/unit/Tag/TagTextFieldTest.php rename to _toCheck/tests/unit/Tag/TagTextFieldTest.php diff --git a/tests/unit/Tag/TagTimeFieldTest.php b/_toCheck/tests/unit/Tag/TagTimeFieldTest.php similarity index 100% rename from tests/unit/Tag/TagTimeFieldTest.php rename to _toCheck/tests/unit/Tag/TagTimeFieldTest.php diff --git a/tests/unit/Tag/TagTitleTest.php b/_toCheck/tests/unit/Tag/TagTitleTest.php similarity index 100% rename from tests/unit/Tag/TagTitleTest.php rename to _toCheck/tests/unit/Tag/TagTitleTest.php diff --git a/tests/unit/Tag/TagUrlFieldTest.php b/_toCheck/tests/unit/Tag/TagUrlFieldTest.php similarity index 100% rename from tests/unit/Tag/TagUrlFieldTest.php rename to _toCheck/tests/unit/Tag/TagUrlFieldTest.php diff --git a/tests/unit/Tag/TagWeekFieldTest.php b/_toCheck/tests/unit/Tag/TagWeekFieldTest.php similarity index 100% rename from tests/unit/Tag/TagWeekFieldTest.php rename to _toCheck/tests/unit/Tag/TagWeekFieldTest.php diff --git a/tests/unit/Text/TextCamelizeTest.php b/_toCheck/tests/unit/Text/TextCamelizeTest.php similarity index 100% rename from tests/unit/Text/TextCamelizeTest.php rename to _toCheck/tests/unit/Text/TextCamelizeTest.php diff --git a/tests/unit/Text/TextConcatTest.php b/_toCheck/tests/unit/Text/TextConcatTest.php similarity index 100% rename from tests/unit/Text/TextConcatTest.php rename to _toCheck/tests/unit/Text/TextConcatTest.php diff --git a/tests/unit/Text/TextDynamicTest.php b/_toCheck/tests/unit/Text/TextDynamicTest.php similarity index 100% rename from tests/unit/Text/TextDynamicTest.php rename to _toCheck/tests/unit/Text/TextDynamicTest.php diff --git a/tests/unit/Text/TextEndsWithTest.php b/_toCheck/tests/unit/Text/TextEndsWithTest.php similarity index 100% rename from tests/unit/Text/TextEndsWithTest.php rename to _toCheck/tests/unit/Text/TextEndsWithTest.php diff --git a/tests/unit/Text/TextHumanizeTest.php b/_toCheck/tests/unit/Text/TextHumanizeTest.php similarity index 100% rename from tests/unit/Text/TextHumanizeTest.php rename to _toCheck/tests/unit/Text/TextHumanizeTest.php diff --git a/tests/unit/Text/TextIncrementTest.php b/_toCheck/tests/unit/Text/TextIncrementTest.php similarity index 100% rename from tests/unit/Text/TextIncrementTest.php rename to _toCheck/tests/unit/Text/TextIncrementTest.php diff --git a/tests/unit/Text/TextRandomTest.php b/_toCheck/tests/unit/Text/TextRandomTest.php similarity index 100% rename from tests/unit/Text/TextRandomTest.php rename to _toCheck/tests/unit/Text/TextRandomTest.php diff --git a/tests/unit/Text/TextReduceSlashesTest.php b/_toCheck/tests/unit/Text/TextReduceSlashesTest.php similarity index 100% rename from tests/unit/Text/TextReduceSlashesTest.php rename to _toCheck/tests/unit/Text/TextReduceSlashesTest.php diff --git a/tests/unit/Text/TextStartsWithTest.php b/_toCheck/tests/unit/Text/TextStartsWithTest.php similarity index 100% rename from tests/unit/Text/TextStartsWithTest.php rename to _toCheck/tests/unit/Text/TextStartsWithTest.php diff --git a/tests/unit/Text/TextUncamelizeTest.php b/_toCheck/tests/unit/Text/TextUncamelizeTest.php similarity index 100% rename from tests/unit/Text/TextUncamelizeTest.php rename to _toCheck/tests/unit/Text/TextUncamelizeTest.php diff --git a/tests/unit/Text/TextUnderscoreTest.php b/_toCheck/tests/unit/Text/TextUnderscoreTest.php similarity index 100% rename from tests/unit/Text/TextUnderscoreTest.php rename to _toCheck/tests/unit/Text/TextUnderscoreTest.php diff --git a/tests/unit/Text/TextUpperLowerTest.php b/_toCheck/tests/unit/Text/TextUpperLowerTest.php similarity index 100% rename from tests/unit/Text/TextUpperLowerTest.php rename to _toCheck/tests/unit/Text/TextUpperLowerTest.php diff --git a/tests/unit/Translate/Adapter/CsvTest.php b/_toCheck/tests/unit/Translate/Adapter/CsvTest.php similarity index 100% rename from tests/unit/Translate/Adapter/CsvTest.php rename to _toCheck/tests/unit/Translate/Adapter/CsvTest.php diff --git a/tests/unit/Translate/Adapter/GettextCest.php b/_toCheck/tests/unit/Translate/Adapter/GettextCest.php similarity index 100% rename from tests/unit/Translate/Adapter/GettextCest.php rename to _toCheck/tests/unit/Translate/Adapter/GettextCest.php diff --git a/tests/unit/Translate/Adapter/NativeArrayTest.php b/_toCheck/tests/unit/Translate/Adapter/NativeArrayTest.php similarity index 100% rename from tests/unit/Translate/Adapter/NativeArrayTest.php rename to _toCheck/tests/unit/Translate/Adapter/NativeArrayTest.php diff --git a/tests/unit/Translate/FactoryTest.php b/_toCheck/tests/unit/Translate/FactoryTest.php similarity index 100% rename from tests/unit/Translate/FactoryTest.php rename to _toCheck/tests/unit/Translate/FactoryTest.php diff --git a/tests/unit/Translate/Interpolator/AssociativeArrayTest.php b/_toCheck/tests/unit/Translate/Interpolator/AssociativeArrayTest.php similarity index 100% rename from tests/unit/Translate/Interpolator/AssociativeArrayTest.php rename to _toCheck/tests/unit/Translate/Interpolator/AssociativeArrayTest.php diff --git a/tests/unit/Translate/Interpolator/IndexedArrayTest.php b/_toCheck/tests/unit/Translate/Interpolator/IndexedArrayTest.php similarity index 100% rename from tests/unit/Translate/Interpolator/IndexedArrayTest.php rename to _toCheck/tests/unit/Translate/Interpolator/IndexedArrayTest.php diff --git a/tests/unit/Validation/Validator/AlnumTest.php b/_toCheck/tests/unit/Validation/Validator/AlnumTest.php similarity index 100% rename from tests/unit/Validation/Validator/AlnumTest.php rename to _toCheck/tests/unit/Validation/Validator/AlnumTest.php diff --git a/tests/unit/Validation/Validator/AlphaTest.php b/_toCheck/tests/unit/Validation/Validator/AlphaTest.php similarity index 100% rename from tests/unit/Validation/Validator/AlphaTest.php rename to _toCheck/tests/unit/Validation/Validator/AlphaTest.php diff --git a/tests/unit/Validation/Validator/BetweenTest.php b/_toCheck/tests/unit/Validation/Validator/BetweenTest.php similarity index 100% rename from tests/unit/Validation/Validator/BetweenTest.php rename to _toCheck/tests/unit/Validation/Validator/BetweenTest.php diff --git a/tests/unit/Validation/Validator/CallbackTest.php b/_toCheck/tests/unit/Validation/Validator/CallbackTest.php similarity index 100% rename from tests/unit/Validation/Validator/CallbackTest.php rename to _toCheck/tests/unit/Validation/Validator/CallbackTest.php diff --git a/tests/unit/Validation/Validator/ConfirmationTest.php b/_toCheck/tests/unit/Validation/Validator/ConfirmationTest.php similarity index 100% rename from tests/unit/Validation/Validator/ConfirmationTest.php rename to _toCheck/tests/unit/Validation/Validator/ConfirmationTest.php diff --git a/tests/unit/Validation/Validator/CreditCardTest.php b/_toCheck/tests/unit/Validation/Validator/CreditCardTest.php similarity index 100% rename from tests/unit/Validation/Validator/CreditCardTest.php rename to _toCheck/tests/unit/Validation/Validator/CreditCardTest.php diff --git a/tests/unit/Validation/Validator/DateTest.php b/_toCheck/tests/unit/Validation/Validator/DateTest.php similarity index 100% rename from tests/unit/Validation/Validator/DateTest.php rename to _toCheck/tests/unit/Validation/Validator/DateTest.php diff --git a/tests/unit/Validation/Validator/DigitTest.php b/_toCheck/tests/unit/Validation/Validator/DigitTest.php similarity index 100% rename from tests/unit/Validation/Validator/DigitTest.php rename to _toCheck/tests/unit/Validation/Validator/DigitTest.php diff --git a/tests/unit/Validation/Validator/EmailTest.php b/_toCheck/tests/unit/Validation/Validator/EmailTest.php similarity index 100% rename from tests/unit/Validation/Validator/EmailTest.php rename to _toCheck/tests/unit/Validation/Validator/EmailTest.php diff --git a/tests/unit/Validation/Validator/ExclusionInTest.php b/_toCheck/tests/unit/Validation/Validator/ExclusionInTest.php similarity index 100% rename from tests/unit/Validation/Validator/ExclusionInTest.php rename to _toCheck/tests/unit/Validation/Validator/ExclusionInTest.php diff --git a/tests/unit/Validation/Validator/IdenticalTest.php b/_toCheck/tests/unit/Validation/Validator/IdenticalTest.php similarity index 100% rename from tests/unit/Validation/Validator/IdenticalTest.php rename to _toCheck/tests/unit/Validation/Validator/IdenticalTest.php diff --git a/tests/unit/Validation/Validator/InclusionInTest.php b/_toCheck/tests/unit/Validation/Validator/InclusionInTest.php similarity index 100% rename from tests/unit/Validation/Validator/InclusionInTest.php rename to _toCheck/tests/unit/Validation/Validator/InclusionInTest.php diff --git a/tests/unit/Validation/Validator/NumericalityTest.php b/_toCheck/tests/unit/Validation/Validator/NumericalityTest.php similarity index 100% rename from tests/unit/Validation/Validator/NumericalityTest.php rename to _toCheck/tests/unit/Validation/Validator/NumericalityTest.php diff --git a/tests/unit/Validation/Validator/PresenceOfTest.php b/_toCheck/tests/unit/Validation/Validator/PresenceOfTest.php similarity index 100% rename from tests/unit/Validation/Validator/PresenceOfTest.php rename to _toCheck/tests/unit/Validation/Validator/PresenceOfTest.php diff --git a/tests/unit/Validation/Validator/RegexTest.php b/_toCheck/tests/unit/Validation/Validator/RegexTest.php similarity index 100% rename from tests/unit/Validation/Validator/RegexTest.php rename to _toCheck/tests/unit/Validation/Validator/RegexTest.php diff --git a/tests/unit/Validation/Validator/StringLengthTest.php b/_toCheck/tests/unit/Validation/Validator/StringLengthTest.php similarity index 100% rename from tests/unit/Validation/Validator/StringLengthTest.php rename to _toCheck/tests/unit/Validation/Validator/StringLengthTest.php diff --git a/tests/unit/Validation/Validator/UniquenessTest.php b/_toCheck/tests/unit/Validation/Validator/UniquenessTest.php similarity index 100% rename from tests/unit/Validation/Validator/UniquenessTest.php rename to _toCheck/tests/unit/Validation/Validator/UniquenessTest.php diff --git a/tests/unit/Validation/Validator/UrlTest.php b/_toCheck/tests/unit/Validation/Validator/UrlTest.php similarity index 100% rename from tests/unit/Validation/Validator/UrlTest.php rename to _toCheck/tests/unit/Validation/Validator/UrlTest.php diff --git a/tests/unit/ValidationTest.php b/_toCheck/tests/unit/ValidationTest.php similarity index 100% rename from tests/unit/ValidationTest.php rename to _toCheck/tests/unit/ValidationTest.php diff --git a/tests/unit/_bootstrap.php b/_toCheck/tests/unit/_bootstrap.php similarity index 100% rename from tests/unit/_bootstrap.php rename to _toCheck/tests/unit/_bootstrap.php diff --git a/unit-tests/.gitignore b/_toCheck/unit-tests/.gitignore similarity index 100% rename from unit-tests/.gitignore rename to _toCheck/unit-tests/.gitignore diff --git a/unit-tests/CacheTest.php b/_toCheck/unit-tests/CacheTest.php similarity index 100% rename from unit-tests/CacheTest.php rename to _toCheck/unit-tests/CacheTest.php diff --git a/unit-tests/DbBindTest.php b/_toCheck/unit-tests/DbBindTest.php similarity index 100% rename from unit-tests/DbBindTest.php rename to _toCheck/unit-tests/DbBindTest.php diff --git a/unit-tests/DbDescribeTest.php b/_toCheck/unit-tests/DbDescribeTest.php similarity index 100% rename from unit-tests/DbDescribeTest.php rename to _toCheck/unit-tests/DbDescribeTest.php diff --git a/unit-tests/DbProfilerTest.php b/_toCheck/unit-tests/DbProfilerTest.php similarity index 100% rename from unit-tests/DbProfilerTest.php rename to _toCheck/unit-tests/DbProfilerTest.php diff --git a/unit-tests/DbTest.php b/_toCheck/unit-tests/DbTest.php similarity index 100% rename from unit-tests/DbTest.php rename to _toCheck/unit-tests/DbTest.php diff --git a/unit-tests/FormsTest.php b/_toCheck/unit-tests/FormsTest.php similarity index 100% rename from unit-tests/FormsTest.php rename to _toCheck/unit-tests/FormsTest.php diff --git a/unit-tests/MicroMvcCollectionsTest.php b/_toCheck/unit-tests/MicroMvcCollectionsTest.php similarity index 100% rename from unit-tests/MicroMvcCollectionsTest.php rename to _toCheck/unit-tests/MicroMvcCollectionsTest.php diff --git a/unit-tests/ModelsCalculationsTest.php b/_toCheck/unit-tests/ModelsCalculationsTest.php similarity index 100% rename from unit-tests/ModelsCalculationsTest.php rename to _toCheck/unit-tests/ModelsCalculationsTest.php diff --git a/unit-tests/ModelsEventsTest.php b/_toCheck/unit-tests/ModelsEventsTest.php similarity index 100% rename from unit-tests/ModelsEventsTest.php rename to _toCheck/unit-tests/ModelsEventsTest.php diff --git a/unit-tests/ModelsForeignKeysTest.php b/_toCheck/unit-tests/ModelsForeignKeysTest.php similarity index 100% rename from unit-tests/ModelsForeignKeysTest.php rename to _toCheck/unit-tests/ModelsForeignKeysTest.php diff --git a/unit-tests/ModelsHydrationTest.php b/_toCheck/unit-tests/ModelsHydrationTest.php similarity index 100% rename from unit-tests/ModelsHydrationTest.php rename to _toCheck/unit-tests/ModelsHydrationTest.php diff --git a/unit-tests/ModelsMetadataStrategyTest.php b/_toCheck/unit-tests/ModelsMetadataStrategyTest.php similarity index 100% rename from unit-tests/ModelsMetadataStrategyTest.php rename to _toCheck/unit-tests/ModelsMetadataStrategyTest.php diff --git a/unit-tests/ModelsMetadataTest.php b/_toCheck/unit-tests/ModelsMetadataTest.php similarity index 100% rename from unit-tests/ModelsMetadataTest.php rename to _toCheck/unit-tests/ModelsMetadataTest.php diff --git a/unit-tests/ModelsQueryExecuteTest.php b/_toCheck/unit-tests/ModelsQueryExecuteTest.php similarity index 100% rename from unit-tests/ModelsQueryExecuteTest.php rename to _toCheck/unit-tests/ModelsQueryExecuteTest.php diff --git a/unit-tests/ModelsRelationsMagicTest.php b/_toCheck/unit-tests/ModelsRelationsMagicTest.php similarity index 100% rename from unit-tests/ModelsRelationsMagicTest.php rename to _toCheck/unit-tests/ModelsRelationsMagicTest.php diff --git a/unit-tests/ModelsRelationsTest.php b/_toCheck/unit-tests/ModelsRelationsTest.php similarity index 100% rename from unit-tests/ModelsRelationsTest.php rename to _toCheck/unit-tests/ModelsRelationsTest.php diff --git a/unit-tests/ModelsResultsetCacheStaticTest.php b/_toCheck/unit-tests/ModelsResultsetCacheStaticTest.php similarity index 100% rename from unit-tests/ModelsResultsetCacheStaticTest.php rename to _toCheck/unit-tests/ModelsResultsetCacheStaticTest.php diff --git a/unit-tests/ModelsResultsetCacheTest.php b/_toCheck/unit-tests/ModelsResultsetCacheTest.php similarity index 100% rename from unit-tests/ModelsResultsetCacheTest.php rename to _toCheck/unit-tests/ModelsResultsetCacheTest.php diff --git a/unit-tests/ModelsResultsetTest.php b/_toCheck/unit-tests/ModelsResultsetTest.php similarity index 100% rename from unit-tests/ModelsResultsetTest.php rename to _toCheck/unit-tests/ModelsResultsetTest.php diff --git a/unit-tests/ModelsTest.php b/_toCheck/unit-tests/ModelsTest.php similarity index 100% rename from unit-tests/ModelsTest.php rename to _toCheck/unit-tests/ModelsTest.php diff --git a/unit-tests/ModelsValidatorsTest.php b/_toCheck/unit-tests/ModelsValidatorsTest.php similarity index 100% rename from unit-tests/ModelsValidatorsTest.php rename to _toCheck/unit-tests/ModelsValidatorsTest.php diff --git a/unit-tests/PaginatorTest.php b/_toCheck/unit-tests/PaginatorTest.php similarity index 100% rename from unit-tests/PaginatorTest.php rename to _toCheck/unit-tests/PaginatorTest.php diff --git a/unit-tests/cache/.gitignore b/_toCheck/unit-tests/cache/.gitignore similarity index 100% rename from unit-tests/cache/.gitignore rename to _toCheck/unit-tests/cache/.gitignore diff --git a/unit-tests/config.db.php b/_toCheck/unit-tests/config.db.php similarity index 100% rename from unit-tests/config.db.php rename to _toCheck/unit-tests/config.db.php diff --git a/unit-tests/controllers/ControllerBase.php b/_toCheck/unit-tests/controllers/ControllerBase.php similarity index 100% rename from unit-tests/controllers/ControllerBase.php rename to _toCheck/unit-tests/controllers/ControllerBase.php diff --git a/unit-tests/controllers/FailureController.php b/_toCheck/unit-tests/controllers/FailureController.php similarity index 100% rename from unit-tests/controllers/FailureController.php rename to _toCheck/unit-tests/controllers/FailureController.php diff --git a/unit-tests/controllers/Test0Controller.php b/_toCheck/unit-tests/controllers/Test0Controller.php similarity index 100% rename from unit-tests/controllers/Test0Controller.php rename to _toCheck/unit-tests/controllers/Test0Controller.php diff --git a/unit-tests/controllers/Test1Controller.php b/_toCheck/unit-tests/controllers/Test1Controller.php similarity index 100% rename from unit-tests/controllers/Test1Controller.php rename to _toCheck/unit-tests/controllers/Test1Controller.php diff --git a/unit-tests/controllers/Test2Controller.php b/_toCheck/unit-tests/controllers/Test2Controller.php similarity index 100% rename from unit-tests/controllers/Test2Controller.php rename to _toCheck/unit-tests/controllers/Test2Controller.php diff --git a/unit-tests/controllers/Test3Controller.php b/_toCheck/unit-tests/controllers/Test3Controller.php similarity index 100% rename from unit-tests/controllers/Test3Controller.php rename to _toCheck/unit-tests/controllers/Test3Controller.php diff --git a/unit-tests/controllers/Test5Controller.php b/_toCheck/unit-tests/controllers/Test5Controller.php similarity index 100% rename from unit-tests/controllers/Test5Controller.php rename to _toCheck/unit-tests/controllers/Test5Controller.php diff --git a/unit-tests/controllers/Test6Controller.php b/_toCheck/unit-tests/controllers/Test6Controller.php similarity index 100% rename from unit-tests/controllers/Test6Controller.php rename to _toCheck/unit-tests/controllers/Test6Controller.php diff --git a/unit-tests/controllers/Test7Controller.php b/_toCheck/unit-tests/controllers/Test7Controller.php similarity index 100% rename from unit-tests/controllers/Test7Controller.php rename to _toCheck/unit-tests/controllers/Test7Controller.php diff --git a/unit-tests/controllers/Test8Controller.php b/_toCheck/unit-tests/controllers/Test8Controller.php similarity index 100% rename from unit-tests/controllers/Test8Controller.php rename to _toCheck/unit-tests/controllers/Test8Controller.php diff --git a/unit-tests/helpers/xcache.php b/_toCheck/unit-tests/helpers/xcache.php similarity index 100% rename from unit-tests/helpers/xcache.php rename to _toCheck/unit-tests/helpers/xcache.php diff --git a/unit-tests/models/Abonnes.php b/_toCheck/unit-tests/models/Abonnes.php similarity index 100% rename from unit-tests/models/Abonnes.php rename to _toCheck/unit-tests/models/Abonnes.php diff --git a/unit-tests/models/AlbumORama/Albums.php b/_toCheck/unit-tests/models/AlbumORama/Albums.php similarity index 100% rename from unit-tests/models/AlbumORama/Albums.php rename to _toCheck/unit-tests/models/AlbumORama/Albums.php diff --git a/unit-tests/models/AlbumORama/Artists.php b/_toCheck/unit-tests/models/AlbumORama/Artists.php similarity index 100% rename from unit-tests/models/AlbumORama/Artists.php rename to _toCheck/unit-tests/models/AlbumORama/Artists.php diff --git a/unit-tests/models/AlbumORama/Songs.php b/_toCheck/unit-tests/models/AlbumORama/Songs.php similarity index 100% rename from unit-tests/models/AlbumORama/Songs.php rename to _toCheck/unit-tests/models/AlbumORama/Songs.php diff --git a/unit-tests/models/Boutique/Robots.php b/_toCheck/unit-tests/models/Boutique/Robots.php similarity index 100% rename from unit-tests/models/Boutique/Robots.php rename to _toCheck/unit-tests/models/Boutique/Robots.php diff --git a/unit-tests/models/Boutique/Robotters.php b/_toCheck/unit-tests/models/Boutique/Robotters.php similarity index 100% rename from unit-tests/models/Boutique/Robotters.php rename to _toCheck/unit-tests/models/Boutique/Robotters.php diff --git a/unit-tests/models/Cacheable/Model.php b/_toCheck/unit-tests/models/Cacheable/Model.php similarity index 100% rename from unit-tests/models/Cacheable/Model.php rename to _toCheck/unit-tests/models/Cacheable/Model.php diff --git a/unit-tests/models/Cacheable/Parts.php b/_toCheck/unit-tests/models/Cacheable/Parts.php similarity index 100% rename from unit-tests/models/Cacheable/Parts.php rename to _toCheck/unit-tests/models/Cacheable/Parts.php diff --git a/unit-tests/models/Cacheable/Robots.php b/_toCheck/unit-tests/models/Cacheable/Robots.php similarity index 100% rename from unit-tests/models/Cacheable/Robots.php rename to _toCheck/unit-tests/models/Cacheable/Robots.php diff --git a/unit-tests/models/Cacheable/RobotsParts.php b/_toCheck/unit-tests/models/Cacheable/RobotsParts.php similarity index 100% rename from unit-tests/models/Cacheable/RobotsParts.php rename to _toCheck/unit-tests/models/Cacheable/RobotsParts.php diff --git a/unit-tests/models/Childs.php b/_toCheck/unit-tests/models/Childs.php similarity index 100% rename from unit-tests/models/Childs.php rename to _toCheck/unit-tests/models/Childs.php diff --git a/unit-tests/models/Deles.php b/_toCheck/unit-tests/models/Deles.php similarity index 100% rename from unit-tests/models/Deles.php rename to _toCheck/unit-tests/models/Deles.php diff --git a/unit-tests/models/GossipRobots.php b/_toCheck/unit-tests/models/GossipRobots.php similarity index 100% rename from unit-tests/models/GossipRobots.php rename to _toCheck/unit-tests/models/GossipRobots.php diff --git a/unit-tests/models/News/Subscribers.php b/_toCheck/unit-tests/models/News/Subscribers.php similarity index 100% rename from unit-tests/models/News/Subscribers.php rename to _toCheck/unit-tests/models/News/Subscribers.php diff --git a/unit-tests/models/Parts.php b/_toCheck/unit-tests/models/Parts.php similarity index 100% rename from unit-tests/models/Parts.php rename to _toCheck/unit-tests/models/Parts.php diff --git a/unit-tests/models/Parts2.php b/_toCheck/unit-tests/models/Parts2.php similarity index 100% rename from unit-tests/models/Parts2.php rename to _toCheck/unit-tests/models/Parts2.php diff --git a/unit-tests/models/People.php b/_toCheck/unit-tests/models/People.php similarity index 100% rename from unit-tests/models/People.php rename to _toCheck/unit-tests/models/People.php diff --git a/unit-tests/models/Personas.php b/_toCheck/unit-tests/models/Personas.php similarity index 100% rename from unit-tests/models/Personas.php rename to _toCheck/unit-tests/models/Personas.php diff --git a/unit-tests/models/Personers.php b/_toCheck/unit-tests/models/Personers.php similarity index 100% rename from unit-tests/models/Personers.php rename to _toCheck/unit-tests/models/Personers.php diff --git a/unit-tests/models/Personnes.php b/_toCheck/unit-tests/models/Personnes.php similarity index 100% rename from unit-tests/models/Personnes.php rename to _toCheck/unit-tests/models/Personnes.php diff --git a/unit-tests/models/Pessoas.php b/_toCheck/unit-tests/models/Pessoas.php similarity index 100% rename from unit-tests/models/Pessoas.php rename to _toCheck/unit-tests/models/Pessoas.php diff --git a/unit-tests/models/Products.php b/_toCheck/unit-tests/models/Products.php similarity index 100% rename from unit-tests/models/Products.php rename to _toCheck/unit-tests/models/Products.php diff --git a/unit-tests/models/Prueba.php b/_toCheck/unit-tests/models/Prueba.php similarity index 100% rename from unit-tests/models/Prueba.php rename to _toCheck/unit-tests/models/Prueba.php diff --git a/unit-tests/models/Relations/Deles.php b/_toCheck/unit-tests/models/Relations/Deles.php similarity index 100% rename from unit-tests/models/Relations/Deles.php rename to _toCheck/unit-tests/models/Relations/Deles.php diff --git a/unit-tests/models/Relations/M2MParts.php b/_toCheck/unit-tests/models/Relations/M2MParts.php similarity index 100% rename from unit-tests/models/Relations/M2MParts.php rename to _toCheck/unit-tests/models/Relations/M2MParts.php diff --git a/unit-tests/models/Relations/M2MRobots.php b/_toCheck/unit-tests/models/Relations/M2MRobots.php similarity index 100% rename from unit-tests/models/Relations/M2MRobots.php rename to _toCheck/unit-tests/models/Relations/M2MRobots.php diff --git a/unit-tests/models/Relations/M2MRobotsParts.php b/_toCheck/unit-tests/models/Relations/M2MRobotsParts.php similarity index 100% rename from unit-tests/models/Relations/M2MRobotsParts.php rename to _toCheck/unit-tests/models/Relations/M2MRobotsParts.php diff --git a/unit-tests/models/Relations/RelationsParts.php b/_toCheck/unit-tests/models/Relations/RelationsParts.php similarity index 100% rename from unit-tests/models/Relations/RelationsParts.php rename to _toCheck/unit-tests/models/Relations/RelationsParts.php diff --git a/unit-tests/models/Relations/RelationsRobots.php b/_toCheck/unit-tests/models/Relations/RelationsRobots.php similarity index 100% rename from unit-tests/models/Relations/RelationsRobots.php rename to _toCheck/unit-tests/models/Relations/RelationsRobots.php diff --git a/unit-tests/models/Relations/RelationsRobotsParts.php b/_toCheck/unit-tests/models/Relations/RelationsRobotsParts.php similarity index 100% rename from unit-tests/models/Relations/RelationsRobotsParts.php rename to _toCheck/unit-tests/models/Relations/RelationsRobotsParts.php diff --git a/unit-tests/models/Relations/Robotters.php b/_toCheck/unit-tests/models/Relations/Robotters.php similarity index 100% rename from unit-tests/models/Relations/Robotters.php rename to _toCheck/unit-tests/models/Relations/Robotters.php diff --git a/unit-tests/models/Relations/RobottersDeles.php b/_toCheck/unit-tests/models/Relations/RobottersDeles.php similarity index 100% rename from unit-tests/models/Relations/RobottersDeles.php rename to _toCheck/unit-tests/models/Relations/RobottersDeles.php diff --git a/unit-tests/models/Relations/Some/Deles.php b/_toCheck/unit-tests/models/Relations/Some/Deles.php similarity index 100% rename from unit-tests/models/Relations/Some/Deles.php rename to _toCheck/unit-tests/models/Relations/Some/Deles.php diff --git a/unit-tests/models/Relations/Some/Parts.php b/_toCheck/unit-tests/models/Relations/Some/Parts.php similarity index 100% rename from unit-tests/models/Relations/Some/Parts.php rename to _toCheck/unit-tests/models/Relations/Some/Parts.php diff --git a/unit-tests/models/Relations/Some/Products.php b/_toCheck/unit-tests/models/Relations/Some/Products.php similarity index 100% rename from unit-tests/models/Relations/Some/Products.php rename to _toCheck/unit-tests/models/Relations/Some/Products.php diff --git a/unit-tests/models/Relations/Some/Robots.php b/_toCheck/unit-tests/models/Relations/Some/Robots.php similarity index 100% rename from unit-tests/models/Relations/Some/Robots.php rename to _toCheck/unit-tests/models/Relations/Some/Robots.php diff --git a/unit-tests/models/Relations/Some/RobotsParts.php b/_toCheck/unit-tests/models/Relations/Some/RobotsParts.php similarity index 100% rename from unit-tests/models/Relations/Some/RobotsParts.php rename to _toCheck/unit-tests/models/Relations/Some/RobotsParts.php diff --git a/unit-tests/models/Relations/Some/Robotters.php b/_toCheck/unit-tests/models/Relations/Some/Robotters.php similarity index 100% rename from unit-tests/models/Relations/Some/Robotters.php rename to _toCheck/unit-tests/models/Relations/Some/Robotters.php diff --git a/unit-tests/models/Relations/Some/RobottersDeles.php b/_toCheck/unit-tests/models/Relations/Some/RobottersDeles.php similarity index 100% rename from unit-tests/models/Relations/Some/RobottersDeles.php rename to _toCheck/unit-tests/models/Relations/Some/RobottersDeles.php diff --git a/unit-tests/models/Robots.php b/_toCheck/unit-tests/models/Robots.php similarity index 100% rename from unit-tests/models/Robots.php rename to _toCheck/unit-tests/models/Robots.php diff --git a/unit-tests/models/Robots2.php b/_toCheck/unit-tests/models/Robots2.php similarity index 100% rename from unit-tests/models/Robots2.php rename to _toCheck/unit-tests/models/Robots2.php diff --git a/unit-tests/models/RobotsParts.php b/_toCheck/unit-tests/models/RobotsParts.php similarity index 100% rename from unit-tests/models/RobotsParts.php rename to _toCheck/unit-tests/models/RobotsParts.php diff --git a/unit-tests/models/Robotters.php b/_toCheck/unit-tests/models/Robotters.php similarity index 100% rename from unit-tests/models/Robotters.php rename to _toCheck/unit-tests/models/Robotters.php diff --git a/unit-tests/models/RobottersDeles.php b/_toCheck/unit-tests/models/RobottersDeles.php similarity index 100% rename from unit-tests/models/RobottersDeles.php rename to _toCheck/unit-tests/models/RobottersDeles.php diff --git a/unit-tests/models/Robotto.php b/_toCheck/unit-tests/models/Robotto.php similarity index 100% rename from unit-tests/models/Robotto.php rename to _toCheck/unit-tests/models/Robotto.php diff --git a/unit-tests/models/Snapshot/Parts.php b/_toCheck/unit-tests/models/Snapshot/Parts.php similarity index 100% rename from unit-tests/models/Snapshot/Parts.php rename to _toCheck/unit-tests/models/Snapshot/Parts.php diff --git a/unit-tests/models/Snapshot/Robots.php b/_toCheck/unit-tests/models/Snapshot/Robots.php similarity index 100% rename from unit-tests/models/Snapshot/Robots.php rename to _toCheck/unit-tests/models/Snapshot/Robots.php diff --git a/unit-tests/models/Snapshot/RobotsParts.php b/_toCheck/unit-tests/models/Snapshot/RobotsParts.php similarity index 100% rename from unit-tests/models/Snapshot/RobotsParts.php rename to _toCheck/unit-tests/models/Snapshot/RobotsParts.php diff --git a/unit-tests/models/Snapshot/Robotters.php b/_toCheck/unit-tests/models/Snapshot/Robotters.php similarity index 100% rename from unit-tests/models/Snapshot/Robotters.php rename to _toCheck/unit-tests/models/Snapshot/Robotters.php diff --git a/unit-tests/models/Some/Deles.php b/_toCheck/unit-tests/models/Some/Deles.php similarity index 100% rename from unit-tests/models/Some/Deles.php rename to _toCheck/unit-tests/models/Some/Deles.php diff --git a/unit-tests/models/Some/Parts.php b/_toCheck/unit-tests/models/Some/Parts.php similarity index 100% rename from unit-tests/models/Some/Parts.php rename to _toCheck/unit-tests/models/Some/Parts.php diff --git a/unit-tests/models/Some/Products.php b/_toCheck/unit-tests/models/Some/Products.php similarity index 100% rename from unit-tests/models/Some/Products.php rename to _toCheck/unit-tests/models/Some/Products.php diff --git a/unit-tests/models/Some/Robots.php b/_toCheck/unit-tests/models/Some/Robots.php similarity index 100% rename from unit-tests/models/Some/Robots.php rename to _toCheck/unit-tests/models/Some/Robots.php diff --git a/unit-tests/models/Some/RobotsParts.php b/_toCheck/unit-tests/models/Some/RobotsParts.php similarity index 100% rename from unit-tests/models/Some/RobotsParts.php rename to _toCheck/unit-tests/models/Some/RobotsParts.php diff --git a/unit-tests/models/Some/Robotters.php b/_toCheck/unit-tests/models/Some/Robotters.php similarity index 100% rename from unit-tests/models/Some/Robotters.php rename to _toCheck/unit-tests/models/Some/Robotters.php diff --git a/unit-tests/models/Some/RobottersDeles.php b/_toCheck/unit-tests/models/Some/RobottersDeles.php similarity index 100% rename from unit-tests/models/Some/RobottersDeles.php rename to _toCheck/unit-tests/models/Some/RobottersDeles.php diff --git a/unit-tests/models/Store/Parts.php b/_toCheck/unit-tests/models/Store/Parts.php similarity index 100% rename from unit-tests/models/Store/Parts.php rename to _toCheck/unit-tests/models/Store/Parts.php diff --git a/unit-tests/models/Store/Robots.php b/_toCheck/unit-tests/models/Store/Robots.php similarity index 100% rename from unit-tests/models/Store/Robots.php rename to _toCheck/unit-tests/models/Store/Robots.php diff --git a/unit-tests/models/Store/RobotsParts.php b/_toCheck/unit-tests/models/Store/RobotsParts.php similarity index 100% rename from unit-tests/models/Store/RobotsParts.php rename to _toCheck/unit-tests/models/Store/RobotsParts.php diff --git a/unit-tests/models/Subscribers.php b/_toCheck/unit-tests/models/Subscribers.php similarity index 100% rename from unit-tests/models/Subscribers.php rename to _toCheck/unit-tests/models/Subscribers.php diff --git a/unit-tests/models/Subscriptores.php b/_toCheck/unit-tests/models/Subscriptores.php similarity index 100% rename from unit-tests/models/Subscriptores.php rename to _toCheck/unit-tests/models/Subscriptores.php diff --git a/unit-tests/views/index.phtml b/_toCheck/unit-tests/views/index.phtml similarity index 100% rename from unit-tests/views/index.phtml rename to _toCheck/unit-tests/views/index.phtml diff --git a/unit-tests/views/layouts/after.phtml b/_toCheck/unit-tests/views/layouts/after.phtml similarity index 100% rename from unit-tests/views/layouts/after.phtml rename to _toCheck/unit-tests/views/layouts/after.phtml diff --git a/unit-tests/views/layouts/before.phtml b/_toCheck/unit-tests/views/layouts/before.phtml similarity index 100% rename from unit-tests/views/layouts/before.phtml rename to _toCheck/unit-tests/views/layouts/before.phtml diff --git a/unit-tests/views/layouts/test10.volt b/_toCheck/unit-tests/views/layouts/test10.volt similarity index 100% rename from unit-tests/views/layouts/test10.volt rename to _toCheck/unit-tests/views/layouts/test10.volt diff --git a/unit-tests/views/layouts/test10.volt.php b/_toCheck/unit-tests/views/layouts/test10.volt.php similarity index 100% rename from unit-tests/views/layouts/test10.volt.php rename to _toCheck/unit-tests/views/layouts/test10.volt.php diff --git a/unit-tests/views/layouts/test13.phtml b/_toCheck/unit-tests/views/layouts/test13.phtml similarity index 100% rename from unit-tests/views/layouts/test13.phtml rename to _toCheck/unit-tests/views/layouts/test13.phtml diff --git a/unit-tests/views/macro/conditionaldate.volt b/_toCheck/unit-tests/views/macro/conditionaldate.volt similarity index 100% rename from unit-tests/views/macro/conditionaldate.volt rename to _toCheck/unit-tests/views/macro/conditionaldate.volt diff --git a/unit-tests/views/macro/error_messages.volt b/_toCheck/unit-tests/views/macro/error_messages.volt similarity index 100% rename from unit-tests/views/macro/error_messages.volt rename to _toCheck/unit-tests/views/macro/error_messages.volt diff --git a/unit-tests/views/macro/form_row.volt b/_toCheck/unit-tests/views/macro/form_row.volt similarity index 100% rename from unit-tests/views/macro/form_row.volt rename to _toCheck/unit-tests/views/macro/form_row.volt diff --git a/unit-tests/views/macro/hello.volt b/_toCheck/unit-tests/views/macro/hello.volt similarity index 100% rename from unit-tests/views/macro/hello.volt rename to _toCheck/unit-tests/views/macro/hello.volt diff --git a/unit-tests/views/macro/list.volt b/_toCheck/unit-tests/views/macro/list.volt similarity index 100% rename from unit-tests/views/macro/list.volt rename to _toCheck/unit-tests/views/macro/list.volt diff --git a/unit-tests/views/macro/my_input.volt b/_toCheck/unit-tests/views/macro/my_input.volt similarity index 100% rename from unit-tests/views/macro/my_input.volt rename to _toCheck/unit-tests/views/macro/my_input.volt diff --git a/unit-tests/views/macro/related_links.volt b/_toCheck/unit-tests/views/macro/related_links.volt similarity index 100% rename from unit-tests/views/macro/related_links.volt rename to _toCheck/unit-tests/views/macro/related_links.volt diff --git a/unit-tests/views/macro/strtotime.volt b/_toCheck/unit-tests/views/macro/strtotime.volt similarity index 100% rename from unit-tests/views/macro/strtotime.volt rename to _toCheck/unit-tests/views/macro/strtotime.volt diff --git a/unit-tests/views/partials/footer.volt b/_toCheck/unit-tests/views/partials/footer.volt similarity index 100% rename from unit-tests/views/partials/footer.volt rename to _toCheck/unit-tests/views/partials/footer.volt diff --git a/unit-tests/views/partials/footer.volt.php b/_toCheck/unit-tests/views/partials/footer.volt.php similarity index 100% rename from unit-tests/views/partials/footer.volt.php rename to _toCheck/unit-tests/views/partials/footer.volt.php diff --git a/unit-tests/views/partials/header.volt b/_toCheck/unit-tests/views/partials/header.volt similarity index 100% rename from unit-tests/views/partials/header.volt rename to _toCheck/unit-tests/views/partials/header.volt diff --git a/unit-tests/views/partials/header.volt.php b/_toCheck/unit-tests/views/partials/header.volt.php similarity index 100% rename from unit-tests/views/partials/header.volt.php rename to _toCheck/unit-tests/views/partials/header.volt.php diff --git a/unit-tests/views/partials/header2.volt b/_toCheck/unit-tests/views/partials/header2.volt similarity index 100% rename from unit-tests/views/partials/header2.volt rename to _toCheck/unit-tests/views/partials/header2.volt diff --git a/unit-tests/views/partials/header2.volt.php b/_toCheck/unit-tests/views/partials/header2.volt.php similarity index 100% rename from unit-tests/views/partials/header2.volt.php rename to _toCheck/unit-tests/views/partials/header2.volt.php diff --git a/unit-tests/views/partials/header3.volt b/_toCheck/unit-tests/views/partials/header3.volt similarity index 100% rename from unit-tests/views/partials/header3.volt rename to _toCheck/unit-tests/views/partials/header3.volt diff --git a/unit-tests/views/partials/header3.volt.php b/_toCheck/unit-tests/views/partials/header3.volt.php similarity index 100% rename from unit-tests/views/partials/header3.volt.php rename to _toCheck/unit-tests/views/partials/header3.volt.php diff --git a/unit-tests/views/templates/a.volt b/_toCheck/unit-tests/views/templates/a.volt similarity index 100% rename from unit-tests/views/templates/a.volt rename to _toCheck/unit-tests/views/templates/a.volt diff --git a/unit-tests/views/templates/b.volt b/_toCheck/unit-tests/views/templates/b.volt similarity index 100% rename from unit-tests/views/templates/b.volt rename to _toCheck/unit-tests/views/templates/b.volt diff --git a/unit-tests/views/templates/c.volt b/_toCheck/unit-tests/views/templates/c.volt similarity index 100% rename from unit-tests/views/templates/c.volt rename to _toCheck/unit-tests/views/templates/c.volt diff --git a/unit-tests/views/test10/.gitignore b/_toCheck/unit-tests/views/test10/.gitignore similarity index 100% rename from unit-tests/views/test10/.gitignore rename to _toCheck/unit-tests/views/test10/.gitignore diff --git a/unit-tests/views/test10/children.extends.volt b/_toCheck/unit-tests/views/test10/children.extends.volt similarity index 100% rename from unit-tests/views/test10/children.extends.volt rename to _toCheck/unit-tests/views/test10/children.extends.volt diff --git a/unit-tests/views/test10/children.volt b/_toCheck/unit-tests/views/test10/children.volt similarity index 100% rename from unit-tests/views/test10/children.volt rename to _toCheck/unit-tests/views/test10/children.volt diff --git a/unit-tests/views/test10/children2.volt b/_toCheck/unit-tests/views/test10/children2.volt similarity index 100% rename from unit-tests/views/test10/children2.volt rename to _toCheck/unit-tests/views/test10/children2.volt diff --git a/unit-tests/views/test10/import.volt b/_toCheck/unit-tests/views/test10/import.volt similarity index 100% rename from unit-tests/views/test10/import.volt rename to _toCheck/unit-tests/views/test10/import.volt diff --git a/unit-tests/views/test10/import2.volt b/_toCheck/unit-tests/views/test10/import2.volt similarity index 100% rename from unit-tests/views/test10/import2.volt rename to _toCheck/unit-tests/views/test10/import2.volt diff --git a/unit-tests/views/test10/index.volt b/_toCheck/unit-tests/views/test10/index.volt similarity index 100% rename from unit-tests/views/test10/index.volt rename to _toCheck/unit-tests/views/test10/index.volt diff --git a/unit-tests/views/test10/other.volt b/_toCheck/unit-tests/views/test10/other.volt similarity index 100% rename from unit-tests/views/test10/other.volt rename to _toCheck/unit-tests/views/test10/other.volt diff --git a/unit-tests/views/test10/parent.volt b/_toCheck/unit-tests/views/test10/parent.volt similarity index 100% rename from unit-tests/views/test10/parent.volt rename to _toCheck/unit-tests/views/test10/parent.volt diff --git a/unit-tests/views/test10/partial.volt b/_toCheck/unit-tests/views/test10/partial.volt similarity index 100% rename from unit-tests/views/test10/partial.volt rename to _toCheck/unit-tests/views/test10/partial.volt diff --git a/unit-tests/views/test11/index.volt b/_toCheck/unit-tests/views/test11/index.volt similarity index 100% rename from unit-tests/views/test11/index.volt rename to _toCheck/unit-tests/views/test11/index.volt diff --git a/unit-tests/views/test11/index.volt.php b/_toCheck/unit-tests/views/test11/index.volt.php similarity index 100% rename from unit-tests/views/test11/index.volt.php rename to _toCheck/unit-tests/views/test11/index.volt.php diff --git a/unit-tests/views/test13/index.phtml b/_toCheck/unit-tests/views/test13/index.phtml similarity index 100% rename from unit-tests/views/test13/index.phtml rename to _toCheck/unit-tests/views/test13/index.phtml diff --git a/unit-tests/views/test14/loop1.volt b/_toCheck/unit-tests/views/test14/loop1.volt similarity index 100% rename from unit-tests/views/test14/loop1.volt rename to _toCheck/unit-tests/views/test14/loop1.volt diff --git a/unit-tests/views/test16/index.phtml b/_toCheck/unit-tests/views/test16/index.phtml similarity index 100% rename from unit-tests/views/test16/index.phtml rename to _toCheck/unit-tests/views/test16/index.phtml diff --git a/unit-tests/views/test3/query.phtml b/_toCheck/unit-tests/views/test3/query.phtml similarity index 100% rename from unit-tests/views/test3/query.phtml rename to _toCheck/unit-tests/views/test3/query.phtml diff --git a/unit-tests/views/test3/yup.phtml b/_toCheck/unit-tests/views/test3/yup.phtml similarity index 100% rename from unit-tests/views/test3/yup.phtml rename to _toCheck/unit-tests/views/test3/yup.phtml diff --git a/unit-tests/views/test8/index.phtml b/_toCheck/unit-tests/views/test8/index.phtml similarity index 100% rename from unit-tests/views/test8/index.phtml rename to _toCheck/unit-tests/views/test8/index.phtml diff --git a/unit-tests/views/test8/leother.phtml b/_toCheck/unit-tests/views/test8/leother.phtml similarity index 100% rename from unit-tests/views/test8/leother.phtml rename to _toCheck/unit-tests/views/test8/leother.phtml diff --git a/unit-tests/views/test8/other.phtml b/_toCheck/unit-tests/views/test8/other.phtml similarity index 100% rename from unit-tests/views/test8/other.phtml rename to _toCheck/unit-tests/views/test8/other.phtml diff --git a/boxfile.yml b/boxfile.yml new file mode 100644 index 00000000000..db41a8684f1 --- /dev/null +++ b/boxfile.yml @@ -0,0 +1,73 @@ +run.config: + engine: php + engine.config: + runtime: php-7.1 + extensions: + - ctype + - curl + - dom + - tokenizer + - zlib + - xml + - xmlwriter + - simplexml + - session + - zephir_parser + - pdo + - pdo_sqlite + - pdo_mysql + - pdo_pgsql + - gmp + - mbstring + - memcached + - memcache + - mongodb + - redis + - zip + zend_extensions: + - opcache + dev_zend_extensions: + add: + - xdebug + rm: + - opcache + extra_packages: + - autoconf + - re2c + extra_steps: + # PSR extension compilation + - | + ( + rm -fR ./build/php-psr + cd build + git clone --depth=1 https://github.com/jbboehr/php-psr.git + cd php-psr + set -e + phpize + ./configure --with-php-config=$(which php-config) + make -j"$(getconf _NPROCESSORS_ONLN)" + make install + cd ../ + rm -fR ./build/php-psr + ) + - echo -e 'extension=psr.so' >> "/data/etc/php/dev_php.ini" + # This is here so that Phalcon can be used right after compilation + - echo -e 'extension=phalcon.so' >> "/data/etc/php/dev_php.ini" + +#data.beanstalkd: +# image: phalcon/beanstalkd + +data.memcached: + image: nanobox/memcached:1.4 + +data.mongodb: + image: nanobox/mongodb:3.0 + +data.mysql: + image: nanobox/mysql:5.7 + +data.postgres: + image: nanobox/postgresql:9.4 + +data.redis : + image : nanobox/redis:3.2 \ No newline at end of file diff --git a/tests/unit/VersionCest.php b/tests/unit/VersionCest.php new file mode 100644 index 00000000000..fdae440a138 --- /dev/null +++ b/tests/unit/VersionCest.php @@ -0,0 +1,207 @@ + + * @since 2014-09-04 + */ + public function testVersionGet(UnitTester $I) + { + $actual = Version::get(); + $I->assertTrue( + $actual, + "get() does not return a string" + ); + } + + /** + * Tests the getId() + * + * @author Nikolaos Dimopoulos + * @since 2014-09-04 + */ + public function testVersionGetId(UnitTester $I) + { + $actual = Version::getId(); + $I->assertTrue( + is_string($actual), + "getId() does not return a string" + ); + } + + /** + * Tests the get() translation to getId() + * + * @author Nikolaos Dimopoulos + * @since 2014-09-04 + */ + public function testVersionGetToGetId(UnitTester $I) + { + $version = Version::get(); + $chunks = explode(' ', $version); + + $special = '4'; + $specialNo = '0'; + + // There are special versions + if (count($chunks) > 1) { + $specialNo = $chunks[2]; + $special = $this->specialToNumber($chunks[1]); + } + + // Now the version itself + $verChunks = explode('.', $chunks[0]); + $major = intval($verChunks[0]); + $med = substr("00" . intval($verChunks[1]), -2); + $min = substr("00" . intval($verChunks[2]), -2); + + $expected = "{$major}{$med}{$min}{$special}{$specialNo}"; + $actual = Version::getId(); + + $I->assertEquals($expected, $actual, "get() to getId() does not produce the same result"); + } + + /** + * Tests the getId() translation to get() + * + * @author Nikolaos Dimopoulos + * @since 2014-09-04 + */ + public function testVersionGetIdToGet(UnitTester $I) + { + $id = Version::getId(); + $major = intval($id[0]); + $med = intval($id[1] . $id[2]); + $min = intval($id[3] . $id[4]); + $special = $this->numberToSpecial($id[5]); + $specialNo = ($special) ? $id[6] : ''; + + $expected = trim("{$major}.{$med}.{$min} {$special} {$specialNo}"); + $actual = Version::get(); + $I->assertEquals($expected, $actual, "getId() to get() does not produce the same result"); + } + + /** + * Tests the constants of the class + * + * @author Nikolaos Dimopoulos + * @since 2014-09-04 + */ + public function testVersionConstants(UnitTester $I) + { + $I->assertEquals(0, Version::VERSION_MAJOR, "VERSION_MAJOR does not return 0"); + $I->assertEquals(1, Version::VERSION_MEDIUM, "VERSION_MAJOR does not return 1"); + $I->assertEquals(2, Version::VERSION_MINOR, "VERSION_MAJOR does not return 2"); + $I->assertEquals(3, Version::VERSION_SPECIAL, "VERSION_MAJOR does not return 3"); + $I->assertEquals(4, Version::VERSION_SPECIAL_NUMBER, "VERSION_MAJOR does not return 4"); + } + + /** + * Tests the getPart with variable parameters passed, valid or not + * + * @author Nikolaos Dimopoulos + * @since 2014-09-04 + */ + public function testVersionGetPart(UnitTester $I) + { + /* + * Note: getId() returns a version string in the format ABBCCDE + * where A is the major version, BB is the medium version (2 digits) + * CC is the minor version (2 digits), D is the release type (see Phalcon\Version) + * and E is the release number (for example 2 for RC2) + */ + + $id = Version::getId(); + $expected = intval($id[0]); //The major version is the first digit + $actual = Version::getPart(Version::VERSION_MAJOR); + $I->assertEquals($expected, $actual, "getPart(VERSION_MAJOR) does not return the correct result"); + + $expected = intval($id[1].$id[2]); //The medium version is the second and third digits + $actual = Version::getPart(Version::VERSION_MEDIUM); + $I->assertEquals($expected, $actual, "getPart(VERSION_MEDIUM) does not return the correct result"); + + $expected = intval($id[3].$id[4]); //The minor version is the fourth and fifth digits + $actual = Version::getPart(Version::VERSION_MINOR); + $I->assertEquals($expected, $actual, "getPart(VERSION_MINOR) does not return the correct result"); + + $expected = $this->numberToSpecial($id[5]); + $actual = Version::getPart(Version::VERSION_SPECIAL); + $I->assertEquals($expected, $actual, "getPart(VERSION_SPECIAL) does not return the correct result"); + + $special = $this->numberToSpecial($id[5]); + $expected = ($special) ? $id[6] : 0; + $actual = Version::getPart(Version::VERSION_SPECIAL_NUMBER); + $I->assertEquals($expected, $actual, "getPart(VERSION_SPECIAL_NUMBER) does not return the correct result"); + + $expected = Version::get(); + $actual = Version::getPart(7); + $I->assertEquals($expected, $actual, "getPart() with incorrect parameters does not return get()"); + } + + /** + * Translates a special version (ALPHA, BETA, RC) to a version number + * + * @author Nikolaos Dimopoulos + * @since 2014-09-04 + * + * @param $input + * + * @return string + */ + private function specialToNumber($input) + { + switch ($input) { + case 'ALPHA': + $special = '1'; + break; + case 'BETA': + $special = '2'; + break; + case 'RC': + $special = '3'; + break; + default: + $special = '4'; + break; + } + + return $special; + } + + /** + * Translates a number to a special version string (ALPHA, BETA, RC) + * + * @author Nikolaos Dimopoulos + * @since 2014-09-04 + * + * @param $number + * + * @return string + */ + private function numberToSpecial($number) + { + $special = ''; + + switch ($number) { + case '1': + $special = 'ALPHA'; + break; + case '2': + $special = 'BETA'; + break; + case '3': + $special = 'RC'; + break; + } + + return $special; + } +} diff --git a/tests/unit/VersionTest.php b/tests/unit/VersionTest.php deleted file mode 100644 index da816a01c53..00000000000 --- a/tests/unit/VersionTest.php +++ /dev/null @@ -1,310 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class VersionTest extends UnitTest -{ - /** - * Tests the get - * - * @author Nikolaos Dimopoulos - * @since 2014-09-04 - */ - public function testVersionGet() - { - $this->specify( - "get() does not return a string", - function () { - $actual = Version::get(); - - expect(is_string($actual))->true(); - } - ); - } - - /** - * Tests the getId() - * - * @author Nikolaos Dimopoulos - * @since 2014-09-04 - */ - public function testVersionGetId() - { - $this->specify( - "getId() does not return a string", - function () { - $actual = Version::getId(); - - expect(is_string($actual))->true(); - } - ); - } - - /** - * Tests the get() translation to getId() - * - * @author Nikolaos Dimopoulos - * @since 2014-09-04 - */ - public function testVersionGetToGetId() - { - $this->specify( - "get() to getId() does not produce the same result", - function () { - $version = Version::get(); - $chunks = explode(' ', $version); - - $special = '4'; - $specialNo = '0'; - - // There are special versions - if (count($chunks) > 1) { - $specialNo = $chunks[2]; - $special = $this->specialToNumber($chunks[1]); - } - - // Now the version itself - $verChunks = explode('.', $chunks[0]); - $major = intval($verChunks[0]); - $med = substr("00" . intval($verChunks[1]), -2); - $min = substr("00" . intval($verChunks[2]), -2); - - $expected = "{$major}{$med}{$min}{$special}{$specialNo}"; - $actual = Version::getId(); - - expect($actual)->equals($expected); - } - ); - } - - /** - * Tests the getId() translation to get() - * - * @author Nikolaos Dimopoulos - * @since 2014-09-04 - */ - public function testVersionGetIdToGet() - { - $this->specify( - "getId() to get() does not produce the same result", - function () { - $id = Version::getId(); - $major = intval($id[0]); - $med = intval($id[1] . $id[2]); - $min = intval($id[3] . $id[4]); - $special = $this->numberToSpecial($id[5]); - $specialNo = ($special) ? $id[6] : ''; - - $expected = trim("{$major}.{$med}.{$min} {$special} {$specialNo}"); - $actual = Version::get(); - - expect($actual)->equals($expected); - } - ); - } - - /** - * Tests the constants of the class - * - * @author Nikolaos Dimopoulos - * @since 2014-09-04 - */ - public function testVersionConstants() - { - $this->specify( - "VERSION_MAJOR does not return 0", - function () { - expect(Version::VERSION_MAJOR)->equals(0); - } - ); - - $this->specify( - "VERSION_MEDIUM does not return 1", - function () { - expect(Version::VERSION_MEDIUM)->equals(1); - } - ); - - $this->specify( - "VERSION_MINOR does not return 2", - function () { - expect(Version::VERSION_MINOR)->equals(2); - } - ); - - $this->specify( - "VERSION_SPECIAL does not return 3", - function () { - expect(Version::VERSION_SPECIAL)->equals(3); - } - ); - - $this->specify( - "VERSION_SPECIAL_NUMBER does not return 4", - function () { - expect(Version::VERSION_SPECIAL_NUMBER)->equals(4); - } - ); - } - - /** - * Tests the getPart with variable parameters passed, valid or not - * - * @author Nikolaos Dimopoulos - * @since 2014-09-04 - */ - public function testVersionGetPart() - { - /* - * Note: getId() returns a version string in the format ABBCCDE - * where A is the major version, BB is the medium version (2 digits) - * CC is the minor version (2 digits), D is the release type (see Phalcon\Version) - * and E is the release number (for example 2 for RC2) - */ - - $this->specify( - "getPart(VERSION_MAJOR) does not return the correct result", - function () { - $id = Version::getId(); - $expected = intval($id[0]); //The major version is the first digit - $actual = Version::getPart(Version::VERSION_MAJOR); - - expect($actual)->equals($expected); - } - ); - - $this->specify( - "getPart(VERSION_MEDIUM) does not return the correct result", - function () { - $id = Version::getId(); - $expected = intval($id[1].$id[2]); //The medium version is the second and third digits - $actual = Version::getPart(Version::VERSION_MEDIUM); - - expect($actual)->equals($expected); - } - ); - - $this->specify( - "getPart(VERSION_MINOR) does not return the correct result", - function () { - $id = Version::getId(); - $expected = intval($id[3].$id[4]); //The minor version is the fourth and fifth digits - $actual = Version::getPart(Version::VERSION_MINOR); - - expect($actual)->equals($expected); - } - ); - - $this->specify( - "getPart(VERSION_SPECIAL) does not return the correct result", - function () { - $id = Version::getId(); - $expected = $this->numberToSpecial($id[5]); - $actual = Version::getPart(Version::VERSION_SPECIAL); - - expect($actual)->equals($expected); - } - ); - - $this->specify( - "getPart(VERSION_SPECIAL_NUMBER) does not return the correct result", - function () { - $id = Version::getId(); - $special = $this->numberToSpecial($id[5]); - $expected = ($special) ? $id[6] : 0; - $actual = Version::getPart(Version::VERSION_SPECIAL_NUMBER); - - expect($actual)->equals($expected); - } - ); - - $this->specify( - "getPart() with incorrect parameters does not return get()", - function () { - $expected = Version::get(); - $actual = Version::getPart(7); - - expect($actual)->equals($expected); - } - ); - } - - /** - * Translates a special version (ALPHA, BETA, RC) to a version number - * - * @author Nikolaos Dimopoulos - * @since 2014-09-04 - * - * @param $input - * - * @return string - */ - private function specialToNumber($input) - { - switch ($input) { - case 'ALPHA': - $special = '1'; - break; - case 'BETA': - $special = '2'; - break; - case 'RC': - $special = '3'; - break; - default: - $special = '4'; - break; - } - - return $special; - } - - /** - * Translates a number to a special version string (ALPHA, BETA, RC) - * - * @author Nikolaos Dimopoulos - * @since 2014-09-04 - * - * @param $number - * - * @return string - */ - private function numberToSpecial($number) - { - $special = ''; - - switch ($number) { - case '1': - $special = 'ALPHA'; - break; - case '2': - $special = 'BETA'; - break; - case '3': - $special = 'RC'; - break; - } - - return $special; - } -} From de20ebcc9969d8bd6d04f4cab49f76126fd829de Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Sat, 3 Nov 2018 19:48:27 -0400 Subject: [PATCH 002/222] Codeception bootstrap --- codeception.yml | 33 ++++++++++ tests/_bootstrap.php | 99 ++++++++++++++++++++++++++++ tests/_data/.gitkeep | 0 tests/_output/.gitignore | 2 + tests/_support/AcceptanceTester.php | 26 ++++++++ tests/_support/FunctionalTester.php | 26 ++++++++ tests/_support/Helper/Acceptance.php | 10 +++ tests/_support/Helper/Functional.php | 10 +++ tests/_support/Helper/Unit.php | 10 +++ tests/_support/UnitTester.php | 26 ++++++++ tests/_support/_generated/.gitignore | 2 + tests/acceptance.suite.yml.bak | 12 ++++ tests/functional.suite.yml.bak | 12 ++++ tests/shim.php | 27 ++++++++ tests/unit.suite.yml | 9 +++ tests/unit/VersionCest.php | 2 +- tests/unit/_bootstrap.php | 2 + 17 files changed, 307 insertions(+), 1 deletion(-) create mode 100644 codeception.yml create mode 100644 tests/_bootstrap.php create mode 100644 tests/_data/.gitkeep create mode 100644 tests/_output/.gitignore create mode 100644 tests/_support/AcceptanceTester.php create mode 100644 tests/_support/FunctionalTester.php create mode 100644 tests/_support/Helper/Acceptance.php create mode 100644 tests/_support/Helper/Functional.php create mode 100644 tests/_support/Helper/Unit.php create mode 100644 tests/_support/UnitTester.php create mode 100644 tests/_support/_generated/.gitignore create mode 100644 tests/acceptance.suite.yml.bak create mode 100644 tests/functional.suite.yml.bak create mode 100644 tests/shim.php create mode 100644 tests/unit.suite.yml create mode 100644 tests/unit/_bootstrap.php diff --git a/codeception.yml b/codeception.yml new file mode 100644 index 00000000000..6e19331729e --- /dev/null +++ b/codeception.yml @@ -0,0 +1,33 @@ +actor_suffix: Tester + +paths: + # where the modules stored + tests: tests + log: tests/_output + # directory for fixture data + data: tests/_data + # directory for custom modules (helpers) + support: tests/_support + envs: tests/_envs + +settings: + # name of bootstrap that will be used + # each bootstrap file should be + # inside a suite directory. + bootstrap: _bootstrap.php + colors: true + # Tests (especially functional) can take a lot of memory + # We set a high limit for them by default. + memory_limit: 1024M + +coverage: + # Disable Code Coverage by default to speed up Travis tests + enabled: false + +extensions: + enabled: + - Codeception\Extension\RunFailed + +#params: +# # get params from environment vars +# - env diff --git a/tests/_bootstrap.php b/tests/_bootstrap.php new file mode 100644 index 00000000000..850ca0cfa24 --- /dev/null +++ b/tests/_bootstrap.php @@ -0,0 +1,99 @@ + TESTS_PATH . '_cache' . DIRECTORY_SEPARATOR, + + // Beanstalk + "TEST_BT_HOST" => '127.0.0.1', + "TEST_BT_PORT" => 11300, + + // Memcached + "TEST_MC_HOST" => '127.0.0.1', + "TEST_MC_PORT" => 11211, + "TEST_MC_WEIGHT" => 1, + + // SQLite + "TEST_DB_SQLITE_NAME" => PATH_OUTPUT . 'phalcon_test.sqlite', + "TEST_DB_I18N_SQLITE_NAME" => PATH_OUTPUT . 'translations.sqlite', + + // MySQL + "TEST_DB_MYSQL_HOST" => '127.0.0.1', + "TEST_DB_MYSQL_PORT" => 3306, + "TEST_DB_MYSQL_USER" => 'root', + "TEST_DB_MYSQL_PASSWD" => '', + "TEST_DB_MYSQL_NAME" => 'phalcon_test', + "TEST_DB_MYSQL_CHARSET" => 'utf8', + + // Postgresql + "TEST_DB_POSTGRESQL_HOST" => '127.0.0.1', + "TEST_DB_POSTGRESQL_PORT" => 5432, + "TEST_DB_POSTGRESQL_USER" => 'postgres', + "TEST_DB_POSTGRESQL_PASSWD" => '', + "TEST_DB_POSTGRESQL_NAME" => 'phalcon_test', + "TEST_DB_POSTGRESQL_SCHEMA" => 'public', + + // Mongo + "TEST_DB_MONGO_HOST" => '127.0.0.1', + "TEST_DB_MONGO_PORT" => 27017, + "TEST_DB_MONGO_USER" => 'admin', + "TEST_DB_MONGO_PASSWD" => '', + "TEST_DB_MONGO_NAME" => 'phalcon_test', + + // Redis + "TEST_RS_HOST" => '127.0.0.1', + "TEST_RS_PORT" => 6379, + "TEST_RS_DB" => 0, +]; + + + +foreach ($defaults as $key => $defaultValue) { + if (defined($key)) { + continue; + } + + $value = getenv($key) ?: $defaultValue; + + define($key, $value); +} diff --git a/tests/_data/.gitkeep b/tests/_data/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/_output/.gitignore b/tests/_output/.gitignore new file mode 100644 index 00000000000..c96a04f008e --- /dev/null +++ b/tests/_output/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/tests/_support/AcceptanceTester.php b/tests/_support/AcceptanceTester.php new file mode 100644 index 00000000000..4c7dcbb6d69 --- /dev/null +++ b/tests/_support/AcceptanceTester.php @@ -0,0 +1,26 @@ + + * @author Serghei Iakovlev + * + * The contents of this file are subject to the New BSD License that is + * bundled with this package in the file LICENSE.txt + * + * If you did not receive a copy of the license and are unable to obtain it + * through the world-wide-web, please send an email to license@phalconphp.com + * so that we can send you a copy immediately. + */ + +if (!function_exists('env')) { + function env($key, $default = null) + { + if (defined($key)) { + return constant($key); + } + + return getenv($key) ?: $default; + } +} diff --git a/tests/unit.suite.yml b/tests/unit.suite.yml new file mode 100644 index 00000000000..026c91db96d --- /dev/null +++ b/tests/unit.suite.yml @@ -0,0 +1,9 @@ +# Codeception Test Suite Configuration +# +# Suite for unit or integration tests. + +actor: UnitTester +modules: + enabled: + - Asserts + - \Helper\Unit \ No newline at end of file diff --git a/tests/unit/VersionCest.php b/tests/unit/VersionCest.php index fdae440a138..76cb440c036 100644 --- a/tests/unit/VersionCest.php +++ b/tests/unit/VersionCest.php @@ -17,7 +17,7 @@ public function testVersionGet(UnitTester $I) { $actual = Version::get(); $I->assertTrue( - $actual, + is_string($actual), "get() does not return a string" ); } diff --git a/tests/unit/_bootstrap.php b/tests/unit/_bootstrap.php new file mode 100644 index 00000000000..8a885558065 --- /dev/null +++ b/tests/unit/_bootstrap.php @@ -0,0 +1,2 @@ + Date: Sat, 3 Nov 2018 20:15:24 -0400 Subject: [PATCH 003/222] Escaper tests --- _toCheck/tests/unit/EscaperTest.php | 241 ---------------------------- tests/unit/EscaperCest.php | 183 +++++++++++++++++++++ tests/unit/VersionCest.php | 42 +++-- 3 files changed, 201 insertions(+), 265 deletions(-) delete mode 100644 _toCheck/tests/unit/EscaperTest.php create mode 100644 tests/unit/EscaperCest.php diff --git a/_toCheck/tests/unit/EscaperTest.php b/_toCheck/tests/unit/EscaperTest.php deleted file mode 100644 index 2f614abaf2a..00000000000 --- a/_toCheck/tests/unit/EscaperTest.php +++ /dev/null @@ -1,241 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class EscaperTest extends UnitTest -{ - /** - * Tests whether a key exists in the array - * - * @author Nikolaos Dimopoulos - * @since 2014-09-12 - */ - public function testEscaperHtml() - { - $this->specify( - "The escaper does not escape string correctly", - function () { - $escaper = new Escaper(); - expect($escaper->escapeHtml("

"))->equals('<h1></h1>'); - } - ); - } - - /** - * Tests the getEncoding and setEncoding - * - * @author Nikolaos Dimopoulos - * @since 2014-09-16 - */ - public function testGetSetEncoding() - { - $this->specify( - 'The escaper does not set/get the encoding correctly', - function () { - $escaper = new Escaper(); - $escaper->setEncoding('UTF-8'); - - expect($escaper->getEncoding())->equals('UTF-8'); - } - ); - } - - /** - * Tests the normalizeEncoding with various quote types - * - * @author Nikolaos Dimopoulos - * @since 2014-09-16 - */ - public function testEscapeAttrWithDifferentEncodings() - { - $this->specify( - 'The escaper does not return the correct result with ENT_HTML401', - function () { - $escaper = new Escaper(); - $escaper->setHtmlQuoteType(ENT_HTML401); - - expect($escaper->escapeHtmlAttr("That's right"))->equals("That's right"); - } - ); - - $this->specify( - 'The escaper does not return the correct result with ENT_XHTML', - function () { - $escaper = new Escaper(); - $escaper->setHtmlQuoteType(ENT_XML1); - - expect($escaper->escapeHtmlAttr("That's right"))->equals("That's right"); - } - ); - - $this->specify( - 'The escaper does not return the correct result with ENT_XHTML', - function () { - $escaper = new Escaper(); - $escaper->setHtmlQuoteType(ENT_XHTML); - - expect($escaper->escapeHtmlAttr("That's right"))->equals("That's right"); - } - ); - - $this->specify( - 'The escaper does not return the correct result with ENT_HTML5', - function () { - $escaper = new Escaper(); - $escaper->setHtmlQuoteType(ENT_HTML5); - - expect($escaper->escapeHtmlAttr("That's right"))->equals("That's right"); - } - ); - } - - /** - * Tests the detectEncoding - * - * @author Nikolaos Dimopoulos - * @since 2014-09-16 - */ - public function testDetectEncoding() - { - $this->specify( - 'The escaper does not detect the encoding correctly UTF-8', - function () { - $escaper = new Escaper(); - expect($escaper->detectEncoding('ḂḃĊċḊḋḞḟĠġṀṁ'))->equals('UTF-8'); - } - ); - - $this->specify( - 'The escaper does not detect the encoding correctly ISO-8859-1', - function () { - $escaper = new Escaper(); - expect($escaper->detectEncoding(chr(172) . chr(128) . chr(159) . 'ḂḃĊċḊḋḞḟĠġṀṁ'))->equals('ISO-8859-1'); - } - ); - - $this->specify( - 'The escaper does not detect the encoding correctly UTF-8', - function () { - $escaper = new Escaper(); - expect($escaper->detectEncoding('\0\0\0H\0\0\0i'))->equals('UTF-8'); - } - ); - } - - /** - * Tests the normalizeEncoding - * - * @author Nikolaos Dimopoulos - * @since 2014-09-16 - */ - public function testNormalizeEncoding() - { - $this->specify( - 'The escaper with normalizeEncoding does not return the correct result ', - function () { - if (!extension_loaded('mbstring')) { - $this->markTestSkipped('Warning: mbstring extension is not loaded'); - } - - $escaper = new Escaper(); - expect($escaper->normalizeEncoding('Hello'))->equals(mb_convert_encoding('Hello', 'UTF-32', 'UTF-8')); - } - ); - } - - /** - * Tests the escapeCss - * - * @author Nikolaos Dimopoulos - * @since 2014-09-16 - */ - public function testEscapeCss() - { - $this->specify( - 'The escaper with escapeCss does not return the correct result ', - function () { - $escaper = new Escaper(); - - $source = ".émotion { background: " - . "url('http://phalconphp.com/a.php?c=d&e=f'); }"; - $expected = '\2e \e9 motion\20 \7b \20 background\3a \20 url\28 ' - . '\27 http\3a \2f \2f phalconphp\2e com\2f a\2e php' - . '\3f c\3d d\26 e\3d f\27 \29 \3b \20 \7d '; - - expect($escaper->escapeCss($source))->equals($expected); - } - ); - } - - /** - * Tests the escapeJs - * - * @author Nikolaos Dimopoulos - * @since 2014-09-16 - */ - public function testEscapeJs() - { - $this->specify( - 'The escaper with escapeJs does not return the correct result ', - function () { - $escaper = new Escaper(); - - $source = "function createtoc () {" - . "var h2s = document.getElementsByTagName('H2');" - . "l = toc.appendChild(document.createElement('ol'));" - . "for (var i=0; iescapeJs($source))->equals($expected); - } - ); - } - - /** - * Tests the escapeUrl - * - * @author Nikolaos Dimopoulos - * @since 2014-09-16 - */ - public function testEscapeUrl() - { - $this->specify( - 'The escaper with escapeCss does not return the correct result ', - function () { - $escaper = new Escaper(); - expect($escaper->escapeUrl("http://phalconphp.com/a.php?c=d&e=f"))->equals('http%3A%2F%2Fphalconphp.com%2Fa.php%3Fc%3Dd%26e%3Df'); - } - ); - } -} diff --git a/tests/unit/EscaperCest.php b/tests/unit/EscaperCest.php new file mode 100644 index 00000000000..c670a5a6fec --- /dev/null +++ b/tests/unit/EscaperCest.php @@ -0,0 +1,183 @@ + + * @since 2014-09-12 + */ + public function testEscaperHtml(UnitTester $I) + { + $escaper = new Escaper(); + $expected = '<h1></h1>'; + $actual = $escaper->escapeHtml("

"); + $I->assertEquals($expected, $actual); + } + + /** + * Tests the getEncoding and setEncoding + * + * @author Nikolaos Dimopoulos + * @since 2014-09-16 + */ + public function testGetSetEncoding(UnitTester $I) + { + $escaper = new Escaper(); + $escaper->setEncoding('UTF-8'); + + $expected = 'UTF-8'; + $actual = $escaper->getEncoding(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests the normalizeEncoding with various quote types + * + * @author Nikolaos Dimopoulos + * @since 2014-09-16 + */ + public function testEscapeAttrWithDifferentEncodings(UnitTester $I) + { + $escaper = new Escaper(); + + $escaper->setHtmlQuoteType(ENT_HTML401); + $expected = "That's right"; + $actual = $escaper->escapeHtmlAttr("That's right"); + $I->assertEquals($expected, $actual); + + $escaper->setHtmlQuoteType(ENT_XML1); + $expected = "That's right"; + $actual = $escaper->escapeHtmlAttr("That's right"); + $I->assertEquals($expected, $actual); + + $escaper->setHtmlQuoteType(ENT_XHTML); + $expected = "That's right"; + $actual = $escaper->escapeHtmlAttr("That's right"); + $I->assertEquals($expected, $actual); + + $escaper->setHtmlQuoteType(ENT_HTML5); + $expected = "That's right"; + $actual = $escaper->escapeHtmlAttr("That's right"); + $I->assertEquals($expected, $actual); + } + + /** + * Tests the detectEncoding + * + * @author Nikolaos Dimopoulos + * @since 2014-09-16 + */ + public function testDetectEncoding(UnitTester $I) + { + $escaper = new Escaper(); + + $source = 'ḂḃĊċḊḋḞḟĠġṀṁ'; + $expected = 'UTF-8'; + $actual = $escaper->detectEncoding($source); + $I->assertEquals($expected, $actual); + + + $source = chr(172) . chr(128) . chr(159) . 'ḂḃĊċḊḋḞḟĠġṀṁ'; + $expected = 'ISO-8859-1'; + $actual = $escaper->detectEncoding($source); + $I->assertEquals($expected, $actual); + + $source = '\0\0\0H\0\0\0i'; + $expected = 'UTF-8'; + $actual = $escaper->detectEncoding($source); + $I->assertEquals($expected, $actual); + } + + /** + * Tests the normalizeEncoding + * + * @author Nikolaos Dimopoulos + * @since 2014-09-16 + */ + public function testNormalizeEncoding(UnitTester $I, $scenario) + { + if (!extension_loaded('mbstring')) { + $scenario->skip('Warning: mbstring extension is not loaded'); + } + + $escaper = new Escaper(); + + $expected = mb_convert_encoding('Hello', 'UTF-32', 'UTF-8'); + $actual = $escaper->normalizeEncoding('Hello'); + + $I->assertEquals($expected, $actual); + } + + /** + * Tests the escapeCss + * + * @author Nikolaos Dimopoulos + * @since 2014-09-16 + */ + public function testEscapeCss(UnitTester $I) + { + $escaper = new Escaper(); + $source = ".émotion { background: " + . "url('http://phalconphp.com/a.php?c=d&e=f'); }"; + $expected = '\2e \e9 motion\20 \7b \20 background\3a \20 url\28 ' + . '\27 http\3a \2f \2f phalconphp\2e com\2f a\2e php' + . '\3f c\3d d\26 e\3d f\27 \29 \3b \20 \7d '; + $actual = $escaper->escapeCss($source); + + $I->assertEquals($expected, $actual); + } + + /** + * Tests the escapeJs + * + * @author Nikolaos Dimopoulos + * @since 2014-09-16 + */ + public function testEscapeJs(UnitTester $I) + { + $escaper = new Escaper(); + $source = "function createtoc () {" + . "var h2s = document.getElementsByTagName('H2');" + . "l = toc.appendChild(document.createElement('ol'));" + . "for (var i=0; iescapeJs($source); + + $I->assertEquals($expected, $actual); + } + + /** + * Tests the escapeUrl + * + * @author Nikolaos Dimopoulos + * @since 2014-09-16 + */ + public function testEscapeUrl(UnitTester $I) + { + $escaper = new Escaper(); + $expected = 'http%3A%2F%2Fphalconphp.com%2Fa.php%3Fc%3Dd%26e%3Df'; + $actual = $escaper->escapeUrl("http://phalconphp.com/a.php?c=d&e=f"); + + $I->assertEquals($expected, $actual); + } +} diff --git a/tests/unit/VersionCest.php b/tests/unit/VersionCest.php index 76cb440c036..70fdcbaca60 100644 --- a/tests/unit/VersionCest.php +++ b/tests/unit/VersionCest.php @@ -2,6 +2,7 @@ namespace Phalcon\Test\Unit; +use function is_string; use Phalcon\Version; use UnitTester; @@ -15,11 +16,8 @@ class VersionCest */ public function testVersionGet(UnitTester $I) { - $actual = Version::get(); - $I->assertTrue( - is_string($actual), - "get() does not return a string" - ); + $actual = is_string(Version::get()); + $I->assertTrue($actual); } /** @@ -30,11 +28,8 @@ public function testVersionGet(UnitTester $I) */ public function testVersionGetId(UnitTester $I) { - $actual = Version::getId(); - $I->assertTrue( - is_string($actual), - "getId() does not return a string" - ); + $actual = is_string(Version::getId()); + $I->assertTrue($actual); } /** @@ -65,8 +60,7 @@ public function testVersionGetToGetId(UnitTester $I) $expected = "{$major}{$med}{$min}{$special}{$specialNo}"; $actual = Version::getId(); - - $I->assertEquals($expected, $actual, "get() to getId() does not produce the same result"); + $I->assertEquals($expected, $actual); } /** @@ -86,7 +80,7 @@ public function testVersionGetIdToGet(UnitTester $I) $expected = trim("{$major}.{$med}.{$min} {$special} {$specialNo}"); $actual = Version::get(); - $I->assertEquals($expected, $actual, "getId() to get() does not produce the same result"); + $I->assertEquals($expected, $actual); } /** @@ -97,11 +91,11 @@ public function testVersionGetIdToGet(UnitTester $I) */ public function testVersionConstants(UnitTester $I) { - $I->assertEquals(0, Version::VERSION_MAJOR, "VERSION_MAJOR does not return 0"); - $I->assertEquals(1, Version::VERSION_MEDIUM, "VERSION_MAJOR does not return 1"); - $I->assertEquals(2, Version::VERSION_MINOR, "VERSION_MAJOR does not return 2"); - $I->assertEquals(3, Version::VERSION_SPECIAL, "VERSION_MAJOR does not return 3"); - $I->assertEquals(4, Version::VERSION_SPECIAL_NUMBER, "VERSION_MAJOR does not return 4"); + $I->assertEquals(0, Version::VERSION_MAJOR); + $I->assertEquals(1, Version::VERSION_MEDIUM); + $I->assertEquals(2, Version::VERSION_MINOR); + $I->assertEquals(3, Version::VERSION_SPECIAL); + $I->assertEquals(4, Version::VERSION_SPECIAL_NUMBER); } /** @@ -122,28 +116,28 @@ public function testVersionGetPart(UnitTester $I) $id = Version::getId(); $expected = intval($id[0]); //The major version is the first digit $actual = Version::getPart(Version::VERSION_MAJOR); - $I->assertEquals($expected, $actual, "getPart(VERSION_MAJOR) does not return the correct result"); + $I->assertEquals($expected, $actual); $expected = intval($id[1].$id[2]); //The medium version is the second and third digits $actual = Version::getPart(Version::VERSION_MEDIUM); - $I->assertEquals($expected, $actual, "getPart(VERSION_MEDIUM) does not return the correct result"); + $I->assertEquals($expected, $actual); $expected = intval($id[3].$id[4]); //The minor version is the fourth and fifth digits $actual = Version::getPart(Version::VERSION_MINOR); - $I->assertEquals($expected, $actual, "getPart(VERSION_MINOR) does not return the correct result"); + $I->assertEquals($expected, $actual); $expected = $this->numberToSpecial($id[5]); $actual = Version::getPart(Version::VERSION_SPECIAL); - $I->assertEquals($expected, $actual, "getPart(VERSION_SPECIAL) does not return the correct result"); + $I->assertEquals($expected, $actual); $special = $this->numberToSpecial($id[5]); $expected = ($special) ? $id[6] : 0; $actual = Version::getPart(Version::VERSION_SPECIAL_NUMBER); - $I->assertEquals($expected, $actual, "getPart(VERSION_SPECIAL_NUMBER) does not return the correct result"); + $I->assertEquals($expected, $actual); $expected = Version::get(); $actual = Version::getPart(7); - $I->assertEquals($expected, $actual, "getPart() with incorrect parameters does not return get()"); + $I->assertEquals($expected, $actual); } /** From 9f33d8927e4fd0d1f02ef25fb3e63aeb42d1d1c8 Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Sat, 3 Nov 2018 22:24:05 -0400 Subject: [PATCH 004/222] WIP - Modifying tests --- _toCheck/tests/unit/DebugTest.php | 52 ---- _toCheck/tests/unit/SecurityTest.php | 288 ------------------ .../unit/ConfigTest.php_ | 0 .../CryptTest.php => tests/unit/CryptCest.php | 132 +++----- tests/unit/DebugCest.php | 49 +++ tests/unit/SecurityCest.php | 254 +++++++++++++++ 6 files changed, 352 insertions(+), 423 deletions(-) delete mode 100644 _toCheck/tests/unit/DebugTest.php delete mode 100644 _toCheck/tests/unit/SecurityTest.php rename _toCheck/tests/unit/ConfigTest.php => tests/unit/ConfigTest.php_ (100%) rename _toCheck/tests/unit/CryptTest.php => tests/unit/CryptCest.php (64%) create mode 100644 tests/unit/DebugCest.php create mode 100644 tests/unit/SecurityCest.php diff --git a/_toCheck/tests/unit/DebugTest.php b/_toCheck/tests/unit/DebugTest.php deleted file mode 100644 index ce6167ae3c5..00000000000 --- a/_toCheck/tests/unit/DebugTest.php +++ /dev/null @@ -1,52 +0,0 @@ - - * @author Serghei Iakovlev - * @package Phalcon\Test\Unit - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class DebugTest extends UnitTest -{ - /** - * Tests the Debug::getVersion - * - * @issue https://github.com/phalcon/cphalcon/issues/12215 - * @author Serghei Iakovlev - * @since 2016-09-25 - */ - public function testShouldGetVersion() - { - $this->specify( - "The getVersion doesn't work as expected", - function () { - $debug = new Debug; - - $target = '"_new"'; - $uri = '"https://docs.phalconphp.com/en/' . Version::getPart(Version::VERSION_MAJOR) . '.0.0/"'; - $version = Version::get(); - - expect($debug->getVersion())->equals( - "
Phalcon Framework {$version}
" - ); - } - ); - } -} diff --git a/_toCheck/tests/unit/SecurityTest.php b/_toCheck/tests/unit/SecurityTest.php deleted file mode 100644 index 21ca0becc55..00000000000 --- a/_toCheck/tests/unit/SecurityTest.php +++ /dev/null @@ -1,288 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class SecurityTest extends UnitTest -{ - /** - * executed before each test - */ - protected function _before() - { - if (!extension_loaded('openssl')) { - $this->markTestSkipped('Warning: openssl extension is not loaded'); - } - } - - /** - * Tests the Security constants - * - * @author Serghei Iakovlev - * @since 2015-12-19 - */ - public function testSecurityConstants() - { - $this->specify( - 'Security constants are not correct', - function () { - expect(Security::CRYPT_DEFAULT)->equals(0); - expect(Security::CRYPT_STD_DES)->equals(1); - expect(Security::CRYPT_EXT_DES)->equals(2); - expect(Security::CRYPT_MD5)->equals(3); - expect(Security::CRYPT_BLOWFISH)->equals(4); - expect(Security::CRYPT_BLOWFISH_A)->equals(5); - expect(Security::CRYPT_BLOWFISH_X)->equals(6); - expect(Security::CRYPT_BLOWFISH_Y)->equals(7); - expect(Security::CRYPT_SHA256)->equals(8); - expect(Security::CRYPT_SHA512)->equals(9); - } - ); - } - - /** - * Tests the HMAC computation - * - * @author Nikolaos Dimopoulos - * @since 2014-09-12 - */ - public function testSecurityComputeHMAC() - { - $this->specify( - 'The HMAC computation values are not identical', - function ($key) { - $security = new Security(); - - $data = []; - for ($i = 1; $i < 256; ++$i) { - $data[] = str_repeat('a', $i); - } - - foreach ($data as $text) { - expect($security->computeHmac($text, $key, 'md5'))->equals(hash_hmac('md5', $text, $key)); - } - }, - [ - 'examples' => [ - [ - substr(md5('test', true), 0, strlen(md5('test', true)) / 2) - ], - [ - md5('test', true) - ], - [ - md5('test', true) . md5('test', true) - ], - ] - ] - ); - } - - /** - * Tests the security defaults - */ - public function testSecurityDefaults() - { - $this->specify( - 'Security defaults are not correct', - function () { - $s = new Security(); - expect($s->getDefaultHash())->equals(null); - expect($s->getRandomBytes())->equals(16); - - $s->setDefaultHash(1); - expect($s->getDefaultHash())->equals(1); - - $s->setRandomBytes(22); - expect($s->getRandomBytes())->equals(22); - } - ); - } - - /** - * Tests Security::getToken and Security::getTokenKey for generating only one token per request - */ - public function testOneTokenPerRequest() - { - $this->specify( - "The Security::getToken and Security::getTokenKey must return only one token per request", - function () { - $di = $this->setupDI(); - - $s = new Security(); - $s->setDI($di); - - $tokenKey = $s->getTokenKey(); - $token = $s->getToken(); - - expect($tokenKey)->equals($s->getTokenKey()); - expect($token)->equals($s->getToken()); - expect($token)->equals($s->getSessionToken()); - - $s->destroyToken(); - - expect($tokenKey)->notEquals($s->getTokenKey()); - expect($token)->notEquals($s->getToken()); - expect($token)->notEquals($s->getSessionToken()); - - $s->destroyToken(); - } - ); - } - - /** - * Tests Security::checkToken - */ - public function testCheckToken() - { - $this->specify( - 'The Security::checkToken works incorrectly', - function () { - $di = $this->setupDI(); - - $s = new Security(); - $s->setDI($di); - - // Random token and token key check - $tokenKey = $s->getTokenKey(); - $token = $s->getToken(); - - $_POST = [$tokenKey => $token]; - - expect($s->checkToken(null, null, false))->true(); - expect($s->checkToken())->true(); - expect($s->checkToken())->false(); - - // Destroy token check - $tokenKey = $s->getTokenKey(); - $token = $s->getToken(); - - $s->destroyToken(); - - $_POST = [$tokenKey => $token]; - - expect($s->checkToken())->false(); - - // Custom token key check - $token = $s->getToken(); - - $_POST = ['custom_key' => $token]; - - expect($s->checkToken(null, null, false))->false(); - expect($s->checkToken('other_custom_key', null, false))->false(); - expect($s->checkToken('custom_key'))->true(); - - // Custom token value check - $token = $s->getToken(); - - $_POST = []; - - expect($s->checkToken(null, null, false))->false(); - expect($s->checkToken('some_random_key', 'some_random_value', false))->false(); - expect($s->checkToken('custom_key', $token))->true(); - } - ); - } - - /** - * Tests Security::getSaltBytes - */ - public function testGetSaltBytes() - { - $this->specify( - 'The Security::getSaltBytes works incorrectly', - function () { - $s = new Security(); - - expect(strlen($s->getSaltBytes()))->greaterOrEquals(16); - expect(strlen($s->getSaltBytes(22)))->greaterOrEquals(22); - } - ); - } - - /** - * Tests Security::hash - */ - public function testHash() - { - $this->specify( - 'The Security::hash works incorrectly', - function () { - $s = new Security(); - - $password = 'SomePasswordValue'; - - $s->setDefaultHash(Security::CRYPT_DEFAULT); - expect($s->checkHash($password, $s->hash($password)))->true(); - - $s->setDefaultHash(Security::CRYPT_STD_DES); - expect($s->checkHash($password, $s->hash($password)))->true(); - - $s->setDefaultHash(Security::CRYPT_EXT_DES); - expect($s->checkHash($password, $s->hash($password)))->true(); - - $s->setDefaultHash(Security::CRYPT_BLOWFISH); - expect($s->checkHash($password, $s->hash($password)))->true(); - - $s->setDefaultHash(Security::CRYPT_BLOWFISH_A); - expect($s->checkHash($password, $s->hash($password)))->true(); - - $s->setDefaultHash(Security::CRYPT_BLOWFISH_X); - expect($s->checkHash($password, $s->hash($password)))->true(); - - $s->setDefaultHash(Security::CRYPT_BLOWFISH_Y); - expect($s->checkHash($password, $s->hash($password)))->true(); - - $s->setDefaultHash(Security::CRYPT_SHA256); - expect($s->checkHash($password, $s->hash($password)))->true(); - - $s->setDefaultHash(Security::CRYPT_SHA512); - expect($s->checkHash($password, $s->hash($password)))->true(); - } - ); - } - - /** - * Set up the environment. - * - * @return Di - */ - private function setupDI() - { - Di::reset(); - - $di = new Di(); - - $di->setShared('session', function () { - return new MemorySession(); - }); - - $di->setShared('request', function () { - return new Request(); - }); - - return $di; - } -} diff --git a/_toCheck/tests/unit/ConfigTest.php b/tests/unit/ConfigTest.php_ similarity index 100% rename from _toCheck/tests/unit/ConfigTest.php rename to tests/unit/ConfigTest.php_ diff --git a/_toCheck/tests/unit/CryptTest.php b/tests/unit/CryptCest.php similarity index 64% rename from _toCheck/tests/unit/CryptTest.php rename to tests/unit/CryptCest.php index 7996a7b2acb..1694c9d22a6 100644 --- a/_toCheck/tests/unit/CryptTest.php +++ b/tests/unit/CryptCest.php @@ -4,32 +4,14 @@ use Phalcon\Crypt; use Phalcon\Test\Module\UnitTest; +use UnitTester; -/** - * Phalcon\Test\Unit\CryptTest - * Tests the Phalcon\Crypt component - * - * @copyright (c) 2011-2018 Phalcon Team - * @link https://phalconphp.com - * @author Andres Gutierrez - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class CryptTest extends UnitTest +class CryptCest { - public function _before() + public function _before(UnitTester $I, $scenario) { - parent::_before(); - if (!extension_loaded('openssl')) { - $this->markTestSkipped('Warning: openssl extension is not loaded'); + $scenario->skip('Warning: openssl extension is not loaded'); } } @@ -46,18 +28,18 @@ public function _before() */ public function shouldThrowExceptionIfHashMismatch() { - $this->specify( - 'Crypt does not check message digest on decrypt', - function () { - $crypt = new Crypt(); - $crypt->useSigning(true); - - $crypt->decrypt( - $crypt->encrypt('le text', 'encrypt key'), - 'wrong key' - ); - } - ); +// $this->specify( +// 'Crypt does not check message digest on decrypt', +// function () { +// $crypt = new Crypt(); +// $crypt->useSigning(true); +// +// $crypt->decrypt( +// $crypt->encrypt('le text', 'encrypt key'), +// 'wrong key' +// ); +// } +// ); } /** @@ -68,25 +50,19 @@ function () { * @author * @since 2018-05-16 */ - public function shouldDecryptSignedString() + public function shouldDecryptSignedString(UnitTester $I) { - $this->specify( - 'Crypt does not check message digest on decrypt', - function () { - $crypt = new Crypt(); - $crypt->useSigning(true); - - $key = 'secret'; - $crypt->setKey($key); + $crypt = new Crypt(); + $crypt->useSigning(true); - $text = 'le text'; + $key = 'secret'; + $crypt->setKey($key); - $encrypted = $crypt->encrypt($text); - $decrypted = $crypt->decrypt($encrypted); + $expected = 'le text'; + $encrypted = $crypt->encrypt($expected); + $actual = $crypt->decrypt($encrypted); - expect($text)->equals($decrypted); - } - ); + expect($expected)->equals($actual); } /** @@ -97,21 +73,16 @@ function () { * @author * @since 2018-05-16 */ - public function shouldNotThrowExceptionIfKeyMismatch() + public function shouldNotThrowExceptionIfKeyMismatch(UnitTester $I) { - $this->specify( - 'Crypt should not check message digest on decrypt', - function () { - $crypt = new Crypt(); + $crypt = new Crypt(); - $result = $crypt->decrypt( - $crypt->encrypt('le text', 'encrypt key'), - 'wrong key' - ); - - expect($result)->notEmpty(); - } + $actual = $crypt->decrypt( + $crypt->encrypt('le text', 'encrypt key'), + 'wrong key' ); + + $I->assertNotEmpty($actual); } /** @@ -124,15 +95,15 @@ function () { * @expectedException \Phalcon\Crypt\Exception * @expectedExceptionMessage The cipher algorithm "xxx-yyy-zzz" is not supported on this system. */ - public function shouldThrowExceptionIfCipherIsUnknown() + public function shouldThrowExceptionIfCipherIsUnknown(UnitTester $I) { - $this->specify( - 'Crypt does not validate cipher algorithm as expected', - function () { - $crypt = new Crypt(); - $crypt->setCipher('xxx-yyy-zzz'); - } - ); +// $this->specify( +// 'Crypt does not validate cipher algorithm as expected', +// function () { +// $crypt = new Crypt(); +// $crypt->setCipher('xxx-yyy-zzz'); +// } +// ); } /** @@ -141,20 +112,15 @@ function () { * @author Serghei Iakovlev * @since 2015-12-20 */ - public function testCryptConstants() + public function testCryptConstants(UnitTester $I) { - $this->specify( - "Crypt constants are not correct", - function () { - expect(Crypt::PADDING_DEFAULT)->equals(0); - expect(Crypt::PADDING_ANSI_X_923)->equals(1); - expect(Crypt::PADDING_PKCS7)->equals(2); - expect(Crypt::PADDING_ISO_10126)->equals(3); - expect(Crypt::PADDING_ISO_IEC_7816_4)->equals(4); - expect(Crypt::PADDING_ZERO)->equals(5); - expect(Crypt::PADDING_SPACE)->equals(6); - } - ); + $I->assertEquals(0, Crypt::PADDING_DEFAULT); + $I->assertEquals(1, Crypt::PADDING_ANSI_X_923); + $I->assertEquals(2, Crypt::PADDING_PKCS7); + $I->assertEquals(3, Crypt::PADDING_ISO_10126); + $I->assertEquals(4, Crypt::PADDING_ISO_IEC_7816_4); + $I->assertEquals(5, Crypt::PADDING_ZERO); + $I->assertEquals(6, Crypt::PADDING_SPACE); } /** @@ -163,7 +129,7 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-10-17 */ - public function testCryptEncryption() + public function testCryptEncryption(UnitTester $I) { $this->specify( "encryption does not return correct results", diff --git a/tests/unit/DebugCest.php b/tests/unit/DebugCest.php new file mode 100644 index 00000000000..9ed36b5f3bb --- /dev/null +++ b/tests/unit/DebugCest.php @@ -0,0 +1,49 @@ +setShared('url', function () { + return new Url(); + }); + + Di::setDefault($container); + } + + public function _after(UnitTester $I) + { + Di::reset(); + } + + /** + * Tests the Debug::getVersion + * + * @issue https://github.com/phalcon/cphalcon/issues/12215 + * @author Serghei Iakovlev + * @since 2016-09-25 + */ + public function testShouldGetVersion(UnitTester $I) + { + $debug = new Debug; + $target = '"_new"'; + $uri = '"https://docs.phalconphp.com/en/' . Version::getPart(Version::VERSION_MAJOR) . '.0.0/"'; + $version = Version::get(); + + $expected = "
Phalcon Framework {$version}
"; + $actual = $debug->getVersion(); + $I->assertEquals($expected, $actual); + } +} diff --git a/tests/unit/SecurityCest.php b/tests/unit/SecurityCest.php new file mode 100644 index 00000000000..51e96be6c56 --- /dev/null +++ b/tests/unit/SecurityCest.php @@ -0,0 +1,254 @@ +skip('Warning: openssl extension is not loaded'); + } + } + + /** + * Tests the Security constants + * + * @author Serghei Iakovlev + * @since 2015-12-19 + */ + public function testSecurityConstants(UnitTester $I) + { + $I->assertEquals(0, Security::CRYPT_DEFAULT); + $I->assertEquals(1, Security::CRYPT_STD_DES); + $I->assertEquals(2, Security::CRYPT_EXT_DES); + $I->assertEquals(3, Security::CRYPT_MD5); + $I->assertEquals(4, Security::CRYPT_BLOWFISH); + $I->assertEquals(5, Security::CRYPT_BLOWFISH_A); + $I->assertEquals(6, Security::CRYPT_BLOWFISH_X); + $I->assertEquals(7, Security::CRYPT_BLOWFISH_Y); + $I->assertEquals(8, Security::CRYPT_SHA256); + $I->assertEquals(9, Security::CRYPT_SHA512); + } + + /** + * Tests the HMAC computation + * + * @author Nikolaos Dimopoulos + * @since 2014-09-12 + */ + public function testSecurityComputeHMAC(UnitTester $I) + { + $security = new Security(); + + $data = []; + for ($i = 1; $i < 256; ++$i) { + $data[] = str_repeat('a', $i); + } + $keys = [ + substr(md5('test', true), 0, strlen(md5('test', true)) / 2), + md5('test', true), + md5('test', true) . md5('test', true), + ]; + + foreach ($data as $index => $text) { + $expected = hash_hmac('md5', $text, $keys[0]); + $actual = $security->computeHmac($text, $keys[0], 'md5'); + $I->assertEquals($expected, $actual); + $expected = hash_hmac('md5', $text, $keys[1]); + $actual = $security->computeHmac($text, $keys[1], 'md5'); + $I->assertEquals($expected, $actual); + $expected = hash_hmac('md5', $text, $keys[2]); + $actual = $security->computeHmac($text, $keys[2], 'md5'); + $I->assertEquals($expected, $actual); + } + } + + /** + * Tests the security defaults + */ + public function testSecurityDefaults(UnitTester $I) + { + $security = new Security(); + + $expected = null; + $actual = $security->getDefaultHash(); + $I->assertEquals($expected, $actual); + + $expected = 16; + $actual = $security->getRandomBytes(); + $I->assertEquals($expected, $actual); + + $security->setDefaultHash(1); + $expected = 1; + $actual = $security->getDefaultHash(); + $I->assertEquals($expected, $actual); + + $security->setRandomBytes(22); + $expected = 22; + $actual = $security->getRandomBytes(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests Security::getToken and Security::getTokenKey for generating only one token per request + */ + public function testOneTokenPerRequest(UnitTester $I, $scenario) + { + $scenario->skip('TODO - Check Session'); + $di = $this->setupDI(); + + $security = new Security(); + $security->setDI($di); + + $tokenKey = $security->getTokenKey(); + $token = $security->getToken(); + + $expected = $tokenKey; + $actual = $security->getTokenKey(); + $I->assertEquals($expected, $actual); + + $expected = $token; + $actual = $security->getToken(); + $I->assertEquals($expected, $actual); + + $expected = $token; + $actual = $security->getSessionToken(); + $I->assertEquals($expected, $actual); + + $security->destroyToken(); + + $expected = $tokenKey; + $actual = $security->getTokenKey(); + $I->assertNotEquals($expected, $actual); + + $expected = $token; + $actual = $security->getToken(); + $I->asserNottEquals($expected, $actual); + + $expected = $token; + $actual = $security->getSessionToken(); + $I->assertNotEquals($expected, $actual); + + $security->destroyToken(); + } + + /** + * Tests Security::checkToken + */ + public function testCheckToken(UnitTester $I, $scenario) + { + $scenario->skip('TODO - Check Session'); + $di = $this->setupDI(); + + $security = new Security(); + $security->setDI($di); + + // Random token and token key check + $tokenKey = $security->getTokenKey(); + $token = $security->getToken(); + $_POST = [$tokenKey => $token]; + $I->assertTrue($security->checkToken(null, null, false)); + $I->assertTrue($security->checkToken()); + $I->assertFalse($security->checkToken()); + + // Destroy token check + $tokenKey = $security->getTokenKey(); + $token = $security->getToken(); + $security->destroyToken(); + + $_POST = [$tokenKey => $token]; + $I->assertFalse($security->checkToken()); + + // Custom token key check + $token = $security->getToken(); + $_POST = ['custom_key' => $token]; + $I->assertFalse($security->checkToken(null, null, false)); + $I->assertFalse($security->checkToken('other_custom_key', null, false)); + $I->assertTrue($security->checkToken('custom_key')); + + // Custom token value check + $token = $security->getToken(); + $_POST = []; + $I->assertFalse($security->checkToken(null, null, false)); + $I->assertFalse($security->checkToken('some_random_key', 'some_random_value', false)); + $I->assertTrue($security->checkToken('custom_key', $token)); + } + + /** + * Tests Security::getSaltBytes + */ + public function testGetSaltBytes(UnitTester $I) + { + $security = new Security(); + + $I->assertGreaterOrEquals(16, strlen($security->getSaltBytes())); + $I->assertGreaterOrEquals(22, strlen($security->getSaltBytes(22))); + } + + /** + * Tests Security::hash + */ + public function testHash(UnitTester $I) + { + $security = new Security(); + $password = 'SomePasswordValue'; + + $security->setDefaultHash(Security::CRYPT_DEFAULT); + $I->assertTrue($security->checkHash($password, $security->hash($password))); + + $security->setDefaultHash(Security::CRYPT_STD_DES); + $I->assertTrue($security->checkHash($password, $security->hash($password))); + + $security->setDefaultHash(Security::CRYPT_EXT_DES); + $I->assertTrue($security->checkHash($password, $security->hash($password))); + + $security->setDefaultHash(Security::CRYPT_BLOWFISH); + $I->assertTrue($security->checkHash($password, $security->hash($password))); + + $security->setDefaultHash(Security::CRYPT_BLOWFISH_A); + $I->assertTrue($security->checkHash($password, $security->hash($password))); + + $security->setDefaultHash(Security::CRYPT_BLOWFISH_X); + $I->assertTrue($security->checkHash($password, $security->hash($password))); + + $security->setDefaultHash(Security::CRYPT_BLOWFISH_Y); + $I->assertTrue($security->checkHash($password, $security->hash($password))); + + $security->setDefaultHash(Security::CRYPT_SHA256); + $I->assertTrue($security->checkHash($password, $security->hash($password))); + + $security->setDefaultHash(Security::CRYPT_SHA512); + $I->assertTrue($security->checkHash($password, $security->hash($password))); + } + + /** + * Set up the environment. + * + * @return Di + */ + private function setupDI() + { + Di::reset(); + + $di = new Di(); + +// $di->setShared('session', function () { +// return new Files(); +// }); + + $di->setShared('request', function () { + return new Request(); + }); + + return $di; + } +} From c735b43e07a378e60f8c70e62fd9f1148e31a22f Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Sun, 4 Nov 2018 12:39:41 -0500 Subject: [PATCH 005/222] [#13578] - Updated docblocks, started work for Config --- .../tests/unit/Config/Helper/ConfigBase.php | 60 ------ composer.json | 1 + .../unit/Config/Adapter/GroupedTest.php_ | 0 .../unit/Config/Adapter/IniTest.php_ | 0 .../unit/Config/Adapter/JsonTest.php_ | 0 .../unit/Config/Adapter/PhpTest.php_ | 0 .../unit/Config/Adapter/YamlTest.php_ | 0 .../ConfigCest.php_} | 42 +--- .../unit/Config/FactoryTest.php_ | 0 tests/unit/Config/Helper/ConfigBase.php | 44 ++++ tests/unit/CryptCest.php | 202 ++++++++---------- tests/unit/DebugCest.php | 8 + tests/unit/EscaperCest.php | 8 + tests/unit/SecurityCest.php | 8 + tests/unit/VersionCest.php | 8 + tests/unit/_bootstrap.php | 11 +- 16 files changed, 187 insertions(+), 205 deletions(-) delete mode 100644 _toCheck/tests/unit/Config/Helper/ConfigBase.php rename _toCheck/tests/unit/Config/Adapter/GroupedTest.php => tests/unit/Config/Adapter/GroupedTest.php_ (100%) rename _toCheck/tests/unit/Config/Adapter/IniTest.php => tests/unit/Config/Adapter/IniTest.php_ (100%) rename _toCheck/tests/unit/Config/Adapter/JsonTest.php => tests/unit/Config/Adapter/JsonTest.php_ (100%) rename _toCheck/tests/unit/Config/Adapter/PhpTest.php => tests/unit/Config/Adapter/PhpTest.php_ (100%) rename _toCheck/tests/unit/Config/Adapter/YamlTest.php => tests/unit/Config/Adapter/YamlTest.php_ (100%) rename tests/unit/{ConfigTest.php_ => Config/ConfigCest.php_} (86%) rename _toCheck/tests/unit/Config/FactoryTest.php => tests/unit/Config/FactoryTest.php_ (100%) create mode 100644 tests/unit/Config/Helper/ConfigBase.php diff --git a/_toCheck/tests/unit/Config/Helper/ConfigBase.php b/_toCheck/tests/unit/Config/Helper/ConfigBase.php deleted file mode 100644 index 15c35e9d883..00000000000 --- a/_toCheck/tests/unit/Config/Helper/ConfigBase.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @package Phalcon\Test\Unit\Config\Helper - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class ConfigBase extends UnitTest -{ - protected $config = [ - 'phalcon' => [ - 'baseuri' => '/phalcon/' - ], - 'models' => [ - 'metadata' => 'memory' - ], - 'database' => [ - 'adapter' => 'mysql', - 'host' => 'localhost', - 'username' => 'user', - 'password' => 'passwd', - 'name' => 'demo' - ], - 'test' => [ - 'parent' => [ - 'property' => 1, - 'property2' => 'yeah' - ], - ], - ]; - - protected function compareConfig(array $actual, Config $expected) - { - $this->assertEquals($actual, $expected->toArray()); - - foreach ($actual as $key => $value) { - $this->assertTrue(isset($expected->$key)); - - if (is_array($value)) { - $this->compareConfig($value, $expected->$key); - } - } - } -} diff --git a/composer.json b/composer.json index 6ea32739413..c7cea039cff 100644 --- a/composer.json +++ b/composer.json @@ -44,6 +44,7 @@ "codeception/specify": "1.0.*", "codeception/verify": "1.0.*", "mustache/mustache": "^2.11", + "phalcon/zephir": "^0.11.1", "phpunit/phpunit": "^6.4", "predis/predis": "^1.1", "squizlabs/php_codesniffer": "^3.2", diff --git a/_toCheck/tests/unit/Config/Adapter/GroupedTest.php b/tests/unit/Config/Adapter/GroupedTest.php_ similarity index 100% rename from _toCheck/tests/unit/Config/Adapter/GroupedTest.php rename to tests/unit/Config/Adapter/GroupedTest.php_ diff --git a/_toCheck/tests/unit/Config/Adapter/IniTest.php b/tests/unit/Config/Adapter/IniTest.php_ similarity index 100% rename from _toCheck/tests/unit/Config/Adapter/IniTest.php rename to tests/unit/Config/Adapter/IniTest.php_ diff --git a/_toCheck/tests/unit/Config/Adapter/JsonTest.php b/tests/unit/Config/Adapter/JsonTest.php_ similarity index 100% rename from _toCheck/tests/unit/Config/Adapter/JsonTest.php rename to tests/unit/Config/Adapter/JsonTest.php_ diff --git a/_toCheck/tests/unit/Config/Adapter/PhpTest.php b/tests/unit/Config/Adapter/PhpTest.php_ similarity index 100% rename from _toCheck/tests/unit/Config/Adapter/PhpTest.php rename to tests/unit/Config/Adapter/PhpTest.php_ diff --git a/_toCheck/tests/unit/Config/Adapter/YamlTest.php b/tests/unit/Config/Adapter/YamlTest.php_ similarity index 100% rename from _toCheck/tests/unit/Config/Adapter/YamlTest.php rename to tests/unit/Config/Adapter/YamlTest.php_ diff --git a/tests/unit/ConfigTest.php_ b/tests/unit/Config/ConfigCest.php_ similarity index 86% rename from tests/unit/ConfigTest.php_ rename to tests/unit/Config/ConfigCest.php_ index b6900773e9c..81aa3ffb064 100644 --- a/tests/unit/ConfigTest.php_ +++ b/tests/unit/Config/ConfigCest.php_ @@ -5,23 +5,6 @@ namespace Phalcon\Test\Unit; use Phalcon\Config; use Phalcon\Test\Unit\Config\Helper\ConfigBase; -/** - * \Phalcon\Test\Unit\ConfigTest - * Tests the \Phalcon\Config component - * - * @copyright (c) 2011-2017 Phalcon Team - * @link https://phalconphp.com - * @author Andres Gutierrez - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ class ConfigTest extends ConfigBase { /** @@ -30,22 +13,17 @@ class ConfigTest extends ConfigBase * @author michanismus * @since 2017-03-29 */ - public function testConfigPath() + public function testConfigPath(\UnitTester $I) { - $this->specify( - "Config path does not return expected value", - function () { - $config = new Config($this->config); - expect($config->path('test.parent.property2'))->equals('yeah'); - expect($config->path('test.parent.property3', 'No'))->equals('No'); - expect($config->path('test.parent'))->isInstanceOf('Phalcon\Config'); - expect($config->path('unknown.path'))->equals(null); - Config::setPathDelimiter('/'); - expect($config->path('test.parent.property2', false))->equals(false); - expect($config->path('test/parent/property2'))->equals('yeah'); - expect($config->path('test/parent'))->isInstanceOf('Phalcon\Config'); - } - ); + $config = new Config($this->config); + expect($config->path('test.parent.property2'))->equals('yeah'); + expect($config->path('test.parent.property3', 'No'))->equals('No'); + expect($config->path('test.parent'))->isInstanceOf('Phalcon\Config'); + expect($config->path('unknown.path'))->equals(null); + Config::setPathDelimiter('/'); + expect($config->path('test.parent.property2', false))->equals(false); + expect($config->path('test/parent/property2'))->equals('yeah'); + expect($config->path('test/parent'))->isInstanceOf('Phalcon\Config'); } /** diff --git a/_toCheck/tests/unit/Config/FactoryTest.php b/tests/unit/Config/FactoryTest.php_ similarity index 100% rename from _toCheck/tests/unit/Config/FactoryTest.php rename to tests/unit/Config/FactoryTest.php_ diff --git a/tests/unit/Config/Helper/ConfigBase.php b/tests/unit/Config/Helper/ConfigBase.php new file mode 100644 index 00000000000..b90c2b2de0a --- /dev/null +++ b/tests/unit/Config/Helper/ConfigBase.php @@ -0,0 +1,44 @@ + [ + 'baseuri' => '/phalcon/' + ], + 'models' => [ + 'metadata' => 'memory' + ], + 'database' => [ + 'adapter' => 'mysql', + 'host' => 'localhost', + 'username' => 'user', + 'password' => 'passwd', + 'name' => 'demo' + ], + 'test' => [ + 'parent' => [ + 'property' => 1, + 'property2' => 'yeah' + ], + ], + ]; + + protected function compareConfig(\UnitTester $I, array $actual, Config $expected) + { + $I->assertEquals($actual, $expected->toArray()); + + foreach ($actual as $key => $value) { + $I->assertTrue(isset($expected->$key)); + + if (is_array($value)) { + $this->compareConfig($I, $value, $expected->$key); + } + } + } +} diff --git a/tests/unit/CryptCest.php b/tests/unit/CryptCest.php index 1694c9d22a6..f2d000ce36c 100644 --- a/tests/unit/CryptCest.php +++ b/tests/unit/CryptCest.php @@ -6,6 +6,14 @@ use Phalcon\Test\Module\UnitTest; use UnitTester; +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ class CryptCest { public function _before(UnitTester $I, $scenario) @@ -26,20 +34,16 @@ public function _before(UnitTester $I, $scenario) * @expectedException \Phalcon\Crypt\Mismatch * @expectedExceptionMessage Hash does not match. */ - public function shouldThrowExceptionIfHashMismatch() + public function shouldThrowExceptionIfHashMismatch(UnitTester $I, $scenario) { -// $this->specify( -// 'Crypt does not check message digest on decrypt', -// function () { -// $crypt = new Crypt(); -// $crypt->useSigning(true); -// -// $crypt->decrypt( -// $crypt->encrypt('le text', 'encrypt key'), -// 'wrong key' -// ); -// } -// ); + $scenario->skip('TODO - Check exception'); + $crypt = new Crypt(); + $crypt->useSigning(true); + + $crypt->decrypt( + $crypt->encrypt('le text', 'encrypt key'), + 'wrong key' + ); } /** @@ -95,15 +99,11 @@ public function shouldNotThrowExceptionIfKeyMismatch(UnitTester $I) * @expectedException \Phalcon\Crypt\Exception * @expectedExceptionMessage The cipher algorithm "xxx-yyy-zzz" is not supported on this system. */ - public function shouldThrowExceptionIfCipherIsUnknown(UnitTester $I) + public function shouldThrowExceptionIfCipherIsUnknown(UnitTester $I, $scenario) { -// $this->specify( -// 'Crypt does not validate cipher algorithm as expected', -// function () { -// $crypt = new Crypt(); -// $crypt->setCipher('xxx-yyy-zzz'); -// } -// ); + $scenario->skip('TODO - Check exception'); + $crypt = new Crypt(); + $crypt->setCipher('xxx-yyy-zzz'); } /** @@ -131,45 +131,36 @@ public function testCryptConstants(UnitTester $I) */ public function testCryptEncryption(UnitTester $I) { - $this->specify( - "encryption does not return correct results", - function () { - $tests = [ - md5(uniqid()) => str_repeat('x', mt_rand(1, 255)), - time().time() => str_shuffle('abcdefeghijklmnopqrst'), - 'le$ki12432543543543543' => null, - ]; - $ciphers = [ - 'AES-128-ECB', - 'AES-128-CBC', - 'AES-128-CFB', - 'AES-128-OFB', - 'AES128', - ]; - - $crypt = new Crypt(); + $tests = [ + md5(uniqid()) => str_repeat('x', mt_rand(1, 255)), + time().time() => str_shuffle('abcdefeghijklmnopqrst'), + 'le$ki12432543543543543' => "", + ]; + $ciphers = [ + 'AES-128-ECB', + 'AES-128-CBC', + 'AES-128-CFB', + 'AES-128-OFB', + 'AES128', + ]; - foreach ($ciphers as $cipher) { - $crypt->setCipher($cipher); - - foreach ($tests as $key => $test) { - $crypt->setKey(substr($key, 0, 16)); - $encryption = $crypt->encrypt($test); - $actual = rtrim($crypt->decrypt($encryption), "\0"); - - expect($actual)->equals($test); - } - - foreach ($tests as $key => $test) { - $encryption = $crypt->encrypt($test, substr($key, 0, 16)); - - $actual = rtrim($crypt->decrypt($encryption, substr($key, 0, 16)), "\0"); + $crypt = new Crypt(); + foreach ($ciphers as $cipher) { + $crypt->setCipher($cipher); + + foreach ($tests as $key => $test) { + $crypt->setKey(substr($key, 0, 16)); + $encryption = $crypt->encrypt($test); + $actual = rtrim($crypt->decrypt($encryption), "\0"); + $I->assertEquals($test, $actual); + } - expect($actual)->equals($test); - } - } + foreach ($tests as $key => $test) { + $encryption = $crypt->encrypt($test, substr($key, 0, 16)); + $actual = rtrim($crypt->decrypt($encryption, substr($key, 0, 16)), "\0"); + $I->assertEquals($test, $actual); } - ); + } } /** @@ -178,50 +169,44 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-10-17 */ - public function testCryptPadding() + public function testCryptPadding(UnitTester $I) { - $this->specify( - "padding not return correct results", - function () { - $texts = ['']; - $key = '0123456789ABCDEF0123456789ABCDEF'; - $ciphers = [ - 'AES-256-ECB', - 'AES-256-CBC', - 'AES-256-CFB', - ]; - $pads = [ - Crypt::PADDING_ANSI_X_923, - Crypt::PADDING_PKCS7, - Crypt::PADDING_ISO_10126, - Crypt::PADDING_ISO_IEC_7816_4, - Crypt::PADDING_ZERO, - Crypt::PADDING_SPACE - ]; - - for ($i = 1; $i < 128; ++$i) { - $texts[] = str_repeat('A', $i); - } - - $crypt = new Crypt(); - $crypt->setKey(substr($key, 0, 32)); + $texts = ['']; + $key = '0123456789ABCDEF0123456789ABCDEF'; + $ciphers = [ + 'AES-256-ECB', + 'AES-256-CBC', + 'AES-256-CFB', + ]; + $pads = [ + Crypt::PADDING_ANSI_X_923, + Crypt::PADDING_PKCS7, + Crypt::PADDING_ISO_10126, + Crypt::PADDING_ISO_IEC_7816_4, + Crypt::PADDING_ZERO, + Crypt::PADDING_SPACE + ]; + + for ($i = 1; $i < 128; ++$i) { + $texts[] = str_repeat('A', $i); + } - foreach ($pads as $padding) { - $crypt->setPadding($padding); + $crypt = new Crypt(); + $crypt->setKey(substr($key, 0, 32)); - foreach ($ciphers as $cipher) { - $crypt->setCipher($cipher); + foreach ($pads as $padding) { + $crypt->setPadding($padding); - foreach ($texts as $text) { - $encrypted = $crypt->encrypt($text); - $actual = $crypt->decrypt($encrypted); + foreach ($ciphers as $cipher) { + $crypt->setCipher($cipher); - expect($actual)->equals($text); - } - } + foreach ($texts as $expected) { + $encrypted = $crypt->encrypt($expected); + $actual = $crypt->decrypt($encrypted); + $I->assertEquals($expected, $actual); } } - ); + } } /** @@ -230,27 +215,20 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-10-17 */ - public function testCryptEncryptBase64() + public function testCryptEncryptBase64(UnitTester $I) { - $this->specify( - "encryption base 64does not return correct results", - function () { - $crypt = new Crypt(); - $crypt->setPadding(Crypt::PADDING_ANSI_X_923); - - $key = substr('phalcon notice 13123123', 0, 16); - $expected = 'https://github.com/phalcon/cphalcon/issues?state=open'; - - $encrypted = $crypt->encryptBase64($expected, substr($key, 0, 16)); - $actual = $crypt->decryptBase64($encrypted, $key); + $crypt = new Crypt(); + $crypt->setPadding(Crypt::PADDING_ANSI_X_923); - expect($actual)->equals($expected); + $key = substr('phalcon notice 13123123', 0, 16); + $expected = 'https://github.com/phalcon/cphalcon/issues?state=open'; - $encrypted = $crypt->encryptBase64($expected, $key, true); - $actual = $crypt->decryptBase64($encrypted, $key, true); + $encrypted = $crypt->encryptBase64($expected, substr($key, 0, 16)); + $actual = $crypt->decryptBase64($encrypted, $key); + $I->assertEquals($expected, $actual); - expect($actual)->equals($expected); - } - ); + $encrypted = $crypt->encryptBase64($expected, $key, true); + $actual = $crypt->decryptBase64($encrypted, $key, true); + $I->assertEquals($expected, $actual); } } diff --git a/tests/unit/DebugCest.php b/tests/unit/DebugCest.php index 9ed36b5f3bb..5aeebe250c1 100644 --- a/tests/unit/DebugCest.php +++ b/tests/unit/DebugCest.php @@ -9,6 +9,14 @@ use Phalcon\Mvc\Url; use UnitTester; +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ class DebugCest { public function _before(UnitTester $I) diff --git a/tests/unit/EscaperCest.php b/tests/unit/EscaperCest.php index c670a5a6fec..6fdd5950821 100644 --- a/tests/unit/EscaperCest.php +++ b/tests/unit/EscaperCest.php @@ -7,6 +7,14 @@ use Phalcon\Test\Module\UnitTest; use UnitTester; +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ class EscaperCest { /** diff --git a/tests/unit/SecurityCest.php b/tests/unit/SecurityCest.php index 51e96be6c56..183c92cd16c 100644 --- a/tests/unit/SecurityCest.php +++ b/tests/unit/SecurityCest.php @@ -7,6 +7,14 @@ use Phalcon\Http\Request; use UnitTester; +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ class SecurityCest { /** diff --git a/tests/unit/VersionCest.php b/tests/unit/VersionCest.php index 70fdcbaca60..6c618cd3c34 100644 --- a/tests/unit/VersionCest.php +++ b/tests/unit/VersionCest.php @@ -6,6 +6,14 @@ use Phalcon\Version; use UnitTester; +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ class VersionCest { /** diff --git a/tests/unit/_bootstrap.php b/tests/unit/_bootstrap.php index 8a885558065..a705e5cb99a 100644 --- a/tests/unit/_bootstrap.php +++ b/tests/unit/_bootstrap.php @@ -1,2 +1,11 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + From 16d29e39791b8766b50b76cb2c1d8db2246607fe Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Sun, 4 Nov 2018 12:43:41 -0500 Subject: [PATCH 006/222] [#13578] - Adjusted docblocks --- tests/unit/CryptCest.php | 13 +++++++------ tests/unit/DebugCest.php | 17 +++++++++-------- tests/unit/EscaperCest.php | 15 ++++++++------- tests/unit/SecurityCest.php | 15 ++++++++------- tests/unit/VersionCest.php | 13 +++++++------ 5 files changed, 39 insertions(+), 34 deletions(-) diff --git a/tests/unit/CryptCest.php b/tests/unit/CryptCest.php index f2d000ce36c..08900825e55 100644 --- a/tests/unit/CryptCest.php +++ b/tests/unit/CryptCest.php @@ -1,11 +1,5 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Phalcon\Test\Unit; use Phalcon\Di; @@ -9,14 +18,6 @@ use Phalcon\Mvc\Url; use UnitTester; -/** - * This file is part of the Phalcon Framework. - * - * (c) Phalcon Team - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ class DebugCest { public function _before(UnitTester $I) diff --git a/tests/unit/EscaperCest.php b/tests/unit/EscaperCest.php index 6fdd5950821..cfdd982f49d 100644 --- a/tests/unit/EscaperCest.php +++ b/tests/unit/EscaperCest.php @@ -1,12 +1,5 @@ Date: Sun, 4 Nov 2018 13:50:12 -0500 Subject: [PATCH 007/222] [#13578] - Added copyright notice; Refactored Config tests --- _toCheck/tests/shim.php | 27 -- .../tests/unit/Factory/Helper/FactoryBase.php | 30 -- tests/_bootstrap.php | 112 +++--- .../_data/config/callbacks.yml | 0 .../_data/config/config-with-constants.ini | 0 .../tests => tests}/_data/config/config.ini | 0 .../tests => tests}/_data/config/config.json | 0 .../tests => tests}/_data/config/config.php | 0 .../tests => tests}/_data/config/config.yml | 0 .../_data/config/directive.ini | 0 .../tests => tests}/_data/config/factory.ini | 0 tests/unit/Config/Adapter/GroupedCest.php | 77 ++++ tests/unit/Config/Adapter/GroupedTest.php_ | 88 ----- tests/unit/Config/Adapter/IniCest.php | 97 +++++ tests/unit/Config/Adapter/IniTest.php_ | 118 ------ tests/unit/Config/Adapter/JsonCest.php | 31 ++ tests/unit/Config/Adapter/JsonTest.php_ | 43 -- tests/unit/Config/Adapter/PhpCest.php | 31 ++ tests/unit/Config/Adapter/PhpTest.php_ | 43 -- tests/unit/Config/Adapter/YamlCest.php | 71 ++++ tests/unit/Config/Adapter/YamlTest.php_ | 82 ---- tests/unit/Config/ConfigCest.php | 368 ++++++++++++++++++ tests/unit/Config/ConfigCest.php_ | 332 ---------------- tests/unit/Config/FactoryCest.php | 84 ++++ tests/unit/Config/FactoryTest.php_ | 85 ---- tests/unit/Config/Helper/ConfigBase.php | 20 +- tests/unit/CryptCest.php | 55 +-- tests/unit/DebugCest.php | 8 +- tests/unit/EscaperCest.php | 9 +- tests/unit/SecurityCest.php | 69 ++-- tests/unit/VersionCest.php | 134 +++---- tests/unit/_bootstrap.php | 4 +- 32 files changed, 968 insertions(+), 1050 deletions(-) delete mode 100644 _toCheck/tests/shim.php delete mode 100644 _toCheck/tests/unit/Factory/Helper/FactoryBase.php rename {_toCheck/tests => tests}/_data/config/callbacks.yml (100%) rename {_toCheck/tests => tests}/_data/config/config-with-constants.ini (100%) rename {_toCheck/tests => tests}/_data/config/config.ini (100%) rename {_toCheck/tests => tests}/_data/config/config.json (100%) rename {_toCheck/tests => tests}/_data/config/config.php (100%) rename {_toCheck/tests => tests}/_data/config/config.yml (100%) rename {_toCheck/tests => tests}/_data/config/directive.ini (100%) rename {_toCheck/tests => tests}/_data/config/factory.ini (100%) create mode 100644 tests/unit/Config/Adapter/GroupedCest.php delete mode 100644 tests/unit/Config/Adapter/GroupedTest.php_ create mode 100644 tests/unit/Config/Adapter/IniCest.php delete mode 100644 tests/unit/Config/Adapter/IniTest.php_ create mode 100644 tests/unit/Config/Adapter/JsonCest.php delete mode 100644 tests/unit/Config/Adapter/JsonTest.php_ create mode 100644 tests/unit/Config/Adapter/PhpCest.php delete mode 100644 tests/unit/Config/Adapter/PhpTest.php_ create mode 100644 tests/unit/Config/Adapter/YamlCest.php delete mode 100644 tests/unit/Config/Adapter/YamlTest.php_ create mode 100644 tests/unit/Config/ConfigCest.php delete mode 100644 tests/unit/Config/ConfigCest.php_ create mode 100644 tests/unit/Config/FactoryCest.php delete mode 100644 tests/unit/Config/FactoryTest.php_ diff --git a/_toCheck/tests/shim.php b/_toCheck/tests/shim.php deleted file mode 100644 index 4a16a6eac86..00000000000 --- a/_toCheck/tests/shim.php +++ /dev/null @@ -1,27 +0,0 @@ - - * @author Serghei Iakovlev - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ - -if (!function_exists('env')) { - function env($key, $default = null) - { - if (defined($key)) { - return constant($key); - } - - return getenv($key) ?: $default; - } -} diff --git a/_toCheck/tests/unit/Factory/Helper/FactoryBase.php b/_toCheck/tests/unit/Factory/Helper/FactoryBase.php deleted file mode 100644 index 4b4029f745b..00000000000 --- a/_toCheck/tests/unit/Factory/Helper/FactoryBase.php +++ /dev/null @@ -1,30 +0,0 @@ -config = new Ini(PATH_DATA."config/factory.ini", INI_SCANNER_NORMAL); - $this->arrayConfig = $this->config->toArray(); - } -} diff --git a/tests/_bootstrap.php b/tests/_bootstrap.php index 850ca0cfa24..475d358d947 100644 --- a/tests/_bootstrap.php +++ b/tests/_bootstrap.php @@ -40,60 +40,58 @@ ini_set('xdebug.var_display_max_depth', 4); } -$defaults = [ - // General - "TEST_CACHE_DIR" => TESTS_PATH . '_cache' . DIRECTORY_SEPARATOR, - - // Beanstalk - "TEST_BT_HOST" => '127.0.0.1', - "TEST_BT_PORT" => 11300, - - // Memcached - "TEST_MC_HOST" => '127.0.0.1', - "TEST_MC_PORT" => 11211, - "TEST_MC_WEIGHT" => 1, - - // SQLite - "TEST_DB_SQLITE_NAME" => PATH_OUTPUT . 'phalcon_test.sqlite', - "TEST_DB_I18N_SQLITE_NAME" => PATH_OUTPUT . 'translations.sqlite', - - // MySQL - "TEST_DB_MYSQL_HOST" => '127.0.0.1', - "TEST_DB_MYSQL_PORT" => 3306, - "TEST_DB_MYSQL_USER" => 'root', - "TEST_DB_MYSQL_PASSWD" => '', - "TEST_DB_MYSQL_NAME" => 'phalcon_test', - "TEST_DB_MYSQL_CHARSET" => 'utf8', - - // Postgresql - "TEST_DB_POSTGRESQL_HOST" => '127.0.0.1', - "TEST_DB_POSTGRESQL_PORT" => 5432, - "TEST_DB_POSTGRESQL_USER" => 'postgres', - "TEST_DB_POSTGRESQL_PASSWD" => '', - "TEST_DB_POSTGRESQL_NAME" => 'phalcon_test', - "TEST_DB_POSTGRESQL_SCHEMA" => 'public', - - // Mongo - "TEST_DB_MONGO_HOST" => '127.0.0.1', - "TEST_DB_MONGO_PORT" => 27017, - "TEST_DB_MONGO_USER" => 'admin', - "TEST_DB_MONGO_PASSWD" => '', - "TEST_DB_MONGO_NAME" => 'phalcon_test', - - // Redis - "TEST_RS_HOST" => '127.0.0.1', - "TEST_RS_PORT" => 6379, - "TEST_RS_DB" => 0, -]; - - - -foreach ($defaults as $key => $defaultValue) { - if (defined($key)) { - continue; - } - - $value = getenv($key) ?: $defaultValue; - - define($key, $value); -} +//$defaults = [ +// // General +// "TEST_CACHE_DIR" => TESTS_PATH . '_cache' . DIRECTORY_SEPARATOR, +// +// // Beanstalk +// "TEST_BT_HOST" => '127.0.0.1', +// "TEST_BT_PORT" => 11300, +// +// // Memcached +// "TEST_MC_HOST" => '127.0.0.1', +// "TEST_MC_PORT" => 11211, +// "TEST_MC_WEIGHT" => 1, +// +// // SQLite +// "TEST_DB_SQLITE_NAME" => PATH_OUTPUT . 'phalcon_test.sqlite', +// "TEST_DB_I18N_SQLITE_NAME" => PATH_OUTPUT . 'translations.sqlite', +// +// // MySQL +// "TEST_DB_MYSQL_HOST" => '127.0.0.1', +// "TEST_DB_MYSQL_PORT" => 3306, +// "TEST_DB_MYSQL_USER" => 'root', +// "TEST_DB_MYSQL_PASSWD" => '', +// "TEST_DB_MYSQL_NAME" => 'phalcon_test', +// "TEST_DB_MYSQL_CHARSET" => 'utf8', +// +// // Postgresql +// "TEST_DB_POSTGRESQL_HOST" => '127.0.0.1', +// "TEST_DB_POSTGRESQL_PORT" => 5432, +// "TEST_DB_POSTGRESQL_USER" => 'postgres', +// "TEST_DB_POSTGRESQL_PASSWD" => '', +// "TEST_DB_POSTGRESQL_NAME" => 'phalcon_test', +// "TEST_DB_POSTGRESQL_SCHEMA" => 'public', +// +// // Mongo +// "TEST_DB_MONGO_HOST" => '127.0.0.1', +// "TEST_DB_MONGO_PORT" => 27017, +// "TEST_DB_MONGO_USER" => 'admin', +// "TEST_DB_MONGO_PASSWD" => '', +// "TEST_DB_MONGO_NAME" => 'phalcon_test', +// +// // Redis +// "TEST_RS_HOST" => '127.0.0.1', +// "TEST_RS_PORT" => 6379, +// "TEST_RS_DB" => 0, +//]; +// +//foreach ($defaults as $key => $defaultValue) { +// if (defined($key)) { +// continue; +// } +// +// $value = getenv($key) ?: $defaultValue; +// +// define($key, $value); +//} diff --git a/_toCheck/tests/_data/config/callbacks.yml b/tests/_data/config/callbacks.yml similarity index 100% rename from _toCheck/tests/_data/config/callbacks.yml rename to tests/_data/config/callbacks.yml diff --git a/_toCheck/tests/_data/config/config-with-constants.ini b/tests/_data/config/config-with-constants.ini similarity index 100% rename from _toCheck/tests/_data/config/config-with-constants.ini rename to tests/_data/config/config-with-constants.ini diff --git a/_toCheck/tests/_data/config/config.ini b/tests/_data/config/config.ini similarity index 100% rename from _toCheck/tests/_data/config/config.ini rename to tests/_data/config/config.ini diff --git a/_toCheck/tests/_data/config/config.json b/tests/_data/config/config.json similarity index 100% rename from _toCheck/tests/_data/config/config.json rename to tests/_data/config/config.json diff --git a/_toCheck/tests/_data/config/config.php b/tests/_data/config/config.php similarity index 100% rename from _toCheck/tests/_data/config/config.php rename to tests/_data/config/config.php diff --git a/_toCheck/tests/_data/config/config.yml b/tests/_data/config/config.yml similarity index 100% rename from _toCheck/tests/_data/config/config.yml rename to tests/_data/config/config.yml diff --git a/_toCheck/tests/_data/config/directive.ini b/tests/_data/config/directive.ini similarity index 100% rename from _toCheck/tests/_data/config/directive.ini rename to tests/_data/config/directive.ini diff --git a/_toCheck/tests/_data/config/factory.ini b/tests/_data/config/factory.ini similarity index 100% rename from _toCheck/tests/_data/config/factory.ini rename to tests/_data/config/factory.ini diff --git a/tests/unit/Config/Adapter/GroupedCest.php b/tests/unit/Config/Adapter/GroupedCest.php new file mode 100644 index 00000000000..0d0caae3b89 --- /dev/null +++ b/tests/unit/Config/Adapter/GroupedCest.php @@ -0,0 +1,77 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Config\Adapter; + +use Phalcon\Config\Adapter\Grouped; +use Phalcon\Test\Unit\Config\Helper\ConfigBase; +use UnitTester; + +class GroupedCest extends ConfigBase +{ + /** + * Tests Grouped config + * + * @test + * @author fenikkusu + * @since 2017-06-06 + */ + public function shouldCreateComplexConfigInstance(UnitTester $I) + { + $this->config["test"]["property2"] = "something-else"; + + $config = new Grouped( + [ + PATH_DATA . 'config/config.php', + [ + 'filePath' => PATH_DATA . 'config/config.json', + 'adapter' => 'json', + ], + [ + 'adapter' => 'array', + 'config' => [ + "test" => [ + "property2" => "something-else", + ], + ], + ], + ] + ); + $this->compareConfig($I, $this->config, $config); + } + + /** + * Testing for exception + * + * @test + * @author Fenikkusu + * @since 2017-06-06 + * + * @expectedException \Phalcon\Factory\Exception + * @expectedExceptionMessage To use 'array' adapter you have to specify + * the 'config' as an array. + */ + public function shouldThrowsFactoryExceptionInCaseOfAbsentConfigParameter(UnitTester $I) + { + $I->expectThrowable( + \Exception::class, + function () { + new Grouped( + [ + [ + 'adapter' => 'array', + ], + ] + ); + } + ); + } +} diff --git a/tests/unit/Config/Adapter/GroupedTest.php_ b/tests/unit/Config/Adapter/GroupedTest.php_ deleted file mode 100644 index 62b5a4e6525..00000000000 --- a/tests/unit/Config/Adapter/GroupedTest.php_ +++ /dev/null @@ -1,88 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Config\Adapter - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class GroupedTest extends ConfigBase -{ - /** - * Tests Grouped config - * - * @test - * @author fenikkusu - * @since 2017-06-06 - */ - public function shouldCreateComplexConfigInstance() - { - $this->specify( - "Comparison of configurations returned a not identical result", - function () { - $this->config["test"]["property2"] = "something-else"; - - $config = new Grouped( - [ - PATH_DATA . 'config/config.php', - [ - 'filePath' => PATH_DATA . 'config/config.json', - 'adapter' => 'json' - ], - [ - 'adapter' => 'array', - 'config' => [ - "test" => [ - "property2" => "something-else" - ] - ] - ] - ] - ); - $this->compareConfig($this->config, $config); - } - ); - } - - /** - * Testing for exception - * - * @test - * @author Fenikkusu - * @since 2017-06-06 - * - * @expectedException \Phalcon\Factory\Exception - * @expectedExceptionMessage To use 'array' adapter you have to specify the 'config' as an array. - */ - public function shouldThrowsFactoryExceptionInCaseOfAbsentConfigParameter() - { - $this->specify( - "Exception not thrown when config array not set.", - function () { - new Grouped( - [ - [ - 'adapter' => 'array' - ] - ] - ); - } - ); - } -} diff --git a/tests/unit/Config/Adapter/IniCest.php b/tests/unit/Config/Adapter/IniCest.php new file mode 100644 index 00000000000..993fbd18984 --- /dev/null +++ b/tests/unit/Config/Adapter/IniCest.php @@ -0,0 +1,97 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Config\Adapter; + +use Phalcon\Config\Adapter\Ini; +use Phalcon\Test\Unit\Config\Helper\ConfigBase; +use UnitTester; + +class IniCest extends ConfigBase +{ + /** + * Tests constants in option values + * + * @author zytzagoo + * @since 2016-08-03 + */ + public function testConstants(UnitTester $I) + { + define('TEST_CONST', 'foo'); + + $config = new Ini(PATH_DATA . 'config/config-with-constants.ini', INI_SCANNER_NORMAL); + + $expected = [ + 'test' => 'foo', + 'path' => 'foo/something/else', + 'section' => [ + 'test' => 'foo', + 'path' => 'foo/another-thing/somewhere', + 'parent' => [ + 'property' => 'foo', + 'property2' => 'foohello', + ], + ], + ]; + $actual = $config->toArray(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests toArray method + * + * @author kjdev + * @since 2013-07-18 + */ + public function testConfigToArray(UnitTester $I) + { + $config = new Ini(PATH_DATA . 'config/directive.ini'); + + $expected = [ + 'test' => [ + 'parent' => [ + 'property' => 1, + 'property2' => 'yeah', + 'property3' => ['baseuri' => '/phalcon/'], + 'property4' => [ + 'models' => ['metadata' => 'memory'], + ], + 'property5' => [ + 'database' => [ + 'adapter' => 'mysql', + 'host' => 'localhost', + 'username' => 'user', + 'password' => 'passwd', + 'name' => 'demo', + ], + ], + 'property6' => [ + 'test' => ['a', 'b', 'c'], + ], + ], + ], + ]; + $actual = $config->toArray(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests Ini config + * + * @author Andres Gutierrez + * @since 2012-08-18 + */ + public function testIniConfig(UnitTester $I) + { + $config = new Ini(PATH_DATA . 'config/config.ini'); + $this->compareConfig($I, $this->config, $config); + } +} diff --git a/tests/unit/Config/Adapter/IniTest.php_ b/tests/unit/Config/Adapter/IniTest.php_ deleted file mode 100644 index d1e09743f59..00000000000 --- a/tests/unit/Config/Adapter/IniTest.php_ +++ /dev/null @@ -1,118 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Config\Adapter - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class IniTest extends ConfigBase -{ - /** - * Tests constants in option values - * @author zytzagoo - * @since 2016-08-03 - */ - public function testConstants() - { - $this->specify( - "Constants in option values are not parsed properly with explicit INI_SCANNER_NORMAL mode", - function () { - define('TEST_CONST', 'foo'); - - $expected = [ - 'test' => 'foo', - 'path' => 'foo/something/else', - 'section' => [ - 'test' => 'foo', - 'path' => 'foo/another-thing/somewhere', - 'parent' => [ - 'property' => 'foo', - 'property2' =>'foohello' - ] - ] - ]; - - $config = new Ini(PATH_DATA . 'config/config-with-constants.ini', INI_SCANNER_NORMAL); - - expect($config->toArray())->equals($expected); - } - ); - } - - /** - * Tests toArray method - * - * @author kjdev - * @since 2013-07-18 - */ - public function testConfigToArray() - { - $this->specify( - "Transform Config to the array does not returns the expected result", - function () { - $expected = [ - 'test' => [ - 'parent' => [ - 'property' => 1, - 'property2' => 'yeah', - 'property3' => ['baseuri' => '/phalcon/'], - 'property4' => [ - 'models' => ['metadata' => 'memory'], - ], - 'property5' => [ - 'database' => [ - 'adapter' => 'mysql', - 'host' => 'localhost', - 'username' => 'user', - 'password' => 'passwd', - 'name' => 'demo' - ], - ], - 'property6' => [ - 'test' => ['a', 'b', 'c'], - ], - ], - ], - ]; - - $config = new Ini(PATH_DATA . 'config/directive.ini'); - - expect($config->toArray())->equals($expected); - } - ); - } - - /** - * Tests Ini config - * - * @author Andres Gutierrez - * @since 2012-08-18 - */ - public function testIniConfig() - { - $this->specify( - "Comparison of configurations returned a not identical result", - function () { - $config = new Ini(PATH_DATA . 'config/config.ini'); - $this->compareConfig($this->config, $config); - } - ); - } -} diff --git a/tests/unit/Config/Adapter/JsonCest.php b/tests/unit/Config/Adapter/JsonCest.php new file mode 100644 index 00000000000..0f5f9794d6c --- /dev/null +++ b/tests/unit/Config/Adapter/JsonCest.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Config\Adapter; + +use Phalcon\Config\Adapter\Json; +use Phalcon\Test\Unit\Config\Helper\ConfigBase; +use UnitTester; + +class JsonCest extends ConfigBase +{ + /** + * Tests Json config + * + * @author Andres Gutierrez + * @since 2012-08-18 + */ + public function testJsonConfig(UnitTester $I) + { + $config = new Json(PATH_DATA . 'config/config.json'); + $this->compareConfig($I, $this->config, $config); + } +} diff --git a/tests/unit/Config/Adapter/JsonTest.php_ b/tests/unit/Config/Adapter/JsonTest.php_ deleted file mode 100644 index 9fa061de80c..00000000000 --- a/tests/unit/Config/Adapter/JsonTest.php_ +++ /dev/null @@ -1,43 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Config\Adapter - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class JsonTest extends ConfigBase -{ - /** - * Tests Json config - * - * @author Andres Gutierrez - * @since 2012-08-18 - */ - public function testJsonConfig() - { - $this->specify( - "Comparison of configurations returned a not identical result", - function () { - $config = new Json(PATH_DATA . 'config/config.json'); - $this->compareConfig($this->config, $config); - } - ); - } -} diff --git a/tests/unit/Config/Adapter/PhpCest.php b/tests/unit/Config/Adapter/PhpCest.php new file mode 100644 index 00000000000..b205c8f2625 --- /dev/null +++ b/tests/unit/Config/Adapter/PhpCest.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Config\Adapter; + +use Phalcon\Config\Adapter\Php; +use Phalcon\Test\Unit\Config\Helper\ConfigBase; +use UnitTester; + +class PhpCest extends ConfigBase +{ + /** + * Tests Php config + * + * @author Andres Gutierrez + * @since 2012-08-18 + */ + public function testPhpConfig(UnitTester $I) + { + $config = new Php(PATH_DATA . 'config/config.php'); + $this->compareConfig($I, $this->config, $config); + } +} diff --git a/tests/unit/Config/Adapter/PhpTest.php_ b/tests/unit/Config/Adapter/PhpTest.php_ deleted file mode 100644 index 811ac9a5cbe..00000000000 --- a/tests/unit/Config/Adapter/PhpTest.php_ +++ /dev/null @@ -1,43 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Config\Adapter - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class PhpTest extends ConfigBase -{ - /** - * Tests Php config - * - * @author Andres Gutierrez - * @since 2012-08-18 - */ - public function testPhpConfig() - { - $this->specify( - "Comparison of configurations returned a not identical result", - function () { - $config = new Php(PATH_DATA . 'config/config.php'); - $this->compareConfig($this->config, $config); - } - ); - } -} diff --git a/tests/unit/Config/Adapter/YamlCest.php b/tests/unit/Config/Adapter/YamlCest.php new file mode 100644 index 00000000000..cbbadda9a43 --- /dev/null +++ b/tests/unit/Config/Adapter/YamlCest.php @@ -0,0 +1,71 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Config\Adapter; + +use Phalcon\Config\Adapter\Yaml; +use Phalcon\Test\Unit\Config\Helper\ConfigBase; +use UnitTester; + +class YamlCest extends ConfigBase +{ + /** + * executed before each test + */ + public function _before(UnitTester $I, $scenario) + { + if (!extension_loaded('yaml')) { + $scenario->skip('Warning: yaml extension is not loaded'); + } + } + + /** + * Tests Yaml config + * + * @author Andres Gutierrez + * @since 2012-08-18 + */ + public function testYamlConfig(UnitTester $I) + { + $config = new Yaml(PATH_DATA . 'config/config.yml'); + $this->compareConfig($I, $this->config, $config); + } + + /** + * Tests Yaml config callbacks + * + * @author Ivan Zubok + * @since 2014-11-12 + */ + public function testYamlConfigCallback(UnitTester $I) + { + define('CALLBACK_APPROOT', dirname(__DIR__)); + $config = new Yaml( + PATH_DATA . 'config/callbacks.yml', + [ + '!decrypt' => function ($value) { + return hash('sha256', $value); + }, + '!approot' => function ($value) { + return CALLBACK_APPROOT . $value; + }, + ] + ); + + $expected = CALLBACK_APPROOT . '/app/controllers/'; + $actual = $config->application->controllersDir; + $I->assertEquals($expected, $actual); + + $expected = '9f7030891b235f3e06c4bff74ae9dc1b9b59d4f2e4e6fd94eeb2b91caee5d223'; + $actual = $config->database->password; + $I->assertEquals($expected, $actual); + } +} diff --git a/tests/unit/Config/Adapter/YamlTest.php_ b/tests/unit/Config/Adapter/YamlTest.php_ deleted file mode 100644 index f5080e86ba4..00000000000 --- a/tests/unit/Config/Adapter/YamlTest.php_ +++ /dev/null @@ -1,82 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Config\Adapter - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class YamlTest extends ConfigBase -{ - /** - * executed before each test - */ - public function _before() - { - parent::_before(); - - if (!extension_loaded('yaml')) { - $this->markTestSkipped('Warning: yaml extension is not loaded'); - } - } - - /** - * Tests Yaml config - * - * @author Andres Gutierrez - * @since 2012-08-18 - */ - public function testYamlConfig() - { - $this->specify( - "Comparison of configurations returned a not identical result", - function () { - $config = new Yaml(PATH_DATA . 'config/config.yml'); - $this->compareConfig($this->config, $config); - } - ); - } - - /** - * Tests Yaml config callbacks - * - * @author Ivan Zubok - * @since 2014-11-12 - */ - public function testYamlConfigCallback() - { - $this->specify( - "Config's callbacks does not works properly", - function () { - define('CALLBACK_APPROOT', dirname(__DIR__)); - $config = new Yaml(PATH_DATA . 'config/callbacks.yml', [ - '!decrypt' => function ($value) { - return hash('sha256', $value); - }, - '!approot' => function ($value) { - return CALLBACK_APPROOT . $value; - } - ]); - - expect($config->application->controllersDir)->equals(CALLBACK_APPROOT . '/app/controllers/'); - expect($config->database->password)->equals('9f7030891b235f3e06c4bff74ae9dc1b9b59d4f2e4e6fd94eeb2b91caee5d223'); - } - ); - } -} diff --git a/tests/unit/Config/ConfigCest.php b/tests/unit/Config/ConfigCest.php new file mode 100644 index 00000000000..d03a88c2d1b --- /dev/null +++ b/tests/unit/Config/ConfigCest.php @@ -0,0 +1,368 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit; + +use Phalcon\Config; +use Phalcon\Test\Unit\Config\Helper\ConfigBase; +use UnitTester; + +class ConfigCest extends ConfigBase +{ + /** + * Tests path method + * + * @author michanismus + * @since 2017-03-29 + */ + public function testConfigPath(UnitTester $I) + { + $config = new Config($this->config); + + $expected = 'yeah'; + $actual = $config->path('test.parent.property2'); + $I->assertEquals($expected, $actual); + + $expected = 'No'; + $actual = $config->path('test.parent.property3', 'No'); + $I->assertEquals($expected, $actual); + + $expected = 'Phalcon\Config'; + $actual = $config->path('test.parent'); + $I->assertInstanceOf($expected, $actual); + + $actual = $config->path('unknown.path'); + $I->assertNull($actual); + + Config::setPathDelimiter('/'); + + $actual = $config->path('test.parent.property2', false); + $I->assertFalse($actual); + + $expected = 'yeah'; + $actual = $config->path('test/parent/property2'); + $I->assertEquals($expected, $actual); + + $expected = 'Phalcon\Config'; + $actual = $config->path('test/parent'); + $I->assertInstanceOf($expected, $actual); + } + + /** + * Tests toArray method + * + * @author Serghei Iakovlev + * @since 2016-01-17 + */ + public function testConfigToArray(UnitTester $I) + { + $settings = [ + 'database' => [ + 'adapter' => 'Mysql', + 'host' => 'localhost', + 'username' => 'scott', + 'password' => 'cheetah', + 'name' => 'test_db', + ], + 'other' => [1, 2, 3, 4], + ]; + + $config = new Config($settings); + + $expected = $settings; + $actual = $config->toArray(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests implementing of Countable interface + * + * @author Faruk Brbovic + * @since 2014-11-03 + */ + public function testConfigCount(UnitTester $I) + { + $config = new Config( + [ + "controllersDir" => "../x/y/z", + "modelsDir" => "../x/y/z", + ] + ); + + $expected = 2; + $actual = count($config); + $I->assertEquals($expected, $actual); + + $expected = 2; + $actual = $config->count(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests Standard Config + * + * @author Andres Gutierrez + * @since 2012-08-18 + */ + public function testStandardConfig(UnitTester $I) + { + $config = new Config($this->config); + $this->compareConfig($I, $this->config, $config); + } + + /** + * Tests access by numeric key + * + * @author Rian Orie + * @since 2014-11-12 + */ + public function testNumericConfig(UnitTester $I) + { + $config = new Config(['abc']); + + $expected = 'abc'; + $actual = $config->{0}; + $I->assertEquals($expected, $actual); + } + + /** + * Tests converting child array to config object + * + * @author Rian Orie + * @since 2014-11-12 + */ + public function testChildArrayToConfigObject(UnitTester $I) + { + $config = new Config( + [ + 'childNode' => ['A', 'B', 'C'], + ] + ); + + $expected = 'Phalcon\Config'; + $actual = $config->childNode; + $I->assertInstanceOf($expected, $actual); + + $expected = 'Phalcon\Config'; + $actual = $config->get('childNode'); + $I->assertInstanceOf($expected, $actual); + + $expected = 'Phalcon\Config'; + $actual = $config->offsetGet('childNode'); + $I->assertInstanceOf($expected, $actual); + } + + /** + * Tests standard config simple array + * + * @author Andres Gutierrez + * @since 2012-09-11 + */ + public function testStandardConfigSimpleArray(UnitTester $I) + { + $settings = [ + 'database' => [ + 'adapter' => 'Mysql', + 'host' => 'localhost', + 'username' => 'scott', + 'password' => 'cheetah', + 'name' => 'test_db', + ], + 'other' => [1, 2, 3, 4], + ]; + + $expected = Config::__set_state( + [ + 'database' => Config::__set_state( + [ + 'adapter' => 'Mysql', + 'host' => 'localhost', + 'username' => 'scott', + 'password' => 'cheetah', + 'name' => 'test_db', + ] + ), + 'other' => [ + 0 => 1, + 1 => 2, + 2 => 3, + 3 => 4, + ], + ] + ); + $actual = new Config($settings); + $I->assertEquals($expected, $actual); + } + + /** + * Tests merging config objects + * + * @author kjdev + * @since 2015-02-18 + */ + public function testConfigMergeArray(UnitTester $I) + { + $config = new Config(['keys' => ['scott', 'cheetah']]); + + $expected = Config::__set_state( + [ + 'keys' => Config::__set_state( + [ + '0' => 'scott', + '1' => 'cheetah', + '2' => 'peter', + ] + ), + ] + ); + $actual = $config->merge(new Config(['keys' => ['peter']])); + $I->assertEquals($expected, $actual); + + $config = new Config(['keys' => ['peter']]); + + $expected = Config::__set_state([ + 'keys' => Config::__set_state([ + '0' => 'peter', + '1' => 'scott', + '2' => 'cheetah', + ]), + ]); + $actual = $config->merge(new Config(['keys' => ['scott', 'cheetah']])); + $I->assertEquals($expected, $actual); + } + + /** + * Tests merging complex config objects + * + * @author Andres Gutierrez + * @since 2012-12-16 + */ + public function testConfigMergeComplexObjects(UnitTester $I) + { + $config1 = new Config([ + 'controllersDir' => '../x/y/z', + 'modelsDir' => '../x/y/z', + 'database' => [ + 'adapter' => 'Mysql', + 'host' => 'localhost', + 'username' => 'scott', + 'password' => 'cheetah', + 'name' => 'test_db', + 'charset' => [ + 'primary' => 'utf8', + ], + 'alternatives' => [ + 'primary' => 'latin1', + 'second' => 'latin1', + ], + ], + ]); + + $config2 = new Config([ + 'modelsDir' => '../x/y/z', + 'database' => [ + 'adapter' => 'Postgresql', + 'host' => 'localhost', + 'username' => 'peter', + 'options' => [ + 'case' => 'lower', + \PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', + ], + 'alternatives' => [ + 'primary' => 'swedish', + 'third' => 'american', + ], + ], + ]); + + $config1->merge($config2); + + $expected = Config::__set_state( + [ + 'controllersDir' => '../x/y/z', + 'modelsDir' => '../x/y/z', + 'database' => Config::__set_state( + [ + 'adapter' => 'Postgresql', + 'host' => 'localhost', + 'username' => 'peter', + 'password' => 'cheetah', + 'name' => 'test_db', + 'charset' => Config::__set_state( + [ + 'primary' => 'utf8', + ] + ), + 'alternatives' => Config::__set_state( + [ + 'primary' => 'swedish', + 'second' => 'latin1', + 'third' => 'american', + ] + ), + 'options' => Config::__set_state( + [ + 'case' => 'lower', + (string) \PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', + ] + ), + ] + ), + ] + ); + $actual = $config1; + $I->assertEquals($expected, $actual); + } + + /** + * Tests issue 12779 + * + * @issue https://github.com/phalcon/cphalcon/issues/12779 + * @author Wojciech Ślawski + * @since 2017-06-19 + */ + public function testIssue12779(UnitTester $I) + { + $config = new Config( + [ + 'a' => [ + [ + 1, + ], + ], + ] + ); + + $config->merge( + new Config( + [ + 'a' => [ + [ + 2, + ], + ], + ] + ) + ); + + + $expected = [ + 'a' => [ + [ + 1, + 2, + ], + ], + ]; + $actual = $config->toArray(); + $I->assertEquals($expected, $actual); + } +} diff --git a/tests/unit/Config/ConfigCest.php_ b/tests/unit/Config/ConfigCest.php_ deleted file mode 100644 index 81aa3ffb064..00000000000 --- a/tests/unit/Config/ConfigCest.php_ +++ /dev/null @@ -1,332 +0,0 @@ -config); - expect($config->path('test.parent.property2'))->equals('yeah'); - expect($config->path('test.parent.property3', 'No'))->equals('No'); - expect($config->path('test.parent'))->isInstanceOf('Phalcon\Config'); - expect($config->path('unknown.path'))->equals(null); - Config::setPathDelimiter('/'); - expect($config->path('test.parent.property2', false))->equals(false); - expect($config->path('test/parent/property2'))->equals('yeah'); - expect($config->path('test/parent'))->isInstanceOf('Phalcon\Config'); - } - - /** - * Tests toArray method - * - * @author Serghei Iakovlev - * @since 2016-01-17 - */ - public function testConfigToArray() - { - $this->specify( - "Transform Config to the array does not returns the expected result", - function () { - $settings = [ - 'database' => [ - 'adapter' => 'Mysql', - 'host' => 'localhost', - 'username' => 'scott', - 'password' => 'cheetah', - 'name' => 'test_db', - ], - 'other' => [1, 2, 3, 4] - ]; - - $config = new Config($settings); - expect($config->toArray())->equals($settings); - } - ); - } - - /** - * Tests implementing of Countable interface - * - * @author Faruk Brbovic - * @since 2014-11-03 - */ - public function testConfigCount() - { - $this->specify( - "Returns the count of properties set in the config", - function () { - $config = new Config([ - "controllersDir" => "../x/y/z", - "modelsDir" => "../x/y/z", - ]); - - expect(count($config))->equals(2); - expect($config->count())->equals(2); - } - ); - } - - /** - * Tests Standard Config - * - * @author Andres Gutierrez - * @since 2012-08-18 - */ - public function testStandardConfig() - { - $this->specify( - "Comparison of configurations returned a not identical result", - function () { - $config = new Config($this->config); - $this->compareConfig($this->config, $config); - } - ); - } - - /** - * Tests access by numeric key - * - * @author Rian Orie - * @since 2014-11-12 - */ - public function testNumericConfig() - { - $this->specify( - "Access by numeric key does not return the expected result", - function () { - $config = new Config(['abc']); - expect($config->{0})->equals('abc'); - } - ); - } - - /** - * Tests converting child array to config object - * - * @author Rian Orie - * @since 2014-11-12 - */ - public function testChildArrayToConfigObject() - { - $this->specify( - "Child node don't converted to the config object", - function () { - $config = new Config(['childNode' => ['A', 'B', 'C']]); - expect($config->childNode)->isInstanceOf('Phalcon\Config'); - expect($config->get('childNode'))->isInstanceOf('Phalcon\Config'); - expect($config->offsetGet('childNode'))->isInstanceOf('Phalcon\Config'); - } - ); - } - - /** - * Tests standard config simple array - * - * @author Andres Gutierrez - * @since 2012-09-11 - */ - public function testStandardConfigSimpleArray() - { - $this->specify( - "Comparison of objects returned a not identical result", - function () { - $expectedConfig = Config::__set_state([ - 'database' => Config::__set_state( - [ - 'adapter' => 'Mysql', - 'host' => 'localhost', - 'username' => 'scott', - 'password' => 'cheetah', - 'name' => 'test_db', - ] - ), - 'other' => [ - 0 => 1, - 1 => 2, - 2 => 3, - 3 => 4, - ], - ]); - - $settings = [ - 'database' => [ - 'adapter' => 'Mysql', - 'host' => 'localhost', - 'username' => 'scott', - 'password' => 'cheetah', - 'name' => 'test_db', - ], - 'other' => [1, 2, 3, 4] - ]; - - expect(new Config($settings))->equals($expectedConfig); - } - ); - } - - /** - * Tests merging config objects - * - * @author kjdev - * @since 2015-02-18 - */ - public function testConfigMergeArray() - { - $this->specify( - "Config objects does not merged properly", - function () { - $expected = Config::__set_state([ - 'keys' => Config::__set_state([ - '0' => 'scott', - '1' => 'cheetah', - '2' => 'peter', - ]), - ]); - - $config = new Config(['keys' => ['scott', 'cheetah']]); - expect($config->merge(new Config(['keys' => ['peter']])))->equals($expected); - - $expected = Config::__set_state([ - 'keys' => Config::__set_state([ - '0' => 'peter', - '1' => 'scott', - '2' => 'cheetah', - ]), - ]); - - $config = new Config(['keys' => ['peter']]); - expect($config->merge(new Config(['keys' => ['scott', 'cheetah']])))->equals($expected); - } - ); - } - - /** - * Tests merging complex config objects - * - * @author Andres Gutierrez - * @since 2012-12-16 - */ - public function testConfigMergeComplexObjects() - { - $this->specify( - "Config objects does not merged properly", - function () { - $config1 = new Config([ - 'controllersDir' => '../x/y/z', - 'modelsDir' => '../x/y/z', - 'database' => [ - 'adapter' => 'Mysql', - 'host' => 'localhost', - 'username' => 'scott', - 'password' => 'cheetah', - 'name' => 'test_db', - 'charset' => [ - 'primary' => 'utf8' - ], - 'alternatives' => [ - 'primary' => 'latin1', - 'second' => 'latin1' - ] - ], - ]); - - $config2 = new Config([ - 'modelsDir' => '../x/y/z', - 'database' => [ - 'adapter' => 'Postgresql', - 'host' => 'localhost', - 'username' => 'peter', - 'options' => [ - 'case' => 'lower', - \PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', - ], - 'alternatives' => [ - 'primary' => 'swedish', - 'third' => 'american', - ], - ], - ]); - - $config1->merge($config2); - - $expected = Config::__set_state([ - 'controllersDir' => '../x/y/z', - 'modelsDir' => '../x/y/z', - 'database' => Config::__set_state([ - 'adapter' => 'Postgresql', - 'host' => 'localhost', - 'username' => 'peter', - 'password' => 'cheetah', - 'name' => 'test_db', - 'charset' => Config::__set_state([ - 'primary' => 'utf8', - ]), - 'alternatives' => Config::__set_state([ - 'primary' => 'swedish', - 'second' => 'latin1', - 'third' => 'american', - ]), - 'options' => Config::__set_state([ - 'case' => 'lower', - (string) \PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', - ]), - ]), - ]); - - expect($config1)->equals($expected); - } - ); - } - - /** - * Tests issue 12779 - * - * @issue https://github.com/phalcon/cphalcon/issues/12779 - * @author Wojciech Ślawski - * @since 2017-06-19 - */ - public function testIssue12779() - { - $config = new Config( - [ - 'a' => [ - [ - 1, - ], - ], - ] - ); - - $config->merge( - new Config( - [ - 'a' => [ - [ - 2, - ], - ], - ] - ) - ); - expect($config->toArray())->equals( - [ - 'a' => [ - [ - 1, - 2, - ], - ], - ] - ); - } -} diff --git a/tests/unit/Config/FactoryCest.php b/tests/unit/Config/FactoryCest.php new file mode 100644 index 00000000000..b9ef4d13508 --- /dev/null +++ b/tests/unit/Config/FactoryCest.php @@ -0,0 +1,84 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Config; + +use Phalcon\Config\Adapter\Ini; +use Phalcon\Config\Factory; +use Phalcon\Test\Unit\Factory\Helper\FactoryBase; +use UnitTester; + +class FactoryCest +{ + protected $config; + + /** + * @var array + */ + protected $arrayConfig; + + public function _before(UnitTester $I) + { + $this->config = new Ini(PATH_DATA . "config/factory.ini", INI_SCANNER_NORMAL); + $this->arrayConfig = $this->config->toArray(); + } + + /** + * Test factory using Phalcon\Config + * + * @author Wojciech Ślawski + * @since 2017-03-02 + */ + public function testConfigFactory(UnitTester $I) + { + $options = $this->config->config; + /** @var Ini $ini */ + $ini = Factory::load($options); + + $expected = Ini::class; + $actual = $ini; + $I->assertInstanceOf($expected, $actual); + } + + /** + * Test factory using array + * + * @author Wojciech Ślawski + * @since 2017-03-02 + */ + public function testArrayFactory(UnitTester $I) + { + $options = $this->arrayConfig["config"]; + /** @var Ini $ini */ + $ini = Factory::load($options); + + $expected = Ini::class; + $actual = $ini; + $I->assertInstanceOf($expected, $actual); + } + + /** + * Test factory using array + * + * @author Wojciech Ślawski + * @since 2017-11-24 + */ + public function testStringFactory(UnitTester $I) + { + $filePath = $this->arrayConfig['config']['filePathExtension']; + /** @var Ini $ini */ + $ini = Factory::load($filePath); + + $expected = Ini::class; + $actual = $ini; + $I->assertInstanceOf($expected, $actual); + } +} diff --git a/tests/unit/Config/FactoryTest.php_ b/tests/unit/Config/FactoryTest.php_ deleted file mode 100644 index 159e8e92fdc..00000000000 --- a/tests/unit/Config/FactoryTest.php_ +++ /dev/null @@ -1,85 +0,0 @@ - - * @author Serghei Iakovlev - * @author Wojciech Ślawski - * @package Phalcon\Test\Unit\Annotations - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class FactoryTest extends FactoryBase -{ - /** - * Test factory using Phalcon\Config - * - * @author Wojciech Ślawski - * @since 2017-03-02 - */ - public function testConfigFactory() - { - $this->specify( - "Factory using Phalcon\\Config doesn't work properly", - function () { - $options = $this->config->config; - /** @var Ini $ini */ - $ini = Factory::load($options); - expect($ini)->isInstanceOf(Ini::class); - } - ); - } - - /** - * Test factory using array - * - * @author Wojciech Ślawski - * @since 2017-03-02 - */ - public function testArrayFactory() - { - $this->specify( - "Factory using array doesn't work properly", - function () { - $options = $this->arrayConfig["config"]; - /** @var Ini $ini */ - $ini = Factory::load($options); - expect($ini)->isInstanceOf(Ini::class); - } - ); - } - - /** - * Test factory using array - * - * @author Wojciech Ślawski - * @since 2017-11-24 - */ - public function testStringFactory() - { - $this->specify( - "Factory using string doesn't work properly", - function () { - $filePath = $this->arrayConfig['config']['filePathExtension']; - /** @var Ini $ini */ - $ini = Factory::load($filePath); - expect($ini)->isInstanceOf(Ini::class); - } - ); - } -} diff --git a/tests/unit/Config/Helper/ConfigBase.php b/tests/unit/Config/Helper/ConfigBase.php index b90c2b2de0a..749a70ecf60 100644 --- a/tests/unit/Config/Helper/ConfigBase.php +++ b/tests/unit/Config/Helper/ConfigBase.php @@ -3,33 +3,33 @@ namespace Phalcon\Test\Unit\Config\Helper; use Phalcon\Config; -use Phalcon\Test\Module\UnitTest; +use UnitTester; class ConfigBase { protected $config = [ - 'phalcon' => [ - 'baseuri' => '/phalcon/' + 'phalcon' => [ + 'baseuri' => '/phalcon/', ], - 'models' => [ - 'metadata' => 'memory' + 'models' => [ + 'metadata' => 'memory', ], 'database' => [ 'adapter' => 'mysql', 'host' => 'localhost', 'username' => 'user', 'password' => 'passwd', - 'name' => 'demo' + 'name' => 'demo', ], - 'test' => [ + 'test' => [ 'parent' => [ - 'property' => 1, - 'property2' => 'yeah' + 'property' => 1, + 'property2' => 'yeah', ], ], ]; - protected function compareConfig(\UnitTester $I, array $actual, Config $expected) + protected function compareConfig(UnitTester $I, array $actual, Config $expected) { $I->assertEquals($actual, $expected->toArray()); diff --git a/tests/unit/CryptCest.php b/tests/unit/CryptCest.php index 08900825e55..f000af83ee2 100644 --- a/tests/unit/CryptCest.php +++ b/tests/unit/CryptCest.php @@ -3,16 +3,16 @@ /** * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * - * For the full copyright and license information, please view the LICENSE + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ namespace Phalcon\Test\Unit; use Phalcon\Crypt; -use Phalcon\Test\Module\UnitTest; +use Phalcon\Crypt\Exception; use UnitTester; class CryptCest @@ -29,21 +29,25 @@ public function _before(UnitTester $I, $scenario) * * @test * @issue https://github.com/phalcon/cphalcon/issues/13379 - * @author - * @since 2018-05-16 + * @author + * @since 2018-05-16 * * @expectedException \Phalcon\Crypt\Mismatch * @expectedExceptionMessage Hash does not match. */ public function shouldThrowExceptionIfHashMismatch(UnitTester $I, $scenario) { - $scenario->skip('TODO - Check exception'); - $crypt = new Crypt(); - $crypt->useSigning(true); - - $crypt->decrypt( - $crypt->encrypt('le text', 'encrypt key'), - 'wrong key' + $I->expectThrowable( + Exception::class, + function () { + $crypt = new Crypt(); + $crypt->useSigning(true); + + $crypt->decrypt( + $crypt->encrypt('le text', 'encrypt key'), + 'wrong key' + ); + } ); } @@ -94,17 +98,22 @@ public function shouldNotThrowExceptionIfKeyMismatch(UnitTester $I) * Tests the Crypt::setCipher * * @test - * @author Serghei Iakovlev - * @since 2018-05-06 + * @author Serghei Iakovlev + * @since 2018-05-06 * * @expectedException \Phalcon\Crypt\Exception - * @expectedExceptionMessage The cipher algorithm "xxx-yyy-zzz" is not supported on this system. + * @expectedExceptionMessage The cipher algorithm "xxx-yyy-zzz" is not + * supported on this system. */ public function shouldThrowExceptionIfCipherIsUnknown(UnitTester $I, $scenario) { - $scenario->skip('TODO - Check exception'); - $crypt = new Crypt(); - $crypt->setCipher('xxx-yyy-zzz'); + $I->expectThrowable( + Exception::class, + function () { + $crypt = new Crypt(); + $crypt->setCipher('xxx-yyy-zzz'); + } + ); } /** @@ -134,7 +143,7 @@ public function testCryptEncryption(UnitTester $I) { $tests = [ md5(uniqid()) => str_repeat('x', mt_rand(1, 255)), - time().time() => str_shuffle('abcdefeghijklmnopqrst'), + time() . time() => str_shuffle('abcdefeghijklmnopqrst'), 'le$ki12432543543543543' => "", ]; $ciphers = [ @@ -172,20 +181,20 @@ public function testCryptEncryption(UnitTester $I) */ public function testCryptPadding(UnitTester $I) { - $texts = ['']; - $key = '0123456789ABCDEF0123456789ABCDEF'; + $texts = ['']; + $key = '0123456789ABCDEF0123456789ABCDEF'; $ciphers = [ 'AES-256-ECB', 'AES-256-CBC', 'AES-256-CFB', ]; - $pads = [ + $pads = [ Crypt::PADDING_ANSI_X_923, Crypt::PADDING_PKCS7, Crypt::PADDING_ISO_10126, Crypt::PADDING_ISO_IEC_7816_4, Crypt::PADDING_ZERO, - Crypt::PADDING_SPACE + Crypt::PADDING_SPACE, ]; for ($i = 1; $i < 128; ++$i) { diff --git a/tests/unit/DebugCest.php b/tests/unit/DebugCest.php index 9791ab7b709..7b9cd761bb9 100644 --- a/tests/unit/DebugCest.php +++ b/tests/unit/DebugCest.php @@ -3,19 +3,19 @@ /** * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * - * For the full copyright and license information, please view the LICENSE + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ namespace Phalcon\Test\Unit; +use Phalcon\Debug; use Phalcon\Di; use Phalcon\Di\FactoryDefault; -use Phalcon\Debug; -use Phalcon\Version; use Phalcon\Mvc\Url; +use Phalcon\Version; use UnitTester; class DebugCest diff --git a/tests/unit/EscaperCest.php b/tests/unit/EscaperCest.php index cfdd982f49d..861a6951486 100644 --- a/tests/unit/EscaperCest.php +++ b/tests/unit/EscaperCest.php @@ -3,18 +3,17 @@ /** * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * - * For the full copyright and license information, please view the LICENSE + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ namespace Phalcon\Test\Unit; -use const ENT_XHTML; use Phalcon\Escaper; -use Phalcon\Test\Module\UnitTest; use UnitTester; +use const ENT_XHTML; class EscaperCest { @@ -56,7 +55,7 @@ public function testGetSetEncoding(UnitTester $I) */ public function testEscapeAttrWithDifferentEncodings(UnitTester $I) { - $escaper = new Escaper(); + $escaper = new Escaper(); $escaper->setHtmlQuoteType(ENT_HTML401); $expected = "That's right"; diff --git a/tests/unit/SecurityCest.php b/tests/unit/SecurityCest.php index f62b886387e..a2c45d860a9 100644 --- a/tests/unit/SecurityCest.php +++ b/tests/unit/SecurityCest.php @@ -3,31 +3,21 @@ /** * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * - * For the full copyright and license information, please view the LICENSE + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ namespace Phalcon\Test\Unit; use Phalcon\Di; -use Phalcon\Security; use Phalcon\Http\Request; +use Phalcon\Security; use UnitTester; class SecurityCest { - /** - * executed before each test - */ - protected function _before(UnitTester $I, $scenario) - { - if (!extension_loaded('openssl')) { - $scenario->skip('Warning: openssl extension is not loaded'); - } - } - /** * Tests the Security constants * @@ -87,11 +77,11 @@ public function testSecurityComputeHMAC(UnitTester $I) public function testSecurityDefaults(UnitTester $I) { $security = new Security(); - + $expected = null; $actual = $security->getDefaultHash(); $I->assertEquals($expected, $actual); - + $expected = 16; $actual = $security->getRandomBytes(); $I->assertEquals($expected, $actual); @@ -108,7 +98,8 @@ public function testSecurityDefaults(UnitTester $I) } /** - * Tests Security::getToken and Security::getTokenKey for generating only one token per request + * Tests Security::getToken and Security::getTokenKey for generating only + * one token per request */ public function testOneTokenPerRequest(UnitTester $I, $scenario) { @@ -119,7 +110,7 @@ public function testOneTokenPerRequest(UnitTester $I, $scenario) $security->setDI($di); $tokenKey = $security->getTokenKey(); - $token = $security->getToken(); + $token = $security->getToken(); $expected = $tokenKey; $actual = $security->getTokenKey(); @@ -150,6 +141,28 @@ public function testOneTokenPerRequest(UnitTester $I, $scenario) $security->destroyToken(); } + /** + * Set up the environment. + * + * @return Di + */ + private function setupDI() + { + Di::reset(); + + $di = new Di(); + +// $di->setShared('session', function () { +// return new Files(); +// }); + + $di->setShared('request', function () { + return new Request(); + }); + + return $di; + } + /** * Tests Security::checkToken */ @@ -240,24 +253,12 @@ public function testHash(UnitTester $I) } /** - * Set up the environment. - * - * @return Di + * executed before each test */ - private function setupDI() + protected function _before(UnitTester $I, $scenario) { - Di::reset(); - - $di = new Di(); - -// $di->setShared('session', function () { -// return new Files(); -// }); - - $di->setShared('request', function () { - return new Request(); - }); - - return $di; + if (!extension_loaded('openssl')) { + $scenario->skip('Warning: openssl extension is not loaded'); + } } } diff --git a/tests/unit/VersionCest.php b/tests/unit/VersionCest.php index 718c995619e..365a44bef59 100644 --- a/tests/unit/VersionCest.php +++ b/tests/unit/VersionCest.php @@ -3,17 +3,17 @@ /** * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * - * For the full copyright and license information, please view the LICENSE + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ namespace Phalcon\Test\Unit; -use function is_string; use Phalcon\Version; use UnitTester; +use function is_string; class VersionCest { @@ -63,15 +63,45 @@ public function testVersionGetToGetId(UnitTester $I) // Now the version itself $verChunks = explode('.', $chunks[0]); - $major = intval($verChunks[0]); - $med = substr("00" . intval($verChunks[1]), -2); - $min = substr("00" . intval($verChunks[2]), -2); + $major = intval($verChunks[0]); + $med = substr("00" . intval($verChunks[1]), -2); + $min = substr("00" . intval($verChunks[2]), -2); $expected = "{$major}{$med}{$min}{$special}{$specialNo}"; $actual = Version::getId(); $I->assertEquals($expected, $actual); } + /** + * Translates a special version (ALPHA, BETA, RC) to a version number + * + * @author Nikolaos Dimopoulos + * @since 2014-09-04 + * + * @param $input + * + * @return string + */ + private function specialToNumber($input) + { + switch ($input) { + case 'ALPHA': + $special = '1'; + break; + case 'BETA': + $special = '2'; + break; + case 'RC': + $special = '3'; + break; + default: + $special = '4'; + break; + } + + return $special; + } + /** * Tests the getId() translation to get() * @@ -92,6 +122,35 @@ public function testVersionGetIdToGet(UnitTester $I) $I->assertEquals($expected, $actual); } + /** + * Translates a number to a special version string (ALPHA, BETA, RC) + * + * @author Nikolaos Dimopoulos + * @since 2014-09-04 + * + * @param $number + * + * @return string + */ + private function numberToSpecial($number) + { + $special = ''; + + switch ($number) { + case '1': + $special = 'ALPHA'; + break; + case '2': + $special = 'BETA'; + break; + case '3': + $special = 'RC'; + break; + } + + return $special; + } + /** * Tests the constants of the class * @@ -127,11 +186,11 @@ public function testVersionGetPart(UnitTester $I) $actual = Version::getPart(Version::VERSION_MAJOR); $I->assertEquals($expected, $actual); - $expected = intval($id[1].$id[2]); //The medium version is the second and third digits + $expected = intval($id[1] . $id[2]); //The medium version is the second and third digits $actual = Version::getPart(Version::VERSION_MEDIUM); $I->assertEquals($expected, $actual); - $expected = intval($id[3].$id[4]); //The minor version is the fourth and fifth digits + $expected = intval($id[3] . $id[4]); //The minor version is the fourth and fifth digits $actual = Version::getPart(Version::VERSION_MINOR); $I->assertEquals($expected, $actual); @@ -148,63 +207,4 @@ public function testVersionGetPart(UnitTester $I) $actual = Version::getPart(7); $I->assertEquals($expected, $actual); } - - /** - * Translates a special version (ALPHA, BETA, RC) to a version number - * - * @author Nikolaos Dimopoulos - * @since 2014-09-04 - * - * @param $input - * - * @return string - */ - private function specialToNumber($input) - { - switch ($input) { - case 'ALPHA': - $special = '1'; - break; - case 'BETA': - $special = '2'; - break; - case 'RC': - $special = '3'; - break; - default: - $special = '4'; - break; - } - - return $special; - } - - /** - * Translates a number to a special version string (ALPHA, BETA, RC) - * - * @author Nikolaos Dimopoulos - * @since 2014-09-04 - * - * @param $number - * - * @return string - */ - private function numberToSpecial($number) - { - $special = ''; - - switch ($number) { - case '1': - $special = 'ALPHA'; - break; - case '2': - $special = 'BETA'; - break; - case '3': - $special = 'RC'; - break; - } - - return $special; - } } diff --git a/tests/unit/_bootstrap.php b/tests/unit/_bootstrap.php index a705e5cb99a..16c7df27018 100644 --- a/tests/unit/_bootstrap.php +++ b/tests/unit/_bootstrap.php @@ -3,9 +3,9 @@ /** * This file is part of the Phalcon Framework. * - * (c) Phalcon Team + * (c) Phalcon Team * - * For the full copyright and license information, please view the LICENSE + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ From 9b890f1301559c04678f65782074c28275f727ea Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Sun, 4 Nov 2018 14:07:59 -0500 Subject: [PATCH 008/222] [#13578] - Refactored Debug/Dump tests --- .../tests/_data/debug/ClassProperties.php | 10 ---- .../tests/_fixtures/dump/class_properties.txt | 7 --- _toCheck/tests/_support/Helper/Unit.php | 27 --------- _toCheck/tests/unit/Debug/DumpTest.php | 57 ------------------- tests/_fixtures/dump/class_properties.txt | 7 +++ tests/_support/Helper/Unit.php | 29 ++++++++++ tests/unit/{ => Debug}/DebugCest.php | 2 +- tests/unit/Debug/DumpCest.php | 43 ++++++++++++++ tests/unit/Debug/Helper/ClassProperties.php | 10 ++++ 9 files changed, 90 insertions(+), 102 deletions(-) delete mode 100644 _toCheck/tests/_data/debug/ClassProperties.php delete mode 100644 _toCheck/tests/_fixtures/dump/class_properties.txt delete mode 100644 _toCheck/tests/unit/Debug/DumpTest.php create mode 100644 tests/_fixtures/dump/class_properties.txt rename tests/unit/{ => Debug}/DebugCest.php (97%) create mode 100644 tests/unit/Debug/DumpCest.php create mode 100644 tests/unit/Debug/Helper/ClassProperties.php diff --git a/_toCheck/tests/_data/debug/ClassProperties.php b/_toCheck/tests/_data/debug/ClassProperties.php deleted file mode 100644 index 8624b7f54c0..00000000000 --- a/_toCheck/tests/_data/debug/ClassProperties.php +++ /dev/null @@ -1,10 +0,0 @@ -foo (public) = Integer (1) - ->bar (protected) = Integer (2) - ->baz (private) = Integer (3) - Phalcon\Test\Debug\ClassProperties methods: (0) ( - ) -) diff --git a/_toCheck/tests/_support/Helper/Unit.php b/_toCheck/tests/_support/Helper/Unit.php index a8b11c2636f..e2d2a4b4112 100644 --- a/_toCheck/tests/_support/Helper/Unit.php +++ b/_toCheck/tests/_support/Helper/Unit.php @@ -53,33 +53,6 @@ public function setProtectedProperty($obj, $prop, $value) $this->assertEquals($value, $property->getValue($obj)); } - /** - * Calls private or protected method. - * - * @param string|object $obj - * @param mixed $method,... Method with a variable number of arguments - * - * @return mixed - * @throws \ReflectionException - */ - public function callProtectedMethod($obj, $method) - { - $reflectionClass = new ReflectionClass($obj); - - $reflectionMethod = $reflectionClass->getMethod($method); - $reflectionMethod->setAccessible(true); - - if (!is_object($obj)) { - $obj = $reflectionClass->newInstanceWithoutConstructor(); - } - - // $obj, $method - $args = array_slice(func_get_args(), 2); - array_unshift($args, $obj); - - return call_user_func_array([$reflectionMethod, 'invoke'], $args); - } - /** * Returns a unique file name * diff --git a/_toCheck/tests/unit/Debug/DumpTest.php b/_toCheck/tests/unit/Debug/DumpTest.php deleted file mode 100644 index 47ba82c17fb..00000000000 --- a/_toCheck/tests/unit/Debug/DumpTest.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @author Serghei Iakovlev - * @package Phalcon\Test\Unit\Debug - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class DumpTest extends UnitTest -{ - /** - * Tests dump object properties. - * - * @test - * @issue https://github.com/phalcon/cphalcon/issues/13315 - * @author Serghei Iakovlev - * @since 2014-10-23 - */ - public function shouldDumpObjectProperties() - { - $this->specify( - "The Dump::output doesn't work as expected", - function () { - $patient = new ClassProperties(); - $dump = new Dump(null, true); - - $actual = $this->tester->callProtectedMethod($dump, 'output', $patient); - $expected = file_get_contents(PATH_FIXTURES . 'dump/class_properties.txt'); - - // Test without HTML - $actual = strip_tags($actual); - - // Remove a trailing newline - $expected = trim($expected); - - expect($actual)->equals($expected); - } - ); - } -} diff --git a/tests/_fixtures/dump/class_properties.txt b/tests/_fixtures/dump/class_properties.txt new file mode 100644 index 00000000000..e120d906e78 --- /dev/null +++ b/tests/_fixtures/dump/class_properties.txt @@ -0,0 +1,7 @@ +Object Phalcon\Test\Unit\Debug\Helper\ClassProperties ( + ->foo (public) = Integer (1) + ->bar (protected) = Integer (2) + ->baz (private) = Integer (3) + Phalcon\Test\Unit\Debug\Helper\ClassProperties methods: (0) ( + ) +) diff --git a/tests/_support/Helper/Unit.php b/tests/_support/Helper/Unit.php index 6064d373276..0987fa6a6ae 100644 --- a/tests/_support/Helper/Unit.php +++ b/tests/_support/Helper/Unit.php @@ -1,10 +1,39 @@ getMethod($method); + $reflectionMethod->setAccessible(true); + + if (!is_object($obj)) { + $obj = $reflectionClass->newInstanceWithoutConstructor(); + } + + // $obj, $method + $args = array_slice(func_get_args(), 2); + array_unshift($args, $obj); + return call_user_func_array([$reflectionMethod, 'invoke'], $args); + } } diff --git a/tests/unit/DebugCest.php b/tests/unit/Debug/DebugCest.php similarity index 97% rename from tests/unit/DebugCest.php rename to tests/unit/Debug/DebugCest.php index 7b9cd761bb9..250408694f8 100644 --- a/tests/unit/DebugCest.php +++ b/tests/unit/Debug/DebugCest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Phalcon\Test\Unit; +namespace Phalcon\Test\Unit\Debug; use Phalcon\Debug; use Phalcon\Di; diff --git a/tests/unit/Debug/DumpCest.php b/tests/unit/Debug/DumpCest.php new file mode 100644 index 00000000000..9e42d50400f --- /dev/null +++ b/tests/unit/Debug/DumpCest.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Debug; + +use Phalcon\Debug\Dump; +use Phalcon\Test\Unit\Debug\Helper\ClassProperties; +use UnitTester; + +class DumpCest +{ + /** + * Tests dump object properties. + * + * @test + * @issue https://github.com/phalcon/cphalcon/issues/13315 + * @author Serghei Iakovlev + * @since 2014-10-23 + */ + public function shouldDumpObjectProperties(UnitTester $I) + { + $patient = new ClassProperties(); + $dump = new Dump(null, true); + + $actual = $I->callProtectedMethod($dump, 'output', $patient); + $expected = file_get_contents(PATH_FIXTURES . 'dump/class_properties.txt'); + + // Test without HTML + $actual = strip_tags($actual); + + // Remove a trailing newline + $expected = trim($expected); + $I->assertEquals($expected, $actual); + } +} diff --git a/tests/unit/Debug/Helper/ClassProperties.php b/tests/unit/Debug/Helper/ClassProperties.php new file mode 100644 index 00000000000..701dfa42c43 --- /dev/null +++ b/tests/unit/Debug/Helper/ClassProperties.php @@ -0,0 +1,10 @@ + Date: Mon, 5 Nov 2018 08:26:50 -0500 Subject: [PATCH 009/222] [#13578] - Work on Messages --- .travis.yml | 9 +- _toCheck/tests/unit/Messages/MessagesTest.php | 221 -------------- tests/unit/Messages/MessagesCest.php | 276 ++++++++++++++++++ 3 files changed, 281 insertions(+), 225 deletions(-) delete mode 100644 _toCheck/tests/unit/Messages/MessagesTest.php create mode 100644 tests/unit/Messages/MessagesCest.php diff --git a/.travis.yml b/.travis.yml index cc40c3b5501..013078b9725 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,10 +13,11 @@ php: git: depth: 1 -branches: - only: - - master - - /^(4|5)\.\d+\.(\d+|x)$/ +# TODO - Remove this when we go deploy this +#branches: +# only: +# - master +# - /^(4|5)\.\d+\.(\d+|x)$/ addons: apt: diff --git a/_toCheck/tests/unit/Messages/MessagesTest.php b/_toCheck/tests/unit/Messages/MessagesTest.php deleted file mode 100644 index 451fc1434df..00000000000 --- a/_toCheck/tests/unit/Messages/MessagesTest.php +++ /dev/null @@ -1,221 +0,0 @@ - - * @author Serghei Iakovlev - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Messages - * @group messages - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class MessagesTest extends UnitTest -{ - /** - * Tests append messages - * - * @test - * @author Serghei Iakovlev - * @since 2016-06-12 - */ - public function validationGroup() - { - $this->specify( - 'The Message Group does not work with Messages as expected', - function () { - $message1 = new Message('This a message #1', 'field1', 'Type1'); - $message2 = new Message('This a message #2', 'field2', 'Type2'); - $message3 = new Message('This a message #3', 'field3', 'Type3'); - - $messages = new Messages([$message1, $message2]); - - expect($messages)->count(2); - - expect(isset($messages[0]))->true(); - expect(isset($messages[1]))->true(); - - expect($messages[0])->equals($message1); - expect($messages[1])->equals($message2); - - $messages->appendMessage($message3); - - expect($messages[2])->equals($message3); - - expect($messages)->count(3); - - foreach ($messages as $position => $message) { - expect($messages[$position]->getMessage())->equals($message->getMessage()); - expect($messages[$position]->getField())->equals($message->getField()); - expect($messages[$position]->getType())->equals($message->getType()); - } - } - ); - } - - /** - * Tests unsetting a message by index - * - * @test - * @issue https://github.com/phalcon/cphalcon/issues/12455 - * @author Serghei Iakovlev - * @since 2017-02-12 - */ - public function unsettingByIndex() - { - $this->specify( - 'error', - function () { - $validation = new Validation(); - - $validation->appendMessage(new Message('error a', 'myField', 'MyValidator')); - - expect($validation->getMessages())->count(1); - expect($validation->getMessages()[0])->equals(Message::__set_state([ - '_message' => 'error a', - '_field' => 'myField', - '_type' => 'MyValidator', - '_code' => 0, - ])); - - $validation->appendMessage(new Message('error b', 'myField', 'MyValidator')); - - expect($validation->getMessages())->count(2); - expect($validation->getMessages()[1])->equals(Message::__set_state([ - '_message' => 'error b', - '_field' => 'myField', - '_type' => 'MyValidator', - '_code' => 0, - ])); - - $messages = $validation->getMessages(); - unset($messages[count($messages) - 1]); - - expect($validation->getMessages())->count(1); - expect($validation->getMessages()[0])->equals(Message::__set_state([ - '_message' => 'error a', - '_field' => 'myField', - '_type' => 'MyValidator', - '_code' => 0, - ])); - - $validation->appendMessage(new Message('error c', 'myField', 'MyValidator')); - - expect($validation->getMessages())->count(2); - expect($validation->getMessages()[1])->equals(Message::__set_state([ - '_message' => 'error c', - '_field' => 'myField', - '_type' => 'MyValidator', - '_code' => 0, - ])); - - expect($validation->getMessages())->equals(Messages::__set_state([ - '_position' => 0, - '_messages' => [ - 0 => Message::__set_state([ - '_message' => 'error a', - '_field' => 'myField', - '_type' => 'MyValidator', - '_code' => 0, - ]), - 1 => Message::__set_state([ - '_message' => 'error c', - '_field' => 'myField', - '_type' => 'MyValidator', - '_code' => 0, - ]), - ] - ])); - - $validation->appendMessage(new Message('error d', 'myField', 'MyValidator')); - $validation->appendMessage(new Message('error e', 'myField', 'MyValidator')); - - $messages = $validation->getMessages(); - $messages->offsetUnset(1); - - expect($validation->getMessages())->equals(Messages::__set_state([ - '_position' => 0, - '_messages' => [ - 0 => Message::__set_state([ - '_message' => 'error a', - '_field' => 'myField', - '_type' => 'MyValidator', - '_code' => 0, - ]), - 1 => Message::__set_state([ - '_message' => 'error d', - '_field' => 'myField', - '_type' => 'MyValidator', - '_code' => 0, - ]), - 2 => Message::__set_state([ - '_message' => 'error e', - '_field' => 'myField', - '_type' => 'MyValidator', - '_code' => 0, - ]), - ] - ])); - } - ); - } - - /** - * Tests JsonSerializable - * - * @test - * @author Nikolaos Dimopoulos - * @since 2018-10-18 - */ - public function shouldImplementJsonSerializable() - { - $this->specify( - 'The Messages do not implement JsonSerializable', - function () { - $message1 = new Message('This is a message #1', 'field1', 'Type1', 1); - $message2 = new Message('This is a message #2', 'field2', 'Type2', 2); - $message3 = new Message('This is a message #3', 'field3', 'Type3', 3); - expect($message1 instanceof \JsonSerializable)->true(); - - $messages = new Messages( - [ - $message1, - $message2, - $message3, - ] - ); - - expect($messages instanceof \JsonSerializable)->true(); - - $expected = [ - 'field' => 'field1', - 'message' => 'This is a message #1', - 'type' => 'Type1', - 'code' => 1, - ]; - - expect($message1->jsonSerialize())->equals($expected); - - $actual = $messages->jsonSerialize(); - expect(is_array($actual))->true(); - expect(count($actual))->equals(3); - } - ); - } -} diff --git a/tests/unit/Messages/MessagesCest.php b/tests/unit/Messages/MessagesCest.php new file mode 100644 index 00000000000..8713ede8be4 --- /dev/null +++ b/tests/unit/Messages/MessagesCest.php @@ -0,0 +1,276 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Messages; + +use Phalcon\Messages\Message; +use Phalcon\Messages\Messages; +use Phalcon\Validation; +use UnitTester; + +class MessagesCest +{ + /** + * Tests append messages + * + * @test + * @author Serghei Iakovlev + * @since 2016-06-12 + */ + public function validationGroup(UnitTester $I) + { + $message1 = new Message('This a message #1', 'field1', 'Type1'); + $message2 = new Message('This a message #2', 'field2', 'Type2'); + $message3 = new Message('This a message #3', 'field3', 'Type3'); + + $messages = new Messages([$message1, $message2]); + + $expected = 2; + $actual = count($messages); + $I->assertEquals($expected, $actual); + + $actual = isset($messages[0]); + $I->assertTrue($actual); + + $actual = isset($messages[1]); + $I->assertTrue($actual); + + $expected = $message1; + $actual = $messages[0]; + $I->assertEquals($expected, $actual); + + $expected = $message2; + $actual = $messages[1]; + $I->assertEquals($expected, $actual); + + $messages->appendMessage($message3); + + $expected = $message3; + $actual = $messages[2]; + $I->assertEquals($expected, $actual); + + $expected = 3; + $actual = count($messages); + $I->assertEquals($expected, $actual); + + foreach ($messages as $position => $message) { + $expected = $messages[$position]->getMessage(); + $actual = $message->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = $messages[$position]->getField(); + $actual = $message->getField(); + $I->assertEquals($expected, $actual); + + $expected = $messages[$position]->getType(); + $actual = $message->getType(); + $I->assertEquals($expected, $actual); + } + } + + /** + * Tests unsetting a message by index + * + * @test + * @issue https://github.com/phalcon/cphalcon/issues/12455 + * @author Serghei Iakovlev + * @since 2017-02-12 + */ + public function unsettingByIndex(UnitTester $I) + { + $validation = new Validation(); + $validation->appendMessage(new Message('error a', 'myField', 'MyValidator')); + + $messages = $validation->getMessages(); + + $expected = 1; + $actual = count($messages); + $I->assertEquals($expected, $actual); + + $expected = Message::__set_state( + [ + '_message' => 'error a', + '_field' => 'myField', + '_type' => 'MyValidator', + '_code' => 0, + ] + ); + $actual = $messages[0]; + $I->assertEquals($expected, $actual); + + + $validation->appendMessage(new Message('error b', 'myField', 'MyValidator')); + + $messages = $validation->getMessages(); + + $expected = 2; + $actual = count($messages); + $I->assertEquals($expected, $actual); + + $expected = Message::__set_state( + [ + '_message' => 'error b', + '_field' => 'myField', + '_type' => 'MyValidator', + '_code' => 0, + ] + ); + $actual = $messages[1]; + $I->assertEquals($expected, $actual); + + + unset($messages[count($messages) - 1]); + + $expected = 1; + $actual = count($messages); + $I->assertEquals($expected, $actual); + + $expected = Message::__set_state( + [ + '_message' => 'error a', + '_field' => 'myField', + '_type' => 'MyValidator', + '_code' => 0, + ] + ); + $actual = $messages[0]; + $I->assertEquals($expected, $actual); + + $validation->appendMessage(new Message('error c', 'myField', 'MyValidator')); + + $expected = 2; + $actual = count($messages); + $I->assertEquals($expected, $actual); + + $expected = Message::__set_state( + [ + '_message' => 'error c', + '_field' => 'myField', + '_type' => 'MyValidator', + '_code' => 0, + ] + ); + $actual = $messages[1]; + $I->assertEquals($expected, $actual); + + $expected = Messages::__set_state( + [ + '_position' => 0, + '_messages' => [ + 0 => Message::__set_state( + [ + '_message' => 'error a', + '_field' => 'myField', + '_type' => 'MyValidator', + '_code' => 0, + ] + ), + 1 => Message::__set_state( + [ + '_message' => 'error c', + '_field' => 'myField', + '_type' => 'MyValidator', + '_code' => 0, + ] + ), + ] + ] + ); + $actual = $messages; + $I->assertEquals($expected, $actual); + + $validation->appendMessage(new Message('error d', 'myField', 'MyValidator')); + $validation->appendMessage(new Message('error e', 'myField', 'MyValidator')); + + $messages = $validation->getMessages(); + $messages->offsetUnset(1); + + $expected = Messages::__set_state( + [ + '_position' => 0, + '_messages' => [ + 0 => Message::__set_state( + [ + '_message' => 'error a', + '_field' => 'myField', + '_type' => 'MyValidator', + '_code' => 0, + ] + ), + 1 => Message::__set_state( + [ + '_message' => 'error d', + '_field' => 'myField', + '_type' => 'MyValidator', + '_code' => 0, + ] + ), + 2 => Message::__set_state( + [ + '_message' => 'error e', + '_field' => 'myField', + '_type' => 'MyValidator', + '_code' => 0, + ] + ), + ] + ] + ); + $actual = $validation->getMessages(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests JsonSerializable + * + * @test + * @author Nikolaos Dimopoulos + * @since 2018-10-18 + */ + public function shouldImplementJsonSerializable(UnitTester $I) + { + $message1 = new Message('This is a message #1', 'field1', 'Type1', 1); + $message2 = new Message('This is a message #2', 'field2', 'Type2', 2); + $message3 = new Message('This is a message #3', 'field3', 'Type3', 3); + + $expected = '\JsonSerializable'; + $actual = $message1; + $I->assertInstanceOf($expected, $actual); + + $messages = new Messages( + [ + $message1, + $message2, + $message3, + ] + ); + $expected = '\JsonSerializable'; + $actual = $messages; + $I->assertInstanceOf($expected, $actual); + + $expected = [ + 'field' => 'field1', + 'message' => 'This is a message #1', + 'type' => 'Type1', + 'code' => 1, + ]; + $actual = $message1->jsonSerialize(); + $I->assertEquals($expected, $actual); + + $data = $messages->jsonSerialize(); + $condition = is_array($data); + $I->assertTrue($condition); + + $expected = 3; + $actual = count($data); + $I->assertEquals($expected, $actual); + } +} From 0547022c3cfafda32e7e67032d83479c2bf1266d Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Mon, 5 Nov 2018 09:07:12 -0500 Subject: [PATCH 010/222] [#13578] - Refactored Filter tests --- .../tests/unit/Filter/FilterAlphanumTest.php | 97 --------- .../tests/unit/Filter/FilterCustomTest.php | 151 -------------- .../tests/unit/Filter/FilterEmailTest.php | 46 ----- .../tests/unit/Filter/FilterFloatTest.php | 103 ---------- .../tests/unit/Filter/FilterIntegerTest.php | 153 -------------- .../tests/unit/Filter/FilterMultipleTest.php | 77 ------- .../unit/Filter/FilterSpecialCharsTest.php | 42 ---- .../tests/unit/Filter/FilterStringTest.php | 190 ------------------ .../tests/unit/Filter/FilterStriptagsTest.php | 77 ------- _toCheck/tests/unit/Filter/FilterTrimTest.php | 77 ------- .../unit/Filter/FilterUpperLowerTest.php | 95 --------- _toCheck/tests/unit/Filter/FilterUrlTest.php | 42 ---- .../tests/unit/Filter/Helper/FilterBase.php | 43 ---- _toCheck/tests/unit/Filter/Helper/IPv4.php | 34 ---- tests/unit/Filter/FilterAlphanumCest.php | 71 +++++++ tests/unit/Filter/FilterCustomCest.php | 118 +++++++++++ tests/unit/Filter/FilterEmailCest.php | 37 ++++ tests/unit/Filter/FilterFloatCest.php | 74 +++++++ tests/unit/Filter/FilterIntegerCest.php | 107 ++++++++++ tests/unit/Filter/FilterMultipleCest.php | 58 ++++++ tests/unit/Filter/FilterSpecialCharsCest.php | 32 +++ tests/unit/Filter/FilterStringCest.php | 141 +++++++++++++ tests/unit/Filter/FilterStriptagsCest.php | 58 ++++++ tests/unit/Filter/FilterTrimCest.php | 58 ++++++ tests/unit/Filter/FilterUpperLowerCest.php | 71 +++++++ tests/unit/Filter/FilterUrlCest.php | 32 +++ tests/unit/Filter/Helper/FilterBase.php | 35 ++++ tests/unit/Filter/Helper/IPv4.php | 27 +++ 28 files changed, 919 insertions(+), 1227 deletions(-) delete mode 100644 _toCheck/tests/unit/Filter/FilterAlphanumTest.php delete mode 100644 _toCheck/tests/unit/Filter/FilterCustomTest.php delete mode 100644 _toCheck/tests/unit/Filter/FilterEmailTest.php delete mode 100644 _toCheck/tests/unit/Filter/FilterFloatTest.php delete mode 100644 _toCheck/tests/unit/Filter/FilterIntegerTest.php delete mode 100644 _toCheck/tests/unit/Filter/FilterMultipleTest.php delete mode 100644 _toCheck/tests/unit/Filter/FilterSpecialCharsTest.php delete mode 100644 _toCheck/tests/unit/Filter/FilterStringTest.php delete mode 100644 _toCheck/tests/unit/Filter/FilterStriptagsTest.php delete mode 100644 _toCheck/tests/unit/Filter/FilterTrimTest.php delete mode 100644 _toCheck/tests/unit/Filter/FilterUpperLowerTest.php delete mode 100644 _toCheck/tests/unit/Filter/FilterUrlTest.php delete mode 100644 _toCheck/tests/unit/Filter/Helper/FilterBase.php delete mode 100644 _toCheck/tests/unit/Filter/Helper/IPv4.php create mode 100644 tests/unit/Filter/FilterAlphanumCest.php create mode 100644 tests/unit/Filter/FilterCustomCest.php create mode 100644 tests/unit/Filter/FilterEmailCest.php create mode 100644 tests/unit/Filter/FilterFloatCest.php create mode 100644 tests/unit/Filter/FilterIntegerCest.php create mode 100644 tests/unit/Filter/FilterMultipleCest.php create mode 100644 tests/unit/Filter/FilterSpecialCharsCest.php create mode 100644 tests/unit/Filter/FilterStringCest.php create mode 100644 tests/unit/Filter/FilterStriptagsCest.php create mode 100644 tests/unit/Filter/FilterTrimCest.php create mode 100644 tests/unit/Filter/FilterUpperLowerCest.php create mode 100644 tests/unit/Filter/FilterUrlCest.php create mode 100644 tests/unit/Filter/Helper/FilterBase.php create mode 100644 tests/unit/Filter/Helper/IPv4.php diff --git a/_toCheck/tests/unit/Filter/FilterAlphanumTest.php b/_toCheck/tests/unit/Filter/FilterAlphanumTest.php deleted file mode 100644 index fca0f6a4b92..00000000000 --- a/_toCheck/tests/unit/Filter/FilterAlphanumTest.php +++ /dev/null @@ -1,97 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Filter - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class FilterAlphanumTest extends Helper\FilterBase -{ - /** - * Tests Alphanum with an integer using constant - * - * @author Nikolaos Dimopoulos - * @since 2015-04-21 - */ - public function testSanitizeAlphanumIntegerConstant() - { - $this->specify( - "Alphanum integer (constant) filter is not correct", - function () { - $expected = '0'; - $value = 0; - $this->sanitizer(Filter::FILTER_ALPHANUM, $expected, $value); - } - ); - } - - /** - * Tests Alphanum with an integer - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeAlphanumInteger() - { - $this->specify( - "Alphanum integer filter is not correct", - function () { - $expected = '0'; - $value = 0; - $this->sanitizer('alphanum', $expected, $value); - } - ); - } - - /** - * Tests Alphanum with a null - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeAlphanumNull() - { - $this->specify( - "Alphanum null filter is not correct", - function () { - $expected = ''; - $value = null; - $this->sanitizer('alphanum', $expected, $value); - } - ); - } - - /** - * Tests Alphanum with a mixed string - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeAlphanumMixed() - { - $this->specify( - "Alphanum mixed string filter is not correct", - function () { - $expected = 'a5xkat1sXan'; - $value = '?a&5xka\tŧ?1-s.Xa[\n'; - $this->sanitizer('alphanum', $expected, $value); - } - ); - } -} diff --git a/_toCheck/tests/unit/Filter/FilterCustomTest.php b/_toCheck/tests/unit/Filter/FilterCustomTest.php deleted file mode 100644 index 14e97590032..00000000000 --- a/_toCheck/tests/unit/Filter/FilterCustomTest.php +++ /dev/null @@ -1,151 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Filter - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class FilterCustomTest extends Helper\FilterBase -{ - /** - * Tests a custom filter IPv4 - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeCustomIpv4FilterHex() - { - $this->specify( - "custom filter does not return correct hex", - function () { - $filter = new Filter(); - - $filter->add('ipv4', new IPv4()); - - expect($filter->sanitize('00:1c:42:bf:71:22', 'ipv4'))->isEmpty(); - } - ); - } - - /** - * Tests a custom filter IPv4 IP - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeCustomIpv4FilterIP() - { - $this->specify( - "custom filter does not return correct IP", - function () { - $filter = new Filter(); - - $filter->add('ipv4', new IPv4()); - - $expected = '127.0.0.1'; - $actual = $filter->sanitize('127.0.0.1', 'ipv4'); - expect($actual)->equals($expected); - } - ); - } - - /** - * Tests a custom filter Lambda - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeCustomLambdaFalse() - { - $this->specify( - "lambda custom filter does not return false", - function () { - $filter = new Filter(); - - $filter->add( - 'md5', - function ($value) { - $filtered = preg_replace('/[^0-9a-f]/', '', $value); - - return (strlen($filtered) != 32) ? false : $value; - } - ); - - $actual = $filter->sanitize('Lladlad12', 'md5'); - expect($actual)->false(); - } - ); - } - - /** - * Tests a custom filter Lambda - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeCustomLambdaFalseTrue() - { - $this->specify( - "lambda custom filter does not return true", - function () { - $filter = new Filter(); - - $filter->add( - 'md5', - function ($value) { - $filtered = preg_replace('/[^0-9a-f]/', '', $value); - - return (strlen($filtered) != 32) ? false : $value; - } - ); - - $expected = md5('why?'); - $actual = $filter->sanitize($expected, 'md5'); - expect($actual)->equals($expected); - } - ); - } - - /** - * Tests a custom callable filter - * - * @author Serghei Iakovlev - * @since 2016-04-15 - * @issue https://github.com/phalcon/cphalcon/issues/11581 - */ - public function testSanitizeCustomCallableFilterIp() - { - $this->specify( - "callable filter does not return correct IP", - function () { - $filter = new Filter(); - - $filter->add('ipv4', [$this, 'ipv4callback']); - - expect($filter->sanitize('127.0.0.1', 'ipv4'))->equals('127.0.0.1'); - } - ); - } - - public function ipv4callback($value) - { - return filter_var($value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4); - } -} diff --git a/_toCheck/tests/unit/Filter/FilterEmailTest.php b/_toCheck/tests/unit/Filter/FilterEmailTest.php deleted file mode 100644 index 03624b96c42..00000000000 --- a/_toCheck/tests/unit/Filter/FilterEmailTest.php +++ /dev/null @@ -1,46 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Filter - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class FilterEmailTest extends Helper\FilterBase -{ - /** - * Tests Email - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeEmail() - { - $this->specify( - "sanitizing email does not return the correct email", - function () { - $expected = 'someone@example.com'; - $value = 'some(one)@exa\\mple.com'; - $this->sanitizer('email', $expected, $value); - - $expected = '!first.guy@*my-domain**##.com.rx'; - $value = '!(first.guy) - @*my-domain**##.com.rx//'; - $this->sanitizer('email', $expected, $value); - } - ); - } -} diff --git a/_toCheck/tests/unit/Filter/FilterFloatTest.php b/_toCheck/tests/unit/Filter/FilterFloatTest.php deleted file mode 100644 index 4fcd6d42457..00000000000 --- a/_toCheck/tests/unit/Filter/FilterFloatTest.php +++ /dev/null @@ -1,103 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Filter - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class FilterFloatTest extends Helper\FilterBase -{ - /** - * Tests sanitizing a float with float filter - * - * @author Nikos Dimopoulos - * @since 2012-11-30 - */ - public function testSanitizeFloatFloat() - { - $this->specify( - "sanitizing float with float filter not correct", - function () { - $this->sanitizer('float', 1000.01, '1000.01'); - } - ); - } - - /** - * Tests sanitizing a hex with float filter - * - * @author Nikos Dimopoulos - * @since 2012-11-30 - */ - public function testSanitizeFloatHex() - { - $this->specify( - "sanitizing hex with float filter not correct", - function () { - $this->sanitizer('float', 0xFFA, 0xFFA); - } - ); - } - - /** - * Tests sanitizing a string number with float filter - * - * @author Nikos Dimopoulos - * @since 2012-11-30 - */ - public function testSanitizeFloatStringNumber() - { - $this->specify( - "sanitizing string number with float filter not correct", - function () { - $this->sanitizer('float', '1000.01', '1000.01'); - } - ); - } - - /** - * Tests sanitizing a string with float filter - * - * @author Nikos Dimopoulos - * @since 2012-11-30 - */ - public function testSanitizeFloatString() - { - $this->specify( - "sanitizing string with float filter not correct", - function () { - $this->sanitizer('float', '', 'lol'); - } - ); - } - - /** - * Tests sanitizing a string with float filter - * - * @author Nikos Dimopoulos - * @since 2012-11-30 - */ - public function testSanitizeFloatStringCombined() - { - $this->specify( - "sanitizing string combined with float filter not correct", - function () { - $this->sanitizer('float', '10001901.01', '!10001901.01a'); - } - ); - } -} diff --git a/_toCheck/tests/unit/Filter/FilterIntegerTest.php b/_toCheck/tests/unit/Filter/FilterIntegerTest.php deleted file mode 100644 index e0ee362530a..00000000000 --- a/_toCheck/tests/unit/Filter/FilterIntegerTest.php +++ /dev/null @@ -1,153 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Filter - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class FilterIntegerTest extends Helper\FilterBase -{ - /** - * Tests sanitizing an integer with abs integer filter with constant - * - * @author Nikos Dimopoulos - * @since 2015-04-21 - */ - public function testSanitizeAbsIntegerInteger() - { - $this->specify( - "sanitizing integer with abs int filter not correct", - function () { - $this->sanitizer(Filter::FILTER_ABSINT, 125, -125); - } - ); - } - - /** - * Tests sanitizing a string with abs integer filter with constant - * - * @author Nikos Dimopoulos - * @since 2015-04-21 - */ - public function testSanitizeAbsIntegerString() - { - $this->specify( - "sanitizing string with abs int filter not correct", - function () { - $this->sanitizer(Filter::FILTER_ABSINT, 125, '-125'); - } - ); - } - - /** - * Tests sanitizing an integer with integer filter with constant - * - * @author Nikos Dimopoulos - * @since 2015-04-21 - */ - public function testSanitizeIntegerIntegerConstant() - { - $this->specify( - "sanitizing integer with int filter not correct", - function () { - $this->sanitizer(Filter::FILTER_INT, 1000, 1000); - } - ); - } - - /** - * Tests sanitizing an integer with integer filter - * - * @author Nikos Dimopoulos - * @since 2012-11-30 - */ - public function testSanitizeIntegerInteger() - { - $this->specify( - "sanitizing integer with int filter not correct", - function () { - $this->sanitizer('int', 1000, 1000); - } - ); - } - - /** - * Tests sanitizing a hex with integer filter - * - * @author Nikos Dimopoulos - * @since 2012-11-30 - */ - public function testSanitizeIntegerHex() - { - $this->specify( - "sanitizing hex with int filter not correct", - function () { - $this->sanitizer('int', 0xFFA, 0xFFA); - } - ); - } - - /** - * Tests sanitizing a string number with integer filter - * - * @author Nikos Dimopoulos - * @since 2012-11-30 - */ - public function testSanitizeIntegerStringNumber() - { - $this->specify( - "sanitizing string number with int filter not correct", - function () { - $this->sanitizer('int', '1000', '1000'); - } - ); - } - - /** - * Tests sanitizing a string with integer filter - * - * @author Nikos Dimopoulos - * @since 2012-11-30 - */ - public function testSanitizeIntegerString() - { - $this->specify( - "sanitizing string with int filter not correct", - function () { - $this->sanitizer('int', '', 'lol'); - } - ); - } - - /** - * Tests sanitizing a string with integer filter - * - * @author Nikos Dimopoulos - * @since 2012-11-30 - */ - public function testSanitizeIntegerStringCombined() - { - $this->specify( - "sanitizing string combined with int filter not correct", - function () { - $this->sanitizer('int', '10001901', '!100a019.01a'); - } - ); - } -} diff --git a/_toCheck/tests/unit/Filter/FilterMultipleTest.php b/_toCheck/tests/unit/Filter/FilterMultipleTest.php deleted file mode 100644 index b1601fc3bc2..00000000000 --- a/_toCheck/tests/unit/Filter/FilterMultipleTest.php +++ /dev/null @@ -1,77 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Filter - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class FilterMultipleTest extends Helper\FilterBase -{ - /** - * Tests sanitizing string with filters - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeStringWithMultipleFilters() - { - $this->specify( - "string with multiple filters does not return the correct result", - function () { - $expected = 'lol'; - $value = ' lol<<< '; - $this->sanitizer(['string', 'trim'], $expected, $value); - } - ); - } - - /** - * Tests sanitizing array with filters - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeArray() - { - $this->specify( - "array does not return the correct result", - function () { - $expected = ['1', '2', '3']; - $value = [' 1 ', ' 2', '3 ']; - $this->sanitizer('trim', $expected, $value); - } - ); - } - - /** - * Tests sanitizing array with multiple filters - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeArrayWithMultipleFilters() - { - $this->specify( - "array with multiple filters does not return the correct result", - function () { - $expected = ['1', '2', '3']; - $value = [' 1 ', '

2

', '

3

']; - $this->sanitizer(['trim', 'striptags'], $expected, $value); - } - ); - } -} diff --git a/_toCheck/tests/unit/Filter/FilterSpecialCharsTest.php b/_toCheck/tests/unit/Filter/FilterSpecialCharsTest.php deleted file mode 100644 index b8e4d257cad..00000000000 --- a/_toCheck/tests/unit/Filter/FilterSpecialCharsTest.php +++ /dev/null @@ -1,42 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @author Zamrony P. Juhara - * @package Phalcon\Test\Unit\Filter - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class FilterSpecialCharsTest extends Helper\FilterBase -{ - /** - * Tests Sanitize special characters - * - * @author Zamrony P. Juhara - * @since 2017-03-23 - */ - public function testSanitizeSpecialChars() - { - $this->specify( - "sanitizing special characters does not return correct string", - function () { - $expected = 'This is <html> tags'; - $value = 'This is tags'; - $this->sanitizer('special_chars', $expected, $value); - } - ); - } -} diff --git a/_toCheck/tests/unit/Filter/FilterStringTest.php b/_toCheck/tests/unit/Filter/FilterStringTest.php deleted file mode 100644 index ba91a03f8a8..00000000000 --- a/_toCheck/tests/unit/Filter/FilterStringTest.php +++ /dev/null @@ -1,190 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Filter - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class FilterStringTest extends Helper\FilterBase -{ - /** - * Tests the filter with a string (US characters) - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeStringStringFilter() - { - $this->specify( - "sanitize string with latin characters does not return correct data", - function () { - $value = 'abcdefghijklmnopqrstuvwzyx1234567890!@#$%^&*()_ `~=+<>'; - $expected = 'abcdefghijklmnopqrstuvwzyx1234567890!@#$%^&*()_ `~=+'; - $this->sanitizer('string', $expected, $value); - } - ); - } - - /** - * Tests the filter with a string with french quotes - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeStringStringFrenchQuotesFilter() - { - $this->specify( - "sanitize string with latin characters does not return correct data", - function () { - $value = "{[]}"; - $expected = '{[]}'; - $this->sanitizer('string', $expected, $value); - } - ); - } - - /** - * Tests the filter with a string (International characters) - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeStringUTF8StringFilter() - { - $this->specify( - "sanitize string with international characters does not return correct data", - function () { - $value = 'buenos días123καλημέρα!@#$%^&*早安()_ `~=+<>'; - $expected = 'buenos días123καλημέρα!@#$%^&*早安()_ `~=+'; - $this->sanitizer('string', $expected, $value); - - $value = '{[]}'; - $expected = '{[]}'; - $this->sanitizer('string', $expected, $value); - } - ); - } - - /** - * Tests the filter with an array filter (US characters) - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeStringArrayFilter() - { - $this->specify( - "sanitize string with array latin characters characters does not return correct data", - function () { - $value = 'abcdefghijklmnopqrstuvwzyx1234567890!@#$%^&*()_ `~=+<>'; - $expected = 'abcdefghijklmnopqrstuvwzyx1234567890!@#$%^&*()_ `~=+'; - $this->sanitizer(['string'], $expected, $value); - } - ); - } - - /** - * Tests the filter with an array filter (International characters) - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeStringUTF8ArrayFilter() - { - $this->specify( - "sanitize string with array international characters characters does not return correct data", - function () { - $value = 'buenos días123καλημέρα!@#$%^&*早安()_ `~=+<>'; - $expected = 'buenos días123καλημέρα!@#$%^&*早安()_ `~=+'; - $this->sanitizer(['string'], $expected, $value); - } - ); - } - - /** - * Tests the filter with a string (no filtering) (US characters) - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeStringStringFilterValidString() - { - $this->specify( - "sanitize string with a valid latin string does not return correct data", - function () { - $value = 'abcdefghijklmnopqrstuvwzyx1234567890!@#$%^&*()_ `~=+'; - $expected = 'abcdefghijklmnopqrstuvwzyx1234567890!@#$%^&*()_ `~=+'; - $this->sanitizer('string', $expected, $value); - } - ); - } - - /** - * Tests the filter with a string (no filtering) (International characters) - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeStringUTF8StringFilterValidString() - { - $this->specify( - "sanitize string with a valid international string does not return correct data", - function () { - $value = 'buenos días123καλημέρα!@#$%^&*早安()_ `~=+'; - $expected = 'buenos días123καλημέρα!@#$%^&*早安()_ `~=+'; - $this->sanitizer('string', $expected, $value); - } - ); - } - - /** - * Tests the filter with an array filter (no filtering) (US characters) - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeArrayFilterValidString() - { - $this->specify( - "sanitize string array with a valid latin string does not return correct data", - function () { - $value = 'abcdefghijklmnopqrstuvwzyx1234567890!@#$%^&*()_ `~=+'; - $expected = 'abcdefghijklmnopqrstuvwzyx1234567890!@#$%^&*()_ `~=+'; - $this->sanitizer(['string'], $expected, $value); - } - ); - } - - /** - * Tests the filter with an array filter (no filtering) - * (International characters) - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeUTF8ArrayFilterValidStringNoFilter() - { - $this->specify( - "sanitize string array with a valid latin string does not return correct data", - function () { - $value = 'buenos días123καλημέρα!@#$%^&*早安()_ `~=+'; - $expected = 'buenos días123καλημέρα!@#$%^&*早安()_ `~=+'; - $this->sanitizer(['string'], $expected, $value); - } - ); - } -} diff --git a/_toCheck/tests/unit/Filter/FilterStriptagsTest.php b/_toCheck/tests/unit/Filter/FilterStriptagsTest.php deleted file mode 100644 index 49ec3fe076b..00000000000 --- a/_toCheck/tests/unit/Filter/FilterStriptagsTest.php +++ /dev/null @@ -1,77 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Filter - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class FilterStriptagsTest extends Helper\FilterBase -{ - /** - * Tests striptags filter with html - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeStriptagsHTML() - { - $this->specify( - "striptags html filter is not correct", - function () { - $expected = 'Hello'; - $value = '

Hello

'; - $this->sanitizer('striptags', $expected, $value); - } - ); - } - - /** - * Tests striptags filter with broken html - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeStriptagsBrokenHTML() - { - $this->specify( - "striptags html filter is not correct", - function () { - $expected = 'Hello'; - $value = '

Hello

'; - $this->sanitizer('striptags', $expected, $value); - } - ); - } - - /** - * Tests striptags filter with single html tag - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeStriptagsSingle() - { - $this->specify( - "striptags html filter is not correct", - function () { - $expected = ''; - $value = '<'; - $this->sanitizer('striptags', $expected, $value); - } - ); - } -} diff --git a/_toCheck/tests/unit/Filter/FilterTrimTest.php b/_toCheck/tests/unit/Filter/FilterTrimTest.php deleted file mode 100644 index abdb16e377a..00000000000 --- a/_toCheck/tests/unit/Filter/FilterTrimTest.php +++ /dev/null @@ -1,77 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Filter - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class FilterTrimTest extends Helper\FilterBase -{ - /** - * Tests Trim left - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeTrimLeft() - { - $this->specify( - "trim left is not correct", - function () { - $expected = 'Hello'; - $value = ' Hello'; - $this->sanitizer('trim', $expected, $value); - } - ); - } - - /** - * Tests Trim right - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeTrimRight() - { - $this->specify( - "trim right is not correct", - function () { - $expected = 'Hello'; - $value = 'Hello '; - $this->sanitizer('trim', $expected, $value); - } - ); - } - - /** - * Tests Trim both - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeTrimBoth() - { - $this->specify( - "trim both is not correct", - function () { - $expected = 'Hello'; - $value = ' Hello '; - $this->sanitizer('trim', $expected, $value); - } - ); - } -} diff --git a/_toCheck/tests/unit/Filter/FilterUpperLowerTest.php b/_toCheck/tests/unit/Filter/FilterUpperLowerTest.php deleted file mode 100644 index 3334bab7506..00000000000 --- a/_toCheck/tests/unit/Filter/FilterUpperLowerTest.php +++ /dev/null @@ -1,95 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Filter - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class FilterUpperLowerTest extends Helper\FilterBase -{ - /** - * Tests lower all - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeLowerAll() - { - $this->specify( - "lower all is not correct", - function () { - $expected = 'hello'; - $value = 'HELLO'; - $this->sanitizer('lower', $expected, $value); - } - ); - } - - /** - * Tests lower mixed - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeLowerMixed() - { - $this->specify( - "lower mixed is not correct", - function () { - $expected = 'hello'; - $value = 'HeLlo'; - $this->sanitizer('lower', $expected, $value); - } - ); - } - - /** - * Tests upper all - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeUpperAll() - { - $this->specify( - "upper all is not correct", - function () { - $expected = 'HELLO'; - $value = 'hello'; - $this->sanitizer('upper', $expected, $value); - } - ); - } - - /** - * Tests upper mixed - * - * @author Nikolaos Dimopoulos - * @since 2014-09-30 - */ - public function testSanitizeUpperMixed() - { - $this->specify( - "upper mixed is not correct", - function () { - $expected = 'HELLO'; - $value = 'HeLlo'; - $this->sanitizer('upper', $expected, $value); - } - ); - } -} diff --git a/_toCheck/tests/unit/Filter/FilterUrlTest.php b/_toCheck/tests/unit/Filter/FilterUrlTest.php deleted file mode 100644 index fa26f669cca..00000000000 --- a/_toCheck/tests/unit/Filter/FilterUrlTest.php +++ /dev/null @@ -1,42 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @author Zamrony P. Juhara - * @package Phalcon\Test\Unit\Filter - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class FilterUrlTest extends Helper\FilterBase -{ - /** - * Tests Url - * - * @author Zamrony P. Juhara - * @since 2017-03-23 - */ - public function testSanitizeUrl() - { - $this->specify( - "sanitizing url does not return the correct url", - function () { - $expected = 'http://juhara.com'; - $value = 'http://juhara��.co�m'; - $this->sanitizer('url', $expected, $value); - } - ); - } -} diff --git a/_toCheck/tests/unit/Filter/Helper/FilterBase.php b/_toCheck/tests/unit/Filter/Helper/FilterBase.php deleted file mode 100644 index d1114fa366a..00000000000 --- a/_toCheck/tests/unit/Filter/Helper/FilterBase.php +++ /dev/null @@ -1,43 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Filter\Helper - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class FilterBase extends UnitTest -{ - /** - * Tests integers - * - * @author Nikos Dimopoulos - * @since 2012-11-30 - * - * @param string $filter - * @param mixed $expected - * @param mixed $value - */ - protected function sanitizer($filter, $expected, $value) - { - $fl = new Filter(); - $actual = $fl->sanitize($value, $filter); - expect($expected)->equals($actual); - } -} diff --git a/_toCheck/tests/unit/Filter/Helper/IPv4.php b/_toCheck/tests/unit/Filter/Helper/IPv4.php deleted file mode 100644 index bf1f0b126cb..00000000000 --- a/_toCheck/tests/unit/Filter/Helper/IPv4.php +++ /dev/null @@ -1,34 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Filter\Helper - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class IPv4 -{ - /** - * Filters data - * - * @param $value - * @return mixed - */ - public function filter($value) - { - return filter_var($value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4); - } -} diff --git a/tests/unit/Filter/FilterAlphanumCest.php b/tests/unit/Filter/FilterAlphanumCest.php new file mode 100644 index 00000000000..7ac6b400494 --- /dev/null +++ b/tests/unit/Filter/FilterAlphanumCest.php @@ -0,0 +1,71 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Filter; + +use Phalcon\Filter; +use Phalcon\Test\Unit\Filter\Helper\FilterBase; +use UnitTester; + +class FilterAlphanumCest extends FilterBase +{ + /** + * Tests Alphanum with an integer using constant + * + * @author Nikolaos Dimopoulos + * @since 2015-04-21 + */ + public function testSanitizeAlphanumIntegerConstant(UnitTester $I) + { + $expected = '0'; + $value = 0; + $this->sanitizer($I, Filter::FILTER_ALPHANUM, $expected, $value); + } + + /** + * Tests Alphanum with an integer + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeAlphanumInteger(UnitTester $I) + { + $expected = '0'; + $value = 0; + $this->sanitizer($I, 'alphanum', $expected, $value); + } + + /** + * Tests Alphanum with a null + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeAlphanumNull(UnitTester $I) + { + $expected = ''; + $value = null; + $this->sanitizer($I, 'alphanum', $expected, $value); + } + + /** + * Tests Alphanum with a mixed string + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeAlphanumMixed(UnitTester $I) + { + $expected = 'a5xkat1sXan'; + $value = '?a&5xka\tŧ?1-s.Xa[\n'; + $this->sanitizer($I, 'alphanum', $expected, $value); + } +} diff --git a/tests/unit/Filter/FilterCustomCest.php b/tests/unit/Filter/FilterCustomCest.php new file mode 100644 index 00000000000..473d9913308 --- /dev/null +++ b/tests/unit/Filter/FilterCustomCest.php @@ -0,0 +1,118 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Filter; + +use Phalcon\Filter; +use Phalcon\Test\Unit\Filter\Helper\IPv4; +use Phalcon\Test\Unit\Filter\Helper\FilterBase; +use UnitTester; + +class FilterCustomCest extends FilterBase +{ + /** + * Tests a custom filter IPv4 + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeCustomIpv4FilterHex(UnitTester $I) + { + $filter = new Filter(); + $filter->add('ipv4', new IPv4()); + + $actual = $filter->sanitize('00:1c:42:bf:71:22', 'ipv4'); + $I->assertEmpty($actual); + } + + /** + * Tests a custom filter IPv4 IP + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeCustomIpv4FilterIP(UnitTester $I) + { + $filter = new Filter(); + $filter->add('ipv4', new IPv4()); + + $expected = '127.0.0.1'; + $actual = $filter->sanitize('127.0.0.1', 'ipv4'); + $I->assertEquals($expected, $actual); + } + + /** + * Tests a custom filter Lambda + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeCustomLambdaFalse(UnitTester $I) + { + $filter = new Filter(); + $filter->add( + 'md5', + function ($value) { + $filtered = preg_replace('/[^0-9a-f]/', '', $value); + + return (strlen($filtered) != 32) ? false : $value; + } + ); + + $actual= $filter->sanitize('Lladlad12', 'md5'); + $I->assertFalse($actual); + } + + /** + * Tests a custom filter Lambda + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeCustomLambdaFalseTrue(UnitTester $I) + { + $filter = new Filter(); + $filter->add( + 'md5', + function ($value) { + $filtered = preg_replace('/[^0-9a-f]/', '', $value); + + return (strlen($filtered) != 32) ? false : $value; + } + ); + + $expected = md5('why?'); + $actual = $filter->sanitize($expected, 'md5'); + $I->assertEquals($expected, $actual); + } + + /** + * Tests a custom callable filter + * + * @author Serghei Iakovlev + * @since 2016-04-15 + * @issue https://github.com/phalcon/cphalcon/issues/11581 + */ + public function testSanitizeCustomCallableFilterIp(UnitTester $I) + { + $filter = new Filter(); + $filter->add('ipv4', [$this, 'ipv4callback']); + + $expected = '127.0.0.1'; + $actual = $filter->sanitize('127.0.0.1', 'ipv4'); + $I->assertEquals($expected, $actual); + } + + public function ipv4callback($value) + { + return filter_var($value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4); + } +} diff --git a/tests/unit/Filter/FilterEmailCest.php b/tests/unit/Filter/FilterEmailCest.php new file mode 100644 index 00000000000..1f1544619b3 --- /dev/null +++ b/tests/unit/Filter/FilterEmailCest.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Filter; + +use Phalcon\Filter; +use Phalcon\Test\Unit\Filter\Helper\FilterBase; +use UnitTester; + +class FilterEmailCest extends FilterBase +{ + /** + * Tests Email + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeEmail(UnitTester $I) + { + $expected = 'someone@example.com'; + $value = 'some(one)@exa\\mple.com'; + $this->sanitizer($I, 'email', $expected, $value); + + $expected = '!first.guy@*my-domain**##.com.rx'; + $value = '!(first.guy) + @*my-domain**##.com.rx//'; + $this->sanitizer($I, 'email', $expected, $value); + } +} diff --git a/tests/unit/Filter/FilterFloatCest.php b/tests/unit/Filter/FilterFloatCest.php new file mode 100644 index 00000000000..7f69b7cbaa8 --- /dev/null +++ b/tests/unit/Filter/FilterFloatCest.php @@ -0,0 +1,74 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Filter; + +use Phalcon\Filter; +use Phalcon\Test\Unit\Filter\Helper\FilterBase; +use UnitTester; + +class FilterFloatCest extends FilterBase +{ + /** + * Tests sanitizing a float with float filter + * + * @author Nikos Dimopoulos + * @since 2012-11-30 + */ + public function testSanitizeFloatFloat(UnitTester $I) + { + $this->sanitizer($I, 'float', 1000.01, '1000.01'); + } + + /** + * Tests sanitizing a hex with float filter + * + * @author Nikos Dimopoulos + * @since 2012-11-30 + */ + public function testSanitizeFloatHex(UnitTester $I) + { + $this->sanitizer($I, 'float', 0xFFA, 0xFFA); + } + + /** + * Tests sanitizing a string number with float filter + * + * @author Nikos Dimopoulos + * @since 2012-11-30 + */ + public function testSanitizeFloatStringNumber(UnitTester $I) + { + $this->sanitizer($I, 'float', '1000.01', '1000.01'); + } + + /** + * Tests sanitizing a string with float filter + * + * @author Nikos Dimopoulos + * @since 2012-11-30 + */ + public function testSanitizeFloatString(UnitTester $I) + { + $this->sanitizer($I, 'float', '', 'lol'); + } + + /** + * Tests sanitizing a string with float filter + * + * @author Nikos Dimopoulos + * @since 2012-11-30 + */ + public function testSanitizeFloatStringCombined(UnitTester $I) + { + $this->sanitizer($I, 'float', '10001901.01', '!10001901.01a'); + } +} diff --git a/tests/unit/Filter/FilterIntegerCest.php b/tests/unit/Filter/FilterIntegerCest.php new file mode 100644 index 00000000000..34eaeccd573 --- /dev/null +++ b/tests/unit/Filter/FilterIntegerCest.php @@ -0,0 +1,107 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Filter; + +use Phalcon\Filter; +use Phalcon\Test\Unit\Filter\Helper\FilterBase; +use UnitTester; + +class FilterIntegerCest extends FilterBase +{ + /** + * Tests sanitizing an integer with abs integer filter with constant + * + * @author Nikos Dimopoulos + * @since 2015-04-21 + */ + public function testSanitizeAbsIntegerInteger(UnitTester $I) + { + $this->sanitizer($I, Filter::FILTER_ABSINT, 125, -125); + } + + /** + * Tests sanitizing a string with abs integer filter with constant + * + * @author Nikos Dimopoulos + * @since 2015-04-21 + */ + public function testSanitizeAbsIntegerString(UnitTester $I) + { + $this->sanitizer($I, Filter::FILTER_ABSINT, 125, '-125'); + } + + /** + * Tests sanitizing an integer with integer filter with constant + * + * @author Nikos Dimopoulos + * @since 2015-04-21 + */ + public function testSanitizeIntegerIntegerConstant(UnitTester $I) + { + $this->sanitizer($I, Filter::FILTER_INT, 1000, 1000); + } + + /** + * Tests sanitizing an integer with integer filter + * + * @author Nikos Dimopoulos + * @since 2012-11-30 + */ + public function testSanitizeIntegerInteger(UnitTester $I) + { + $this->sanitizer($I, 'int', 1000, 1000); + } + + /** + * Tests sanitizing a hex with integer filter + * + * @author Nikos Dimopoulos + * @since 2012-11-30 + */ + public function testSanitizeIntegerHex(UnitTester $I) + { + $this->sanitizer($I, 'int', 0xFFA, 0xFFA); + } + + /** + * Tests sanitizing a string number with integer filter + * + * @author Nikos Dimopoulos + * @since 2012-11-30 + */ + public function testSanitizeIntegerStringNumber(UnitTester $I) + { + $this->sanitizer($I, 'int', '1000', '1000'); + } + + /** + * Tests sanitizing a string with integer filter + * + * @author Nikos Dimopoulos + * @since 2012-11-30 + */ + public function testSanitizeIntegerString(UnitTester $I) + { + $this->sanitizer($I, 'int', '', 'lol'); + } + + /** + * Tests sanitizing a string with integer filter + * + * @author Nikos Dimopoulos + * @since 2012-11-30 + */ + public function testSanitizeIntegerStringCombined(UnitTester $I) + { + $this->sanitizer($I, 'int', '10001901', '!100a019.01a'); + } +} diff --git a/tests/unit/Filter/FilterMultipleCest.php b/tests/unit/Filter/FilterMultipleCest.php new file mode 100644 index 00000000000..a0f96e491b1 --- /dev/null +++ b/tests/unit/Filter/FilterMultipleCest.php @@ -0,0 +1,58 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Filter; + +use Phalcon\Filter; +use Phalcon\Test\Unit\Filter\Helper\FilterBase; +use UnitTester; + +class FilterMultipleCest extends FilterBase +{ + /** + * Tests sanitizing string with filters + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeStringWithMultipleFilters(UnitTester $I) + { + $expected = 'lol'; + $value = ' lol<<< '; + $this->sanitizer($I, ['string', 'trim'], $expected, $value); + } + + /** + * Tests sanitizing array with filters + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeArray(UnitTester $I) + { + $expected = ['1', '2', '3']; + $value = [' 1 ', ' 2', '3 ']; + $this->sanitizer($I, 'trim', $expected, $value); + } + + /** + * Tests sanitizing array with multiple filters + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeArrayWithMultipleFilters(UnitTester $I) + { + $expected = ['1', '2', '3']; + $value = [' 1 ', '

2

', '

3

']; + $this->sanitizer($I, ['trim', 'striptags'], $expected, $value); + } +} diff --git a/tests/unit/Filter/FilterSpecialCharsCest.php b/tests/unit/Filter/FilterSpecialCharsCest.php new file mode 100644 index 00000000000..8b1a989babd --- /dev/null +++ b/tests/unit/Filter/FilterSpecialCharsCest.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Filter; + +use Phalcon\Filter; +use Phalcon\Test\Unit\Filter\Helper\FilterBase; +use UnitTester; + +class FilterSpecialCharsCest extends FilterBase +{ + /** + * Tests Sanitize special characters + * + * @author Zamrony P. Juhara + * @since 2017-03-23 + */ + public function testSanitizeSpecialChars(UnitTester $I) + { + $expected = 'This is <html> tags'; + $value = 'This is tags'; + $this->sanitizer($I, 'special_chars', $expected, $value); + } +} diff --git a/tests/unit/Filter/FilterStringCest.php b/tests/unit/Filter/FilterStringCest.php new file mode 100644 index 00000000000..1348c66468e --- /dev/null +++ b/tests/unit/Filter/FilterStringCest.php @@ -0,0 +1,141 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Filter; + +use Phalcon\Filter; +use Phalcon\Test\Unit\Filter\Helper\FilterBase; +use UnitTester; + +class FilterStringCest extends FilterBase +{ + /** + * Tests the filter with a string (US characters) + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeStringStringFilter(UnitTester $I) + { + $value = 'abcdefghijklmnopqrstuvwzyx1234567890!@#$%^&*()_ `~=+<>'; + $expected = 'abcdefghijklmnopqrstuvwzyx1234567890!@#$%^&*()_ `~=+'; + $this->sanitizer($I, 'string', $expected, $value); + } + + /** + * Tests the filter with a string with french quotes + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeStringStringFrenchQuotesFilter(UnitTester $I) + { + $value = "{[]}"; + $expected = '{[]}'; + $this->sanitizer($I, 'string', $expected, $value); + } + + /** + * Tests the filter with a string (International characters) + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeStringUTF8StringFilter(UnitTester $I) + { + $value = 'buenos días123καλημέρα!@#$%^&*早安()_ `~=+<>'; + $expected = 'buenos días123καλημέρα!@#$%^&*早安()_ `~=+'; + $this->sanitizer($I, 'string', $expected, $value); + + $value = '{[]}'; + $expected = '{[]}'; + $this->sanitizer($I, 'string', $expected, $value); + } + + /** + * Tests the filter with an array filter (US characters) + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeStringArrayFilter(UnitTester $I) + { + $value = 'abcdefghijklmnopqrstuvwzyx1234567890!@#$%^&*()_ `~=+<>'; + $expected = 'abcdefghijklmnopqrstuvwzyx1234567890!@#$%^&*()_ `~=+'; + $this->sanitizer($I, ['string'], $expected, $value); + } + + /** + * Tests the filter with an array filter (International characters) + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeStringUTF8ArrayFilter(UnitTester $I) + { + $value = 'buenos días123καλημέρα!@#$%^&*早安()_ `~=+<>'; + $expected = 'buenos días123καλημέρα!@#$%^&*早安()_ `~=+'; + $this->sanitizer($I, ['string'], $expected, $value); + } + + /** + * Tests the filter with a string (no filtering) (US characters) + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeStringStringFilterValidString(UnitTester $I) + { + $value = 'abcdefghijklmnopqrstuvwzyx1234567890!@#$%^&*()_ `~=+'; + $expected = 'abcdefghijklmnopqrstuvwzyx1234567890!@#$%^&*()_ `~=+'; + $this->sanitizer($I, 'string', $expected, $value); + } + + /** + * Tests the filter with a string (no filtering) (International characters) + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeStringUTF8StringFilterValidString(UnitTester $I) + { + $value = 'buenos días123καλημέρα!@#$%^&*早安()_ `~=+'; + $expected = 'buenos días123καλημέρα!@#$%^&*早安()_ `~=+'; + $this->sanitizer($I, 'string', $expected, $value); + } + + /** + * Tests the filter with an array filter (no filtering) (US characters) + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeArrayFilterValidString(UnitTester $I) + { + $value = 'abcdefghijklmnopqrstuvwzyx1234567890!@#$%^&*()_ `~=+'; + $expected = 'abcdefghijklmnopqrstuvwzyx1234567890!@#$%^&*()_ `~=+'; + $this->sanitizer($I, ['string'], $expected, $value); + } + + /** + * Tests the filter with an array filter (no filtering) + * (International characters) + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeUTF8ArrayFilterValidStringNoFilter(UnitTester $I) + { + $value = 'buenos días123καλημέρα!@#$%^&*早安()_ `~=+'; + $expected = 'buenos días123καλημέρα!@#$%^&*早安()_ `~=+'; + $this->sanitizer($I, ['string'], $expected, $value); + } +} diff --git a/tests/unit/Filter/FilterStriptagsCest.php b/tests/unit/Filter/FilterStriptagsCest.php new file mode 100644 index 00000000000..67bdc02dae6 --- /dev/null +++ b/tests/unit/Filter/FilterStriptagsCest.php @@ -0,0 +1,58 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Filter; + +use Phalcon\Filter; +use Phalcon\Test\Unit\Filter\Helper\FilterBase; +use UnitTester; + +class FilterStriptagsCest extends FilterBase +{ + /** + * Tests striptags filter with html + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeStriptagsHTML(UnitTester $I) + { + $expected = 'Hello'; + $value = '

Hello

'; + $this->sanitizer($I, 'striptags', $expected, $value); + } + + /** + * Tests striptags filter with broken html + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeStriptagsBrokenHTML(UnitTester $I) + { + $expected = 'Hello'; + $value = '

Hello

'; + $this->sanitizer($I, 'striptags', $expected, $value); + } + + /** + * Tests striptags filter with single html tag + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeStriptagsSingle(UnitTester $I) + { + $expected = ''; + $value = '<'; + $this->sanitizer($I, 'striptags', $expected, $value); + } +} diff --git a/tests/unit/Filter/FilterTrimCest.php b/tests/unit/Filter/FilterTrimCest.php new file mode 100644 index 00000000000..d5453acde27 --- /dev/null +++ b/tests/unit/Filter/FilterTrimCest.php @@ -0,0 +1,58 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Filter; + +use Phalcon\Filter; +use Phalcon\Test\Unit\Filter\Helper\FilterBase; +use UnitTester; + +class FilterTrimCest extends FilterBase +{ + /** + * Tests Trim left + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeTrimLeft(UnitTester $I) + { + $expected = 'Hello'; + $value = ' Hello'; + $this->sanitizer($I, 'trim', $expected, $value); + } + + /** + * Tests Trim right + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeTrimRight(UnitTester $I) + { + $expected = 'Hello'; + $value = 'Hello '; + $this->sanitizer($I, 'trim', $expected, $value); + } + + /** + * Tests Trim both + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeTrimBoth(UnitTester $I) + { + $expected = 'Hello'; + $value = ' Hello '; + $this->sanitizer($I, 'trim', $expected, $value); + } +} diff --git a/tests/unit/Filter/FilterUpperLowerCest.php b/tests/unit/Filter/FilterUpperLowerCest.php new file mode 100644 index 00000000000..355c7d464bd --- /dev/null +++ b/tests/unit/Filter/FilterUpperLowerCest.php @@ -0,0 +1,71 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Filter; + +use Phalcon\Filter; +use Phalcon\Test\Unit\Filter\Helper\FilterBase; +use UnitTester; + +class FilterUpperLowerCest extends FilterBase +{ + /** + * Tests lower all + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeLowerAll(UnitTester $I) + { + $expected = 'hello'; + $value = 'HELLO'; + $this->sanitizer($I, 'lower', $expected, $value); + } + + /** + * Tests lower mixed + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeLowerMixed(UnitTester $I) + { + $expected = 'hello'; + $value = 'HeLlo'; + $this->sanitizer($I, 'lower', $expected, $value); + } + + /** + * Tests upper all + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeUpperAll(UnitTester $I) + { + $expected = 'HELLO'; + $value = 'hello'; + $this->sanitizer($I, 'upper', $expected, $value); + } + + /** + * Tests upper mixed + * + * @author Nikolaos Dimopoulos + * @since 2014-09-30 + */ + public function testSanitizeUpperMixed(UnitTester $I) + { + $expected = 'HELLO'; + $value = 'HeLlo'; + $this->sanitizer($I, 'upper', $expected, $value); + } +} diff --git a/tests/unit/Filter/FilterUrlCest.php b/tests/unit/Filter/FilterUrlCest.php new file mode 100644 index 00000000000..780227af301 --- /dev/null +++ b/tests/unit/Filter/FilterUrlCest.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Filter; + +use Phalcon\Filter; +use Phalcon\Test\Unit\Filter\Helper\FilterBase; +use UnitTester; + +class FilterUrlCest extends FilterBase +{ + /** + * Tests Url + * + * @author Zamrony P. Juhara + * @since 2017-03-23 + */ + public function testSanitizeUrl(UnitTester $I) + { + $expected = 'http://juhara.com'; + $value = 'http://juhara��.co�m'; + $this->sanitizer($I, 'url', $expected, $value); + } +} diff --git a/tests/unit/Filter/Helper/FilterBase.php b/tests/unit/Filter/Helper/FilterBase.php new file mode 100644 index 00000000000..bde4424ab6f --- /dev/null +++ b/tests/unit/Filter/Helper/FilterBase.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Filter\Helper; + +use Phalcon\Filter; +use UnitTester; + +class FilterBase +{ + /** + * Tests integers + * + * @author Nikos Dimopoulos + * @since 2012-11-30 + * + * @param string $filter + * @param mixed $expected + * @param mixed $value + */ + protected function sanitizer(UnitTester $I, $filter, $expected, $value) + { + $fl = new Filter(); + $actual = $fl->sanitize($value, $filter); + $I->assertEquals($expected, $actual); + } +} diff --git a/tests/unit/Filter/Helper/IPv4.php b/tests/unit/Filter/Helper/IPv4.php new file mode 100644 index 00000000000..97abb33fca5 --- /dev/null +++ b/tests/unit/Filter/Helper/IPv4.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Filter\Helper; + +class IPv4 +{ + /** + * Filters data + * + * @param $value + * + * @return mixed + */ + public function filter($value) + { + return filter_var($value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4); + } +} From f798628c8147fb1fef9bdaa310186e48c2452945 Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Mon, 5 Nov 2018 09:08:36 -0500 Subject: [PATCH 011/222] [#13578] - Moved back _ci folder --- {_toCheck/tests => tests}/_cache/.gitignore | 2 +- {_toCheck/tests => tests}/_ci/after-failure.sh | 0 {_toCheck/tests => tests}/_ci/appveyor.psm1 | 0 {_toCheck/tests => tests}/_ci/ci.ini | 0 {_toCheck/tests => tests}/_ci/environment | 0 {_toCheck/tests => tests}/_ci/install-prereqs.sh | 0 {_toCheck/tests => tests}/_ci/install-re2c.sh | 0 {_toCheck/tests => tests}/_ci/install-zephir-parser.sh | 0 {_toCheck/tests => tests}/_ci/pear-setup.sh | 0 {_toCheck/tests => tests}/_ci/phalcon.ini | 0 {_toCheck/tests => tests}/_ci/precompile-headers.sh | 0 {_toCheck/tests => tests}/_ci/setup-dbs.sh | 0 12 files changed, 1 insertion(+), 1 deletion(-) rename {_toCheck/tests => tests}/_cache/.gitignore (50%) rename {_toCheck/tests => tests}/_ci/after-failure.sh (100%) rename {_toCheck/tests => tests}/_ci/appveyor.psm1 (100%) rename {_toCheck/tests => tests}/_ci/ci.ini (100%) rename {_toCheck/tests => tests}/_ci/environment (100%) rename {_toCheck/tests => tests}/_ci/install-prereqs.sh (100%) rename {_toCheck/tests => tests}/_ci/install-re2c.sh (100%) rename {_toCheck/tests => tests}/_ci/install-zephir-parser.sh (100%) rename {_toCheck/tests => tests}/_ci/pear-setup.sh (100%) rename {_toCheck/tests => tests}/_ci/phalcon.ini (100%) rename {_toCheck/tests => tests}/_ci/precompile-headers.sh (100%) rename {_toCheck/tests => tests}/_ci/setup-dbs.sh (100%) diff --git a/_toCheck/tests/_cache/.gitignore b/tests/_cache/.gitignore similarity index 50% rename from _toCheck/tests/_cache/.gitignore rename to tests/_cache/.gitignore index c96a04f008e..cf57c3b0f25 100644 --- a/_toCheck/tests/_cache/.gitignore +++ b/tests/_cache/.gitignore @@ -1,2 +1,2 @@ -* +.gitignore !.gitignore \ No newline at end of file diff --git a/_toCheck/tests/_ci/after-failure.sh b/tests/_ci/after-failure.sh similarity index 100% rename from _toCheck/tests/_ci/after-failure.sh rename to tests/_ci/after-failure.sh diff --git a/_toCheck/tests/_ci/appveyor.psm1 b/tests/_ci/appveyor.psm1 similarity index 100% rename from _toCheck/tests/_ci/appveyor.psm1 rename to tests/_ci/appveyor.psm1 diff --git a/_toCheck/tests/_ci/ci.ini b/tests/_ci/ci.ini similarity index 100% rename from _toCheck/tests/_ci/ci.ini rename to tests/_ci/ci.ini diff --git a/_toCheck/tests/_ci/environment b/tests/_ci/environment similarity index 100% rename from _toCheck/tests/_ci/environment rename to tests/_ci/environment diff --git a/_toCheck/tests/_ci/install-prereqs.sh b/tests/_ci/install-prereqs.sh similarity index 100% rename from _toCheck/tests/_ci/install-prereqs.sh rename to tests/_ci/install-prereqs.sh diff --git a/_toCheck/tests/_ci/install-re2c.sh b/tests/_ci/install-re2c.sh similarity index 100% rename from _toCheck/tests/_ci/install-re2c.sh rename to tests/_ci/install-re2c.sh diff --git a/_toCheck/tests/_ci/install-zephir-parser.sh b/tests/_ci/install-zephir-parser.sh similarity index 100% rename from _toCheck/tests/_ci/install-zephir-parser.sh rename to tests/_ci/install-zephir-parser.sh diff --git a/_toCheck/tests/_ci/pear-setup.sh b/tests/_ci/pear-setup.sh similarity index 100% rename from _toCheck/tests/_ci/pear-setup.sh rename to tests/_ci/pear-setup.sh diff --git a/_toCheck/tests/_ci/phalcon.ini b/tests/_ci/phalcon.ini similarity index 100% rename from _toCheck/tests/_ci/phalcon.ini rename to tests/_ci/phalcon.ini diff --git a/_toCheck/tests/_ci/precompile-headers.sh b/tests/_ci/precompile-headers.sh similarity index 100% rename from _toCheck/tests/_ci/precompile-headers.sh rename to tests/_ci/precompile-headers.sh diff --git a/_toCheck/tests/_ci/setup-dbs.sh b/tests/_ci/setup-dbs.sh similarity index 100% rename from _toCheck/tests/_ci/setup-dbs.sh rename to tests/_ci/setup-dbs.sh From e7a146efce822bc1040e68bff204f9cb0a4980e7 Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Mon, 5 Nov 2018 10:20:00 -0500 Subject: [PATCH 012/222] [#13578] - Refactored Security tests --- .travis.yml | 5 +- _toCheck/tests/unit/Security/RandomTest.php | 376 -------------------- tests/unit/Filter/FilterCustomCest.php | 4 +- tests/unit/Security/RandomCest.php | 328 +++++++++++++++++ tests/unit/{ => Security}/SecurityCest.php | 2 +- 5 files changed, 334 insertions(+), 381 deletions(-) delete mode 100644 _toCheck/tests/unit/Security/RandomTest.php create mode 100644 tests/unit/Security/RandomCest.php rename tests/unit/{ => Security}/SecurityCest.php (99%) diff --git a/.travis.yml b/.travis.yml index 013078b9725..4eea978d93f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -110,8 +110,9 @@ script: - vendor/bin/phpcs - vendor/bin/codecept build # TODO: Add `cli' suite and refactor current cli-tests - - vendor/bin/codecept run -v -n tests/integration/ - - vendor/bin/codecept run -v -n tests/unit/ + # TODO: Add `integration` suite and refactor tests + # - vendor/bin/codecept run -v -n tests/unit/ + - vendor/bin/codecept run -v # TODO: Refactor legacy unit tests from the "unit-tests" directory after_failure: diff --git a/_toCheck/tests/unit/Security/RandomTest.php b/_toCheck/tests/unit/Security/RandomTest.php deleted file mode 100644 index 803df68f7b7..00000000000 --- a/_toCheck/tests/unit/Security/RandomTest.php +++ /dev/null @@ -1,376 +0,0 @@ - - * @package Phalcon\Test\Unit\Security - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class RandomTest extends UnitTest -{ - /** - * executed before each test - */ - protected function _before() - { - if (!function_exists('random_bytes') && !extension_loaded('openssl') && !extension_loaded('libsodium') && !file_exists('/dev/urandom')) { - $this->markTestSkipped( - 'Warning: libsodium and openssl extensions is not loaded, /dev/urandom file does not exists and random_bytes function does not exists' - ); - } - } - - /** - * Tests the random number generation - * - * @author Serghei Iakovlev - * @since 2015-08-17 - */ - public function testRandomNumber() - { - $this->specify( - "number does not generated correct length of number", - function () { - $lens = [ - 2, - 100, - 9, - 8777, - 123456789, - 1, - 9999999999999 - ]; - - $random = new Random(); - - foreach ($lens as $len) { - $actual = $random->number($len); - - expect($actual)->lessOrEquals($len); - expect($actual)->greaterOrEquals(0); - } - } - ); - } - - /** - * Tests the random UUID v4 generation - * - * @author Serghei Iakovlev - * @since 2015-08-17 - */ - public function testRandomUuid() - { - $this->specify( - "uuid does not created a properly formatted UUID", - function () { - $random = new Random(); - - $isValid = function ($uuid) { - return (preg_match('/^\{?[0-9a-f]{8}\-?[0-9a-f]{4}\-?[0-9a-f]{4}\-?[0-9a-f]{4}\-?[0-9a-f]{12}\}?$/i', $uuid) === 1); - }; - - for ($i = 0; $i <= 10; $i++) { - $actual = $random->uuid(); - - expect($isValid($actual))->true(); - expect(substr($actual, 14, 1))->equals(4); - expect(in_array(substr($actual, 19, 1), ['8', '9', 'a', 'b']))->true(); - } - } - ); - } - - /** - * Tests the random base58 generation - * - * @author Serghei Iakovlev - * @since 2015-08-20 - */ - public function testRandomBase58() - { - $this->specify( - "base58 does not generate a valid string", - function ($len) { - $random = new Random(); - - $isValid = function ($base58) { - $alphabet = array_merge( - range("A", "H"), - range("J", "N"), - range("P", "Z"), - range("a", "k"), - range("m", "z"), - range("1", "9") - ); - - return (preg_match('#^[^'.join('', $alphabet).']+$#i', $base58) === 0); - }; - - $actual = $random->base58($len); - - if ($len === null) { - expect(strlen($actual))->equals(16); - } else { - expect(strlen($actual))->equals($len); - } - - expect($isValid($actual))->true(); - }, - [ - 'examples' => [ - [null], - [2], - [12], - [16], - [24], - [48], - [100], - ] - ] - ); - } - - /** - * Tests the random base62 generation - * - * @issue https://github.com/phalcon/cphalcon/issues/12105 - * @author Serghei Iakovlev - * @since 2017-05-21 - */ - public function testRandomBase62() - { - $this->specify( - 'base62 does not generate a valid string', - function ($len) { - $random = new Random(); - - $isValid = function ($base62) { - return (preg_match("#^[^a-z0-9]+$#i", $base62) === 0); - }; - - $actual = $random->base62($len); - - if ($len === null) { - expect(strlen($actual))->equals(16); - } else { - expect(strlen($actual))->equals($len); - } - - expect($isValid($actual))->true(); - }, - [ - 'examples' => [ - [null], - [2], - [12], - [16], - [24], - [48], - [100], - ] - ] - ); - } - - /** - * Tests the random base64 generation - * - * @author Serghei Iakovlev - * @since 2015-08-17 - */ - public function testRandomBase64() - { - $this->specify( - "base64 does not generate a valid string", - function ($len) { - $random = new Random(); - - $isValid = function ($base64) { - return (preg_match("#[^a-z0-9+_=/-]+#i", $base64) === 0); - }; - - $actual = $random->base64($len); - - if ($len === null) { - expect($this->checkSize($actual, 16))->true(); - } else { - expect($this->checkSize($actual, $len))->true(); - } - - expect($isValid($actual))->true(); - }, - [ - 'examples' => [ - [null], - [2], - [12], - [16], - [24], - [48], - [100], - ] - ] - ); - } - - /** - * Tests the random base64 generation - * - * @author Serghei Iakovlev - * @since 2015-08-17 - */ - public function testRandomBase64Safe() - { - $this->specify( - "base64Safe does not generate a valid string", - function ($len, $padding, $pattern) { - $random = new Random(); - - $isValid = function ($base64) use ($pattern) { - return (preg_match("#[^$pattern]+#i", $base64) === 0); - }; - - $actual = $random->base64Safe($len, $padding); - expect($isValid($actual))->true(); - }, - [ - 'examples' => [ - [null, false, 'a-z0-9_-' ], - [null, true, 'a-z0-9_=-'], - [2, false, 'a-z0-9_-' ], - [2, true, 'a-z0-9_=-'], - [12, false, 'a-z0-9_-' ], - [12, true, 'a-z0-9_=-'], - [16, false, 'a-z0-9_-' ], - [16, true, 'a-z0-9_=-'], - [24, false, 'a-z0-9_-' ], - [24, true, 'a-z0-9_=-'], - [48, false, 'a-z0-9_-' ], - [48, true, 'a-z0-9_=-'], - [100, false, 'a-z0-9_-' ], - [100, true, 'a-z0-9_=-'], - ] - ] - ); - } - - /** - * Tests the random hex generation - * - * @author Serghei Iakovlev - * @since 2015-08-17 - */ - public function testRandomHex() - { - $this->specify( - "hex does not generate a valid string", - function () { - $lens = [ - 3, - 6, - 130, - 19, - 710, - 943087 - ]; - - $random = new Random(); - - $checkSize = function ($hex, $len) { - return strlen($hex) == $len * 2; - }; - - $isValid = function ($hex) { - return (preg_match("#^[^0-9a-f]+$#i", $hex) === 0); - }; - - foreach ($lens as $len) { - $actual = $random->hex($len); - - expect($checkSize($actual, $len))->true(); - expect($isValid($actual))->true(); - } - - $actual = $random->hex(); - expect($checkSize($actual, 16))->true(); - expect($isValid($actual))->true(); - } - ); - } - - /** - * Tests the random bytes string generation - * - * @author Serghei Iakovlev - * @since 2015-08-17 - */ - public function testRandomByte() - { - $this->specify( - "bytes does not generate a valid string", - function () { - $lens = [ - 3, - 6, - 19, - 222, - 100, - 9090909, - 12312312 - ]; - - $random = new Random(); - - $isValid = function ($bytes) { - return (preg_match('#^[^\x00-\xFF]+$#', $bytes) === 0); - }; - - foreach ($lens as $len) { - $actual = $random->bytes($len); - - expect(strlen($actual))->equals($len); - expect($isValid($actual))->true(); - } - - $actual = $random->bytes(); - expect(strlen($actual))->equals(16); - expect($isValid($actual))->true(); - } - ); - } - - /** - * Size formula: 4 * ($n / 3) and this need to be rounded up to a multiple of 4. - * - * @param string $string - * @param int $n - * - * @return bool - */ - protected function checkSize($string, $n) - { - if (round(4 * ($n / 3)) % 4 === 0) { - $len = round(4 * ($n / 3)); - } else { - $len = round((4 * ($n / 3) + 4 / 2) / 4) * 4; - } - - return strlen($string) == $len; - } -} diff --git a/tests/unit/Filter/FilterCustomCest.php b/tests/unit/Filter/FilterCustomCest.php index 473d9913308..dd5482066ba 100644 --- a/tests/unit/Filter/FilterCustomCest.php +++ b/tests/unit/Filter/FilterCustomCest.php @@ -12,8 +12,8 @@ namespace Phalcon\Test\Unit\Filter; use Phalcon\Filter; -use Phalcon\Test\Unit\Filter\Helper\IPv4; use Phalcon\Test\Unit\Filter\Helper\FilterBase; +use Phalcon\Test\Unit\Filter\Helper\IPv4; use UnitTester; class FilterCustomCest extends FilterBase @@ -67,7 +67,7 @@ function ($value) { } ); - $actual= $filter->sanitize('Lladlad12', 'md5'); + $actual = $filter->sanitize('Lladlad12', 'md5'); $I->assertFalse($actual); } diff --git a/tests/unit/Security/RandomCest.php b/tests/unit/Security/RandomCest.php new file mode 100644 index 00000000000..78e26125b93 --- /dev/null +++ b/tests/unit/Security/RandomCest.php @@ -0,0 +1,328 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Security; + +use Phalcon\Security\Random; +use UnitTester; + +class RandomCest +{ + /** + * executed before each test + */ + protected function _before(UnitTester $I, $scenario) + { + if (!function_exists('random_bytes') && + !extension_loaded('openssl') && + !extension_loaded('libsodium') && + !file_exists('/dev/urandom')) { + $scenario->skip( + 'Warning: libsodium and openssl extensions is not loaded or ' . + '/dev/urandom file does not exist or ' . + 'random_bytes function does not exists' + ); + } + } + + /** + * Tests the random number generation + * + * @author Serghei Iakovlev + * @since 2015-08-17 + */ + public function testRandomNumber(UnitTester $I) + { + $lens = [ + 2, + 100, + 9, + 8777, + 123456789, + 1, + 9999999999999 + ]; + + $random = new Random(); + + foreach ($lens as $len) { + $actual = $random->number($len); + $I->assertLessOrEquals($len, $actual); + $I->assertGreaterOrEquals(0, $actual); + } + } + + /** + * Tests the random UUID v4 generation + * + * @author Serghei Iakovlev + * @since 2015-08-17 + */ + public function testRandomUuid(UnitTester $I) + { + $random = new Random(); + + $isValid = function ($uuid) { + return ( + preg_match( + '/^\{?[0-9a-f]{8}\-?[0-9a-f]{4}\-?[0-9a-f]{4}\-?[0-9a-f]{4}\-?[0-9a-f]{12}\}?$/i', + $uuid + ) === 1); + }; + + for ($i = 0; $i <= 10; $i++) { + $uuid = $random->uuid(); + + $I->assertTrue($isValid($uuid)); + + $expected = 4; + $actual = substr($uuid, 14, 1); + $I->assertEquals($expected, $actual); + + $actual = in_array(substr($uuid, 19, 1), ['8', '9', 'a', 'b']); + $I->assertTrue($actual); + } + } + + /** + * Tests the random base58 generation + * + * @author Serghei Iakovlev + * @since 2015-08-20 + */ + public function testRandomBase58(UnitTester $I) + { + $examples = [null, 2, 12, 16, 24, 48, 100]; + + foreach ($examples as $len) { + $random = new Random(); + + $isValid = function ($base58) { + $alphabet = array_merge( + range("A", "H"), + range("J", "N"), + range("P", "Z"), + range("a", "k"), + range("m", "z"), + range("1", "9") + ); + + return (preg_match('#^[^'.join('', $alphabet).']+$#i', $base58) === 0); + }; + + $base58 = $random->base58($len); + + $expected = ($len === null) ? 16 : $len; + $actual = strlen($base58); + $I->assertEquals($expected, $actual); + $I->assertTrue($isValid($actual)); + } + } + + /** + * Tests the random base62 generation + * + * @issue https://github.com/phalcon/cphalcon/issues/12105 + * @author Serghei Iakovlev + * @since 2017-05-21 + */ + public function testRandomBase62(UnitTester $I) + { + $examples = [null, 2, 12, 16, 24, 48, 100]; + + foreach ($examples as $len) { + $random = new Random(); + + $isValid = function ($base62) { + return (preg_match("#^[^a-z0-9]+$#i", $base62) === 0); + }; + + $base62 = $random->base62($len); + + $expected = ($len === null) ? 16 : $len; + $actual = strlen($base62); + $I->assertEquals($expected, $actual); + $I->assertTrue($isValid($actual)); + } + } + + /** + * Tests the random base64 generation + * + * @author Serghei Iakovlev + * @since 2015-08-17 + */ + public function testRandomBase64(UnitTester $I) + { + $examples = [null, 2, 12, 16, 24, 48, 100]; + + foreach ($examples as $len) { + $random = new Random(); + + $isValid = function ($base64) { + return (preg_match("#[^a-z0-9+_=/-]+#i", $base64) === 0); + }; + + $base64 = $random->base64($len); + + $expected = ($len === null) ? 16 : $len; + $actual = strlen($base64); + $I->assertTrue($this->checkSize($base64, $expected)); + $I->assertTrue($isValid($actual)); + } + } + + /** + * Tests the random base64 generation + * + * @author Serghei Iakovlev + * @since 2015-08-17 + */ + public function testRandomBase64Safe(UnitTester $I) + { + $examples = [ + [null, false, 'a-z0-9_-' ], + [null, true, 'a-z0-9_=-'], + [2, false, 'a-z0-9_-' ], + [2, true, 'a-z0-9_=-'], + [12, false, 'a-z0-9_-' ], + [12, true, 'a-z0-9_=-'], + [16, false, 'a-z0-9_-' ], + [16, true, 'a-z0-9_=-'], + [24, false, 'a-z0-9_-' ], + [24, true, 'a-z0-9_=-'], + [48, false, 'a-z0-9_-' ], + [48, true, 'a-z0-9_=-'], + [100, false, 'a-z0-9_-' ], + [100, true, 'a-z0-9_=-'], + ]; + + foreach ($examples as $example) { + $len = $example[0]; + $padding = $example[1]; + $pattern = $example[2]; + + $random = new Random(); + + $isValid = function ($base64) use ($pattern) { + return (preg_match("#[^$pattern]+#i", $base64) === 0); + }; + + $actual = $random->base64Safe($len, $padding); + $I->assertTrue($isValid($actual)); + } + } + + /** + * Tests the random hex generation + * + * @author Serghei Iakovlev + * @since 2015-08-17 + */ + public function testRandomHex(UnitTester $I) + { + $lens = [ + 3, + 6, + 130, + 19, + 710, + 943087 + ]; + + $random = new Random(); + + $checkSize = function ($hex, $len) { + return strlen($hex) == $len * 2; + }; + + $isValid = function ($hex) { + return (preg_match("#^[^0-9a-f]+$#i", $hex) === 0); + }; + + foreach ($lens as $len) { + $hex = $random->hex($len); + + $actual = $checkSize($hex, $len); + $I->assertTrue($actual); + + $actual = $isValid($hex); + $I->assertTrue($actual); + } + + $hex = $random->hex(); + + $actual = $checkSize($hex, 16); + $I->assertTrue($actual); + + $actual = $isValid($hex); + $I->assertTrue($actual); + } + + /** + * Tests the random bytes string generation + * + * @author Serghei Iakovlev + * @since 2015-08-17 + */ + public function testRandomByte(UnitTester $I) + { + $lens = [ + 3, + 6, + 19, + 222, + 100, + 9090909, + 12312312 + ]; + + $random = new Random(); + $isValid = function ($bytes) { + return (preg_match('#^[^\x00-\xFF]+$#', $bytes) === 0); + }; + + foreach ($lens as $len) { + $bytes = $random->bytes($len); + + $expected = $len; + $actual = strlen($bytes); + $I->assertEquals($expected, $actual); + $I->assertTrue($isValid($bytes)); + } + + $bytes = $random->bytes(); + + $expected = 16; + $actual = strlen($bytes); + $I->assertEquals($expected, $actual); + $I->assertTrue($isValid($bytes)); + } + + /** + * Size formula: 4 * ($n / 3) and this need to be rounded up to a multiple of 4. + * + * @param string $string + * @param int $n + * + * @return bool + */ + protected function checkSize($string, $n) + { + if (round(4 * ($n / 3)) % 4 === 0) { + $len = round(4 * ($n / 3)); + } else { + $len = round((4 * ($n / 3) + 4 / 2) / 4) * 4; + } + + return strlen($string) == $len; + } +} diff --git a/tests/unit/SecurityCest.php b/tests/unit/Security/SecurityCest.php similarity index 99% rename from tests/unit/SecurityCest.php rename to tests/unit/Security/SecurityCest.php index a2c45d860a9..006b696eb60 100644 --- a/tests/unit/SecurityCest.php +++ b/tests/unit/Security/SecurityCest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Phalcon\Test\Unit; +namespace Phalcon\Test\Unit\Security; use Phalcon\Di; use Phalcon\Http\Request; From c46d939fadb2ae3b63f88c9bd3d4e0ab1ebc3a19 Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Mon, 5 Nov 2018 10:37:14 -0500 Subject: [PATCH 013/222] [#13578] - PHPCS fixes --- .travis.yml | 2 +- phpcs.xml | 1 - tests/_bootstrap.php | 2 +- tests/unit/Debug/Helper/ClassProperties.php | 4 ++-- tests/unit/_bootstrap.php | 1 - 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4eea978d93f..05ec48a297c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -96,7 +96,7 @@ before_script: - '[[ "${PHP_VERNUM}" -lt 70300 ]] || export USE_ZEND_ALLOC=1' script: - # To avoud this: + # To avoid this: # sh: 1: /home/travis/build/phalcon/cphalcon/libtool: not found - ln -s ${TRAVIS_BUILD_DIR}/ext/libtool ${TRAVIS_BUILD_DIR}/libtool # Syntax recognize tests diff --git a/phpcs.xml b/phpcs.xml index cb4875f3572..c10c8a2dde8 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -8,7 +8,6 @@ - tests/integration tests/unit tests/_support/Helper diff --git a/tests/_bootstrap.php b/tests/_bootstrap.php index 475d358d947..33e44f60bcd 100644 --- a/tests/_bootstrap.php +++ b/tests/_bootstrap.php @@ -94,4 +94,4 @@ // $value = getenv($key) ?: $defaultValue; // // define($key, $value); -//} +//} \ No newline at end of file diff --git a/tests/unit/Debug/Helper/ClassProperties.php b/tests/unit/Debug/Helper/ClassProperties.php index 701dfa42c43..9c7d61c8b2b 100644 --- a/tests/unit/Debug/Helper/ClassProperties.php +++ b/tests/unit/Debug/Helper/ClassProperties.php @@ -4,7 +4,7 @@ class ClassProperties { - public $foo = 1; + public $foo = 1; protected $bar = 2; - private $baz = 3; + private $baz = 3; } diff --git a/tests/unit/_bootstrap.php b/tests/unit/_bootstrap.php index 16c7df27018..aedc64299ff 100644 --- a/tests/unit/_bootstrap.php +++ b/tests/unit/_bootstrap.php @@ -8,4 +8,3 @@ * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ - From d21e743aebfdbaeb497cf2c101e48477dc9d95f7 Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Mon, 5 Nov 2018 17:44:41 -0500 Subject: [PATCH 014/222] [#13578] - Refactored validation messages --- .travis.yml | 2 +- .../unit/Validation/Validator/AlnumTest.php | 75 ---- .../unit/Validation/Validator/AlphaTest.php | 187 ---------- .../unit/Validation/Validator/BetweenTest.php | 161 -------- .../Validation/Validator/ConfirmationTest.php | 211 ----------- .../Validation/Validator/CreditCardTest.php | 180 --------- .../unit/Validation/Validator/DateTest.php | 163 --------- .../unit/Validation/Validator/DigitTest.php | 114 ------ .../unit/Validation/Validator/EmailTest.php | 144 -------- .../Validation/Validator/ExclusionInTest.php | 191 ---------- .../Validation/Validator/IdenticalTest.php | 186 ---------- .../Validation/Validator/InclusionInTest.php | 191 ---------- .../Validation/Validator/NumericalityTest.php | 134 ------- .../Validation/Validator/PresenceOfTest.php | 207 ----------- .../unit/Validation/Validator/RegexTest.php | 184 ---------- .../Validation/Validator/StringLengthTest.php | 271 -------------- ...{UniquenessTest.php => UniquenessCest.php} | 0 .../unit/Validation/Validator/UrlTest.php | 142 -------- boxfile.yml | 24 +- tests/unit/Validation/Validator/AlnumCest.php | 97 +++++ tests/unit/Validation/Validator/AlphaCest.php | 209 +++++++++++ .../unit/Validation/Validator/BetweenCest.php | 179 +++++++++ .../Validation/Validator/CallbackCest.php | 177 +++++---- .../Validation/Validator/ConfirmationCest.php | 263 ++++++++++++++ .../Validation/Validator/CreditCardCest.php | 182 ++++++++++ tests/unit/Validation/Validator/DateCest.php | 173 +++++++++ tests/unit/Validation/Validator/DigitCest.php | 118 ++++++ tests/unit/Validation/Validator/EmailCest.php | 152 ++++++++ .../Validation/Validator/ExclusionInCest.php | 228 ++++++++++++ .../Validation/Validator/IdenticalCest.php | 225 ++++++++++++ .../Validation/Validator/InclusionInCest.php | 229 ++++++++++++ .../Validation/Validator/NumericalityCest.php | 165 +++++++++ .../Validation/Validator/PresenceOfCest.php | 235 ++++++++++++ tests/unit/Validation/Validator/RegexCest.php | 220 +++++++++++ .../Validation/Validator/StringLengthCest.php | 343 ++++++++++++++++++ tests/unit/Validation/Validator/UrlCest.php | 155 ++++++++ 36 files changed, 3299 insertions(+), 2818 deletions(-) delete mode 100644 _toCheck/tests/unit/Validation/Validator/AlnumTest.php delete mode 100644 _toCheck/tests/unit/Validation/Validator/AlphaTest.php delete mode 100644 _toCheck/tests/unit/Validation/Validator/BetweenTest.php delete mode 100644 _toCheck/tests/unit/Validation/Validator/ConfirmationTest.php delete mode 100644 _toCheck/tests/unit/Validation/Validator/CreditCardTest.php delete mode 100644 _toCheck/tests/unit/Validation/Validator/DateTest.php delete mode 100644 _toCheck/tests/unit/Validation/Validator/DigitTest.php delete mode 100644 _toCheck/tests/unit/Validation/Validator/EmailTest.php delete mode 100644 _toCheck/tests/unit/Validation/Validator/ExclusionInTest.php delete mode 100644 _toCheck/tests/unit/Validation/Validator/IdenticalTest.php delete mode 100644 _toCheck/tests/unit/Validation/Validator/InclusionInTest.php delete mode 100644 _toCheck/tests/unit/Validation/Validator/NumericalityTest.php delete mode 100644 _toCheck/tests/unit/Validation/Validator/PresenceOfTest.php delete mode 100644 _toCheck/tests/unit/Validation/Validator/RegexTest.php delete mode 100644 _toCheck/tests/unit/Validation/Validator/StringLengthTest.php rename _toCheck/tests/unit/Validation/Validator/{UniquenessTest.php => UniquenessCest.php} (100%) delete mode 100644 _toCheck/tests/unit/Validation/Validator/UrlTest.php create mode 100644 tests/unit/Validation/Validator/AlnumCest.php create mode 100644 tests/unit/Validation/Validator/AlphaCest.php create mode 100644 tests/unit/Validation/Validator/BetweenCest.php rename _toCheck/tests/unit/Validation/Validator/CallbackTest.php => tests/unit/Validation/Validator/CallbackCest.php (70%) create mode 100644 tests/unit/Validation/Validator/ConfirmationCest.php create mode 100644 tests/unit/Validation/Validator/CreditCardCest.php create mode 100644 tests/unit/Validation/Validator/DateCest.php create mode 100644 tests/unit/Validation/Validator/DigitCest.php create mode 100644 tests/unit/Validation/Validator/EmailCest.php create mode 100644 tests/unit/Validation/Validator/ExclusionInCest.php create mode 100644 tests/unit/Validation/Validator/IdenticalCest.php create mode 100644 tests/unit/Validation/Validator/InclusionInCest.php create mode 100644 tests/unit/Validation/Validator/NumericalityCest.php create mode 100644 tests/unit/Validation/Validator/PresenceOfCest.php create mode 100644 tests/unit/Validation/Validator/RegexCest.php create mode 100644 tests/unit/Validation/Validator/StringLengthCest.php create mode 100644 tests/unit/Validation/Validator/UrlCest.php diff --git a/.travis.yml b/.travis.yml index 05ec48a297c..05153ee6b23 100644 --- a/.travis.yml +++ b/.travis.yml @@ -111,7 +111,7 @@ script: - vendor/bin/codecept build # TODO: Add `cli' suite and refactor current cli-tests # TODO: Add `integration` suite and refactor tests - # - vendor/bin/codecept run -v -n tests/unit/ + # - vendor/bin/codecept run -v -n tests/integration/ - vendor/bin/codecept run -v # TODO: Refactor legacy unit tests from the "unit-tests" directory diff --git a/_toCheck/tests/unit/Validation/Validator/AlnumTest.php b/_toCheck/tests/unit/Validation/Validator/AlnumTest.php deleted file mode 100644 index 85b0077c9fb..00000000000 --- a/_toCheck/tests/unit/Validation/Validator/AlnumTest.php +++ /dev/null @@ -1,75 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @author Wojciech Ślawski - * @package Phalcon\Test\Unit\Validation\Validator - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class AlnumTest extends UnitTest -{ - /** - * Tests alnum validator with single field - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testSingleField() - { - $this->specify('Test alnum validator with single field.', function () { - $validation = new Validation(); - $validation->add('name', new Alnum()); - $messages = $validation->validate(['name' => 'SomeValue123']); - expect($messages->count())->equals(0); - $messages = $validation->validate(['name' => 'SomeValue123!@#']); - expect($messages->count())->equals(1); - }); - } - - /** - * Tests alnum validator with multiple field - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testMultipleField() - { - $this->specify('Test alnum validator with multiple field.', function () { - $validation = new Validation(); - $validationMessages = [ - 'name' => 'Name must be alnum', - 'type' => 'Type must be alnum', - ]; - $validation->add(['name', 'type'], new Alnum([ - 'message' => $validationMessages, - ])); - $messages = $validation->validate(['name' => 'SomeValue123', 'type' => 'SomeValue123']); - expect($messages->count())->equals(0); - $messages = $validation->validate(['name' => 'SomeValue123!@#', 'type' => 'SomeValue123']); - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['name']); - $messages = $validation->validate(['name' => 'SomeValue123!@#', 'type' => 'SomeValue123!@#']); - expect($messages->count())->equals(2); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['name']); - expect($messages->offsetGet(1)->getMessage())->equals($validationMessages['type']); - }); - } -} diff --git a/_toCheck/tests/unit/Validation/Validator/AlphaTest.php b/_toCheck/tests/unit/Validation/Validator/AlphaTest.php deleted file mode 100644 index dec35debabb..00000000000 --- a/_toCheck/tests/unit/Validation/Validator/AlphaTest.php +++ /dev/null @@ -1,187 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @author Wojciech Ślawski - * @package Phalcon\Test\Unit\Validation\Validator - * @group validation - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class AlphaTest extends UnitTest -{ - /** - * Tests alpha validator with single field - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testSingleField() - { - $validation = new Validation(); - $validation->add('name', new Alpha()); - $messages = $validation->validate(['name' => 'Asd']); - expect($messages->count())->equals(0); - $messages = $validation->validate(['name' => 'Asd123']); - expect($messages->count())->equals(1); - } - - /** - * Tests alpha validator with multiple field - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testMultipleField() - { - $validation = new Validation(); - $validationMessages = [ - 'name' => 'Name must be alpha.', - 'type' => 'Type must by alpha.', - ]; - $validation->add(['name', 'type'], new Alpha([ - 'message' => $validationMessages, - ])); - - $messages = $validation->validate(['name' => 'Asd', 'type' => 'Asd']); - expect($messages->count())->equals(0); - $messages = $validation->validate(['name' => 'Asd123', 'type' => 'Asd']); - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['name']); - $messages = $validation->validate(['name' => 'Asd123', 'type' => 'Asd123']); - expect($messages->count())->equals(2); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['name']); - expect($messages->offsetGet(1)->getMessage())->equals($validationMessages['type']); - } - - /** - * Tests Non Alphabetic Characters - * - * @author Serghei Iakovlev - * @since 2016-06-10 - */ - public function testShouldDetectNonAlphabeticCharacters() - { - $this->specify( - "The Alpha Validator does not detect non alphabetic characters", - function ($input) { - $validation = new Validation; - $validation->add('name', new Alpha([ - 'message' => ':field must contain only letters' - ])); - - $messages = $validation->validate(['name' => $input]); - - $expectedMessages = Messages::__set_state([ - '_messages' => [ - Message::__set_state([ - '_type' => 'Alpha', - '_message' => 'name must contain only letters', - '_field' => 'name', - '_code' => '0', - ]) - ], - ]); - - expect($messages)->equals($expectedMessages); - }, - [ - 'examples' => [ - ['1'], - [123], - ['a-b-c-d'], - ['a-1-c-2'], - ['a1c2'], - ['o0o0o0o0'], - ] - ] - ); - } - - /** - * Tests Alphabetic Characters - * - * @author Serghei Iakovlev - * @since 2016-06-10 - */ - public function testShouldValidateAlphabeticCharacters() - { - $this->specify( - "The Alpha Validator does not validate alphabetic characters", - function ($input) { - $validation = new Validation; - $validation->add('name', new Alpha([ - 'message' => ':field must contain only letters' - ])); - - $messages = $validation->validate(['name' => $input]); - - expect($messages)->count(0); - }, - [ - 'examples' => [ - ['a'], - ['asdavafaiwnoabwiubafpowf'], - ['QWERTYUIOPASDFGHJKL'], - ['aSdFgHjKl'], - [null], - ] - ] - ); - } - - /** - * Tests Non Latin Characters - * - * @author Serghei Iakovlev - * @since 2016-06-10 - */ - public function testShouldValidateNonLatinCharacters() - { - $this->specify( - "The Alpha Validator does not validate alphabetic characters", - function ($input) { - $validation = new Validation; - $validation->add('name', new Alpha([ - 'message' => ':field must contain only letters' - ])); - - $messages = $validation->validate(['name' => $input]); - - expect($messages)->count(0); - }, - [ - 'examples' => [ - ['йцукенг'], - ['ждлорпа'], - ['Señor'], - ['cocoñùт'], - ['COCOÑÙТ'], - ['JÄGER'], - ['šš'], - ['あいうえお'], - ['零一二三四五'], - ] - ] - ); - } -} diff --git a/_toCheck/tests/unit/Validation/Validator/BetweenTest.php b/_toCheck/tests/unit/Validation/Validator/BetweenTest.php deleted file mode 100644 index 1ebba4c83e7..00000000000 --- a/_toCheck/tests/unit/Validation/Validator/BetweenTest.php +++ /dev/null @@ -1,161 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @author Wojciech Ślawski - * @package Phalcon\Test\Unit\Validation\Validator - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class BetweenTest extends UnitTest -{ - /** - * Tests between validator with single field - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testSingleField() - { - $this->specify('Test between validator with single field.', function () { - $validation = new Validation(); - - $validation->add( - 'price', - new Between( - [ - 'minimum' => 1, - 'maximum' => 3 - ] - ) - ); - - $messages = $validation->validate(['price' => 5]); - - $expectedMessages = Messages::__set_state( - [ - '_messages' => [ - 0 => Message::__set_state( - [ - '_type' => 'Between', - '_message' => 'Field price must be within the range of 1 to 3', - '_field' => 'price', - '_code' => '0', - ] - ) - ] - ] - ); - - expect($expectedMessages)->equals($messages); - - $messages = $validation->validate([]); - expect($expectedMessages)->equals($messages); - - $messages = $validation->validate(['price' => 2]); - expect($messages)->count(0); - }); - } - - /** - * Tests between validator with multiple field - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testMultipleField() - { - $this->specify('Test between validator with multiple field.', function () { - $validation = new Validation(); - $validationMessages = [ - 'amount' => 'Amount must be between 0 and 999.', - 'price' => 'Price must be between 0 and 999.', - ]; - $validation->add(['amount', 'price'], new Between([ - 'minimum' => [ - 'amount' => 0, - 'price' => 0, - ], - 'maximum' => [ - 'amount' => 999, - 'price' => 999, - ], - 'message' => $validationMessages, - ])); - $messages = $validation->validate(['amount' => 100]); - expect($messages->count())->equals(0); - $messages = $validation->validate(['amount' => 1000, 'price' => 100]); - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['amount']); - $messages = $validation->validate(['amount' => 1000, 'price' => 1000]); - expect($messages->count())->equals(2); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['amount']); - expect($messages->offsetGet(1)->getMessage())->equals($validationMessages['price']); - }); - } - - public function testCustomMessage() - { - $this->specify( - 'Test Between validator works with a custom message.', - function () { - $validation = new Validation(); - - $validation->add( - 'price', - new Between( - [ - 'minimum' => 1, - 'maximum' => 3, - 'message' => 'The price must be between 1 and 3' - ] - ) - ); - - $messages = $validation->validate(['price' => 5]); - - $expectedMessages = Messages::__set_state( - [ - '_messages' => [ - 0 => Message::__set_state( - [ - '_type' => 'Between', - '_message' => 'The price must be between 1 and 3', - '_field' => 'price', - '_code' => '0', - ] - ) - ] - ] - ); - - $this->assertEquals($expectedMessages, $messages); - - $messages = $validation->validate([]); - expect($expectedMessages)->equals($messages); - - $messages = $validation->validate(['price' => 2]); - expect($messages)->count(0); - } - ); - } -} diff --git a/_toCheck/tests/unit/Validation/Validator/ConfirmationTest.php b/_toCheck/tests/unit/Validation/Validator/ConfirmationTest.php deleted file mode 100644 index c798e6198b4..00000000000 --- a/_toCheck/tests/unit/Validation/Validator/ConfirmationTest.php +++ /dev/null @@ -1,211 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @author Wojciech Ślawski - * @package Phalcon\Test\Unit\Validation\Validator - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class ConfirmationTest extends UnitTest -{ - /** - * Tests confirmation validator with single field - * - * @test - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function shouldValidateSingleField() - { - $this->specify('Test confirmation validator with single field.', function () { - $validation = new Validation(); - $validation->add('name', new Confirmation([ - 'with' => 'nameWith', - ])); - - $messages = $validation->validate( - [ - 'name' => 'SomeValue', - 'nameWith' => 'SomeValue', - ] - ); - - expect($messages->count())->equals(0); - - $messages = $validation->validate( - [ - 'name' => 'SomeValue', - 'nameWith' => 'SomeValue123', - ] - ); - - expect($messages->count())->equals(1); - }); - } - - /** - * Tests confirmation validator with multiple field - * - * @test - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function shouldValidateMultipleField() - { - $this->specify('Test confirmation validator with multiple field.', function () { - $validation = new Validation(); - $validationMessages = [ - 'name' => 'Name must be same as nameWith.', - 'type' => 'Type must be same as typeWith.', - ]; - $validation->add(['name', 'type'], new Confirmation([ - 'with' => [ - 'name' => 'nameWith', - 'type' => 'typeWith', - ], - 'message' => $validationMessages, - ])); - - $messages = $validation->validate( - [ - 'name' => 'SomeValue', - 'nameWith' => 'SomeValue', - 'type' => 'SomeValue', - 'typeWith' => 'SomeValue', - ] - ); - - expect($messages->count())->equals(0); - - $messages = $validation->validate( - [ - 'name' => 'SomeValue', - 'nameWith' => 'SomeValue123', - 'type' => 'SomeValue', - 'typeWith' => 'SomeValue', - ] - ); - - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['name']); - - $messages = $validation->validate( - [ - 'name' => 'SomeValue', - 'nameWith' => 'SomeValue123', - 'type' => 'SomeValue', - 'typeWith' => 'SomeValue123', - ] - ); - - expect($messages->count())->equals(2); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['name']); - expect($messages->offsetGet(1)->getMessage())->equals($validationMessages['type']); - }); - } - - /** - * Tests allowing empty value - * - * @test - * @author Stanislav Kiryukhin - * @since 2015-09-06 - */ - public function shouldAllowEmptyValues() - { - $this->specify( - 'The Confirmation validator should allow empty value', - function () { - $expected = Messages::__set_state([ - '_messages' => [ - Message::__set_state([ - '_type' => 'Confirmation', - '_message' => 'Field password must be the same as password2', - '_field' => 'password', - '_code' => '0', - ]), - ] - ]); - - $validation = new Validation(); - $validation->add('password', new Confirmation([ - 'allowEmpty' => true, - 'with' => 'password2' - ])); - - $actual = $validation->validate([ - 'password' => 'test123', - 'password2' => 'test123' - ]); - - expect($actual)->count(0); - - $actual = $validation->validate([ - 'password' => null, - 'password2' => 'test123' - ]); - - expect($actual)->count(0); - - $validation = new Validation(); - $validation->add('password', new Confirmation([ - 'allowEmpty' => false, - 'with' => 'password2' - ])); - - $actual = $validation->validate([ - 'password' => 'test123', - 'password2' => 'test123' - ]); - - expect($actual)->count(0); - - $actual = $validation->validate([ - 'password' => null, - 'password2' => 'test123' - ]); - - expect($actual)->count(1); - expect($actual)->equals($expected); - - $validation = new Validation(); - $validation->add('password', new Confirmation(['with' => 'password2'])); - - $actual = $validation->validate([ - 'password' => 'test123', - 'password2' => 'test123' - ]); - - expect($actual)->count(0); - - $actual = $validation->validate([ - 'password' => null, - 'password2' => 'test123' - ]); - - expect($actual)->count(1); - expect($actual)->equals($expected); - } - ); - } -} diff --git a/_toCheck/tests/unit/Validation/Validator/CreditCardTest.php b/_toCheck/tests/unit/Validation/Validator/CreditCardTest.php deleted file mode 100644 index 7ec3dd181da..00000000000 --- a/_toCheck/tests/unit/Validation/Validator/CreditCardTest.php +++ /dev/null @@ -1,180 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @author Wojciech Ślawski - * @package Phalcon\Test\Unit\Validation\Validator - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class CreditCardTest extends UnitTest -{ - /** - * Tests credit card validator with single field - * - * @test - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function shouldValidateSingleField() - { - $this->specify('Test credit card validator with single field.', function () { - $validation = new Validation(); - $validation->add('creditCard', new CreditCard()); - - expect($validation->validate(['creditCard' => 4601587377626131]))->count(0); - expect($validation->validate(['creditCard' => 46015873776261312]))->count(1); - }); - } - - /** - * Tests credit card validator with multiple field - * - * @test - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function shouldValidateMultipleFields() - { - $this->specify('Test credit card validator with multiple field.', function () { - $validation = new Validation(); - - $validationMessages = [ - 'creditCard' => 'CreditCard must be correct credit card value.', - 'anotherCreditCard' => 'AnotherCreditCard must be correct credit card value.', - ]; - - $validation->add(['creditCard', 'anotherCreditCard'], new CreditCard([ - 'message' => $validationMessages, - ])); - - $messages = $validation->validate( - [ - 'creditCard' => 4601587377626131, - 'anotherCreditCard' => 4601587377626131, - ] - ); - - expect($messages->count())->equals(0); - - $messages = $validation->validate( - [ - 'creditCard' => 46015873776261312, - 'anotherCreditCard' => 4601587377626131, - ] - ); - - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['creditCard']); - - - - $messages = $validation->validate( - [ - 'creditCard' => 46015873776261312, - 'anotherCreditCard' => 46015873776261312, - ] - ); - - expect($messages->count())->equals(2); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['creditCard']); - expect($messages->offsetGet(1)->getMessage())->equals($validationMessages['anotherCreditCard']); - }); - } - - /** - * Tests detect valid card numbers - * - * @test - * @author Caio Almeida - * @since 2015-09-06 - */ - public function shouldDetectValidCreditCard() - { - $this->specify( - "The CreditCard validator can't detect valid card number correctly.", - function ($number) { - $validation = new Validation(); - $validation->add('creditCard', new CreditCard()); - - expect($validation->validate(['creditCard' => $number]))->count(0); - }, - ['examples' => $this->validCardNumberProvider()] - ); - } - - /** - * Tests detect invalid card numbers - * - * @test - * @author Caio Almeida - * @since 2015-09-06 - */ - public function shouldDetectInvalidCreditCard() - { - $this->specify( - "The CreditCard validator can't detect invalid card number correctly.", - function ($number) { - $validation = new Validation(); - $validation->add('creditCard', new CreditCard()); - - $expected = Messages::__set_state([ - '_messages' => [ - Message::__set_state([ - '_type' => 'CreditCard', - '_message' => 'Field creditCard is not valid for a credit card number', - '_field' => 'creditCard', - '_code' => '0', - ]) - ] - ]); - - $actual = $validation->validate(['creditCard' => $number]); - - expect($actual)->equals($expected); - }, - ['examples' => $this->invalidCardNumberProvider()] - ); - } - - protected function validCardNumberProvider() - { - return [ - 'amex' => ['378282246310005' ], - 'visa' => ['4012888888881881'], - 'dinners' => ['38520000023237' ], - 'mastercard' => ['5105105105105100'], - 'discover' => ['6011000990139424'], - ]; - } - - protected function invalidCardNumberProvider() - { - return [ - ['1203191201121221'], - ['102030102320' ], - ['120120s201023' ], - ['20323200003230' ], - ['12010012' ], - ]; - } -} diff --git a/_toCheck/tests/unit/Validation/Validator/DateTest.php b/_toCheck/tests/unit/Validation/Validator/DateTest.php deleted file mode 100644 index ec2c39625e3..00000000000 --- a/_toCheck/tests/unit/Validation/Validator/DateTest.php +++ /dev/null @@ -1,163 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @author Wojciech Ślawski - * @package Phalcon\Test\Unit\Validation\Validator - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class DateTest extends UnitTest -{ - /** - * Tests date validator with single field - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testSingleField() - { - $this->specify('Test date validator with single field.', function () { - $validation = new Validation(); - $validation->add('date', new Date()); - - expect($validation->validate(['date' => '2016-06-05']))->count(0); - expect($validation->validate(['date' => '2016-06-32']))->count(1); - }); - } - - /** - * Tests date validator with multiple field - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testMultipleField() - { - $this->specify('Test date validator with multiple field.', function () { - $validation = new Validation(); - $validationMessages = [ - 'date' =>'Date must be correct date format Y-m-d.', - 'anotherDate'=>'AnotherDate must be correct date format d-m-Y.' - ]; - - $validation->add(['date', 'anotherDate'], new Date([ - 'format'=>[ - 'date'=>'Y-m-d', - 'anotherDate'=>'d-m-Y' - ], - 'message'=>$validationMessages - ])); - - - expect($validation->validate(['date' => '2016-06-05', 'anotherDate' => '05-06-2017']))->count(0); - - $messages = $validation->validate(['date' => '2016-06-32', 'anotherDate' => '05-06-2017']); - expect($messages)->count(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['date']); - - $messages = $validation->validate(['date' => '2016-06-32', 'anotherDate' => '32-06-2017']); - expect($messages)->count(2); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['date']); - expect($messages->offsetGet(1)->getMessage())->equals($validationMessages['anotherDate']); - }); - } - - /** - * Tests detect valid dates - * - * @test - * @author Gustavo Verzola - * @since 2015-03-09 - */ - public function shouldDetectValidDates() - { - $this->specify( - "The Date validator can't detect valid dates correctly.", - function ($date, $format) { - $validation = new Validation(); - $validation->add('date', new Date(['format' => $format])); - - expect($validation->validate(['date' => $date]))->count(0); - }, - ['examples' => $this->validDatesProvider()] - ); - } - - /** - * Tests detect invalid dates - * - * @test - * @author Gustavo Verzola - * @since 2015-03-09 - */ - public function shouldDetectInvalidDates() - { - $this->specify( - "The Date validator can't detect invalid dates correctly.", - function ($date, $format) { - $validation = new Validation(); - $validation->add('date', new Date(['format' => $format])); - - $expected = Messages::__set_state([ - '_messages' => [ - Message::__set_state([ - '_type' => 'Date', - '_message' => 'Field date is not a valid date', - '_field' => 'date', - '_code' => '0', - ]) - ] - ]); - - $actual = $validation->validate(['date' => $date]); - - expect($actual)->equals($expected); - }, - ['examples' => $this->invalidDatesProvider()] - ); - } - - protected function invalidDatesProvider() - { - return [ - ['', 'Y-m-d'], - [false, 'Y-m-d'], - [null, 'Y-m-d'], - [new \stdClass, 'Y-m-d'], - ['2015-13-01', 'Y-m-d'], - ['2015-01-32', 'Y-m-d'], - ['2015-01', 'Y-m-d'], - ['2015-01-01', 'd-m-Y'], - ]; - } - - protected function validDatesProvider() - { - return [ - ['2012-01-01', 'Y-m-d'], - ['2013-31-12', 'Y-d-m'], - ['01/01/2014', 'd/m/Y'], - ['12@12@2015', 'd@m@Y'], - ]; - } -} diff --git a/_toCheck/tests/unit/Validation/Validator/DigitTest.php b/_toCheck/tests/unit/Validation/Validator/DigitTest.php deleted file mode 100644 index 20f8a721413..00000000000 --- a/_toCheck/tests/unit/Validation/Validator/DigitTest.php +++ /dev/null @@ -1,114 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @author Wojciech Ślawski - * @package Phalcon\Test\Unit\Validation\Validator - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class DigitTest extends UnitTest -{ - /** - * Tests digit validator with single field - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testSingleField() - { - $this->specify( - 'The Digit Validator does not validate correctly', - function () { - $validation = new Validation(); - $validation->add('amount', new Digit()); - - $messages = $validation->validate(['amount' => '123']); - expect($messages->count())->equals(0); - - $messages = $validation->validate(['amount' => '123abc']); - expect($messages->count())->equals(1); - } - ); - } - - /** - * Tests digit validator with multiple field - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testMultipleField() - { - $this->specify( - 'The Digit Validator does not validate multiple field', - function () { - $validation = new Validation(); - $validationMessages = [ - 'amount' => 'Amount must be digit.', - 'price' => 'Price must be digit.', - ]; - $validation->add(['amount', 'price'], new Digit([ - 'message' => $validationMessages, - ])); - - $messages = $validation->validate(['amount' => '123', 'price' => '123']); - expect($messages->count())->equals(0); - - $messages = $validation->validate(['amount' => '123abc', 'price' => '123']); - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['amount']); - - $messages = $validation->validate(['amount' => '123abc', 'price' => '123abc']); - expect($messages->count())->equals(2); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['amount']); - expect($messages->offsetGet(1)->getMessage())->equals($validationMessages['price']); - } - ); - } - - public function testShouldValidateIntOrStringOfDigits() - { - $this->specify( - 'The Digit Validator does not validate digits correctly', - function ($digit) { - $validation = new Validation(); - $validation->add('amount', new Digit()); - - $messages = $validation->validate(['amount' => $digit]); - - expect($messages)->count(0); - }, - [ - 'examples' => [ - ['123'], - [123], - [PHP_INT_MAX], - [0xFFFFFF], - [100000], - [-100000], - [0], - ["0"], - ["00001233422003400"], - ] - ] - ); - } -} diff --git a/_toCheck/tests/unit/Validation/Validator/EmailTest.php b/_toCheck/tests/unit/Validation/Validator/EmailTest.php deleted file mode 100644 index 16cdb7e4f55..00000000000 --- a/_toCheck/tests/unit/Validation/Validator/EmailTest.php +++ /dev/null @@ -1,144 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @author Wojciech Ślawski - * @package Phalcon\Test\Unit\Validation\Validator - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class EmailTest extends UnitTest -{ - /** - * Tests email validator with single field - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testSingleField() - { - $this->specify( - 'Test email validator with single field.', - function () { - $validation = new Validation(); - - $validation->add('email', new Email()); - - $messages = $validation->validate(['email' => 'test@somemail.com']); - expect($messages->count())->equals(0); - - $messages = $validation->validate(['email' => 'rootlocalhost']); - expect($messages->count())->equals(1); - - $expectedMessages = Messages::__set_state( - [ - '_messages' => [ - 0 => Message::__set_state( - [ - '_type' => 'Email', - '_message' => 'Field email must be an email address', - '_field' => 'email', - '_code' => 0, - ] - ) - ] - ] - ); - - expect($expectedMessages)->equals($messages); - } - ); - } - - /** - * Tests email validator with multiple field - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testMultipleField() - { - $this->specify('Test email validator with multiple field.', function () { - $validation = new Validation(); - $validationMessages = [ - 'email' => 'Email must be correct email.', - 'anotherEmail' => 'AnotherEmail must be correct email.', - ]; - $validation->add(['email', 'anotherEmail'], new Email([ - 'message' => $validationMessages, - ])); - $messages = $validation->validate(['email' => 'test@somemail.com', 'anotherEmail' => 'test@somemail.com']); - expect($messages->count())->equals(0); - $messages = $validation->validate(['email' => 'rootlocalhost', 'anotherEmail' => 'test@somemail.com']); - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['email']); - $messages = $validation->validate(['email' => 'rootlocalhost', 'anotherEmail' => 'rootlocalhost']); - expect($messages->count())->equals(2); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['email']); - expect($messages->offsetGet(1)->getMessage())->equals($validationMessages['anotherEmail']); - }); - } - - public function testCustomMessage() - { - $this->specify( - 'Test Email validator works with a custom message.', - function () { - $validation = new Validation(); - - $validation->add( - 'email', - new Email( - [ - 'message' => 'The email is not valid' - ] - ) - ); - - $messages = $validation->validate([]); - - $expectedMessages = Messages::__set_state( - [ - '_messages' => [ - 0 => Message::__set_state( - [ - '_type' => 'Email', - '_message' => 'The email is not valid', - '_field' => 'email', - '_code' => '0', - ] - ) - ] - ] - ); - - $this->assertEquals($expectedMessages, $messages); - - $messages = $validation->validate(['email' => 'x=1']); - expect($expectedMessages)->equals($messages); - - $messages = $validation->validate(['email' => 'x.x@hotmail.com']); - expect($messages)->count(0); - } - ); - } -} diff --git a/_toCheck/tests/unit/Validation/Validator/ExclusionInTest.php b/_toCheck/tests/unit/Validation/Validator/ExclusionInTest.php deleted file mode 100644 index 1e981b41c7b..00000000000 --- a/_toCheck/tests/unit/Validation/Validator/ExclusionInTest.php +++ /dev/null @@ -1,191 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @author Wojciech Ślawski - * @package Phalcon\Test\Unit\Validation\Validator - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class ExclusionInTest extends UnitTest -{ - /** - * Tests exclusion in validator with single field - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testSingleField() - { - $this->specify( - 'Test exclusion in validator with single field.', - function () { - $validation = new Validation(); - - $validation->add( - 'status', - new ExclusionIn( - [ - 'domain' => ['A', 'I'] - ] - ) - ); - - $messages = $validation->validate(['status' => 'A']); - - $expectedMessages = Messages::__set_state( - [ - '_messages' => [ - 0 => Message::__set_state( - [ - '_type' => 'ExclusionIn', - '_message' => 'Field status must not be a part of list: A, I', - '_field' => 'status', - '_code' => 0, - ] - ) - ] - ] - ); - - expect($expectedMessages)->equals($messages); - - $messages = $validation->validate(['status' => 'A']); - expect($expectedMessages)->equals($messages); - - $messages = $validation->validate(['status' => 'X']); - expect($messages)->count(0); - } - ); - } - - /** - * Tests exclusion in validator with multiple field and single domain - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testMultipleFieldSingleDomain() - { - $this->specify('Test exclusion in validator with multiple field and single domain.', function () { - $validation = new Validation(); - $validationMessages = [ - 'type' => 'Type cant be mechanic or cyborg.', - 'anotherType' => 'AnotherType cant by mechanic or cyborg.', - ]; - $validation->add(['type', 'anotherType'], new ExclusionIn([ - 'domain' => ['mechanic', 'cyborg'], - 'message' => $validationMessages, - ])); - $messages = $validation->validate(['type' => 'hydraulic', 'anotherType' => 'hydraulic']); - expect($messages->count())->equals(0); - $messages = $validation->validate(['type' => 'cyborg', 'anotherType' => 'hydraulic']); - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['type']); - $messages = $validation->validate(['type' => 'cyborg', 'anotherType' => 'mechanic']); - expect($messages->count())->equals(2); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['type']); - expect($messages->offsetGet(1)->getMessage())->equals($validationMessages['anotherType']); - }); - } - - /** - * Tests exclusion in validator with multiple field and multiple domain - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testMultipleFieldMultipleDomain() - { - $this->specify('Test exclusion in validator with multiple field and single domain.', function () { - $validation = new Validation(); - $validationMessages = [ - 'type' => 'Type cant be mechanic or cyborg.', - 'anotherType' => 'AnotherType cant by mechanic or hydraulic.', - ]; - $validation->add(['type', 'anotherType'], new ExclusionIn([ - 'domain' => [ - 'type' => ['mechanic', 'cyborg'], - 'anotherType' => ['mechanic', 'hydraulic'], - ], - 'message' => $validationMessages, - ])); - $messages = $validation->validate(['type' => 'hydraulic', 'anotherType' => 'cyborg']); - expect($messages->count())->equals(0); - $messages = $validation->validate(['type' => 'cyborg', 'anotherType' => 'cyborg']); - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['type']); - $messages = $validation->validate(['type' => 'hydraulic', 'anotherType' => 'mechanic']); - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['anotherType']); - $messages = $validation->validate(['type' => 'cyborg', 'anotherType' => 'mechanic']); - expect($messages->count())->equals(2); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['type']); - expect($messages->offsetGet(1)->getMessage())->equals($validationMessages['anotherType']); - }); - } - - public function testCustomMessage() - { - $this->specify( - 'Test Exclusion In validator works with a custom message.', - function () { - $validation = new Validation(); - - $validation->add( - 'status', - new ExclusionIn( - [ - 'message' => 'The status must not be A=Active or I=Inactive', - 'domain' => ['A', 'I'] - ] - ) - ); - - $messages = $validation->validate(['status' => 'A']); - - $expectedMessages = Messages::__set_state( - [ - '_messages' => [ - 0 => Message::__set_state( - [ - '_type' => 'ExclusionIn', - '_message' => 'The status must not be A=Active or I=Inactive', - '_field' => 'status', - '_code' => '0', - ] - ) - ] - ] - ); - - expect($expectedMessages)->equals($messages); - - $messages = $validation->validate(['status' => 'A']); - expect($expectedMessages)->equals($messages); - - $messages = $validation->validate(['status' => 'X']); - expect($messages)->count(0); - } - ); - } -} diff --git a/_toCheck/tests/unit/Validation/Validator/IdenticalTest.php b/_toCheck/tests/unit/Validation/Validator/IdenticalTest.php deleted file mode 100644 index 4178669e1b7..00000000000 --- a/_toCheck/tests/unit/Validation/Validator/IdenticalTest.php +++ /dev/null @@ -1,186 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @author Wojciech Ślawski - * @package Phalcon\Test\Unit\Validation\Validator - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class IdenticalTest extends UnitTest -{ - /** - * Tests identical validator with single field - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testSingleField() - { - $this->specify( - 'Test identical validator with single field.', - function () { - $validation = new Validation(); - - $validation->add( - 'name', - new Validation\Validator\Identical( - [ - 'accepted' => 'SomeValue', - ] - ) - ); - - $messages = $validation->validate(['name' => 'SomeValue']); - expect($messages->count())->equals(0); - - $messages = $validation->validate(['name' => 'SomeValue123']); - expect($messages->count())->equals(1); - - $expectedMessages = Messages::__set_state( - [ - '_messages' => [ - 0 => Message::__set_state( - [ - '_type' => 'Identical', - '_message' => 'Field name does not have the expected value', - '_field' => 'name', - '_code' => '0', - ] - ) - ] - ] - ); - - expect($expectedMessages)->equals($messages); - } - ); - } - - /** - * Tests identical validator with multiple field and single accepted - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testMultipleFieldSingleAccepted() - { - $this->specify('Test identical validator with multiple field and single accepted.', function () { - $validation = new Validation(); - $validationMessages = [ - 'name' => 'Name must be SomeValue.', - 'anotherName' => 'AnotherName must be SomeValue.', - ]; - $validation->add(['name', 'anotherName'], new Validation\Validator\Identical([ - 'accepted' => 'SomeValue', - 'message' => $validationMessages, - ])); - $messages = $validation->validate(['name' => 'SomeValue', 'anotherName' => 'SomeValue']); - expect($messages->count())->equals(0); - $messages = $validation->validate(['name' => 'SomeValue123', 'anotherName' => 'SomeValue']); - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['name']); - $messages = $validation->validate(['name' => 'SomeValue123', 'anotherName' => 'SomeValue123']); - expect($messages->count())->equals(2); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['name']); - expect($messages->offsetGet(1)->getMessage())->equals($validationMessages['anotherName']); - }); - } - - /** - * Tests identical validator with multiple field and multiple accepted - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testMultipleFieldMultipleAccepted() - { - $this->specify('Test identical with multiple field and accepted.', function () { - $validation = new Validation(); - $validationMessages = [ - 'name' => 'Name must be SomeValue.', - 'anotherName' => 'AnotherName must be SomeAnotherValue.', - ]; - $validation->add(['name', 'anotherName'], new Validation\Validator\Identical([ - 'accepted' => [ - 'name' => 'SomeValue', - 'anotherName' => 'SomeAnotherValue', - ], - 'message' => $validationMessages, - ])); - $messages = $validation->validate(['name' => 'SomeValue', 'anotherName' => 'SomeAnotherValue']); - expect($messages->count())->equals(0); - $messages = $validation->validate(['name' => 'SomeValue123', 'anotherName' => 'SomeAnotherValue']); - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['name']); - $messages = $validation->validate(['name' => 'SomeValue', 'anotherName' => 'SomeAnotherValue123']); - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['anotherName']); - $messages = $validation->validate(['name' => 'SomeValue123', 'anotherName' => 'SomeAnotherValue123']); - expect($messages->count())->equals(2); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['name']); - expect($messages->offsetGet(1)->getMessage())->equals($validationMessages['anotherName']); - }); - } - - public function testCustomMessage() - { - $this->specify( - 'Test Identical validator works with a custom message.', - function () { - $validation = new Validation(); - - $validation->add( - 'name', - new Validation\Validator\Identical( - [ - 'accepted' => 'Peter', - 'message' => 'The name must be peter', - ] - ) - ); - - $messages = $validation->validate([]); - - $expectedMessages = Messages::__set_state( - [ - '_messages' => [ - 0 => Message::__set_state( - [ - '_type' => 'Identical', - '_message' => 'The name must be peter', - '_field' => 'name', - '_code' => '0', - ] - ) - ] - ] - ); - - expect($expectedMessages)->equals($messages); - - $messages = $validation->validate(['name' => 'Peter']); - - expect($messages)->count(0); - } - ); - } -} diff --git a/_toCheck/tests/unit/Validation/Validator/InclusionInTest.php b/_toCheck/tests/unit/Validation/Validator/InclusionInTest.php deleted file mode 100644 index 20c73c8da50..00000000000 --- a/_toCheck/tests/unit/Validation/Validator/InclusionInTest.php +++ /dev/null @@ -1,191 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @author Wojciech Ślawski - * @package Phalcon\Test\Unit\Validation\Validator - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class InclusionInTest extends UnitTest -{ - /** - * Tests inclusion in validator with single field - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testSingleField() - { - $this->specify( - 'Test inclusion in validator with single field.', - function () { - $validation = new Validation(); - - $validation->add( - 'status', - new InclusionIn( - [ - 'domain' => ['A', 'I'] - ] - ) - ); - - $messages = $validation->validate([]); - - $expectedMessages = Messages::__set_state( - [ - '_messages' => [ - 0 => Message::__set_state( - [ - '_type' => 'InclusionIn', - '_message' => 'Field status must be a part of list: A, I', - '_field' => 'status', - '_code' => 0, - ] - ) - ] - ] - ); - - expect($expectedMessages)->equals($messages); - - $messages = $validation->validate(['status' => 'X']); - expect($expectedMessages)->equals($messages); - - $messages = $validation->validate(['status' => 'A']); - expect($messages)->count(0); - } - ); - } - - /** - * Tests inclusion in validator with single multiple field and single domain - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testMultipleFieldSingleDomain() - { - $this->specify('Test inclusion in validator with multiple field and single domain.', function () { - $validation = new Validation(); - $validationMessages = [ - 'type' => 'Type must be mechanical or cyborg.', - 'anotherType' => 'AnotherType must be mechanical or cyborg.', - ]; - $validation->add(['type', 'anotherType'], new InclusionIn([ - 'domain' => ['mechanical', 'cyborg'], - 'message' => $validationMessages, - ])); - $messages = $validation->validate(['type' => 'cyborg', 'anotherType' => 'cyborg']); - expect($messages->count())->equals(0); - $messages = $validation->validate(['type' => 'hydraulic', 'anotherType' => 'cyborg']); - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['type']); - $messages = $validation->validate(['type' => 'hydraulic', 'anotherType' => 'hydraulic']); - expect($messages->count())->equals(2); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['type']); - expect($messages->offsetGet(1)->getMessage())->equals($validationMessages['anotherType']); - }); - } - - /** - * Tests inclusion in validator with single multiple field and domain - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testMultipleFieldMultipleDomain() - { - $this->specify('Test inclusion in validator with multiple field domain.', function () { - $validation = new Validation(); - $validationMessages = [ - 'type' => 'Type must be mechanic or cyborg.', - 'anotherType' => 'AnotherType must be mechanic or hydraulic.', - ]; - $validation->add(['type', 'anotherType'], new InclusionIn([ - 'domain' => [ - 'type' => ['cyborg', 'mechanic'], - 'anotherType' => ['mechanic', 'hydraulic'], - ], - 'message' => $validationMessages, - ])); - $messages = $validation->validate(['type' => 'cyborg', 'anotherType' => 'mechanic']); - expect($messages->count())->equals(0); - $messages = $validation->validate(['type' => 'hydraulic', 'anotherType' => 'mechanic']); - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['type']); - $messages = $validation->validate(['type' => 'mechanic', 'anotherType' => 'cyborg']); - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['anotherType']); - $messages = $validation->validate(['type' => 'hydraulic', 'anotherType' => 'cyborg']); - expect($messages->count())->equals(2); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['type']); - expect($messages->offsetGet(1)->getMessage())->equals($validationMessages['anotherType']); - }); - } - - public function testCustomMessage() - { - $this->specify( - 'Test Inclusion In validator works with a custom message.', - function () { - $validation = new Validation(); - - $validation->add( - 'status', - new InclusionIn( - [ - 'message' => 'The status must be A=Active or I=Inactive', - 'domain' => ['A', 'I'] - ] - ) - ); - - $messages = $validation->validate([]); - - $expectedMessages = Messages::__set_state( - [ - '_messages' => [ - 0 => Message::__set_state( - [ - '_type' => 'InclusionIn', - '_message' => 'The status must be A=Active or I=Inactive', - '_field' => 'status', - '_code' => '0', - ] - ) - ] - ] - ); - - expect($expectedMessages)->equals($messages); - - $messages = $validation->validate(['status' => 'x=1']); - expect($expectedMessages)->equals($messages); - - $messages = $validation->validate(['status' => 'A']); - expect($messages)->count(0); - } - ); - } -} diff --git a/_toCheck/tests/unit/Validation/Validator/NumericalityTest.php b/_toCheck/tests/unit/Validation/Validator/NumericalityTest.php deleted file mode 100644 index f1d43bd0a3a..00000000000 --- a/_toCheck/tests/unit/Validation/Validator/NumericalityTest.php +++ /dev/null @@ -1,134 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @author Wojciech Ślawski - * @author Andrey Izman - * @package Phalcon\Test\Unit\Validation\Validator - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class NumericalityTest extends UnitTest -{ - /** - * Tests numericality validator with single field - * - * @author Wojciech Ślawski - * @author Andrey Izman - * @since 2016-06-05 - */ - public function testSingleField() - { - $this->specify('Test numericality validator with single field.', function () { - $validation = new Validation(); - $validation->add('amount', new Numericality()); - $messages = $validation->validate(['amount' => 123]); - expect($messages->count())->equals(0); - $messages = $validation->validate(['amount' => 123.12]); - expect($messages->count())->equals(0); - $messages = $validation->validate(['amount' => '123abc']); - expect($messages->count())->equals(1); - $messages = $validation->validate(['amount' => '123.12e3']); - expect($messages->count())->equals(1); - }); - } - - /** - * Tests numericality validator with multiple field - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testMultipleField() - { - $this->specify('Test numericality validator with multiple field', function () { - $validation = new Validation(); - $validationMessages = [ - 'amount' => 'Amount must be digit.', - 'price' => 'Price must be digit.', - ]; - $validation->add(['amount', 'price'], new Numericality([ - 'message' => $validationMessages, - ])); - $messages = $validation->validate(['amount'=>123, 'price' => 123]); - expect($messages->count())->equals(0); - $messages = $validation->validate(['amount'=>'123abc', 'price' => 123]); - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['amount']); - $messages = $validation->validate(['amount'=>'123abc', 'price' => '123abc']); - expect($messages->count())->equals(2); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['amount']); - expect($messages->offsetGet(1)->getMessage())->equals($validationMessages['price']); - }); - } - - /** - * Set locale - * - * @param string $locale - * @return string - * - * @author Andrey Izman - * @since 2018-08-08 - */ - protected function setTestLocale($locale) - { - putenv('LC_ALL=' . $locale); - putenv('LANG=' . $locale); - putenv('LANGUAGE=' . $locale); - return setlocale(LC_ALL, $locale); - } - - /** - * Tests numericality validator for custom locales - * - * @link https://github.com/phalcon/cphalcon/issues/13450 - * - * @author Andrey Izman - * @since 2018-08-08 - */ - public function testLocales() - { - $this->specify('Test numericality validator with custom locales.', function () { - $validation = new Validation(); - $validation->add('amount', new Numericality()); - - // get default locale - $locale = setlocale(LC_ALL, 0); - - $this->setTestLocale('en_US.UTF8'); - - $messages = $validation->validate(['amount' => 123.12]); - expect($messages->count())->equals(0); - $messages = $validation->validate(['amount' => '123.12']); - expect($messages->count())->equals(0); - $messages = $validation->validate(['amount' => '123,12']); - expect($messages->count())->equals(1); - - $this->setTestLocale('fr_FR.UTF8'); - - $messages = $validation->validate(['amount' => 123.12]); - expect($messages->count())->equals(0); - - // revert back locale - $this->setTestLocale($locale); - }); - } -} diff --git a/_toCheck/tests/unit/Validation/Validator/PresenceOfTest.php b/_toCheck/tests/unit/Validation/Validator/PresenceOfTest.php deleted file mode 100644 index adf220a6d12..00000000000 --- a/_toCheck/tests/unit/Validation/Validator/PresenceOfTest.php +++ /dev/null @@ -1,207 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @author Wojciech Ślawski - * @package Phalcon\Test\Unit\Validation\Validator - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class PresenceOfTest extends UnitTest -{ - /** - * Tests presence of validator with single field - * - * @test - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function shouldValidateSingleField() - { - $this->specify('Test presence of validator with single field.', function () { - $validation = new Validation(); - $validation->add('name', new PresenceOf()); - - expect($validation->validate(['name' => 'SomeValue']))->count(0); - expect($validation->validate(['name' => '']))->count(1); - }); - } - - /** - * Tests presence of validator with multiple field - * - * @test - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function shouldValidateMultipleField() - { - $this->specify('Test presence of validator with multiple field.', function () { - $validation = new Validation(); - $validationMessages = [ - 'name' => 'Name cant be empty.', - 'type' => 'Type cant be empty.', - ]; - $validation->add(['name', 'type'], new PresenceOf([ - 'message' => $validationMessages, - ])); - - expect($validation->validate(['name' => 'SomeValue', 'type' => 'SomeValue']))->count(0); - - $messages = $validation->validate(['name' => '', 'type' => 'SomeValue']); - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['name']); - - $expectedMessages = Messages::__set_state([ - '_messages' => [ - Message::__set_state([ - '_type' => 'PresenceOf', - '_message' => 'Name cant be empty.', - '_field' => 'name', - '_code' => '0', - ]) - ], - ]); - - expect($messages)->equals($expectedMessages); - - $messages = $validation->validate(['name' => '', 'type' => '']); - expect($messages->count())->equals(2); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['name']); - expect($messages->offsetGet(1)->getMessage())->equals($validationMessages['type']); - - $expectedMessages = Messages::__set_state([ - '_messages' => [ - Message::__set_state([ - '_type' => 'PresenceOf', - '_message' => 'Name cant be empty.', - '_field' => 'name', - '_code' => '0', - ]), - Message::__set_state([ - '_type' => 'PresenceOf', - '_message' => 'Type cant be empty.', - '_field' => 'type', - '_code' => '0', - ]) - ], - ]); - - expect($messages)->equals($expectedMessages); - }); - } - - /** - * Tests mixed fields - * - * @test - * @author Andres Gutierrez - * @since 2013-03-01 - */ - public function shouldValidateMixedFields() - { - $this->specify( - 'The PresenceOf does not validate mixed fields as expected', - function () { - $validation = new Validation(); - - $validation - ->add('name', new PresenceOf(['message' => 'The name is required'])) - ->add('email', new PresenceOf(['message' => 'The email is required'])) - ->add('login', new PresenceOf(['message' => 'The login is required'])); - - $actual = $validation->validate([]); - - $expected = Messages::__set_state([ - '_messages' => [ - Message::__set_state([ - '_type' => 'PresenceOf', - '_message' => 'The name is required', - '_field' => 'name', - '_code' => '0', - ]), - Message::__set_state([ - '_type' => 'PresenceOf', - '_message' => 'The email is required', - '_field' => 'email', - '_code' => '0', - ]), - Message::__set_state([ - '_type' => 'PresenceOf', - '_message' => 'The login is required', - '_field' => 'login', - '_code' => '0', - ]), - ], - ]); - - expect($actual)->equals($expected); - } - ); - } - - /** - * Tests cancel validation on first fail - * - * @test - * @author Andres Gutierrez - * @since 2013-03-01 - */ - public function shouldCancelOnFail() - { - $this->specify( - 'Validator should cancel validation on first fail', - function () { - $validation = new Validation(); - - $validation - ->add('name', new PresenceOf(['message' => 'The name is required'])) - ->add('email', new PresenceOf([ - 'message' => 'The email is required', - 'cancelOnFail' => true - ])) - ->add('login', new PresenceOf(['message' => 'The login is required'])); - - $actual = $validation->validate([]); - - $expected = Messages::__set_state([ - '_messages' => [ - Message::__set_state([ - '_type' => 'PresenceOf', - '_message' => 'The name is required', - '_field' => 'name', - '_code' => '0', - ]), - Message::__set_state([ - '_type' => 'PresenceOf', - '_message' => 'The email is required', - '_field' => 'email', - '_code' => '0', - ]) - ], - ]); - - expect($actual)->equals($expected); - } - ); - } -} diff --git a/_toCheck/tests/unit/Validation/Validator/RegexTest.php b/_toCheck/tests/unit/Validation/Validator/RegexTest.php deleted file mode 100644 index 70cb6ee5ecc..00000000000 --- a/_toCheck/tests/unit/Validation/Validator/RegexTest.php +++ /dev/null @@ -1,184 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @author Wojciech Ślawski - * @package Phalcon\Test\Unit\Validation\Validator - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class RegexTest extends UnitTest -{ - /** - * Tests regex validator with single field - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testSingleField() - { - $this->specify( - 'Test regex validator with single field.', - function () { - $validation = new Validation(); - - $validation->add( - 'car_plate', - new Validation\Validator\Regex( - [ - 'pattern' => '/[A-Z]{3}\-[0-9]{3}/' - ] - ) - ); - - $messages = $validation->validate([]); - - $expectedMessages = Messages::__set_state( - [ - '_messages' => [ - 0 => Message::__set_state( - [ - '_type' => 'Regex', - '_message' => 'Field car_plate does not match the required format', - '_field' => 'car_plate', - '_code' => '0', - ] - ) - ] - ] - ); - - expect($expectedMessages)->equals($messages); - - $messages = $validation->validate(['car_plate' => 'XYZ-123']); - expect($messages)->count(0); - } - ); - } - - /** - * Tests regex validator with multiple field and single pattern - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testMultipleFieldSinglePattern() - { - $this->specify('Test regex validator with multiple field and single pattern.', function () { - $validation = new Validation(); - $validationMessages = [ - 'name' => 'Name can be only lowercase letters.', - 'type' => 'Type can be only lowercase letters.', - ]; - $validation->add(['name', 'type'], new Validation\Validator\Regex([ - 'pattern' => '/^[a-z]+$/', - 'message' => $validationMessages, - ])); - $messages = $validation->validate(['name' => 'somevalue', 'type' => 'somevalue']); - expect($messages->count())->equals(0); - $messages = $validation->validate(['name' => 'SomeValue', 'type' => 'somevalue']); - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['name']); - $messages = $validation->validate(['name' => 'SomeValue', 'type' => 'SomeValue']); - expect($messages->count())->equals(2); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['name']); - expect($messages->offsetGet(1)->getMessage())->equals($validationMessages['type']); - }); - } - - /** - * Tests regex validator with multiple field and pattern - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testMultipleFieldMultiplePattern() - { - $this->specify('Test regex validator with multiple field and pattern.', function () { - $validation = new Validation(); - $validationMessages = [ - 'name' => 'Name can be only lowercase letters.', - 'type' => 'Type can be only uppercase letters.', - ]; - $validation->add(['name', 'type'], new Validation\Validator\Regex([ - 'pattern' => [ - 'name' => '/^[a-z]+$/', - 'type' => '/^[A-Z]+$/', - ], - 'message' => $validationMessages, - ])); - $messages = $validation->validate(['name' => 'somevalue', 'type' => 'SOMEVALUE']); - expect($messages->count())->equals(0); - $messages = $validation->validate(['name' => 'SomeValue', 'type' => 'SOMEVALUE']); - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['name']); - $messages = $validation->validate(['name' => 'somevalue', 'type' => 'somevalue']); - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['type']); - $messages = $validation->validate(['name' => 'SomeValue', 'type' => 'SomeValue']); - expect($messages->count())->equals(2); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['name']); - expect($messages->offsetGet(1)->getMessage())->equals($validationMessages['type']); - }); - } - - public function testCustomMessage() - { - $this->specify( - 'Test Regex validator works with a custom message.', - function () { - $validation = new Validation(); - - $validation->add( - 'car_plate', - new Validation\Validator\Regex( - [ - 'pattern' => '/[A-Z]{3}\-[0-9]{3}/', - 'message' => 'The car plate is not valid' - ] - ) - ); - - $messages = $validation->validate([]); - - $expectedMessages = Messages::__set_state( - [ - '_messages' => [ - 0 => Message::__set_state( - [ - '_type' => 'Regex', - '_message' => 'The car plate is not valid', - '_field' => 'car_plate', - '_code' => '0', - ] - ) - ] - ] - ); - - expect($expectedMessages)->equals($messages); - - $messages = $validation->validate(['car_plate' => 'XYZ-123']); - expect($messages)->count(0); - } - ); - } -} diff --git a/_toCheck/tests/unit/Validation/Validator/StringLengthTest.php b/_toCheck/tests/unit/Validation/Validator/StringLengthTest.php deleted file mode 100644 index d0890c4c3c0..00000000000 --- a/_toCheck/tests/unit/Validation/Validator/StringLengthTest.php +++ /dev/null @@ -1,271 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @author Wojciech Ślawski - * @package Phalcon\Test\Unit\Validation\Validator - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class StringLengthTest extends UnitTest -{ - /** - * Tests string length validator with single field - * - * @test - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function shouldValidateSingleField() - { - $this->specify('Test string length with single field.', function () { - $validation = new Validation(); - $validation->add('name', new StringLength([ - 'min' => 3, - 'max' => 9, - ])); - - expect($validation->validate(['name' => 'SomeValue']))->count(0); - expect($validation->validate(['name' => 'SomeValue123']))->count(1); - }); - } - - /** - * Tests too short string length - * - * @test - * @author Andres Gutierrez - * @since 2013-03-09 - */ - public function shouldValidateStringLengthMinimum() - { - $this->specify( - 'The StringLength validator does not validate too short string length correctly.', - function () { - $validation = new Validation(); - $validation->add('name', new StringLength(['min' => 3])); - - expect($validation->validate(['name' => 'Something']))->count(0); - - $expected = Messages::__set_state([ - '_messages' => [ - Message::__set_state([ - '_type' => 'TooShort', - '_message' => 'Field name must be at least 3 characters long', - '_field' => 'name', - '_code' => '0', - ]) - ] - ]); - - expect($validation->validate(['name' => 'So']))->equals($expected); - } - ); - } - - /** - * Tests too short string length with custom message - * - * @test - * @author Andres Gutierrez - * @since 2013-03-09 - */ - public function shouldValidateStringLengthMinimumWithCustomMessage() - { - $this->specify( - 'The StringLength validator does not validate too short string length with custom message correctly.', - function () { - $validation = new Validation(); - $validation->add( - 'message', - new StringLength(['min' => 3, 'messageMinimum' => 'The message is too short']) - ); - - expect($validation->validate(['message' => 'Something']))->count(0); - - $expected = Messages::__set_state([ - '_messages' => [ - Message::__set_state([ - '_type' => 'TooShort', - '_message' => 'The message is too short', - '_field' => 'message', - '_code' => '0', - ]) - ] - ]); - - expect($validation->validate(['message' => 'So']))->equals($expected); - } - ); - } - - /** - * Tests too long string length - * - * @test - * @author Andres Gutierrez - * @since 2013-03-09 - */ - public function shouldValidateStringLengthMaximum() - { - $this->specify( - 'The StringLength validator does not validate too long string length correctly.', - function () { - $validation = new Validation(); - $validation->add('name', new StringLength(['max' => 4])); - - expect($validation->validate(['name' => 'John']))->count(0); - - $expected = Messages::__set_state([ - '_messages' => [ - Message::__set_state([ - '_type' => 'TooLong', - '_message' => 'Field name must not exceed 4 characters long', - '_field' => 'name', - '_code' => '0', - ]) - ] - ]); - - expect($validation->validate(['name' => 'Johannes']))->equals($expected); - } - ); - } - - /** - * Tests too long string length with custom message - * - * @test - * @author Andres Gutierrez - * @since 2013-03-09 - */ - public function shouldValidateStringLengthMaximumWithCustomMessage() - { - $this->specify( - 'The StringLength validator does not validate too long string length with custom message correctly.', - function () { - $validation = new Validation(); - $validation->add( - 'message', - new StringLength(['max' => 4, 'messageMaximum' => 'The message is too long']) - ); - - expect($validation->validate(['message' => 'Pet']))->count(0); - - $expected = Messages::__set_state([ - '_messages' => [ - Message::__set_state([ - '_type' => 'TooLong', - '_message' => 'The message is too long', - '_field' => 'message', - '_code' => '0', - ]) - ] - ]); - - expect($validation->validate(['message' => 'Validation']))->equals($expected); - } - ); - } - - /** - * Tests string length validator with multiple field and single min, max - * - * @test - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function shouldValidateMultipleFieldSingleMinMax() - { - $this->specify('Test string length with multiple field and single min, max.', function () { - $validation = new Validation(); - $validationMinimumMessages = [ - 'name' => 'Name length must be minimum 0.', - 'type' => 'Type length must be minimum 0.', - ]; - $validationMaximumMessages = [ - 'name' => 'Name length must be maximum 9.', - 'type' => 'Type length must be maximum 9.', - ]; - $validation->add(['name', 'type'], new StringLength([ - 'min' => 0, - 'max' => 9, - 'messageMinimum' => $validationMinimumMessages, - 'messageMaximum' => $validationMaximumMessages - ])); - $messages = $validation->validate(['name' => 'SomeValue', 'type' => 'SomeValue']); - expect($messages->count())->equals(0); - $messages = $validation->validate(['name' => 'SomeValue123', 'type' => 'SomeValue']); - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMaximumMessages['name']); - $messages = $validation->validate(['name' => 'SomeValue123', 'type' => 'SomeValue123']); - expect($messages->count())->equals(2); - expect($messages->offsetGet(0)->getMessage())->equals($validationMaximumMessages['name']); - expect($messages->offsetGet(1)->getMessage())->equals($validationMaximumMessages['type']); - }); - } - - /** - * Tests string length validator with multiple field and min, max - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testMultipleFieldMultipleMinMax() - { - $this->specify('Test string length with multiple field and min, max.', function () { - $validation = new Validation(); - $validationMinimumMessages = [ - 'name' => 'Name length must be minimum 0.', - 'type' => 'Type length must be minimum 0.', - ]; - $validationMaximumMessages = [ - 'name' => 'Name length must be maximum 9.', - 'type' => 'Type length must be maximum 4.', - ]; - $validation->add(['name', 'type'], new StringLength([ - 'min' => [ - 'name' => 0, - 'type' => 0, - ], - 'max' => [ - 'name' => 9, - 'type' => 4, - ], - 'messageMinimum' => $validationMinimumMessages, - 'messageMaximum' => $validationMaximumMessages - ])); - $messages = $validation->validate(['name' => 'SomeValue', 'type' => 'Some']); - expect($messages->count())->equals(0); - $messages = $validation->validate(['name' => 'SomeValue123', 'type' => 'Some']); - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMaximumMessages['name']); - $messages = $validation->validate(['name' => 'SomeValue', 'type' => 'SomeValue']); - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMaximumMessages['type']); - $messages = $validation->validate(['name' => 'SomeValue123', 'type' => 'SomeValue']); - expect($messages->count())->equals(2); - expect($messages->offsetGet(0)->getMessage())->equals($validationMaximumMessages['name']); - expect($messages->offsetGet(1)->getMessage())->equals($validationMaximumMessages['type']); - }); - } -} diff --git a/_toCheck/tests/unit/Validation/Validator/UniquenessTest.php b/_toCheck/tests/unit/Validation/Validator/UniquenessCest.php similarity index 100% rename from _toCheck/tests/unit/Validation/Validator/UniquenessTest.php rename to _toCheck/tests/unit/Validation/Validator/UniquenessCest.php diff --git a/_toCheck/tests/unit/Validation/Validator/UrlTest.php b/_toCheck/tests/unit/Validation/Validator/UrlTest.php deleted file mode 100644 index 31049d782d0..00000000000 --- a/_toCheck/tests/unit/Validation/Validator/UrlTest.php +++ /dev/null @@ -1,142 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @author Wojciech Ślawski - * @package Phalcon\Test\Unit\Validation\Validator - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class UrlTest extends UnitTest -{ - /** - * Tests url validator with single field - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testSingleField() - { - $this->specify('Test url validator with single field.', function () { - $validation = new Validation(); - - $validation->add('url', new Validation\Validator\Url()); - - $messages = $validation->validate([]); - - $expectedMessages = Messages::__set_state( - [ - '_messages' => [ - 0 => Message::__set_state( - [ - '_type' => 'Url', - '_message' => 'Field url must be a url', - '_field' => 'url', - '_code' => 0, - ] - ) - ] - ] - ); - - expect($expectedMessages)->equals($messages); - - $messages = $validation->validate(['url' => 'x=1']); - expect($expectedMessages)->equals($messages); - - $messages = $validation->validate(['url' => 'http://phalconphp.com']); - expect($messages)->count(0); - }); - } - - /** - * Tests url validator with multiple field - * - * @author Wojciech Ślawski - * @since 2016-06-05 - */ - public function testMultipleField() - { - $this->specify('Test url validator with multiple field.', function () { - $validation = new Validation(); - $validationMessages = [ - 'url' => 'Url must be correct url.', - 'anotherUrl' => 'AnotherUrl must be correct url.', - ]; - $validation->add(['url', 'anotherUrl'], new Validation\Validator\Url([ - 'message' => $validationMessages, - ])); - $messages = $validation->validate(['url' => 'http://google.com', 'anotherUrl' => 'http://google.com']); - expect($messages->count())->equals(0); - $messages = $validation->validate(['url' => '://google.', 'anotherUrl' => 'http://google.com']); - expect($messages->count())->equals(1); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['url']); - $messages = $validation->validate(['url' => '://google.', 'anotherUrl' => '://google.']); - expect($messages->count())->equals(2); - expect($messages->offsetGet(0)->getMessage())->equals($validationMessages['url']); - expect($messages->offsetGet(1)->getMessage())->equals($validationMessages['anotherUrl']); - }); - } - - public function testCustomMessage() - { - $this->specify( - 'Test URL validator works with a custom message.', - function () { - $validation = new Validation(); - - $validation->add( - 'url', - new Validation\Validator\Url( - [ - 'message' => 'The url is not valid' - ] - ) - ); - - $messages = $validation->validate([]); - - $expectedMessages = Messages::__set_state( - [ - '_messages' => [ - 0 => Message::__set_state( - [ - '_type' => 'Url', - '_message' => 'The url is not valid', - '_field' => 'url', - '_code' => '0', - ] - ) - ] - ] - ); - - expect($expectedMessages)->equals($messages); - - $messages = $validation->validate(['url' => 'x=1']); - expect($expectedMessages)->equals($messages); - - $messages = $validation->validate(['url' => 'http://phalconphp.com']); - expect($messages)->count(0); - } - ); - } -} diff --git a/boxfile.yml b/boxfile.yml index db41a8684f1..e0ca481cd0f 100644 --- a/boxfile.yml +++ b/boxfile.yml @@ -6,24 +6,26 @@ run.config: - ctype - curl - dom - - tokenizer - - zlib - - xml - - xmlwriter - - simplexml - - session - - zephir_parser - - pdo - - pdo_sqlite - - pdo_mysql - - pdo_pgsql + - json - gmp - mbstring - memcached - memcache - mongodb + - pdo + - pdo_mysql + - pdo_pgsql + - pdo_sqlite - redis + - session + - simplexml + - tokenizer + - yaml + - zephir_parser + - xml + - xmlwriter - zip + - zlib zend_extensions: - opcache dev_zend_extensions: diff --git a/tests/unit/Validation/Validator/AlnumCest.php b/tests/unit/Validation/Validator/AlnumCest.php new file mode 100644 index 00000000000..feac31a46b6 --- /dev/null +++ b/tests/unit/Validation/Validator/AlnumCest.php @@ -0,0 +1,97 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Validation\Validator; + +use Phalcon\Validation; +use Phalcon\Validation\Validator\Alnum; +use UnitTester; + +class AlnumCest +{ + /** + * Tests alnum validator with single field + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testSingleField(UnitTester $I) + { + $validation = new Validation(); + $validation->add('name', new Alnum()); + $messages = $validation->validate(['name' => 'SomeValue123']); + + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => 'SomeValue123!@#']); + + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests alnum validator with multiple field + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testMultipleField(UnitTester $I) + { + $validation = new Validation(); + $validationMessages = [ + 'name' => 'Name must be alnum', + 'type' => 'Type must be alnum', + ]; + $validation->add( + [ + 'name', + 'type', + ], + new Alnum( + [ + 'message' => $validationMessages, + ] + ) + ); + $messages = $validation->validate(['name' => 'SomeValue123', 'type' => 'SomeValue123']); + + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => 'SomeValue123!@#', 'type' => 'SomeValue123']); + + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['name']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => 'SomeValue123!@#', 'type' => 'SomeValue123!@#']); + + $expected = 2; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['name']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['type']; + $actual = $messages->offsetGet(1)->getMessage(); + $I->assertEquals($expected, $actual); + } +} diff --git a/tests/unit/Validation/Validator/AlphaCest.php b/tests/unit/Validation/Validator/AlphaCest.php new file mode 100644 index 00000000000..b63bb6c4565 --- /dev/null +++ b/tests/unit/Validation/Validator/AlphaCest.php @@ -0,0 +1,209 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Validation\Validator; + +use Phalcon\Messages\Message; +use Phalcon\Messages\Messages; +use Phalcon\Validation; +use Phalcon\Validation\Validator\Alpha; +use UnitTester; + +class AlphaCest +{ + /** + * Tests alpha validator with single field + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testSingleField(UnitTester $I) + { + $validation = new Validation(); + $validation->add('name', new Alpha()); + $messages = $validation->validate(['name' => 'Asd']); + + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => 'Asd123']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests alpha validator with multiple field + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testMultipleField(UnitTester $I) + { + $validation = new Validation(); + $validationMessages = [ + 'name' => 'Name must be alpha.', + 'type' => 'Type must by alpha.', + ]; + $validation->add(['name', 'type'], new Alpha([ + 'message' => $validationMessages, + ])); + + $messages = $validation->validate(['name' => 'Asd', 'type' => 'Asd']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + $messages = $validation->validate(['name' => 'Asd123', 'type' => 'Asd']); + + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['name']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => 'Asd123', 'type' => 'Asd123']); + $expected = 2; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['name']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['type']; + $actual = $messages->offsetGet(1)->getMessage(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests Non Alphabetic Characters + * + * @author Serghei Iakovlev + * @since 2016-06-10 + */ + public function testShouldDetectNonAlphabeticCharacters(UnitTester $I) + { + $examples = [ + '1', + 123, + 'a-b-c-d', + 'a-1-c-2', + 'a1c2', + 'o0o0o0o0', + ]; + + foreach ($examples as $input) { + $validation = new Validation; + $validation->add( + 'name', + new Alpha( + [ + 'message' => ':field must contain only letters', + ] + ) + ); + + $expected = Messages::__set_state( + [ + '_messages' => [ + Message::__set_state( + [ + '_type' => 'Alpha', + '_message' => 'name must contain only letters', + '_field' => 'name', + '_code' => '0', + ] + ), + ], + ] + ); + $actual = $validation->validate(['name' => $input]); + $I->assertEquals($expected, $actual); + } + } + + /** + * Tests Alphabetic Characters + * + * @author Serghei Iakovlev + * @since 2016-06-10 + */ + public function testShouldValidateAlphabeticCharacters(UnitTester $I) + { + $examples = [ + 'a', + 'asdavafaiwnoabwiubafpowf', + 'QWERTYUIOPASDFGHJKL', + 'aSdFgHjKl', + null, + ]; + + foreach ($examples as $input) { + $validation = new Validation; + $validation->add( + 'name', + new Alpha( + [ + 'message' => ':field must contain only letters', + ] + ) + ); + + $messages = $validation->validate(['name' => $input]); + + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } + } + + /** + * Tests Non Latin Characters + * + * @author Serghei Iakovlev + * @since 2016-06-10 + */ + public function testShouldValidateNonLatinCharacters(UnitTester $I) + { + $examples = [ + 'йцукенг', + 'ждлорпа', + 'Señor', + 'cocoñùт', + 'COCOÑÙТ', + 'JÄGER', + 'šš', + 'あいうえお', + '零一二三四五', + ]; + + foreach ($examples as $input) { + $validation = new Validation; + $validation->add( + 'name', + new Alpha( + [ + 'message' => ':field must contain only letters', + ] + ) + ); + + $messages = $validation->validate(['name' => $input]); + + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } + } +} diff --git a/tests/unit/Validation/Validator/BetweenCest.php b/tests/unit/Validation/Validator/BetweenCest.php new file mode 100644 index 00000000000..15df092fb46 --- /dev/null +++ b/tests/unit/Validation/Validator/BetweenCest.php @@ -0,0 +1,179 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Validation\Validator; + +use Phalcon\Messages\Message; +use Phalcon\Messages\Messages; +use Phalcon\Validation; +use Phalcon\Validation\Validator\Between; +use UnitTester; + +class BetweenCest +{ + /** + * Tests between validator with single field + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testSingleField(UnitTester $I) + { + $validation = new Validation(); + $validation->add( + 'price', + new Between( + [ + 'minimum' => 1, + 'maximum' => 3, + ] + ) + ); + + $messages = $validation->validate(['price' => 5]); + + $expected = Messages::__set_state( + [ + '_messages' => [ + 0 => Message::__set_state( + [ + '_type' => 'Between', + '_message' => 'Field price must be within the range of 1 to 3', + '_field' => 'price', + '_code' => '0', + ] + ), + ], + ] + ); + $actual = $messages; + $I->assertEquals($expected, $actual); + + $messages = $validation->validate([]); + $actual = $messages; + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['price' => 2]); + + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests between validator with multiple field + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testMultipleField(UnitTester $I) + { + $validation = new Validation(); + $validationMessages = [ + 'amount' => 'Amount must be between 0 and 999.', + 'price' => 'Price must be between 0 and 999.', + ]; + $validation->add( + [ + 'amount', + 'price', + ], + new Between( + [ + 'minimum' => [ + 'amount' => 0, + 'price' => 0, + ], + 'maximum' => [ + 'amount' => 999, + 'price' => 999, + ], + 'message' => $validationMessages, + ] + ) + ); + + $messages = $validation->validate(['amount' => 100]); + + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['amount' => 1000, 'price' => 100]); + + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['amount']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['amount' => 1000, 'price' => 1000]); + + $expected = 2; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['amount']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['price']; + $actual = $messages->offsetGet(1)->getMessage(); + $I->assertEquals($expected, $actual); + } + + public function testCustomMessage(UnitTester $I) + { + $validation = new Validation(); + + $validation->add( + 'price', + new Between( + [ + 'minimum' => 1, + 'maximum' => 3, + 'message' => 'The price must be between 1 and 3', + ] + ) + ); + + $messages = $validation->validate(['price' => 5]); + + $expected = Messages::__set_state( + [ + '_messages' => [ + 0 => Message::__set_state( + [ + '_type' => 'Between', + '_message' => 'The price must be between 1 and 3', + '_field' => 'price', + '_code' => '0', + ] + ), + ], + ] + ); + $actual = $messages; + $I->assertEquals($expected, $actual); + + $messages = $validation->validate([]); + $actual = $messages; + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['price' => 2]); + + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } +} diff --git a/_toCheck/tests/unit/Validation/Validator/CallbackTest.php b/tests/unit/Validation/Validator/CallbackCest.php similarity index 70% rename from _toCheck/tests/unit/Validation/Validator/CallbackTest.php rename to tests/unit/Validation/Validator/CallbackCest.php index b509b45dc2f..9cd3c7913f2 100644 --- a/_toCheck/tests/unit/Validation/Validator/CallbackTest.php +++ b/tests/unit/Validation/Validator/CallbackCest.php @@ -1,35 +1,27 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + namespace Phalcon\Test\Unit\Validation\Validator; -use Phalcon\Test\Module\UnitTest; -use Phalcon\Validation; use Phalcon\Messages\Message; use Phalcon\Messages\Messages; +use Phalcon\Validation; +use Phalcon\Validation\Validator\Between; use Phalcon\Validation\Validator\Callback; +use Phalcon\Validation\Validator\Exception; use Phalcon\Validation\Validator\PresenceOf; use Phalcon\Validation\Validator\StringLength; +use UnitTester; -/** - * \Phalcon\Test\Unit\Validation\Validator\CallbackTest - * Tests the \Phalcon\Validation\Validator\Callback component - * - * @copyright (c) 2011-2016 Phalcon Team - * @link http://www.phalconphp.com - * @author Andres Gutierrez - * @author Nikolaos Dimopoulos - * @author Wojciech Ślawski - * @package Phalcon\Test\Unit\Validation\Validator - * @group validation - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class CallbackTest extends UnitTest +class CallbackCest { /** * Tests single field using boolean @@ -37,7 +29,7 @@ class CallbackTest extends UnitTest * @author Wojciech Ślawski * @since 2016-10-29 */ - public function testSingleFieldBoolean() + public function testSingleFieldBoolean(UnitTester $I) { $validation = new Validation(); $validation->add( @@ -52,14 +44,24 @@ public function testSingleFieldBoolean() ] ) ); + $messages = $validation->validate(["user" => "user", "admin" => null]); - expect($messages)->count(0); + + $expected = 0; + $actual = count($messages); + $I->assertEquals($expected, $actual); + $messages = $validation->validate(["user" => null, "admin" => "admin"]); - expect($messages)->count(0); + $expected = 0; + $actual = count($messages); + $I->assertEquals($expected, $actual); + $messages = $validation->validate(["user" => "user", "admin" => "admin"]); - expect($messages)->count(1); + $expected = 1; + $actual = count($messages); + $I->assertEquals($expected, $actual); - $expectedMessages = Messages::__set_state( + $expected = Messages::__set_state( [ '_messages' => [ Message::__set_state( @@ -73,8 +75,8 @@ public function testSingleFieldBoolean() ], ] ); - - expect($messages)->equals($expectedMessages); + $actual = $messages; + $I->assertEquals($expected, $actual); } /** @@ -83,7 +85,7 @@ public function testSingleFieldBoolean() * @author Wojciech Ślawski * @since 2016-10-29 */ - public function testSingleFieldValidator() + public function testSingleFieldValidator(UnitTester $I) { $validation = new Validation(); $validation->add( @@ -106,12 +108,24 @@ public function testSingleFieldValidator() ) ); $messages = $validation->validate(['user' => 'u', 'admin' => 'admin']); - expect($messages)->count(0); + + $expected = 0; + $actual = count($messages); + $I->assertEquals($expected, $actual); + $messages = $validation->validate(['user' => 'user', 'admin' => null]); - expect($messages)->count(0); + + $expected = 0; + $actual = count($messages); + $I->assertEquals($expected, $actual); + $messages = $validation->validate(['user' => 'u', 'admin' => null]); - expect($messages)->count(1); - $expectedMessages = Messages::__set_state( + + $expected = 1; + $actual = count($messages); + $I->assertEquals($expected, $actual); + + $expected = Messages::__set_state( [ '_messages' => [ Message::__set_state( @@ -125,7 +139,8 @@ public function testSingleFieldValidator() ], ] ); - expect($messages)->equals($expectedMessages); + $actual = $messages; + $I->assertEquals($expected, $actual); } /** @@ -134,7 +149,7 @@ public function testSingleFieldValidator() * @author Wojciech Ślawski * @since 2016-10-29 */ - public function testMultipleFieldBoolean() + public function testMultipleFieldBoolean(UnitTester $I) { $validation = new Validation(); $validation->add( @@ -152,13 +167,25 @@ public function testMultipleFieldBoolean() ] ) ); + $messages = $validation->validate(['user' => null, 'admin' => 'admin']); - expect($messages)->count(0); + + $expected = 0; + $actual = count($messages); + $I->assertEquals($expected, $actual); + $messages = $validation->validate(['user' => 'user', 'admin' => null]); - expect($messages)->count(0); + + $expected = 0; + $actual = count($messages); + $I->assertEquals($expected, $actual); $messages = $validation->validate(['user' => 'user', 'admin' => 'admin']); - expect($messages)->count(2); - $expectedMessages = Messages::__set_state( + + $expected = 2; + $actual = count($messages); + $I->assertEquals($expected, $actual); + + $expected = Messages::__set_state( [ '_messages' => [ Message::__set_state( @@ -180,7 +207,8 @@ public function testMultipleFieldBoolean() ], ] ); - expect($messages)->equals($expectedMessages); + $actual = $messages; + $I->assertEquals($expected, $actual); } /** @@ -189,7 +217,7 @@ public function testMultipleFieldBoolean() * @author Wojciech Ślawski * @since 2016-10-29 */ - public function testMultipleFieldValidator() + public function testMultipleFieldValidator(UnitTester $I) { $validation = new Validation(); $validation->add( @@ -217,8 +245,12 @@ public function testMultipleFieldValidator() ); $messages = $validation->validate(['admin' => null, 'user' => null]); - expect($messages)->count(2); - $expectedMessages = Messages::__set_state( + + $expected = 2; + $actual = count($messages); + $I->assertEquals($expected, $actual); + + $expected = Messages::__set_state( [ '_messages' => [ Message::__set_state( @@ -240,14 +272,25 @@ public function testMultipleFieldValidator() ], ] ); - expect($messages)->equals($expectedMessages); + $actual = $messages; + $I->assertEquals($expected, $actual); + $messages = $validation->validate(['admin' => 'admin', 'user' => null]); - expect($messages)->count(0); + $expected = 0; + $actual = count($messages); + $I->assertEquals($expected, $actual); + $messages = $validation->validate(['admin' => null, 'user' => 'user']); - expect($messages)->count(0); + $expected = 0; + $actual = count($messages); + $I->assertEquals($expected, $actual); + $messages = $validation->validate(['admin' => 'admin', 'user' => 'user']); - expect($messages)->count(2); - $expectedMessages = Messages::__set_state( + $expected = 2; + $actual = count($messages); + $I->assertEquals($expected, $actual); + + $expected = Messages::__set_state( [ '_messages' => [ Message::__set_state( @@ -269,7 +312,8 @@ public function testMultipleFieldValidator() ], ] ); - expect($messages)->equals($expectedMessages); + $actual = $messages; + $I->assertEquals($expected, $actual); } /** @@ -277,23 +321,26 @@ public function testMultipleFieldValidator() * * @author Wojciech Ślawski * @since 2016-10-29 - * @expectedException \Phalcon\Validation\Validator\Exception - * @expectedExceptionMessage Callback must return boolean or Phalcon\Validation\Validator object */ - public function testException() + public function testException(UnitTester $I) { - $validation = new Validation(); - $validation->add( - 'user', - new Callback( - [ - "callback" => function ($data) { - return new Validation(); - }, - ] - ) - ); + $I->expectThrowable( + new Exception('Callback must return boolean or Phalcon\Validation\Validator object'), + function () { + $validation = new Validation(); + $validation->add( + 'user', + new Callback( + [ + "callback" => function ($data) { + return new Validation(); + }, + ] + ) + ); - $validation->validate(['user' => 'user']); + $validation->validate(['user' => 'user']); + } + ); } } diff --git a/tests/unit/Validation/Validator/ConfirmationCest.php b/tests/unit/Validation/Validator/ConfirmationCest.php new file mode 100644 index 00000000000..355febf1860 --- /dev/null +++ b/tests/unit/Validation/Validator/ConfirmationCest.php @@ -0,0 +1,263 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Validation\Validator; + +use Phalcon\Messages\Message; +use Phalcon\Messages\Messages; +use Phalcon\Validation; +use Phalcon\Validation\Validator\Confirmation; +use UnitTester; + +class ConfirmationCest +{ + /** + * Tests confirmation validator with single field + * + * @test + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function shouldValidateSingleField(UnitTester $I) + { + $validation = new Validation(); + $validation->add( + 'name', + new Confirmation( + [ + 'with' => 'nameWith', + ] + ) + ); + + $messages = $validation->validate( + [ + 'name' => 'SomeValue', + 'nameWith' => 'SomeValue', + ] + ); + + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate( + [ + 'name' => 'SomeValue', + 'nameWith' => 'SomeValue123', + ] + ); + + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests confirmation validator with multiple field + * + * @test + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function shouldValidateMultipleField(UnitTester $I) + { + $validation = new Validation(); + $validationMessages = [ + 'name' => 'Name must be same as nameWith.', + 'type' => 'Type must be same as typeWith.', + ]; + $validation->add( + ['name', 'type'], + new Confirmation( + [ + 'with' => [ + 'name' => 'nameWith', + 'type' => 'typeWith', + ], + 'message' => $validationMessages, + ] + ) + ); + + $messages = $validation->validate( + [ + 'name' => 'SomeValue', + 'nameWith' => 'SomeValue', + 'type' => 'SomeValue', + 'typeWith' => 'SomeValue', + ] + ); + + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate( + [ + 'name' => 'SomeValue', + 'nameWith' => 'SomeValue123', + 'type' => 'SomeValue', + 'typeWith' => 'SomeValue', + ] + ); + + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['name']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate( + [ + 'name' => 'SomeValue', + 'nameWith' => 'SomeValue123', + 'type' => 'SomeValue', + 'typeWith' => 'SomeValue123', + ] + ); + + $expected = 2; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['name']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['type']; + $actual = $messages->offsetGet(1)->getMessage(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests allowing empty value + * + * @test + * @author Stanislav Kiryukhin + * @since 2015-09-06 + */ + public function shouldAllowEmptyValues(UnitTester $I) + { + $expected = Messages::__set_state( + [ + '_messages' => [ + Message::__set_state( + [ + '_type' => 'Confirmation', + '_message' => 'Field password must be the same as password2', + '_field' => 'password', + '_code' => '0', + ] + ), + ] + ] + ); + + $validation = new Validation(); + $validation->add( + 'password', + new Confirmation( + [ + 'allowEmpty' => true, + 'with' => 'password2' + ] + ) + ); + + $messages = $validation->validate( + [ + 'password' => 'test123', + 'password2' => 'test123' + ] + ); + + $actual = $messages->count(); + $I->assertEquals(0, $actual); + + $messages = $validation->validate( + [ + 'password' => null, + 'password2' => 'test123' + ] + ); + + $actual = $messages->count(); + $I->assertEquals(0, $actual); + + $validation = new Validation(); + $validation->add( + 'password', + new Confirmation( + [ + 'allowEmpty' => false, + 'with' => 'password2' + ] + ) + ); + + $messages = $validation->validate( + [ + 'password' => 'test123', + 'password2' => 'test123' + ] + ); + + $actual = $messages->count(); + $I->assertEquals(0, $actual); + + $messages = $validation->validate( + [ + 'password' => null, + 'password2' => 'test123' + ] + ); + + $actual = $messages->count(); + $I->assertEquals(1, $actual); + $actual = $messages; + $I->assertEquals($expected, $actual); + + $validation = new Validation(); + $validation->add( + 'password', + new Confirmation( + [ + 'with' => 'password2' + ] + ) + ); + + $messages = $validation->validate( + [ + 'password' => 'test123', + 'password2' => 'test123' + ] + ); + + $actual = $messages->count(); + $I->assertEquals(0, $actual); + + $messages = $validation->validate( + [ + 'password' => null, + 'password2' => 'test123' + ] + ); + + $actual = $messages->count(); + $I->assertEquals(1, $actual); + $actual = $messages; + $I->assertEquals($expected, $actual); + } +} diff --git a/tests/unit/Validation/Validator/CreditCardCest.php b/tests/unit/Validation/Validator/CreditCardCest.php new file mode 100644 index 00000000000..d85ff0d8702 --- /dev/null +++ b/tests/unit/Validation/Validator/CreditCardCest.php @@ -0,0 +1,182 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Validation\Validator; + +use Phalcon\Messages\Message; +use Phalcon\Messages\Messages; +use Phalcon\Validation; +use Phalcon\Validation\Validator\CreditCard; +use UnitTester; + +class CreditCardCest +{ + /** + * Tests credit card validator with single field + * + * @test + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function shouldValidateSingleField(UnitTester $I) + { + $validation = new Validation(); + $validation->add('creditCard', new CreditCard()); + + $expected = 0; + $actual = count($validation->validate(['creditCard' => 4601587377626131])); + $I->assertEquals($expected, $actual); + + $expected = 1; + $actual = count($validation->validate(['creditCard' => 46015873776261312])); + $I->assertEquals($expected, $actual); + } + + /** + * Tests credit card validator with multiple field + * + * @test + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function shouldValidateMultipleFields(UnitTester $I) + { + $validation = new Validation(); + + $validationMessages = [ + 'creditCard' => 'CreditCard must be correct credit card value.', + 'anotherCreditCard' => 'AnotherCreditCard must be correct credit card value.', + ]; + + $validation->add( + ['creditCard', 'anotherCreditCard'], + new CreditCard( + [ + 'message' => $validationMessages, + ] + ) + ); + + $messages = $validation->validate( + [ + 'creditCard' => 4601587377626131, + 'anotherCreditCard' => 4601587377626131, + ] + ); + + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate( + [ + 'creditCard' => 46015873776261312, + 'anotherCreditCard' => 4601587377626131, + ] + ); + + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['creditCard']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate( + [ + 'creditCard' => 46015873776261312, + 'anotherCreditCard' => 46015873776261312, + ] + ); + + $expected = 2; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['creditCard']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['anotherCreditCard']; + $actual = $messages->offsetGet(1)->getMessage(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests detect valid card numbers + * + * @test + * @author Caio Almeida + * @since 2015-09-06 + */ + public function shouldDetectValidCreditCard(UnitTester $I) + { + $providers = [ + 'amex' => '378282246310005', + 'visa' => '4012888888881881', + 'dinners' => '38520000023237', + 'mastercard' => '5105105105105100', + 'discover' => '6011000990139424', + ]; + + foreach ($providers as $number) { + $validation = new Validation(); + $validation->add('creditCard', new CreditCard()); + + $expected = 0; + $actual = count($validation->validate(['creditCard' => $number])); + $I->assertEquals($expected, $actual); + } + } + + /** + * Tests detect invalid card numbers + * + * @test + * @author Caio Almeida + * @since 2015-09-06 + */ + public function shouldDetectInvalidCreditCard(UnitTester $I) + { + $cards = [ + '1203191201121221', + '102030102320', + '120120s201023', + '20323200003230', + '12010012', + ]; + + foreach ($cards as $number) { + $validation = new Validation(); + $validation->add('creditCard', new CreditCard()); + + $expected = Messages::__set_state( + [ + '_messages' => [ + Message::__set_state( + [ + '_type' => 'CreditCard', + '_message' => 'Field creditCard is not valid for a credit card number', + '_field' => 'creditCard', + '_code' => '0', + ] + ) + ] + ] + ); + + $actual = $validation->validate(['creditCard' => $number]); + $I->assertEquals($expected, $actual); + } + } +} + diff --git a/tests/unit/Validation/Validator/DateCest.php b/tests/unit/Validation/Validator/DateCest.php new file mode 100644 index 00000000000..8cbb3281e57 --- /dev/null +++ b/tests/unit/Validation/Validator/DateCest.php @@ -0,0 +1,173 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Validation\Validator; + +use Phalcon\Messages\Message; +use Phalcon\Messages\Messages; +use Phalcon\Validation; +use Phalcon\Validation\Validator\Date; +use UnitTester; + +class DateCest +{ + /** + * Tests date validator with single field + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testSingleField(UnitTester $I) + { + $validation = new Validation(); + $validation->add('date', new Date()); + + $messages = $validation->validate(['date' => '2016-06-05']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['date' => '2016-06-32']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests date validator with multiple field + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testMultipleField(UnitTester $I) + { + $validation = new Validation(); + $validationMessages = [ + 'date' =>'Date must be correct date format Y-m-d.', + 'anotherDate'=>'AnotherDate must be correct date format d-m-Y.' + ]; + + $validation->add( + ['date', 'anotherDate'], + new Date( + [ + 'format'=>[ + 'date'=>'Y-m-d', + 'anotherDate'=>'d-m-Y' + ], + 'message'=>$validationMessages + ] + ) + ); + + $messages = $validation->validate(['date' => '2016-06-05', 'anotherDate' => '05-06-2017']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['date' => '2016-06-32', 'anotherDate' => '05-06-2017']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['date']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['date' => '2016-06-32', 'anotherDate' => '32-06-2017']); + $expected = 2; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['date']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['anotherDate']; + $actual = $messages->offsetGet(1)->getMessage(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests detect valid dates + * + * @test + * @author Gustavo Verzola + * @since 2015-03-09 + */ + public function shouldDetectValidDates(UnitTester $I) + { + $dates = [ + ['2012-01-01', 'Y-m-d'], + ['2013-31-12', 'Y-d-m'], + ['01/01/2014', 'd/m/Y'], + ['12@12@2015', 'd@m@Y'], + ]; + + foreach ($dates as $item) { + $date = $item[0]; + $format = $item[1]; + $validation = new Validation(); + $validation->add('date', new Date(['format' => $format])); + + $messages = $validation->validate(['date' => $date]); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } + } + + /** + * Tests detect invalid dates + * + * @test + * @author Gustavo Verzola + * @since 2015-03-09 + */ + public function shouldDetectInvalidDates(UnitTester $I) + { + $dates = [ + ['', 'Y-m-d'], + [false, 'Y-m-d'], + [null, 'Y-m-d'], + [new \stdClass, 'Y-m-d'], + ['2015-13-01', 'Y-m-d'], + ['2015-01-32', 'Y-m-d'], + ['2015-01', 'Y-m-d'], + ['2015-01-01', 'd-m-Y'], + ]; + + foreach ($dates as $item) { + $date = $item[0]; + $format = $item[1]; + $validation = new Validation(); + $validation->add('date', new Date(['format' => $format])); + + $expected = Messages::__set_state( + [ + '_messages' => [ + Message::__set_state( + [ + '_type' => 'Date', + '_message' => 'Field date is not a valid date', + '_field' => 'date', + '_code' => '0', + ] + ) + ] + ] + ); + + $actual = $validation->validate(['date' => $date]); + $I->assertEquals($expected, $actual); + } + } +} diff --git a/tests/unit/Validation/Validator/DigitCest.php b/tests/unit/Validation/Validator/DigitCest.php new file mode 100644 index 00000000000..84167b54176 --- /dev/null +++ b/tests/unit/Validation/Validator/DigitCest.php @@ -0,0 +1,118 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Validation\Validator; + +use Phalcon\Messages\Message; +use Phalcon\Messages\Messages; +use Phalcon\Validation; +use Phalcon\Validation\Validator\Digit; +use UnitTester; + +class DigitCest +{ + /** + * Tests digit validator with single field + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testSingleField(UnitTester $I) + { + $validation = new Validation(); + $validation->add('amount', new Digit()); + + $messages = $validation->validate(['amount' => '123']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['amount' => '123abc']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests digit validator with multiple field + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testMultipleField(UnitTester $I) + { + $validation = new Validation(); + $validationMessages = [ + 'amount' => 'Amount must be digit.', + 'price' => 'Price must be digit.', + ]; + $validation->add( + ['amount', 'price'], + new Digit( + [ + 'message' => $validationMessages, + ] + ) + ); + + $messages = $validation->validate(['amount' => '123', 'price' => '123']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['amount' => '123abc', 'price' => '123']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['amount']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['amount' => '123abc', 'price' => '123abc']); + $expected = 2; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['amount']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['price']; + $actual = $messages->offsetGet(1)->getMessage(); + $I->assertEquals($expected, $actual); + } + + public function testShouldValidateIntOrStringOfDigits(UnitTester $I) + { + $examples = [ + '123', + 123, + PHP_INT_MAX, + 0xFFFFFF, + 100000, + -100000, + 0, + "0", + "00001233422003400", + ]; + + foreach ($examples as $digit) { + $validation = new Validation(); + $validation->add('amount', new Digit()); + + $messages = $validation->validate(['amount' => $digit]); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } + } +} diff --git a/tests/unit/Validation/Validator/EmailCest.php b/tests/unit/Validation/Validator/EmailCest.php new file mode 100644 index 00000000000..6ff927fdaf0 --- /dev/null +++ b/tests/unit/Validation/Validator/EmailCest.php @@ -0,0 +1,152 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Validation\Validator; + +use Phalcon\Messages\Message; +use Phalcon\Messages\Messages; +use Phalcon\Validation; +use Phalcon\Validation\Validator\Email; +use UnitTester; + +class EmailCest +{ + /** + * Tests email validator with single field + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testSingleField(UnitTester $I) + { + $validation = new Validation(); + + $validation->add('email', new Email()); + + $messages = $validation->validate(['email' => 'test@somemail.com']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['email' => 'rootlocalhost']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = Messages::__set_state( + [ + '_messages' => [ + 0 => Message::__set_state( + [ + '_type' => 'Email', + '_message' => 'Field email must be an email address', + '_field' => 'email', + '_code' => 0, + ] + ) + ] + ] + ); + $actual = $messages; + $I->assertEquals($expected, $actual); + } + + /** + * Tests email validator with multiple field + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testMultipleField(UnitTester $I) + { + $validation = new Validation(); + $validationMessages = [ + 'email' => 'Email must be correct email.', + 'anotherEmail' => 'AnotherEmail must be correct email.', + ]; + $validation->add( + [ + 'email', + 'anotherEmail', + ], + new Email( + [ + 'message' => $validationMessages, + ] + ) + ); + $messages = $validation->validate(['email' => 'test@somemail.com', 'anotherEmail' => 'test@somemail.com']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['email' => 'rootlocalhost', 'anotherEmail' => 'test@somemail.com']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['email']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['email' => 'rootlocalhost', 'anotherEmail' => 'rootlocalhost']); + $expected = 2; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['email']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['anotherEmail']; + $actual = $messages->offsetGet(1)->getMessage(); + $I->assertEquals($expected, $actual); + } + + public function testCustomMessage(UnitTester $I) + { + $validation = new Validation(); + + $validation->add( + 'email', + new Email( + [ + 'message' => 'The email is not valid' + ] + ) + ); + + $actual = $validation->validate([]); + $expected = Messages::__set_state( + [ + '_messages' => [ + 0 => Message::__set_state( + [ + '_type' => 'Email', + '_message' => 'The email is not valid', + '_field' => 'email', + '_code' => '0', + ] + ) + ] + ] + ); + $I->assertEquals($expected, $actual); + + $actual = $validation->validate(['email' => 'x=1']); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['email' => 'x.x@hotmail.com']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } +} diff --git a/tests/unit/Validation/Validator/ExclusionInCest.php b/tests/unit/Validation/Validator/ExclusionInCest.php new file mode 100644 index 00000000000..c7a3ce1613e --- /dev/null +++ b/tests/unit/Validation/Validator/ExclusionInCest.php @@ -0,0 +1,228 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Validation\Validator; + +use Phalcon\Messages\Message; +use Phalcon\Messages\Messages; +use Phalcon\Validation; +use Phalcon\Validation\Validator\ExclusionIn; +use UnitTester; + +class ExclusionInCest +{ + /** + * Tests exclusion in validator with single field + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testSingleField(UnitTester $I) + { + $validation = new Validation(); + + $validation->add( + 'status', + new ExclusionIn( + [ + 'domain' => ['A', 'I'] + ] + ) + ); + + $messages = $validation->validate(['status' => 'A']); + $expected = Messages::__set_state( + [ + '_messages' => [ + 0 => Message::__set_state( + [ + '_type' => 'ExclusionIn', + '_message' => 'Field status must not be a part of list: A, I', + '_field' => 'status', + '_code' => 0, + ] + ) + ] + ] + ); + $actual = $messages; + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['status' => 'A']); + $actual = $messages; + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['status' => 'X']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests exclusion in validator with multiple field and single domain + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testMultipleFieldSingleDomain(UnitTester $I) + { + $validation = new Validation(); + $validationMessages = [ + 'type' => 'Type cant be mechanic or cyborg.', + 'anotherType' => 'AnotherType cant by mechanic or cyborg.', + ]; + $validation->add( + [ + 'type', + 'anotherType', + ], + new ExclusionIn( + [ + 'domain' => ['mechanic', 'cyborg'], + 'message' => $validationMessages, + ] + ) + ); + $messages = $validation->validate(['type' => 'hydraulic', 'anotherType' => 'hydraulic']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['type' => 'cyborg', 'anotherType' => 'hydraulic']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['type']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['type' => 'cyborg', 'anotherType' => 'mechanic']); + $expected = 2; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['type']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['anotherType']; + $actual = $messages->offsetGet(1)->getMessage(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests exclusion in validator with multiple field and multiple domain + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testMultipleFieldMultipleDomain(UnitTester $I) + { + $validation = new Validation(); + $validationMessages = [ + 'type' => 'Type cant be mechanic or cyborg.', + 'anotherType' => 'AnotherType cant by mechanic or hydraulic.', + ]; + $validation->add( + [ + 'type', + 'anotherType', + ], + new ExclusionIn( + [ + 'domain' => [ + 'type' => ['mechanic', 'cyborg'], + 'anotherType' => ['mechanic', 'hydraulic'], + ], + 'message' => $validationMessages, + ] + ) + ); + $messages = $validation->validate(['type' => 'hydraulic', 'anotherType' => 'cyborg']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['type' => 'cyborg', 'anotherType' => 'cyborg']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['type']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['type' => 'hydraulic', 'anotherType' => 'mechanic']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['anotherType']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['type' => 'cyborg', 'anotherType' => 'mechanic']); + $expected = 2; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['type']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['anotherType']; + $actual = $messages->offsetGet(1)->getMessage(); + $I->assertEquals($expected, $actual); + } + + public function testCustomMessage(UnitTester $I) + { + $validation = new Validation(); + + $validation->add( + 'status', + new ExclusionIn( + [ + 'message' => 'The status must not be A=Active or I=Inactive', + 'domain' => ['A', 'I'] + ] + ) + ); + + $messages = $validation->validate(['status' => 'A']); + $expected = Messages::__set_state( + [ + '_messages' => [ + 0 => Message::__set_state( + [ + '_type' => 'ExclusionIn', + '_message' => 'The status must not be A=Active or I=Inactive', + '_field' => 'status', + '_code' => '0', + ] + ) + ] + ] + ); + $actual = $messages; + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['status' => 'A']); + $actual = $messages; + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['status' => 'X']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } +} diff --git a/tests/unit/Validation/Validator/IdenticalCest.php b/tests/unit/Validation/Validator/IdenticalCest.php new file mode 100644 index 00000000000..921611a83ee --- /dev/null +++ b/tests/unit/Validation/Validator/IdenticalCest.php @@ -0,0 +1,225 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Validation\Validator; + +use Phalcon\Messages\Message; +use Phalcon\Messages\Messages; +use Phalcon\Validation; +use Phalcon\Validation\Validator\Identical; +use UnitTester; + +class IdenticalCest +{ + /** + * Tests identical validator with single field + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testSingleField(UnitTester $I) + { + $validation = new Validation(); + + $validation->add( + 'name', + new Identical( + [ + 'accepted' => 'SomeValue', + ] + ) + ); + + $messages = $validation->validate(['name' => 'SomeValue']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => 'SomeValue123']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = Messages::__set_state( + [ + '_messages' => [ + 0 => Message::__set_state( + [ + '_type' => 'Identical', + '_message' => 'Field name does not have the expected value', + '_field' => 'name', + '_code' => '0', + ] + ) + ] + ] + ); + $actual = $messages; + $I->assertEquals($expected, $actual); + } + + /** + * Tests identical validator with multiple field and single accepted + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testMultipleFieldSingleAccepted(UnitTester $I) + { + $validation = new Validation(); + $validationMessages = [ + 'name' => 'Name must be SomeValue.', + 'anotherName' => 'AnotherName must be SomeValue.', + ]; + $validation->add( + [ + 'name', + 'anotherName', + ], + new Identical( + [ + 'accepted' => 'SomeValue', + 'message' => $validationMessages, + ] + ) + ); + $messages = $validation->validate(['name' => 'SomeValue', 'anotherName' => 'SomeValue']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => 'SomeValue123', 'anotherName' => 'SomeValue']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['name']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => 'SomeValue123', 'anotherName' => 'SomeValue123']); + $expected = 2; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['name']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['anotherName']; + $actual = $messages->offsetGet(1)->getMessage(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests identical validator with multiple field and multiple accepted + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testMultipleFieldMultipleAccepted(UnitTester $I) + { + $validation = new Validation(); + $validationMessages = [ + 'name' => 'Name must be SomeValue.', + 'anotherName' => 'AnotherName must be SomeAnotherValue.', + ]; + $validation->add( + [ + 'name', + 'anotherName', + ], + new Identical( + [ + 'accepted' => [ + 'name' => 'SomeValue', + 'anotherName' => 'SomeAnotherValue', + ], + 'message' => $validationMessages, + ] + ) + ); + + $messages = $validation->validate(['name' => 'SomeValue', 'anotherName' => 'SomeAnotherValue']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => 'SomeValue123', 'anotherName' => 'SomeAnotherValue']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['name']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => 'SomeValue', 'anotherName' => 'SomeAnotherValue123']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['anotherName']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => 'SomeValue123', 'anotherName' => 'SomeAnotherValue123']); + $expected = 2; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['name']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['anotherName']; + $actual = $messages->offsetGet(1)->getMessage(); + $I->assertEquals($expected, $actual); + } + + public function testCustomMessage(UnitTester $I) + { + $validation = new Validation(); + + $validation->add( + 'name', + new Validation\Validator\Identical( + [ + 'accepted' => 'Peter', + 'message' => 'The name must be peter', + ] + ) + ); + + $messages = $validation->validate([]); + $expected = Messages::__set_state( + [ + '_messages' => [ + 0 => Message::__set_state( + [ + '_type' => 'Identical', + '_message' => 'The name must be peter', + '_field' => 'name', + '_code' => '0', + ] + ) + ] + ] + ); + $actual = $messages; + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => 'Peter']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } +} diff --git a/tests/unit/Validation/Validator/InclusionInCest.php b/tests/unit/Validation/Validator/InclusionInCest.php new file mode 100644 index 00000000000..6fc668c4edc --- /dev/null +++ b/tests/unit/Validation/Validator/InclusionInCest.php @@ -0,0 +1,229 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Validation\Validator; + +use Phalcon\Messages\Message; +use Phalcon\Messages\Messages; +use Phalcon\Validation; +use Phalcon\Validation\Validator\InclusionIn; +use UnitTester; + +class InclusionInCest +{ + /** + * Tests inclusion in validator with single field + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testSingleField(UnitTester $I) + { + $validation = new Validation(); + + $validation->add( + 'status', + new InclusionIn( + [ + 'domain' => ['A', 'I'] + ] + ) + ); + + $messages = $validation->validate([]); + $expected = Messages::__set_state( + [ + '_messages' => [ + 0 => Message::__set_state( + [ + '_type' => 'InclusionIn', + '_message' => 'Field status must be a part of list: A, I', + '_field' => 'status', + '_code' => 0, + ] + ) + ] + ] + ); + $actual = $messages; + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['status' => 'X']); + $actual = $messages; + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['status' => 'A']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests inclusion in validator with single multiple field and single domain + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testMultipleFieldSingleDomain(UnitTester $I) + { + $validation = new Validation(); + $validationMessages = [ + 'type' => 'Type must be mechanical or cyborg.', + 'anotherType' => 'AnotherType must be mechanical or cyborg.', + ]; + $validation->add( + [ + 'type', + 'anotherType', + ], + new InclusionIn( + [ + 'domain' => ['mechanical', 'cyborg'], + 'message' => $validationMessages, + ] + ) + ); + $messages = $validation->validate(['type' => 'cyborg', 'anotherType' => 'cyborg']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['type' => 'hydraulic', 'anotherType' => 'cyborg']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['type']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['type' => 'hydraulic', 'anotherType' => 'hydraulic']); + $expected = 2; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['type']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['anotherType']; + $actual = $messages->offsetGet(1)->getMessage(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests inclusion in validator with single multiple field and domain + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testMultipleFieldMultipleDomain(UnitTester $I) + { + $validation = new Validation(); + $validationMessages = [ + 'type' => 'Type must be mechanic or cyborg.', + 'anotherType' => 'AnotherType must be mechanic or hydraulic.', + ]; + $validation->add( + [ + 'type', + 'anotherType', + ], + new InclusionIn( + [ + 'domain' => [ + 'type' => ['cyborg', 'mechanic'], + 'anotherType' => ['mechanic', 'hydraulic'], + ], + 'message' => $validationMessages, + ] + ) + ); + + $messages = $validation->validate(['type' => 'cyborg', 'anotherType' => 'mechanic']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['type' => 'hydraulic', 'anotherType' => 'mechanic']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['type']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['type' => 'mechanic', 'anotherType' => 'cyborg']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['anotherType']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['type' => 'hydraulic', 'anotherType' => 'cyborg']); + $expected = 2; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['type']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['anotherType']; + $actual = $messages->offsetGet(1)->getMessage(); + $I->assertEquals($expected, $actual); + } + + public function testCustomMessage(UnitTester $I) + { + $validation = new Validation(); + + $validation->add( + 'status', + new InclusionIn( + [ + 'message' => 'The status must be A=Active or I=Inactive', + 'domain' => ['A', 'I'] + ] + ) + ); + + $messages = $validation->validate([]); + $expected = Messages::__set_state( + [ + '_messages' => [ + 0 => Message::__set_state( + [ + '_type' => 'InclusionIn', + '_message' => 'The status must be A=Active or I=Inactive', + '_field' => 'status', + '_code' => '0', + ] + ) + ] + ] + ); + $actual = $messages; + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['status' => 'x=1']); + $actual = $messages; + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['status' => 'A']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } +} diff --git a/tests/unit/Validation/Validator/NumericalityCest.php b/tests/unit/Validation/Validator/NumericalityCest.php new file mode 100644 index 00000000000..8e770dffc44 --- /dev/null +++ b/tests/unit/Validation/Validator/NumericalityCest.php @@ -0,0 +1,165 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Validation\Validator; + +use Phalcon\Messages\Message; +use Phalcon\Messages\Messages; +use Phalcon\Validation; +use Phalcon\Validation\Validator\Numericality; +use UnitTester; + +class NumericalityCest +{ + /** + * Tests numericality validator with single field + * + * @author Wojciech Ślawski + * @author Andrey Izman + * @since 2016-06-05 + */ + public function testSingleField(UnitTester $I) + { + $validation = new Validation(); + $validation->add('amount', new Numericality()); + $messages = $validation->validate(['amount' => 123]); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['amount' => 123.12]); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['amount' => '123abc']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['amount' => '123.12e3']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests numericality validator with multiple field + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testMultipleField(UnitTester $I) + { + $validation = new Validation(); + $validationMessages = [ + 'amount' => 'Amount must be digit.', + 'price' => 'Price must be digit.', + ]; + $validation->add( + [ + 'amount', + 'price', + ], + new Numericality( + [ + 'message' => $validationMessages, + ] + ) + ); + $messages = $validation->validate(['amount'=>123, 'price' => 123]); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['amount'=>'123abc', 'price' => 123]); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['amount']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['amount'=>'123abc', 'price' => '123abc']); + $expected = 2; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['amount']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['price']; + $actual = $messages->offsetGet(1)->getMessage(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests numericality validator for custom locales + * + * @link https://github.com/phalcon/cphalcon/issues/13450 + * + * @author Andrey Izman + * @since 2018-08-08 + */ + public function testLocales(UnitTester $I) + { + $validation = new Validation(); + $validation->add('amount', new Numericality()); + + // get default locale + $locale = setlocale(LC_ALL, 0); + $this->setTestLocale('en_US.UTF8'); + + $messages = $validation->validate(['amount' => 123.12]); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['amount' => '123.12']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['amount' => '123,12']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $this->setTestLocale('fr_FR.UTF8'); + + $messages = $validation->validate(['amount' => 123.12]); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + // revert back locale + $this->setTestLocale($locale); + } + + /** + * Set locale + * + * @param string $locale + * @return string + * + * @author Andrey Izman + * @since 2018-08-08 + */ + protected function setTestLocale($locale) + { + putenv('LC_ALL=' . $locale); + putenv('LANG=' . $locale); + putenv('LANGUAGE=' . $locale); + return setlocale(LC_ALL, $locale); + } +} diff --git a/tests/unit/Validation/Validator/PresenceOfCest.php b/tests/unit/Validation/Validator/PresenceOfCest.php new file mode 100644 index 00000000000..5127b24d755 --- /dev/null +++ b/tests/unit/Validation/Validator/PresenceOfCest.php @@ -0,0 +1,235 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Validation\Validator; + +use Phalcon\Messages\Message; +use Phalcon\Messages\Messages; +use Phalcon\Validation; +use Phalcon\Validation\Validator\PresenceOf; +use UnitTester; + +class PresenceOfCest +{ + /** + * Tests presence of validator with single field + * + * @test + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function shouldValidateSingleField(UnitTester $I) + { + $validation = new Validation(); + $validation->add('name', new PresenceOf()); + + $messages = $validation->validate(['name' => 'SomeValue']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => '']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests presence of validator with multiple field + * + * @test + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function shouldValidateMultipleField(UnitTester $I) + { + $validation = new Validation(); + $validationMessages = [ + 'name' => 'Name cant be empty.', + 'type' => 'Type cant be empty.', + ]; + $validation->add( + ['name', 'type'], + new PresenceOf( + [ + 'message' => $validationMessages, + ] + ) + ); + + $messages = $validation->validate(['name' => 'SomeValue', 'type' => 'SomeValue']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => '', 'type' => 'SomeValue']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['name']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = Messages::__set_state( + [ + '_messages' => [ + Message::__set_state( + [ + '_type' => 'PresenceOf', + '_message' => 'Name cant be empty.', + '_field' => 'name', + '_code' => '0', + ] + ) + ], + ] + ); + $actual = $messages; + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => '', 'type' => '']); + $expected = 2; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['name']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['type']; + $actual = $messages->offsetGet(1)->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = Messages::__set_state( + [ + '_messages' => [ + Message::__set_state( + [ + '_type' => 'PresenceOf', + '_message' => 'Name cant be empty.', + '_field' => 'name', + '_code' => '0', + ] + ), + Message::__set_state( + [ + '_type' => 'PresenceOf', + '_message' => 'Type cant be empty.', + '_field' => 'type', + '_code' => '0', + ] + ) + ], + ] + ); + $actual = $messages; + $I->assertEquals($expected, $actual); + } + + /** + * Tests mixed fields + * + * @test + * @author Andres Gutierrez + * @since 2013-03-01 + */ + public function shouldValidateMixedFields(UnitTester $I) + { + $validation = new Validation(); + + $validation + ->add('name', new PresenceOf(['message' => 'The name is required'])) + ->add('email', new PresenceOf(['message' => 'The email is required'])) + ->add('login', new PresenceOf(['message' => 'The login is required'])); + + $actual = $validation->validate([]); + + $expected = Messages::__set_state( + [ + '_messages' => [ + Message::__set_state( + [ + '_type' => 'PresenceOf', + '_message' => 'The name is required', + '_field' => 'name', + '_code' => '0', + ] + ), + Message::__set_state( + [ + '_type' => 'PresenceOf', + '_message' => 'The email is required', + '_field' => 'email', + '_code' => '0', + ] + ), + Message::__set_state( + [ + '_type' => 'PresenceOf', + '_message' => 'The login is required', + '_field' => 'login', + '_code' => '0', + ] + ), + ], + ] + ); + + $I->assertEquals($expected, $actual); + } + + /** + * Tests cancel validation on first fail + * + * @test + * @author Andres Gutierrez + * @since 2013-03-01 + */ + public function shouldCancelOnFail(UnitTester $I) + { + $validation = new Validation(); + + $validation + ->add('name', new PresenceOf(['message' => 'The name is required'])) + ->add('email', new PresenceOf([ + 'message' => 'The email is required', + 'cancelOnFail' => true + ])) + ->add('login', new PresenceOf(['message' => 'The login is required'])); + + $actual = $validation->validate([]); + + $expected = Messages::__set_state( + [ + '_messages' => [ + Message::__set_state( + [ + '_type' => 'PresenceOf', + '_message' => 'The name is required', + '_field' => 'name', + '_code' => '0', + ] + ), + Message::__set_state( + [ + '_type' => 'PresenceOf', + '_message' => 'The email is required', + '_field' => 'email', + '_code' => '0', + ] + ) + ], + ] + ); + $I->assertEquals($expected, $actual); + } +} diff --git a/tests/unit/Validation/Validator/RegexCest.php b/tests/unit/Validation/Validator/RegexCest.php new file mode 100644 index 00000000000..c52024f949f --- /dev/null +++ b/tests/unit/Validation/Validator/RegexCest.php @@ -0,0 +1,220 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Validation\Validator; + +use Phalcon\Messages\Message; +use Phalcon\Messages\Messages; +use Phalcon\Validation; +use Phalcon\Validation\Validator\Regex; +use UnitTester; + +class RegexCest +{ + /** + * Tests regex validator with single field + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testSingleField(UnitTester $I) + { + $validation = new Validation(); + + $validation->add( + 'car_plate', + new Regex( + [ + 'pattern' => '/[A-Z]{3}\-[0-9]{3}/' + ] + ) + ); + + $messages = $validation->validate([]); + $expected = Messages::__set_state( + [ + '_messages' => [ + 0 => Message::__set_state( + [ + '_type' => 'Regex', + '_message' => 'Field car_plate does not match the required format', + '_field' => 'car_plate', + '_code' => '0', + ] + ) + ] + ] + ); + $actual = $messages; + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['car_plate' => 'XYZ-123']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests regex validator with multiple field and single pattern + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testMultipleFieldSinglePattern(UnitTester $I) + { + $validation = new Validation(); + $validationMessages = [ + 'name' => 'Name can be only lowercase letters.', + 'type' => 'Type can be only lowercase letters.', + ]; + $validation->add( + [ + 'name', + 'type', + ], + new Regex( + [ + 'pattern' => '/^[a-z]+$/', + 'message' => $validationMessages, + ] + ) + ); + $messages = $validation->validate(['name' => 'somevalue', 'type' => 'somevalue']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => 'SomeValue', 'type' => 'somevalue']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['name']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => 'SomeValue', 'type' => 'SomeValue']); + $expected = 2; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['name']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['type']; + $actual = $messages->offsetGet(1)->getMessage(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests regex validator with multiple field and pattern + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testMultipleFieldMultiplePattern(UnitTester $I) + { + $validation = new Validation(); + $validationMessages = [ + 'name' => 'Name can be only lowercase letters.', + 'type' => 'Type can be only uppercase letters.', + ]; + $validation->add( + [ + 'name', + 'type', + ], + new Regex( + [ + 'pattern' => [ + 'name' => '/^[a-z]+$/', + 'type' => '/^[A-Z]+$/', + ], + 'message' => $validationMessages, + ] + ) + ); + $messages = $validation->validate(['name' => 'somevalue', 'type' => 'SOMEVALUE']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => 'SomeValue', 'type' => 'SOMEVALUE']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['name']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => 'somevalue', 'type' => 'somevalue']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['type']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => 'SomeValue', 'type' => 'SomeValue']); + $expected = 2; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['name']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['type']; + $actual = $messages->offsetGet(1)->getMessage(); + $I->assertEquals($expected, $actual); + } + + public function testCustomMessage(UnitTester $I) + { + $validation = new Validation(); + + $validation->add( + 'car_plate', + new Validation\Validator\Regex( + [ + 'pattern' => '/[A-Z]{3}\-[0-9]{3}/', + 'message' => 'The car plate is not valid' + ] + ) + ); + + $messages = $validation->validate([]); + $expected = Messages::__set_state( + [ + '_messages' => [ + 0 => Message::__set_state( + [ + '_type' => 'Regex', + '_message' => 'The car plate is not valid', + '_field' => 'car_plate', + '_code' => '0', + ] + ) + ] + ] + ); + $actual = $messages; + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['car_plate' => 'XYZ-123']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } +} diff --git a/tests/unit/Validation/Validator/StringLengthCest.php b/tests/unit/Validation/Validator/StringLengthCest.php new file mode 100644 index 00000000000..f1993780f25 --- /dev/null +++ b/tests/unit/Validation/Validator/StringLengthCest.php @@ -0,0 +1,343 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Validation\Validator; + +use Phalcon\Messages\Message; +use Phalcon\Messages\Messages; +use Phalcon\Validation; +use Phalcon\Validation\Validator\StringLength; +use UnitTester; + +class StringLengthCest +{ + /** + * Tests string length validator with single field + * + * @test + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function shouldValidateSingleField(UnitTester $I) + { + $validation = new Validation(); + $validation->add( + 'name', + new StringLength( + [ + 'min' => 3, + 'max' => 9, + ] + ) + ); + + $messages = $validation->validate(['name' => 'SomeValue']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => 'SomeValue123']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests too short string length + * + * @test + * @author Andres Gutierrez + * @since 2013-03-09 + */ + public function shouldValidateStringLengthMinimum(UnitTester $I) + { + $validation = new Validation(); + $validation->add('name', new StringLength(['min' => 3])); + + $messages = $validation->validate(['name' => 'Something']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = Messages::__set_state( + [ + '_messages' => [ + Message::__set_state( + [ + '_type' => 'TooShort', + '_message' => 'Field name must be at least 3 characters long', + '_field' => 'name', + '_code' => '0', + ] + ) + ] + ] + ); + + $messages = $validation->validate(['name' => 'So']); + $actual = $messages; + $I->assertEquals($expected, $actual); + } + + /** + * Tests too short string length with custom message + * + * @test + * @author Andres Gutierrez + * @since 2013-03-09 + */ + public function shouldValidateStringLengthMinimumWithCustomMessage(UnitTester $I) + { + $validation = new Validation(); + $validation->add( + 'message', + new StringLength(['min' => 3, 'messageMinimum' => 'The message is too short']) + ); + + $messages = $validation->validate(['message' => 'Something']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = Messages::__set_state( + [ + '_messages' => [ + Message::__set_state( + [ + '_type' => 'TooShort', + '_message' => 'The message is too short', + '_field' => 'message', + '_code' => '0', + ] + ) + ] + ] + ); + + $messages = $validation->validate(['message' => 'So']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests too long string length + * + * @test + * @author Andres Gutierrez + * @since 2013-03-09 + */ + public function shouldValidateStringLengthMaximum(UnitTester $I) + { + $validation = new Validation(); + $validation->add('name', new StringLength(['max' => 4])); + + $messages = $validation->validate(['name' => 'John']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = Messages::__set_state( + [ + '_messages' => [ + Message::__set_state( + [ + '_type' => 'TooLong', + '_message' => 'Field name must not exceed 4 characters long', + '_field' => 'name', + '_code' => '0', + ] + ) + ] + ] + ); + + $messages = $validation->validate(['name' => 'Johannes']); + $actual = $messages; + $I->assertEquals($expected, $actual); + } + + /** + * Tests too long string length with custom message + * + * @test + * @author Andres Gutierrez + * @since 2013-03-09 + */ + public function shouldValidateStringLengthMaximumWithCustomMessage(UnitTester $I) + { + $validation = new Validation(); + $validation->add( + 'message', + new StringLength(['max' => 4, 'messageMaximum' => 'The message is too long']) + ); + + $messages = $validation->validate(['message' => 'Pet']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = Messages::__set_state( + [ + '_messages' => [ + Message::__set_state( + [ + '_type' => 'TooLong', + '_message' => 'The message is too long', + '_field' => 'message', + '_code' => '0', + ] + ) + ] + ] + ); + + $messages = $validation->validate(['message' => 'Validation']); + $actual = $messages; + $I->assertEquals($expected, $actual); + } + + /** + * Tests string length validator with multiple field and single min, max + * + * @test + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function shouldValidateMultipleFieldSingleMinMax(UnitTester $I) + { + $validation = new Validation(); + $validationMinimumMessages = [ + 'name' => 'Name length must be minimum 0.', + 'type' => 'Type length must be minimum 0.', + ]; + $validationMaximumMessages = [ + 'name' => 'Name length must be maximum 9.', + 'type' => 'Type length must be maximum 9.', + ]; + $validation->add( + [ + 'name', + 'type', + ], + new StringLength( + [ + 'min' => 0, + 'max' => 9, + 'messageMinimum' => $validationMinimumMessages, + 'messageMaximum' => $validationMaximumMessages + ] + ) + ); + + $messages = $validation->validate(['name' => 'SomeValue', 'type' => 'SomeValue']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => 'SomeValue123', 'type' => 'SomeValue']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMaximumMessages['name']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => 'SomeValue123', 'type' => 'SomeValue123']); + $expected = 2; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMaximumMessages['name']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = $validationMaximumMessages['type']; + $actual = $messages->offsetGet(1)->getMessage(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests string length validator with multiple field and min, max + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testMultipleFieldMultipleMinMax(UnitTester $I) + { + $validation = new Validation(); + $validationMinimumMessages = [ + 'name' => 'Name length must be minimum 0.', + 'type' => 'Type length must be minimum 0.', + ]; + $validationMaximumMessages = [ + 'name' => 'Name length must be maximum 9.', + 'type' => 'Type length must be maximum 4.', + ]; + $validation->add( + [ + 'name', + 'type', + ], + new StringLength( + [ + 'min' => [ + 'name' => 0, + 'type' => 0, + ], + 'max' => [ + 'name' => 9, + 'type' => 4, + ], + 'messageMinimum' => $validationMinimumMessages, + 'messageMaximum' => $validationMaximumMessages + ] + ) + ); + + $messages = $validation->validate(['name' => 'SomeValue', 'type' => 'Some']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => 'SomeValue123', 'type' => 'Some']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMaximumMessages['name']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => 'SomeValue', 'type' => 'SomeValue']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMaximumMessages['type']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['name' => 'SomeValue123', 'type' => 'SomeValue']); + $expected = 2; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMaximumMessages['name']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = $validationMaximumMessages['type']; + $actual = $messages->offsetGet(1)->getMessage(); + $I->assertEquals($expected, $actual); + } +} diff --git a/tests/unit/Validation/Validator/UrlCest.php b/tests/unit/Validation/Validator/UrlCest.php new file mode 100644 index 00000000000..54e70d56915 --- /dev/null +++ b/tests/unit/Validation/Validator/UrlCest.php @@ -0,0 +1,155 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Validation\Validator; + +use Phalcon\Messages\Message; +use Phalcon\Messages\Messages; +use Phalcon\Validation; +use Phalcon\Validation\Validator\Url; +use UnitTester; + +class UrlCest +{ + /** + * Tests url validator with single field + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testSingleField(UnitTester $I) + { + $validation = new Validation(); + $validation->add('url', new Url()); + + $messages = $validation->validate([]); + $expected = Messages::__set_state( + [ + '_messages' => [ + 0 => Message::__set_state( + [ + '_type' => 'Url', + '_message' => 'Field url must be a url', + '_field' => 'url', + '_code' => 0, + ] + ) + ] + ] + ); + + $actual = $messages; + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['url' => 'x=1']); + $actual = $messages; + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['url' => 'http://phalconphp.com']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } + + /** + * Tests url validator with multiple field + * + * @author Wojciech Ślawski + * @since 2016-06-05 + */ + public function testMultipleField(UnitTester $I) + { + $validation = new Validation(); + $validationMessages = [ + 'url' => 'Url must be correct url.', + 'anotherUrl' => 'AnotherUrl must be correct url.', + ]; + $validation->add( + [ + 'url', + 'anotherUrl', + ], + new Url( + [ + 'message' => $validationMessages, + ] + ) + ); + $messages = $validation->validate(['url' => 'http://google.com', 'anotherUrl' => 'http://google.com']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['url' => '://google.', 'anotherUrl' => 'http://google.com']); + $expected = 1; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['url']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['url' => '://google.', 'anotherUrl' => '://google.']); + $expected = 2; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['url']; + $actual = $messages->offsetGet(0)->getMessage(); + $I->assertEquals($expected, $actual); + + $expected = $validationMessages['anotherUrl']; + $actual = $messages->offsetGet(1)->getMessage(); + $I->assertEquals($expected, $actual); + } + + public function testCustomMessage(UnitTester $I) + { + $validation = new Validation(); + + $validation->add( + 'url', + new Url( + [ + 'message' => 'The url is not valid' + ] + ) + ); + + $messages = $validation->validate([]); + $expected = Messages::__set_state( + [ + '_messages' => [ + 0 => Message::__set_state( + [ + '_type' => 'Url', + '_message' => 'The url is not valid', + '_field' => 'url', + '_code' => '0', + ] + ) + ] + ] + ); + + $actual = $messages; + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['url' => 'x=1']); + $actual = $messages; + $I->assertEquals($expected, $actual); + + $messages = $validation->validate(['url' => 'http://phalconphp.com']); + $expected = 0; + $actual = $messages->count(); + $I->assertEquals($expected, $actual); + } +} From 18233e718a007d106fa250c712cb04e90bc179b6 Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Mon, 5 Nov 2018 17:58:54 -0500 Subject: [PATCH 015/222] [#13578] - PHPCS fixes --- tests/unit/Validation/Validator/CreditCardCest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/unit/Validation/Validator/CreditCardCest.php b/tests/unit/Validation/Validator/CreditCardCest.php index d85ff0d8702..3074a0f8522 100644 --- a/tests/unit/Validation/Validator/CreditCardCest.php +++ b/tests/unit/Validation/Validator/CreditCardCest.php @@ -179,4 +179,3 @@ public function shouldDetectInvalidCreditCard(UnitTester $I) } } } - From db780d7b99e55aae216bb294cd9dc28f9650814a Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Mon, 5 Nov 2018 19:14:42 -0500 Subject: [PATCH 016/222] [#13578] - Refactored Text tests --- _toCheck/tests/unit/Text/TextCamelizeTest.php | 66 ------ _toCheck/tests/unit/Text/TextConcatTest.php | 51 ----- _toCheck/tests/unit/Text/TextDynamicTest.php | 100 --------- _toCheck/tests/unit/Text/TextEndsWithTest.php | 129 ------------ _toCheck/tests/unit/Text/TextHumanizeTest.php | 45 ----- .../tests/unit/Text/TextIncrementTest.php | 140 ------------- _toCheck/tests/unit/Text/TextRandomTest.php | 191 ------------------ .../tests/unit/Text/TextReduceSlashesTest.php | 45 ----- .../tests/unit/Text/TextStartsWithTest.php | 129 ------------ .../tests/unit/Text/TextUncamelizeTest.php | 64 ------ .../tests/unit/Text/TextUnderscoreTest.php | 45 ----- .../tests/unit/Text/TextUpperLowerTest.php | 106 ---------- .../unit/Tag/TagCheckFieldTest.php | 0 .../unit/Tag/TagColorFieldTest.php | 0 .../unit/Tag/TagDateFieldTest.php | 0 .../unit/Tag/TagDateTimeFieldTest.php | 0 .../unit/Tag/TagDateTimeLocalFieldTest.php | 0 .../unit/Tag/TagDoctypeTest.php | 0 .../unit/Tag/TagEmailFieldTest.php | 0 .../unit/Tag/TagFileFieldTest.php | 0 .../unit/Tag/TagFriendlyTitleTest.php | 0 .../unit/Tag/TagHiddenFieldTest.php | 0 .../unit/Tag/TagImageInputTest.php | 0 .../tests => tests}/unit/Tag/TagImageTest.php | 0 .../unit/Tag/TagJavascriptIncludeTest.php | 0 .../unit/Tag/TagLinkToTest.php | 0 .../unit/Tag/TagMonthFieldTest.php | 0 .../unit/Tag/TagNumericFieldTest.php | 0 .../unit/Tag/TagPasswordFieldTest.php | 0 .../unit/Tag/TagRadioFieldTest.php | 0 .../unit/Tag/TagRangeFieldTest.php | 0 .../unit/Tag/TagResetInputTest.php | 0 .../unit/Tag/TagSearchFieldTest.php | 0 .../unit/Tag/TagSelectStaticTest.php | 0 .../unit/Tag/TagSetDefaultTest.php | 0 .../unit/Tag/TagStylesheetlinkTest.php | 0 .../unit/Tag/TagSubmitButtonTest.php | 0 .../unit/Tag/TagTagHtmlTest.php | 0 .../unit/Tag/TagTelFieldTest.php | 0 .../unit/Tag/TagTextAreaTest.php | 0 .../unit/Tag/TagTextFieldTest.php | 0 .../unit/Tag/TagTimeFieldTest.php | 0 .../tests => tests}/unit/Tag/TagTitleTest.php | 0 .../unit/Tag/TagUrlFieldTest.php | 0 .../unit/Tag/TagWeekFieldTest.php | 0 tests/unit/Text/TextCamelizeCest.php | 58 ++++++ tests/unit/Text/TextConcatCest.php | 37 ++++ tests/unit/Text/TextDynamicCest.php | 89 ++++++++ tests/unit/Text/TextEndsWithCest.php | 96 +++++++++ tests/unit/Text/TextHumanizeCest.php | 43 ++++ tests/unit/Text/TextIncrementCest.php | 102 ++++++++++ tests/unit/Text/TextRandomCest.php | 182 +++++++++++++++++ tests/unit/Text/TextReduceSlashesCest.php | 43 ++++ tests/unit/Text/TextStartsWithCest.php | 96 +++++++++ tests/unit/Text/TextUncamelizeCest.php | 56 +++++ tests/unit/Text/TextUnderscoreCest.php | 43 ++++ tests/unit/Text/TextUpperLowerCest.php | 129 ++++++++++++ 57 files changed, 974 insertions(+), 1111 deletions(-) delete mode 100644 _toCheck/tests/unit/Text/TextCamelizeTest.php delete mode 100644 _toCheck/tests/unit/Text/TextConcatTest.php delete mode 100644 _toCheck/tests/unit/Text/TextDynamicTest.php delete mode 100644 _toCheck/tests/unit/Text/TextEndsWithTest.php delete mode 100644 _toCheck/tests/unit/Text/TextHumanizeTest.php delete mode 100644 _toCheck/tests/unit/Text/TextIncrementTest.php delete mode 100644 _toCheck/tests/unit/Text/TextRandomTest.php delete mode 100644 _toCheck/tests/unit/Text/TextReduceSlashesTest.php delete mode 100644 _toCheck/tests/unit/Text/TextStartsWithTest.php delete mode 100644 _toCheck/tests/unit/Text/TextUncamelizeTest.php delete mode 100644 _toCheck/tests/unit/Text/TextUnderscoreTest.php delete mode 100644 _toCheck/tests/unit/Text/TextUpperLowerTest.php rename {_toCheck/tests => tests}/unit/Tag/TagCheckFieldTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagColorFieldTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagDateFieldTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagDateTimeFieldTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagDateTimeLocalFieldTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagDoctypeTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagEmailFieldTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagFileFieldTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagFriendlyTitleTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagHiddenFieldTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagImageInputTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagImageTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagJavascriptIncludeTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagLinkToTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagMonthFieldTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagNumericFieldTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagPasswordFieldTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagRadioFieldTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagRangeFieldTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagResetInputTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagSearchFieldTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagSelectStaticTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagSetDefaultTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagStylesheetlinkTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagSubmitButtonTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagTagHtmlTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagTelFieldTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagTextAreaTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagTextFieldTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagTimeFieldTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagTitleTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagUrlFieldTest.php (100%) rename {_toCheck/tests => tests}/unit/Tag/TagWeekFieldTest.php (100%) create mode 100644 tests/unit/Text/TextCamelizeCest.php create mode 100644 tests/unit/Text/TextConcatCest.php create mode 100644 tests/unit/Text/TextDynamicCest.php create mode 100644 tests/unit/Text/TextEndsWithCest.php create mode 100644 tests/unit/Text/TextHumanizeCest.php create mode 100644 tests/unit/Text/TextIncrementCest.php create mode 100644 tests/unit/Text/TextRandomCest.php create mode 100644 tests/unit/Text/TextReduceSlashesCest.php create mode 100644 tests/unit/Text/TextStartsWithCest.php create mode 100644 tests/unit/Text/TextUncamelizeCest.php create mode 100644 tests/unit/Text/TextUnderscoreCest.php create mode 100644 tests/unit/Text/TextUpperLowerCest.php diff --git a/_toCheck/tests/unit/Text/TextCamelizeTest.php b/_toCheck/tests/unit/Text/TextCamelizeTest.php deleted file mode 100644 index ff9ece4c947..00000000000 --- a/_toCheck/tests/unit/Text/TextCamelizeTest.php +++ /dev/null @@ -1,66 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class TextCamelizeTest extends UnitTest -{ - /** - * Tests the camelize function - * - * @author Nikolaos Dimopoulos - * @since 2014-09-29 - */ - public function testTextCamelizeString() - { - $this->specify( - 'Text::camelize conversions do not return the correct string', - function ($actual, $expected, $delimiter) { - expect(Text::camelize($actual, $delimiter))->equals($expected); - }, - [ - 'examples' => [ - ['camelize', 'Camelize', null], - ['CameLiZe', 'Camelize', null], - ['cAmeLize', 'Camelize', null], - ['123camelize', '123camelize', null], - ['c_a_m_e_l_i_z_e', 'CAMELIZE', null], - ['Camelize', 'Camelize', null], - ['camel_ize', 'CamelIze', null], - ['CameLize', 'Camelize', null], - ["c_a-m_e-l_i-z_e", 'CAMELIZE', null], - ["came_li_ze", 'CameLiZe', null], - ["=_camelize", '=Camelize', "_" ], - ["camelize", 'Camelize', "_" ], - ["came_li_ze", 'CameLiZe', "_" ], - ["came#li#ze", 'CameLiZe', "#" ], - ["came li ze", 'CameLiZe', " " ], - ["came.li^ze", 'CameLiZe', ".^"], - ["c_a-m_e-l_i-z_e", 'CAMELIZE', "-_"], - ["came.li.ze", 'CameLiZe', "." ], - ["came-li-ze", 'CameLiZe', "-" ], - ["c+a+m+e+l+i+z+e", 'CAMELIZE', "+" ], - ] - ] - ); - } -} diff --git a/_toCheck/tests/unit/Text/TextConcatTest.php b/_toCheck/tests/unit/Text/TextConcatTest.php deleted file mode 100644 index 5e68b3b0252..00000000000 --- a/_toCheck/tests/unit/Text/TextConcatTest.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class TextConcatTest extends UnitTest -{ - /** - * Tests the concat function - * - * @author Stanislav Kiryukhin - * @since 2015-05-06 - */ - public function testTextConcatString() - { - $this->specify( - "concat do not return the correct string", - function () { - - // Test 1 - $actual = Text::concat('/', '/tmp/', '/folder_1/', '/folder_2', 'folder_3/'); - $expected = '/tmp/folder_1/folder_2/folder_3/'; - expect($actual)->equals($expected); - - // Test 2 - $actual = Text::concat('.', '@test.', '.test2.', '.test', '.34'); - $expected = '@test.test2.test.34'; - expect($actual)->equals($expected); - } - ); - } -} diff --git a/_toCheck/tests/unit/Text/TextDynamicTest.php b/_toCheck/tests/unit/Text/TextDynamicTest.php deleted file mode 100644 index a6bee0db4c0..00000000000 --- a/_toCheck/tests/unit/Text/TextDynamicTest.php +++ /dev/null @@ -1,100 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class TextDynamicTest extends UnitTest -{ - /** - * Tests the dynamic function - * - * @author Stanislav Kiryukhin - * @since 2015-07-01 - */ - public function testTextDynamicString() - { - $this->specify( - "dynamic do not return the correct string", - function () { - $actual = Text::dynamic('{Hi|Hello}, my name is a Bob!'); - expect($actual)->notContains('{'); - expect($actual)->notContains('}'); - - expect(preg_match('/^(Hi|Hello), my name is a Bob!$/', $actual))->equals(1); - } - ); - } - - /** - * Tests the dynamic function - * - * @author Stanislav Kiryukhin - * @since 2015-07-01 - */ - public function testTextDynamicStringCustomDelimiter() - { - $actual = Text::dynamic('(Hi|Hello), my name is a Bob!', '(', ')'); - expect($actual)->notContains('('); - expect($actual)->notContains(')'); - - expect(preg_match('/^(Hi|Hello), my name is a Bob!$/', $actual))->equals(1); - } - - /** - * Tests custom separator - * - * @issue https://github.com/phalcon/cphalcon/issues/11215 - * @author Serghei Iakovlev - * @since 2016-06-27 - */ - public function testTextDynamicStringCustomSeparator() - { - $this->specify( - 'Text::dynamic with custom separator does not return expected result', - function () { - $actual = Text::dynamic('{Hi=Hello}, my name is a Bob!', '{', '}', '='); - - expect($actual)->notContains('{'); - expect($actual)->notContains('}'); - expect($actual)->notContains('='); - - expect(preg_match('/^(Hi|Hello), my name is a Bob!$/', $actual))->equals(1); - - $actual = Text::dynamic("{Hi'Hello}, my name is a {Rob'Zyxep'Andres}!", '{', '}', "'"); - - expect($actual)->notContains('{'); - expect($actual)->notContains('}'); - expect($actual)->notContains("'"); - - expect(preg_match('/^(Hi|Hello), my name is a (Rob|Zyxep|Andres)!$/', $actual))->equals(1); - - $actual = Text::dynamic('{Hi/Hello}, my name is a {Stanislav/Nikos}!', '{', '}', '/'); - - expect($actual)->notContains('{'); - expect($actual)->notContains('}'); - expect($actual)->notContains('/'); - - expect(preg_match('/^(Hi|Hello), my name is a (Stanislav|Nikos)!$/', $actual))->equals(1); - } - ); - } -} diff --git a/_toCheck/tests/unit/Text/TextEndsWithTest.php b/_toCheck/tests/unit/Text/TextEndsWithTest.php deleted file mode 100644 index 046912638ce..00000000000 --- a/_toCheck/tests/unit/Text/TextEndsWithTest.php +++ /dev/null @@ -1,129 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class TextEndsWithTest extends UnitTest -{ - /** - * Tests the endsWith function with empty strings - * - * @author Nikos Dimopoulos - * @since 2014-09-29 - */ - public function testTextEndsWithEmpty() - { - $this->specify( - "endsWith does not return correct result with empty strings", - function () { - $actual = Text::endsWith("", ""); - expect($actual)->false(); - } - ); - } - - /** - * Tests the endsWith function with empty search string - * - * @author Nikos Dimopoulos - * @since 2014-09-29 - */ - public function testTextEndsWithEmptySearchString() - { - $this->specify( - "endsWith does not return correct result with empty/something string", - function () { - $actual = Text::endsWith("", "hello"); - expect($actual)->false(); - } - ); - } - - /** - * Tests the endsWith function - * - * @author Nikos Dimopoulos - * @since 2014-09-29 - */ - public function testTextEndsWith() - { - $this->specify( - "endsWith does not return correct result with matched strings", - function () { - $actual = Text::endsWith("Hello", "o"); - expect($actual)->true(); - - $actual = Text::endsWith("Hello", "lo"); - expect($actual)->true(); - - $actual = Text::endsWith("Hello", "Hello"); - expect($actual)->true(); - } - ); - } - - /** - * Tests the endsWith function with case insensitive flag - * - * @author Nikos Dimopoulos - * @since 2014-09-29 - */ - public function testTextEndsWithCaseInsensitive() - { - $this->specify( - "endsWith does not return correct result with case insensitive string", - function () { - $actual = Text::endsWith("Hello", "O"); - expect($actual)->true(); - - $actual = Text::endsWith("Hello", "LO"); - expect($actual)->true(); - - $actual = Text::endsWith("Hello", "hello"); - expect($actual)->true(); - } - ); - } - - /** - * Tests the endsWith function with case sensitive flage - * - * @author Nikos Dimopoulos - * @since 2014-09-29 - */ - public function testTextEndsWithCaseSensitive() - { - $this->specify( - "endsWith does not return correct result with case sensitivity", - function () { - $actual = Text::endsWith("Hello", "hello", true); - expect($actual)->true(); - - $actual = Text::endsWith("Hello", "hello", false); - expect($actual)->false(); - - $actual = Text::endsWith("Hello", "O", false); - expect($actual)->false(); - } - ); - } -} diff --git a/_toCheck/tests/unit/Text/TextHumanizeTest.php b/_toCheck/tests/unit/Text/TextHumanizeTest.php deleted file mode 100644 index 84552dd542f..00000000000 --- a/_toCheck/tests/unit/Text/TextHumanizeTest.php +++ /dev/null @@ -1,45 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class TextHumanizeTest extends UnitTest -{ - /** - * Tests the humanize function - * - * @author Serghei Iakovlev - * @since 2015-11-09 - */ - public function testUnderscore() - { - $this->specify( - "humanize do not an underscored or dashed phrase human-readable", - function () { - expect(Text::humanize('start_a_horse'))->equals('start a horse'); - expect(Text::humanize("five-cats"))->equals('five cats'); - expect(Text::humanize('kittens-are_cats'))->equals('kittens are cats'); - expect(Text::humanize(" \t Awesome-Phalcon \t "))->equals('Awesome Phalcon'); - } - ); - } -} diff --git a/_toCheck/tests/unit/Text/TextIncrementTest.php b/_toCheck/tests/unit/Text/TextIncrementTest.php deleted file mode 100644 index 1032dff4292..00000000000 --- a/_toCheck/tests/unit/Text/TextIncrementTest.php +++ /dev/null @@ -1,140 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class TextIncrementTest extends UnitTest -{ - /** - * Tests the increment function - * - * @author Nikolaos Dimopoulos - * @since 2014-09-29 - */ - public function testTextIncrementSimpleString() - { - $this->specify( - "increment does not increment a simple string", - function () { - $source = 'file'; - $expected = 'file_1'; - $actual = Text::increment($source); - expect($actual)->equals($expected); - } - ); - } - - /** - * Tests the increment function with an already incremented string - * - * @author Nikolaos Dimopoulos - * @since 2014-09-29 - */ - public function testTextIncrementAlreadyIncremented() - { - $this->specify( - "increment does not increment an incremented string", - function () { - $source = 'file_1'; - $expected = 'file_2'; - $actual = Text::increment($source); - expect($actual)->equals($expected); - } - ); - } - - /** - * Tests the increment function for an already incremented string twice - * - * @author Nikolaos Dimopoulos - * @since 2014-09-29 - */ - public function testTextIncrementAlreadyIncrementedTwice() - { - $this->specify( - "increment does not increment a second incremented string", - function () { - $source = 'file_2'; - $expected = 'file_3'; - $actual = Text::increment($source); - expect($actual)->equals($expected); - } - ); - } - - /** - * Tests the increment function for a string with underscore - * - * @author Nikolaos Dimopoulos - * @since 2014-09-29 - */ - public function testTextIncrementStringWithUnderscore() - { - $this->specify( - "increment does not increment a string with an underscore", - function () { - $source = 'file_'; - $expected = 'file_1'; - $actual = Text::increment($source); - expect($actual)->equals($expected); - } - ); - } - - /** - * Tests the increment function for a string with a space at the end - * - * @author Nikolaos Dimopoulos - * @since 2014-09-29 - */ - public function testTextIncrementStringWithSpace() - { - $this->specify( - "increment does not increment a string with a space at the end", - function () { - $source = 'file '; - $expected = 'file _1'; - $actual = Text::increment($source); - expect($actual)->equals($expected); - } - ); - } - - /** - * Tests the increment function with a different separator - * - * @author Nikolaos Dimopoulos - * @since 2014-09-29 - */ - public function testTextIncrementStringWithDifferentSeparator() - { - $this->specify( - "increment does not increment a string with a different separator", - function () { - $source = 'file'; - $expected = 'file-1'; - $actual = Text::increment($source, '-'); - expect($actual)->equals($expected); - } - ); - } -} diff --git a/_toCheck/tests/unit/Text/TextRandomTest.php b/_toCheck/tests/unit/Text/TextRandomTest.php deleted file mode 100644 index 7d2f182ba3a..00000000000 --- a/_toCheck/tests/unit/Text/TextRandomTest.php +++ /dev/null @@ -1,191 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class TextRandomTest extends UnitTest -{ - /** - * Tests the constants for the random function - * - * @author Nikolaos Dimopoulos - * @since 2014-09-29 - */ - public function testRandomConstants() - { - $this->specify( - "random constants are not correct", - function () { - expect(Text::RANDOM_ALNUM)->equals(0); - expect(Text::RANDOM_ALPHA)->equals(1); - expect(Text::RANDOM_HEXDEC)->equals(2); - expect(Text::RANDOM_NUMERIC)->equals(3); - expect(Text::RANDOM_NOZERO)->equals(4); - expect(Text::RANDOM_DISTINCT)->equals(5); - } - ); - } - - /** - * Tests the random function with alnum - * - * @author Nikolaos Dimopoulos - * @since 2014-09-29 - */ - public function testRandomAlnum() - { - $this->specify( - "random with alnum does not return correct results", - function () { - for ($i = 1; $i < 10; $i++) { - $source = Text::random(Text::RANDOM_ALNUM, $i); - - expect(preg_match('/[a-zA-Z0-9]+/', $source, $matches))->equals(1); - expect($matches[0])->equals($source); - expect(strlen($source))->equals($i); - } - } - ); - } - - /** - * Tests the random function with alpha - * - * @author Nikolaos Dimopoulos - * @since 2014-09-29 - */ - public function testRandomAlpha() - { - $this->specify( - "random with alpha does not return correct results", - function () { - for ($i = 1; $i < 10; $i++) { - $source = Text::random(Text::RANDOM_ALPHA, $i); - - expect(preg_match('/[a-zA-Z]+/', $source, $matches))->equals(1); - expect($matches[0])->equals($source); - expect(strlen($source))->equals($i); - } - } - ); - } - - /** - * Tests the random function with hexdec - * - * @author Nikolaos Dimopoulos - * @since 2014-09-29 - */ - public function testRandomHexDec() - { - $this->specify( - "random with hexdec does not return correct results", - function () { - for ($i = 1; $i < 10; $i++) { - $source = Text::random(Text::RANDOM_HEXDEC, $i); - - expect(preg_match('/[a-f0-9]+/', $source, $matches))->equals(1); - expect($matches[0])->equals($source); - expect(strlen($source))->equals($i); - } - } - ); - } - - /** - * Tests the random function with numeric - * - * @author Nikolaos Dimopoulos - * @since 2014-09-29 - */ - public function testRandomNumeric() - { - $this->specify( - "random with numeric does not return correct results", - function () { - for ($i = 1; $i < 10; $i++) { - $source = Text::random(Text::RANDOM_NUMERIC, $i); - - expect(preg_match('/[0-9]+/', $source, $matches))->equals(1); - expect($matches[0])->equals($source); - expect(strlen($source))->equals($i); - } - } - ); - } - - /** - * Tests the random function with non zero - * - * @author Nikolaos Dimopoulos - * @since 2014-09-29 - */ - public function testRandomNonZero() - { - $this->specify( - "random with nonzero does not return correct results", - function () { - for ($i = 1; $i < 10; $i++) { - $source = Text::random(Text::RANDOM_NOZERO, $i); - - expect(preg_match('/[1-9]+/', $source, $matches))->equals(1); - expect($matches[0])->equals($source); - expect(strlen($source))->equals($i); - } - } - ); - } - - /** - * Tests the random function with distinct type - * - * @author Serghei Iakovlev - * @since 2017-06-09 - */ - public function testRandomDistinct() - { - $this->specify( - "distinct random does not return correct results", - function ($i) { - $source = Text::random(Text::RANDOM_DISTINCT, $i); - $pattern = '#^[^2345679ACDEFHJKLMNPRSTUVWXYZ]+$#'; - - expect(preg_match($pattern, $source))->equals(0); - expect(strlen($source))->equals($i); - }, - [ - 'examples' => [ - [1], - [10], - [100], - [200], - [500], - [1000], - [2000], - [3000], - [4000], - [5000], - ], - ] - ); - } -} diff --git a/_toCheck/tests/unit/Text/TextReduceSlashesTest.php b/_toCheck/tests/unit/Text/TextReduceSlashesTest.php deleted file mode 100644 index 6ad917a0ba9..00000000000 --- a/_toCheck/tests/unit/Text/TextReduceSlashesTest.php +++ /dev/null @@ -1,45 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class TextReduceSlashesTest extends UnitTest -{ - /** - * Tests the reduce slashes function - * - * @author Serghei Iakovlev - * @since 2015-05-11 - */ - public function testReduceSlashes() - { - $this->specify( - "reduce slashes do not delete extra slashes", - function () { - expect(Text::reduceSlashes('app/controllers//IndexController'))->equals('app/controllers/IndexController'); - expect(Text::reduceSlashes('http://foo//bar/baz/buz'))->equals('http://foo/bar/baz/buz'); - expect(Text::reduceSlashes('php://memory'))->equals('php://memory'); - expect(Text::reduceSlashes('http//https'))->equals('http/https'); - } - ); - } -} diff --git a/_toCheck/tests/unit/Text/TextStartsWithTest.php b/_toCheck/tests/unit/Text/TextStartsWithTest.php deleted file mode 100644 index 147a1256e4d..00000000000 --- a/_toCheck/tests/unit/Text/TextStartsWithTest.php +++ /dev/null @@ -1,129 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class TextStartsWithTest extends UnitTest -{ - /** - * Tests the startsWith function with empty strings - * - * @author Nikolaos Dimopoulos - * @since 2014-09-29 - */ - public function testTextStartsWithEmpty() - { - $this->specify( - "startsWith does not return correct result with empty strings", - function () { - $actual = Text::startsWith("", ""); - expect($actual)->false(); - } - ); - } - - /** - * Tests the startsWith function finding an empty string - * - * @author Nikolaos Dimopoulos - * @since 2014-09-29 - */ - public function testTextStartsWithEmptySearchString() - { - $this->specify( - "startsWith does not return correct result with empty/something string", - function () { - $actual = Text::startsWith("", "hello"); - expect($actual)->false(); - } - ); - } - - /** - * Tests the startsWith function - * - * @author Nikolaos Dimopoulos - * @since 2014-09-29 - */ - public function testTextStartsWith() - { - $this->specify( - "startsWith does not return correct result with matched strings", - function () { - $actual = Text::startsWith("Hello", "H"); - expect($actual)->true(); - - $actual = Text::startsWith("Hello", "He"); - expect($actual)->true(); - - $actual = Text::startsWith("Hello", "Hello"); - expect($actual)->true(); - } - ); - } - - /** - * Tests the startsWith function with case insensitive flag - * - * @author Nikolaos Dimopoulos - * @since 2014-09-29 - */ - public function testTextStartsWithCaseInsensitive() - { - $this->specify( - "startsWith does not return correct result with case insensitive string", - function () { - $actual = Text::startsWith("Hello", "h"); - expect($actual)->true(); - - $actual = Text::startsWith("Hello", "he"); - expect($actual)->true(); - - $actual = Text::startsWith("Hello", "hello"); - expect($actual)->true(); - } - ); - } - - /** - * Tests the startsWith function with case sensitive flag - * - * @author Nikolaos Dimopoulos - * @since 2014-09-29 - */ - public function testTextStartsWithCaseSensitive() - { - $this->specify( - "startsWith does not return correct result with case sensitivity", - function () { - $actual = Text::startsWith("Hello", "hello", true); - expect($actual)->true(); - - $actual = Text::startsWith("Hello", "hello", false); - expect($actual)->false(); - - $actual = Text::startsWith("Hello", "h", false); - expect($actual)->false(); - } - ); - } -} diff --git a/_toCheck/tests/unit/Text/TextUncamelizeTest.php b/_toCheck/tests/unit/Text/TextUncamelizeTest.php deleted file mode 100644 index 16c0a378afe..00000000000 --- a/_toCheck/tests/unit/Text/TextUncamelizeTest.php +++ /dev/null @@ -1,64 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class TextUncamelizeTest extends UnitTest -{ - /** - * Tests the uncamelize function - * - * @author Nikolaos Dimopoulos - * @since 2014-09-29 - */ - public function testTextUncamelizeString() - { - $this->specify( - 'Text::uncamelize conversions do not return the correct string', - function ($actual, $expected, $delimiter) { - expect(Text::uncamelize($actual, $delimiter))->equals($expected); - }, - [ - 'examples' => [ - ['camelize', 'camelize', null], - ['CameLiZe', 'came_li_ze', null], - ['cAmeLize', 'c_ame_lize', null], - ['_camelize', '_camelize', null], - ['123camelize', '123camelize', null], - ['c_a_m_e_l_i_z_e', 'c_a_m_e_l_i_z_e', null], - ['Camelize', 'camelize', null], - ['camel_ize', 'camel_ize', null], - ['CameLize', 'came_lize', null], - ["Camelize", 'camelize', null], - ["=Camelize", '=_camelize', "_" ], - ["Camelize", 'camelize', "_" ], - ["CameLiZe", 'came_li_ze', "_" ], - ["CameLiZe", 'came#li#ze', "#" ], - ["CameLiZe", 'came li ze', " " ], - ["CameLiZe", 'came.li.ze', "." ], - ["CameLiZe", 'came-li-ze', "-" ], - ["CAMELIZE", 'c/a/m/e/l/i/z/e', "/" ], - ] - ] - ); - } -} diff --git a/_toCheck/tests/unit/Text/TextUnderscoreTest.php b/_toCheck/tests/unit/Text/TextUnderscoreTest.php deleted file mode 100644 index ff6591b6af9..00000000000 --- a/_toCheck/tests/unit/Text/TextUnderscoreTest.php +++ /dev/null @@ -1,45 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class TextUnderscoreTest extends UnitTest -{ - /** - * Tests the uderscore function - * - * @author Serghei Iakovlev - * @since 2015-11-09 - */ - public function testUnderscore() - { - $this->specify( - "underscore do not replace spaces", - function () { - expect(Text::underscore('start a horse'))->equals('start_a_horse'); - expect(Text::underscore("five\tcats"))->equals('five_cats'); - expect(Text::underscore(' look behind '))->equals('look_behind'); - expect(Text::underscore(" \t Awesome \t \t Phalcon "))->equals('Awesome_Phalcon'); - } - ); - } -} diff --git a/_toCheck/tests/unit/Text/TextUpperLowerTest.php b/_toCheck/tests/unit/Text/TextUpperLowerTest.php deleted file mode 100644 index 6a4bffc6d42..00000000000 --- a/_toCheck/tests/unit/Text/TextUpperLowerTest.php +++ /dev/null @@ -1,106 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class TextUpperLowerTest extends UnitTest -{ - /** - * Tests the upper function - * - * @author Nikolaos Dimopoulos - * @since 2014-09-29 - */ - public function testUpper() - { - $this->specify( - "upper returns incorrect results", - function () { - expect(Text::upper('hello'))->equals('HELLO'); - expect(Text::upper('HELLO'))->equals('HELLO'); - expect(Text::upper('1234'))->equals('1234'); - } - ); - } - - /** - * Tests the upper function for multi-bytes encoding - * - * @author Stanislav Kiryukhin - * @since 2015-05-06 - */ - public function testUpperMultiBytesEncoding() - { - $this->specify( - "upper returns incorrect results", - function () { - expect(Text::upper('ПРИВЕТ МИР!'))->equals('ПРИВЕТ МИР!'); - expect(Text::upper('ПриВЕт Мир!'))->equals('ПРИВЕТ МИР!'); - expect(Text::upper('привет мир!'))->equals('ПРИВЕТ МИР!'); - - expect(Text::upper('MÄNNER'))->equals('MÄNNER'); - expect(Text::upper('mÄnnER'))->equals('MÄNNER'); - expect(Text::upper('männer'))->equals('MÄNNER'); - } - ); - } - - /** - * Tests the lower function - * - * @author Nikolaos Dimopoulos - * @since 2014-09-29 - */ - public function testLower() - { - $this->specify( - "lower returns incorrect results", - function () { - expect(Text::lower('hello'))->equals('hello'); - expect(Text::lower('HELLO'))->equals('hello'); - expect(Text::lower('1234'))->equals('1234'); - } - ); - } - - /** - * Tests the lower function for multi-bytes encoding - * - * @author Stanislav Kiryukhin - * @since 2015-05-06 - */ - public function testLowerMultiBytesEncoding() - { - $this->specify( - "lower returns incorrect results", - function () { - expect(Text::lower('привет мир!'))->equals('привет мир!'); - expect(Text::lower('ПриВЕт Мир!'))->equals('привет мир!'); - expect(Text::lower('ПРИВЕТ МИР!'))->equals('привет мир!'); - - expect(Text::lower('männer'))->equals('männer'); - expect(Text::lower('mÄnnER'))->equals('männer'); - expect(Text::lower('MÄNNER'))->equals('männer'); - } - ); - } -} diff --git a/_toCheck/tests/unit/Tag/TagCheckFieldTest.php b/tests/unit/Tag/TagCheckFieldTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagCheckFieldTest.php rename to tests/unit/Tag/TagCheckFieldTest.php diff --git a/_toCheck/tests/unit/Tag/TagColorFieldTest.php b/tests/unit/Tag/TagColorFieldTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagColorFieldTest.php rename to tests/unit/Tag/TagColorFieldTest.php diff --git a/_toCheck/tests/unit/Tag/TagDateFieldTest.php b/tests/unit/Tag/TagDateFieldTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagDateFieldTest.php rename to tests/unit/Tag/TagDateFieldTest.php diff --git a/_toCheck/tests/unit/Tag/TagDateTimeFieldTest.php b/tests/unit/Tag/TagDateTimeFieldTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagDateTimeFieldTest.php rename to tests/unit/Tag/TagDateTimeFieldTest.php diff --git a/_toCheck/tests/unit/Tag/TagDateTimeLocalFieldTest.php b/tests/unit/Tag/TagDateTimeLocalFieldTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagDateTimeLocalFieldTest.php rename to tests/unit/Tag/TagDateTimeLocalFieldTest.php diff --git a/_toCheck/tests/unit/Tag/TagDoctypeTest.php b/tests/unit/Tag/TagDoctypeTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagDoctypeTest.php rename to tests/unit/Tag/TagDoctypeTest.php diff --git a/_toCheck/tests/unit/Tag/TagEmailFieldTest.php b/tests/unit/Tag/TagEmailFieldTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagEmailFieldTest.php rename to tests/unit/Tag/TagEmailFieldTest.php diff --git a/_toCheck/tests/unit/Tag/TagFileFieldTest.php b/tests/unit/Tag/TagFileFieldTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagFileFieldTest.php rename to tests/unit/Tag/TagFileFieldTest.php diff --git a/_toCheck/tests/unit/Tag/TagFriendlyTitleTest.php b/tests/unit/Tag/TagFriendlyTitleTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagFriendlyTitleTest.php rename to tests/unit/Tag/TagFriendlyTitleTest.php diff --git a/_toCheck/tests/unit/Tag/TagHiddenFieldTest.php b/tests/unit/Tag/TagHiddenFieldTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagHiddenFieldTest.php rename to tests/unit/Tag/TagHiddenFieldTest.php diff --git a/_toCheck/tests/unit/Tag/TagImageInputTest.php b/tests/unit/Tag/TagImageInputTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagImageInputTest.php rename to tests/unit/Tag/TagImageInputTest.php diff --git a/_toCheck/tests/unit/Tag/TagImageTest.php b/tests/unit/Tag/TagImageTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagImageTest.php rename to tests/unit/Tag/TagImageTest.php diff --git a/_toCheck/tests/unit/Tag/TagJavascriptIncludeTest.php b/tests/unit/Tag/TagJavascriptIncludeTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagJavascriptIncludeTest.php rename to tests/unit/Tag/TagJavascriptIncludeTest.php diff --git a/_toCheck/tests/unit/Tag/TagLinkToTest.php b/tests/unit/Tag/TagLinkToTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagLinkToTest.php rename to tests/unit/Tag/TagLinkToTest.php diff --git a/_toCheck/tests/unit/Tag/TagMonthFieldTest.php b/tests/unit/Tag/TagMonthFieldTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagMonthFieldTest.php rename to tests/unit/Tag/TagMonthFieldTest.php diff --git a/_toCheck/tests/unit/Tag/TagNumericFieldTest.php b/tests/unit/Tag/TagNumericFieldTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagNumericFieldTest.php rename to tests/unit/Tag/TagNumericFieldTest.php diff --git a/_toCheck/tests/unit/Tag/TagPasswordFieldTest.php b/tests/unit/Tag/TagPasswordFieldTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagPasswordFieldTest.php rename to tests/unit/Tag/TagPasswordFieldTest.php diff --git a/_toCheck/tests/unit/Tag/TagRadioFieldTest.php b/tests/unit/Tag/TagRadioFieldTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagRadioFieldTest.php rename to tests/unit/Tag/TagRadioFieldTest.php diff --git a/_toCheck/tests/unit/Tag/TagRangeFieldTest.php b/tests/unit/Tag/TagRangeFieldTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagRangeFieldTest.php rename to tests/unit/Tag/TagRangeFieldTest.php diff --git a/_toCheck/tests/unit/Tag/TagResetInputTest.php b/tests/unit/Tag/TagResetInputTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagResetInputTest.php rename to tests/unit/Tag/TagResetInputTest.php diff --git a/_toCheck/tests/unit/Tag/TagSearchFieldTest.php b/tests/unit/Tag/TagSearchFieldTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagSearchFieldTest.php rename to tests/unit/Tag/TagSearchFieldTest.php diff --git a/_toCheck/tests/unit/Tag/TagSelectStaticTest.php b/tests/unit/Tag/TagSelectStaticTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagSelectStaticTest.php rename to tests/unit/Tag/TagSelectStaticTest.php diff --git a/_toCheck/tests/unit/Tag/TagSetDefaultTest.php b/tests/unit/Tag/TagSetDefaultTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagSetDefaultTest.php rename to tests/unit/Tag/TagSetDefaultTest.php diff --git a/_toCheck/tests/unit/Tag/TagStylesheetlinkTest.php b/tests/unit/Tag/TagStylesheetlinkTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagStylesheetlinkTest.php rename to tests/unit/Tag/TagStylesheetlinkTest.php diff --git a/_toCheck/tests/unit/Tag/TagSubmitButtonTest.php b/tests/unit/Tag/TagSubmitButtonTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagSubmitButtonTest.php rename to tests/unit/Tag/TagSubmitButtonTest.php diff --git a/_toCheck/tests/unit/Tag/TagTagHtmlTest.php b/tests/unit/Tag/TagTagHtmlTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagTagHtmlTest.php rename to tests/unit/Tag/TagTagHtmlTest.php diff --git a/_toCheck/tests/unit/Tag/TagTelFieldTest.php b/tests/unit/Tag/TagTelFieldTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagTelFieldTest.php rename to tests/unit/Tag/TagTelFieldTest.php diff --git a/_toCheck/tests/unit/Tag/TagTextAreaTest.php b/tests/unit/Tag/TagTextAreaTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagTextAreaTest.php rename to tests/unit/Tag/TagTextAreaTest.php diff --git a/_toCheck/tests/unit/Tag/TagTextFieldTest.php b/tests/unit/Tag/TagTextFieldTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagTextFieldTest.php rename to tests/unit/Tag/TagTextFieldTest.php diff --git a/_toCheck/tests/unit/Tag/TagTimeFieldTest.php b/tests/unit/Tag/TagTimeFieldTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagTimeFieldTest.php rename to tests/unit/Tag/TagTimeFieldTest.php diff --git a/_toCheck/tests/unit/Tag/TagTitleTest.php b/tests/unit/Tag/TagTitleTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagTitleTest.php rename to tests/unit/Tag/TagTitleTest.php diff --git a/_toCheck/tests/unit/Tag/TagUrlFieldTest.php b/tests/unit/Tag/TagUrlFieldTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagUrlFieldTest.php rename to tests/unit/Tag/TagUrlFieldTest.php diff --git a/_toCheck/tests/unit/Tag/TagWeekFieldTest.php b/tests/unit/Tag/TagWeekFieldTest.php similarity index 100% rename from _toCheck/tests/unit/Tag/TagWeekFieldTest.php rename to tests/unit/Tag/TagWeekFieldTest.php diff --git a/tests/unit/Text/TextCamelizeCest.php b/tests/unit/Text/TextCamelizeCest.php new file mode 100644 index 00000000000..beaa207fac7 --- /dev/null +++ b/tests/unit/Text/TextCamelizeCest.php @@ -0,0 +1,58 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Text; + +use Phalcon\Text; +use UnitTester; + +class TextCamelizeCest +{ + /** + * Tests the camelize function + * + * @author Nikolaos Dimopoulos + * @since 2014-09-29 + */ + public function testTextCamelizeString(UnitTester $I) + { + $examples = [ + ['camelize', 'Camelize', null], + ['CameLiZe', 'Camelize', null], + ['cAmeLize', 'Camelize', null], + ['123camelize', '123camelize', null], + ['c_a_m_e_l_i_z_e', 'CAMELIZE', null], + ['Camelize', 'Camelize', null], + ['camel_ize', 'CamelIze', null], + ['CameLize', 'Camelize', null], + ["c_a-m_e-l_i-z_e", 'CAMELIZE', null], + ["came_li_ze", 'CameLiZe', null], + ["=_camelize", '=Camelize', "_" ], + ["camelize", 'Camelize', "_" ], + ["came_li_ze", 'CameLiZe', "_" ], + ["came#li#ze", 'CameLiZe', "#" ], + ["came li ze", 'CameLiZe', " " ], + ["came.li^ze", 'CameLiZe', ".^"], + ["c_a-m_e-l_i-z_e", 'CAMELIZE', "-_"], + ["came.li.ze", 'CameLiZe', "." ], + ["came-li-ze", 'CameLiZe', "-" ], + ["c+a+m+e+l+i+z+e", 'CAMELIZE', "+" ], + ]; + + foreach ($examples as $item) { + $value = $item[0]; + $expected = $item[1]; + $delimiter = $item[2]; + $actual = Text::camelize($value, $delimiter); + $I->assertEquals($expected, $actual); + } + } +} diff --git a/tests/unit/Text/TextConcatCest.php b/tests/unit/Text/TextConcatCest.php new file mode 100644 index 00000000000..34a02f3ee97 --- /dev/null +++ b/tests/unit/Text/TextConcatCest.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Text; + +use Phalcon\Text; +use UnitTester; + +class TextConcatCest +{ + /** + * Tests the concat function + * + * @author Stanislav Kiryukhin + * @since 2015-05-06 + */ + public function testTextConcatString(UnitTester $I) + { + // Test 1 + $actual = Text::concat('/', '/tmp/', '/folder_1/', '/folder_2', 'folder_3/'); + $expected = '/tmp/folder_1/folder_2/folder_3/'; + $I->assertEquals($expected, $actual); + + // Test 2 + $actual = Text::concat('.', '@test.', '.test2.', '.test', '.34'); + $expected = '@test.test2.test.34'; + $I->assertEquals($expected, $actual); + } +} diff --git a/tests/unit/Text/TextDynamicCest.php b/tests/unit/Text/TextDynamicCest.php new file mode 100644 index 00000000000..b7741229ade --- /dev/null +++ b/tests/unit/Text/TextDynamicCest.php @@ -0,0 +1,89 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Text; + +use Phalcon\Text; +use UnitTester; + +class TextDynamicCest +{ + /** + * Tests the dynamic function + * + * @author Stanislav Kiryukhin + * @since 2015-07-01 + */ + public function testTextDynamicString(UnitTester $I) + { + $actual = Text::dynamic('{Hi|Hello}, my name is a Bob!'); + $I->assertNotContains('{', $actual); + $I->assertNotContains('}', $actual); + + $expected = 1; + $actual = preg_match('/^(Hi|Hello), my name is a Bob!$/', $actual); + $I->assertEquals($expected, $actual); + } + + /** + * Tests the dynamic function + * + * @author Stanislav Kiryukhin + * @since 2015-07-01 + */ + public function testTextDynamicStringCustomDelimiter(UnitTester $I) + { + $actual = Text::dynamic('(Hi|Hello), my name is a Bob!', '(', ')'); + $I->assertNotContains('{', $actual); + $I->assertNotContains('}', $actual); + + $expected = 1; + $actual = preg_match('/^(Hi|Hello), my name is a Bob!$/', $actual); + $I->assertEquals($expected, $actual); + } + + /** + * Tests custom separator + * + * @issue https://github.com/phalcon/cphalcon/issues/11215 + * @author Serghei Iakovlev + * @since 2016-06-27 + */ + public function testTextDynamicStringCustomSeparator(UnitTester $I) + { + $actual = Text::dynamic('{Hi=Hello}, my name is a Bob!', '{', '}', '='); + $I->assertNotContains('{', $actual); + $I->assertNotContains('}', $actual); + $I->assertNotContains('=', $actual); + + $expected = 1; + $actual = preg_match('/^(Hi|Hello), my name is a Bob!$/', $actual); + $I->assertEquals($expected, $actual); + + $actual = Text::dynamic("{Hi'Hello}, my name is a {Rob'Zyxep'Andres}!", '{', '}', "'"); + $I->assertNotContains('{', $actual); + $I->assertNotContains('}', $actual); + $I->assertNotContains("''", $actual); + + $expected = 1; + $actual = preg_match('/^(Hi|Hello), my name is a (Rob|Zyxep|Andres)!$/', $actual); + $I->assertEquals($expected, $actual); + + $actual = Text::dynamic('{Hi/Hello}, my name is a {Stanislav/Nikos}!', '{', '}', '/'); + $I->assertNotContains('{', $actual); + $I->assertNotContains('}', $actual); + $I->assertNotContains('/', $actual); + + $expected = 1; + $actual = preg_match('/^(Hi|Hello), my name is a (Stanislav|Nikos)!$/', $actual); + $I->assertEquals($expected, $actual); + } +} diff --git a/tests/unit/Text/TextEndsWithCest.php b/tests/unit/Text/TextEndsWithCest.php new file mode 100644 index 00000000000..1dbf8af9661 --- /dev/null +++ b/tests/unit/Text/TextEndsWithCest.php @@ -0,0 +1,96 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Text; + +use Phalcon\Text; +use UnitTester; + +class TextEndsWithCest +{ + /** + * Tests the endsWith function with empty strings + * + * @author Nikos Dimopoulos + * @since 2014-09-29 + */ + public function testTextEndsWithEmpty(UnitTester $I) + { + $actual = Text::endsWith("", ""); + $I->assertFalse($actual); + } + + /** + * Tests the endsWith function with empty search string + * + * @author Nikos Dimopoulos + * @since 2014-09-29 + */ + public function testTextEndsWithEmptySearchString(UnitTester $I) + { + $actual = Text::endsWith("", "hello"); + $I->assertFalse($actual); + } + + /** + * Tests the endsWith function + * + * @author Nikos Dimopoulos + * @since 2014-09-29 + */ + public function testTextEndsWith(UnitTester $I) + { + $actual = Text::endsWith("Hello", "o"); + $I->assertTrue($actual); + + $actual = Text::endsWith("Hello", "lo"); + $I->assertTrue($actual); + + $actual = Text::endsWith("Hello", "Hello"); + $I->assertTrue($actual); + } + + /** + * Tests the endsWith function with case insensitive flag + * + * @author Nikos Dimopoulos + * @since 2014-09-29 + */ + public function testTextEndsWithCaseInsensitive(UnitTester $I) + { + $actual = Text::endsWith("Hello", "O"); + $I->assertTrue($actual); + + $actual = Text::endsWith("Hello", "LO"); + $I->assertTrue($actual); + + $actual = Text::endsWith("Hello", "hello"); + $I->assertTrue($actual); + } + + /** + * Tests the endsWith function with case sensitive flage + * + * @author Nikos Dimopoulos + * @since 2014-09-29 + */ + public function testTextEndsWithCaseSensitive(UnitTester $I) + { + $actual = Text::endsWith("Hello", "hello", true); + $I->assertTrue($actual); + + $actual = Text::endsWith("Hello", "hello", false); + $I->assertFalse($actual); + + $actual = Text::endsWith("Hello", "O", false); + $I->assertFalse($actual); + } +} diff --git a/tests/unit/Text/TextHumanizeCest.php b/tests/unit/Text/TextHumanizeCest.php new file mode 100644 index 00000000000..8120b3ec8d7 --- /dev/null +++ b/tests/unit/Text/TextHumanizeCest.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Text; + +use Phalcon\Text; +use UnitTester; + +class TextHumanizeCest +{ + /** + * Tests the humanize function + * + * @author Serghei Iakovlev + * @since 2015-11-09 + */ + public function testUnderscore(UnitTester $I) + { + $expected = 'start a horse'; + $actual = Text::humanize('start_a_horse'); + $I->assertEquals($expected, $actual); + + $expected = 'five cats'; + $actual = Text::humanize('five-cats'); + $I->assertEquals($expected, $actual); + + $expected = 'kittens are cats'; + $actual = Text::humanize('kittens-are_cats'); + $I->assertEquals($expected, $actual); + + $expected = 'Awesome Phalcon'; + $actual = Text::humanize(" \t Awesome-Phalcon \t "); + $I->assertEquals($expected, $actual); + } +} diff --git a/tests/unit/Text/TextIncrementCest.php b/tests/unit/Text/TextIncrementCest.php new file mode 100644 index 00000000000..2f164a4d028 --- /dev/null +++ b/tests/unit/Text/TextIncrementCest.php @@ -0,0 +1,102 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Text; + +use Phalcon\Text; +use UnitTester; + +class TextIncrementCest +{ + /** + * Tests the increment function + * + * @author Nikolaos Dimopoulos + * @since 2014-09-29 + */ + public function testTextIncrementSimpleString(UnitTester $I) + { + $source = 'file'; + $expected = 'file_1'; + $actual = Text::increment($source); + $I->assertEquals($expected, $actual); + } + + /** + * Tests the increment function with an already incremented string + * + * @author Nikolaos Dimopoulos + * @since 2014-09-29 + */ + public function testTextIncrementAlreadyIncremented(UnitTester $I) + { + $source = 'file_1'; + $expected = 'file_2'; + $actual = Text::increment($source); + $I->assertEquals($expected, $actual); + } + + /** + * Tests the increment function for an already incremented string twice + * + * @author Nikolaos Dimopoulos + * @since 2014-09-29 + */ + public function testTextIncrementAlreadyIncrementedTwice(UnitTester $I) + { + $source = 'file_2'; + $expected = 'file_3'; + $actual = Text::increment($source); + $I->assertEquals($expected, $actual); + } + + /** + * Tests the increment function for a string with underscore + * + * @author Nikolaos Dimopoulos + * @since 2014-09-29 + */ + public function testTextIncrementStringWithUnderscore(UnitTester $I) + { + $source = 'file_'; + $expected = 'file_1'; + $actual = Text::increment($source); + $I->assertEquals($expected, $actual); + } + + /** + * Tests the increment function for a string with a space at the end + * + * @author Nikolaos Dimopoulos + * @since 2014-09-29 + */ + public function testTextIncrementStringWithSpace(UnitTester $I) + { + $source = 'file '; + $expected = 'file _1'; + $actual = Text::increment($source); + $I->assertEquals($expected, $actual); + } + + /** + * Tests the increment function with a different separator + * + * @author Nikolaos Dimopoulos + * @since 2014-09-29 + */ + public function testTextIncrementStringWithDifferentSeparator(UnitTester $I) + { + $source = 'file'; + $expected = 'file-1'; + $actual = Text::increment($source, '-'); + $I->assertEquals($expected, $actual); + } +} diff --git a/tests/unit/Text/TextRandomCest.php b/tests/unit/Text/TextRandomCest.php new file mode 100644 index 00000000000..ac1f6aa65cb --- /dev/null +++ b/tests/unit/Text/TextRandomCest.php @@ -0,0 +1,182 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Text; + +use Phalcon\Text; +use UnitTester; + +class TextRandomCest +{ + /** + * Tests the constants for the random function + * + * @author Nikolaos Dimopoulos + * @since 2014-09-29 + */ + public function testRandomConstants(UnitTester $I) + { + $I->assertEquals(0, Text::RANDOM_ALNUM); + $I->assertEquals(1, Text::RANDOM_ALPHA); + $I->assertEquals(2, Text::RANDOM_HEXDEC); + $I->assertEquals(3, Text::RANDOM_NUMERIC); + $I->assertEquals(4, Text::RANDOM_NOZERO); + $I->assertEquals(5, Text::RANDOM_DISTINCT); + } + + /** + * Tests the random function with alnum + * + * @author Nikolaos Dimopoulos + * @since 2014-09-29 + */ + public function testRandomAlnum(UnitTester $I) + { + for ($i = 1; $i < 10; $i++) { + $source = Text::random(Text::RANDOM_ALNUM, $i); + + $expected = 1; + $actual = preg_match('/[a-zA-Z0-9]+/', $source, $matches); + $I->assertEquals($expected, $actual); + + $expected = $source; + $actual = $matches[0]; + $I->assertEquals($expected, $actual); + + $expected = $i; + $actual = strlen($source); + $I->assertEquals($expected, $actual); + } + } + + /** + * Tests the random function with alpha + * + * @author Nikolaos Dimopoulos + * @since 2014-09-29 + */ + public function testRandomAlpha(UnitTester $I) + { + for ($i = 1; $i < 10; $i++) { + $source = Text::random(Text::RANDOM_ALPHA, $i); + + $expected = 1; + $actual = preg_match('/[a-zA-Z]+/', $source, $matches); + $I->assertEquals($expected, $actual); + + $expected = $source; + $actual = $matches[0]; + $I->assertEquals($expected, $actual); + + $expected = $i; + $actual = strlen($source); + $I->assertEquals($expected, $actual); + } + } + + /** + * Tests the random function with hexdec + * + * @author Nikolaos Dimopoulos + * @since 2014-09-29 + */ + public function testRandomHexDec(UnitTester $I) + { + for ($i = 1; $i < 10; $i++) { + $source = Text::random(Text::RANDOM_HEXDEC, $i); + + $expected = 1; + $actual = preg_match('/[a-f0-9]+/', $source, $matches); + $I->assertEquals($expected, $actual); + + $expected = $source; + $actual = $matches[0]; + $I->assertEquals($expected, $actual); + + $expected = $i; + $actual = strlen($source); + $I->assertEquals($expected, $actual); + } + } + + /** + * Tests the random function with numeric + * + * @author Nikolaos Dimopoulos + * @since 2014-09-29 + */ + public function testRandomNumeric(UnitTester $I) + { + for ($i = 1; $i < 10; $i++) { + $source = Text::random(Text::RANDOM_NUMERIC, $i); + + $expected = 1; + $actual = preg_match('/[0-9]+/', $source, $matches); + $I->assertEquals($expected, $actual); + + $expected = $source; + $actual = $matches[0]; + $I->assertEquals($expected, $actual); + + $expected = $i; + $actual = strlen($source); + $I->assertEquals($expected, $actual); + } + } + + /** + * Tests the random function with non zero + * + * @author Nikolaos Dimopoulos + * @since 2014-09-29 + */ + public function testRandomNonZero(UnitTester $I) + { + for ($i = 1; $i < 10; $i++) { + $source = Text::random(Text::RANDOM_NOZERO, $i); + + $expected = 1; + $actual = preg_match('/[1-9]+/', $source, $matches); + $I->assertEquals($expected, $actual); + + $expected = $source; + $actual = $matches[0]; + $I->assertEquals($expected, $actual); + + $expected = $i; + $actual = strlen($source); + $I->assertEquals($expected, $actual); + } + } + + /** + * Tests the random function with distinct type + * + * @author Serghei Iakovlev + * @since 2017-06-09 + */ + public function testRandomDistinct(UnitTester $I) + { + $examples = [1, 10, 100, 200, 500, 1000, 2000, 3000, 4000, 5000]; + foreach ($examples as $i) { + $source = Text::random(Text::RANDOM_DISTINCT, $i); + $pattern = '#^[^2345679ACDEFHJKLMNPRSTUVWXYZ]+$#'; + + $expected = 0; + $actual = preg_match($pattern, $source); + $I->assertEquals($expected, $actual); + + $expected = $i; + $actual = strlen($source); + $I->assertEquals($expected, $actual); + } + } +} diff --git a/tests/unit/Text/TextReduceSlashesCest.php b/tests/unit/Text/TextReduceSlashesCest.php new file mode 100644 index 00000000000..beb8ccf7fdd --- /dev/null +++ b/tests/unit/Text/TextReduceSlashesCest.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Text; + +use Phalcon\Text; +use UnitTester; + +class TextReduceSlashesCest +{ + /** + * Tests the reduce slashes function + * + * @author Serghei Iakovlev + * @since 2015-05-11 + */ + public function testReduceSlashes(UnitTester $I) + { + $expected = 'app/controllers/IndexController'; + $actual = Text::reduceSlashes('app/controllers//IndexController'); + $I->assertEquals($expected, $actual); + + $expected = 'http://foo/bar/baz/buz'; + $actual = Text::reduceSlashes('http://foo//bar/baz/buz'); + $I->assertEquals($expected, $actual); + + $expected = 'php://memory'; + $actual = Text::reduceSlashes('php://memory'); + $I->assertEquals($expected, $actual); + + $expected = 'http/https'; + $actual = Text::reduceSlashes('http//https'); + $I->assertEquals($expected, $actual); + } +} diff --git a/tests/unit/Text/TextStartsWithCest.php b/tests/unit/Text/TextStartsWithCest.php new file mode 100644 index 00000000000..5e35052f94f --- /dev/null +++ b/tests/unit/Text/TextStartsWithCest.php @@ -0,0 +1,96 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Text; + +use Phalcon\Text; +use UnitTester; + +class TextStartsWithCest +{ + /** + * Tests the startsWith function with empty strings + * + * @author Nikolaos Dimopoulos + * @since 2014-09-29 + */ + public function testTextStartsWithEmpty(UnitTester $I) + { + $actual = Text::startsWith("", ""); + $I->assertFalse($actual); + } + + /** + * Tests the startsWith function finding an empty string + * + * @author Nikolaos Dimopoulos + * @since 2014-09-29 + */ + public function testTextStartsWithEmptySearchString(UnitTester $I) + { + $actual = Text::startsWith("", "hello"); + $I->assertFalse($actual); + } + + /** + * Tests the startsWith function + * + * @author Nikolaos Dimopoulos + * @since 2014-09-29 + */ + public function testTextStartsWith(UnitTester $I) + { + $actual = Text::startsWith("Hello", "H"); + $I->assertTrue($actual); + + $actual = Text::startsWith("Hello", "He"); + $I->assertTrue($actual); + + $actual = Text::startsWith("Hello", "Hello"); + $I->assertTrue($actual); + } + + /** + * Tests the startsWith function with case insensitive flag + * + * @author Nikolaos Dimopoulos + * @since 2014-09-29 + */ + public function testTextStartsWithCaseInsensitive(UnitTester $I) + { + $actual = Text::startsWith("Hello", "h"); + $I->assertTrue($actual); + + $actual = Text::startsWith("Hello", "he"); + $I->assertTrue($actual); + + $actual = Text::startsWith("Hello", "hello"); + $I->assertTrue($actual); + } + + /** + * Tests the startsWith function with case sensitive flag + * + * @author Nikolaos Dimopoulos + * @since 2014-09-29 + */ + public function testTextStartsWithCaseSensitive(UnitTester $I) + { + $actual = Text::startsWith("Hello", "hello", true); + $I->assertTrue($actual); + + $actual = Text::startsWith("Hello", "hello", false); + $I->assertFalse($actual); + + $actual = Text::startsWith("Hello", "h", false); + $I->assertFalse($actual); + } +} diff --git a/tests/unit/Text/TextUncamelizeCest.php b/tests/unit/Text/TextUncamelizeCest.php new file mode 100644 index 00000000000..820204979b0 --- /dev/null +++ b/tests/unit/Text/TextUncamelizeCest.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Text; + +use Phalcon\Text; +use UnitTester; + +class TextUncamelizeCest +{ + /** + * Tests the uncamelize function + * + * @author Nikolaos Dimopoulos + * @since 2014-09-29 + */ + public function testTextUncamelizeString(UnitTester $I) + { + $examples = [ + ['camelize', 'camelize', null], + ['CameLiZe', 'came_li_ze', null], + ['cAmeLize', 'c_ame_lize', null], + ['_camelize', '_camelize', null], + ['123camelize', '123camelize', null], + ['c_a_m_e_l_i_z_e', 'c_a_m_e_l_i_z_e', null], + ['Camelize', 'camelize', null], + ['camel_ize', 'camel_ize', null], + ['CameLize', 'came_lize', null], + ["Camelize", 'camelize', null], + ["=Camelize", '=_camelize', "_" ], + ["Camelize", 'camelize', "_" ], + ["CameLiZe", 'came_li_ze', "_" ], + ["CameLiZe", 'came#li#ze', "#" ], + ["CameLiZe", 'came li ze', " " ], + ["CameLiZe", 'came.li.ze', "." ], + ["CameLiZe", 'came-li-ze', "-" ], + ["CAMELIZE", 'c/a/m/e/l/i/z/e', "/" ], + ]; + + foreach ($examples as $item) { + $value = $item[0]; + $expected = $item[1]; + $delimiter = $item[2]; + $actual = Text::uncamelize($value, $delimiter); + $I->assertEquals($expected, $actual); + } + } +} diff --git a/tests/unit/Text/TextUnderscoreCest.php b/tests/unit/Text/TextUnderscoreCest.php new file mode 100644 index 00000000000..238c26c6183 --- /dev/null +++ b/tests/unit/Text/TextUnderscoreCest.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Text; + +use Phalcon\Text; +use UnitTester; + +class TextUnderscoreCest +{ + /** + * Tests the uderscore function + * + * @author Serghei Iakovlev + * @since 2015-11-09 + */ + public function testUnderscore(UnitTester $I) + { + $expected = 'start_a_horse'; + $actual = Text::underscore('start a horse'); + $I->assertEquals($expected, $actual); + + $expected = 'five_cats'; + $actual = Text::underscore("five\tcats"); + $I->assertEquals($expected, $actual); + + $expected = 'look_behind'; + $actual = Text::underscore(' look behind '); + $I->assertEquals($expected, $actual); + + $expected = 'Awesome_Phalcon'; + $actual = Text::underscore(" \t Awesome \t \t Phalcon "); + $I->assertEquals($expected, $actual); + } +} diff --git a/tests/unit/Text/TextUpperLowerCest.php b/tests/unit/Text/TextUpperLowerCest.php new file mode 100644 index 00000000000..3151480fe05 --- /dev/null +++ b/tests/unit/Text/TextUpperLowerCest.php @@ -0,0 +1,129 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Text; + +use Phalcon\Text; +use UnitTester; + +class TextUpperLowerCest +{ + /** + * Tests the upper function + * + * @author Nikolaos Dimopoulos + * @since 2014-09-29 + */ + public function testUpper(UnitTester $I) + { + $expected = 'HELLO'; + $actual = Text::upper('hello'); + $I->assertEquals($expected, $actual); + + $expected = 'HELLO'; + $actual = Text::upper('HELLO'); + $I->assertEquals($expected, $actual); + + $expected = '1234'; + $actual = Text::upper('1234'); + $I->assertEquals($expected, $actual); + + } + + /** + * Tests the upper function for multi-bytes encoding + * + * @author Stanislav Kiryukhin + * @since 2015-05-06 + */ + public function testUpperMultiBytesEncoding(UnitTester $I) + { + $expected = 'ПРИВЕТ МИР!'; + $actual = Text::upper('ПРИВЕТ МИР!'); + $I->assertEquals($expected, $actual); + + $expected = 'ПРИВЕТ МИР!'; + $actual = Text::upper('ПриВЕт Мир!'); + $I->assertEquals($expected, $actual); + + $expected = 'ПРИВЕТ МИР!'; + $actual = Text::upper('привет мир!'); + $I->assertEquals($expected, $actual); + + $expected = 'MÄNNER'; + $actual = Text::upper('MÄNNER'); + $I->assertEquals($expected, $actual); + + $expected = 'MÄNNER'; + $actual = Text::upper('mÄnnER'); + $I->assertEquals($expected, $actual); + + $expected = 'MÄNNER'; + $actual = Text::upper('männer'); + $I->assertEquals($expected, $actual); + + } + + /** + * Tests the lower function + * + * @author Nikolaos Dimopoulos + * @since 2014-09-29 + */ + public function testLower(UnitTester $I) + { + $expected = 'hello'; + $actual = Text::lower('hello'); + $I->assertEquals($expected, $actual); + + $expected = 'hello'; + $actual = Text::lower('HELLO'); + $I->assertEquals($expected, $actual); + + $expected = '1234'; + $actual = Text::lower('1234'); + $I->assertEquals($expected, $actual); + } + + /** + * Tests the lower function for multi-bytes encoding + * + * @author Stanislav Kiryukhin + * @since 2015-05-06 + */ + public function testLowerMultiBytesEncoding(UnitTester $I) + { + $expected = 'привет мир!'; + $actual = Text::lower('привет мир!'); + $I->assertEquals($expected, $actual); + + $expected = 'привет мир!'; + $actual = Text::lower('ПриВЕт Мир!'); + $I->assertEquals($expected, $actual); + + $expected = 'привет мир!'; + $actual = Text::lower('ПРИВЕТ МИР!'); + $I->assertEquals($expected, $actual); + + + $expected = 'männer'; + $actual = Text::lower('männer'); + $I->assertEquals($expected, $actual); + + $expected = 'männer'; + $actual = Text::lower('mÄnnER'); + $I->assertEquals($expected, $actual); + + $expected = 'männer'; + $actual = Text::lower('MÄNNER'); + $I->assertEquals($expected, $actual); + } +} From fb6608684a653b21d2c3b5112da86fea91167729 Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Tue, 6 Nov 2018 16:17:44 -0500 Subject: [PATCH 017/222] [#13578] - WIP Tag test refactoring --- _toCheck/tests/_support/Helper/Unit.php | 34 -- tests/unit/Debug/Helper/ClassProperties.php | 4 +- tests/unit/Tag/Helper/TagBase.php | 53 ++ tests/unit/Tag/TagCheckFieldCest.php | 378 ++++++++++++ tests/unit/Tag/TagCheckFieldTest.php | 436 -------------- tests/unit/Tag/TagColorFieldCest.php | 362 ++++++++++++ tests/unit/Tag/TagColorFieldTest.php | 433 -------------- tests/unit/Tag/TagDateFieldCest.php | 362 ++++++++++++ tests/unit/Tag/TagDateFieldTest.php | 433 -------------- tests/unit/Tag/TagDateTimeFieldCest.php | 362 ++++++++++++ tests/unit/Tag/TagDateTimeFieldTest.php | 433 -------------- tests/unit/Tag/TagDateTimeLocalFieldCest.php | 364 ++++++++++++ tests/unit/Tag/TagDateTimeLocalFieldTest.php | 435 -------------- ...{TagDoctypeTest.php => TagDoctypeCest.php} | 136 ++--- tests/unit/Tag/TagEmailFieldCest.php | 362 ++++++++++++ tests/unit/Tag/TagEmailFieldTest.php | 433 -------------- tests/unit/Tag/TagFileFieldCest.php | 362 ++++++++++++ tests/unit/Tag/TagFileFieldTest.php | 433 -------------- tests/unit/Tag/TagFriendlyTitleCest.php | 194 +++++++ tests/unit/Tag/TagFriendlyTitleTest.php | 251 -------- tests/unit/Tag/TagHiddenFieldCest.php | 362 ++++++++++++ tests/unit/Tag/TagHiddenFieldTest.php | 433 -------------- tests/unit/Tag/TagImageCest.php | 433 ++++++++++++++ tests/unit/Tag/TagImageInputCest.php | 354 ++++++++++++ tests/unit/Tag/TagImageInputTest.php | 425 -------------- tests/unit/Tag/TagImageTest.php | 544 ------------------ ...eTest.php => TagJavascriptIncludeCest.php} | 44 +- .../{TagLinkToTest.php => TagLinkToCest.php} | 74 +-- ...nthFieldTest.php => TagMonthFieldCest.php} | 142 +++-- ...cFieldTest.php => TagNumericFieldCest.php} | 142 +++-- ...FieldTest.php => TagPasswordFieldCest.php} | 142 +++-- ...dioFieldTest.php => TagRadioFieldCest.php} | 142 +++-- ...ngeFieldTest.php => TagRangeFieldCest.php} | 142 +++-- ...setInputTest.php => TagResetInputCest.php} | 46 +- ...chFieldTest.php => TagSearchFieldCest.php} | 142 +++-- ...StaticTest.php => TagSelectStaticCest.php} | 116 ++-- ...tDefaultTest.php => TagSetDefaultCest.php} | 26 +- ...linkTest.php => TagStylesheetlinkCest.php} | 64 ++- ...ButtonTest.php => TagSubmitButtonCest.php} | 142 +++-- ...{TagTagHtmlTest.php => TagTagHtmlCest.php} | 84 +-- ...agTelFieldTest.php => TagTelFieldCest.php} | 142 +++-- ...agTextAreaTest.php => TagTextAreaCest.php} | 92 +-- ...TextFieldTest.php => TagTextFieldCest.php} | 142 +++-- ...TimeFieldTest.php => TagTimeFieldCest.php} | 142 +++-- .../{TagTitleTest.php => TagTitleCest.php} | 82 +-- ...agUrlFieldTest.php => TagUrlFieldCest.php} | 142 +++-- ...WeekFieldTest.php => TagWeekFieldCest.php} | 142 +++-- tests/unit/Text/TextCamelizeCest.php | 40 +- tests/unit/Text/TextUncamelizeCest.php | 34 +- 49 files changed, 5395 insertions(+), 5822 deletions(-) create mode 100644 tests/unit/Tag/Helper/TagBase.php create mode 100644 tests/unit/Tag/TagCheckFieldCest.php delete mode 100644 tests/unit/Tag/TagCheckFieldTest.php create mode 100644 tests/unit/Tag/TagColorFieldCest.php delete mode 100644 tests/unit/Tag/TagColorFieldTest.php create mode 100644 tests/unit/Tag/TagDateFieldCest.php delete mode 100644 tests/unit/Tag/TagDateFieldTest.php create mode 100644 tests/unit/Tag/TagDateTimeFieldCest.php delete mode 100644 tests/unit/Tag/TagDateTimeFieldTest.php create mode 100644 tests/unit/Tag/TagDateTimeLocalFieldCest.php delete mode 100644 tests/unit/Tag/TagDateTimeLocalFieldTest.php rename tests/unit/Tag/{TagDoctypeTest.php => TagDoctypeCest.php} (60%) create mode 100644 tests/unit/Tag/TagEmailFieldCest.php delete mode 100644 tests/unit/Tag/TagEmailFieldTest.php create mode 100644 tests/unit/Tag/TagFileFieldCest.php delete mode 100644 tests/unit/Tag/TagFileFieldTest.php create mode 100644 tests/unit/Tag/TagFriendlyTitleCest.php delete mode 100644 tests/unit/Tag/TagFriendlyTitleTest.php create mode 100644 tests/unit/Tag/TagHiddenFieldCest.php delete mode 100644 tests/unit/Tag/TagHiddenFieldTest.php create mode 100644 tests/unit/Tag/TagImageCest.php create mode 100644 tests/unit/Tag/TagImageInputCest.php delete mode 100644 tests/unit/Tag/TagImageInputTest.php delete mode 100644 tests/unit/Tag/TagImageTest.php rename tests/unit/Tag/{TagJavascriptIncludeTest.php => TagJavascriptIncludeCest.php} (77%) rename tests/unit/Tag/{TagLinkToTest.php => TagLinkToCest.php} (80%) rename tests/unit/Tag/{TagMonthFieldTest.php => TagMonthFieldCest.php} (80%) rename tests/unit/Tag/{TagNumericFieldTest.php => TagNumericFieldCest.php} (80%) rename tests/unit/Tag/{TagPasswordFieldTest.php => TagPasswordFieldCest.php} (80%) rename tests/unit/Tag/{TagRadioFieldTest.php => TagRadioFieldCest.php} (80%) rename tests/unit/Tag/{TagRangeFieldTest.php => TagRangeFieldCest.php} (80%) rename tests/unit/Tag/{TagResetInputTest.php => TagResetInputCest.php} (78%) rename tests/unit/Tag/{TagSearchFieldTest.php => TagSearchFieldCest.php} (80%) rename tests/unit/Tag/{TagSelectStaticTest.php => TagSelectStaticCest.php} (88%) rename tests/unit/Tag/{TagSetDefaultTest.php => TagSetDefaultCest.php} (66%) rename tests/unit/Tag/{TagStylesheetlinkTest.php => TagStylesheetlinkCest.php} (81%) rename tests/unit/Tag/{TagSubmitButtonTest.php => TagSubmitButtonCest.php} (79%) rename tests/unit/Tag/{TagTagHtmlTest.php => TagTagHtmlCest.php} (78%) rename tests/unit/Tag/{TagTelFieldTest.php => TagTelFieldCest.php} (80%) rename tests/unit/Tag/{TagTextAreaTest.php => TagTextAreaCest.php} (78%) rename tests/unit/Tag/{TagTextFieldTest.php => TagTextFieldCest.php} (80%) rename tests/unit/Tag/{TagTimeFieldTest.php => TagTimeFieldCest.php} (80%) rename tests/unit/Tag/{TagTitleTest.php => TagTitleCest.php} (71%) rename tests/unit/Tag/{TagUrlFieldTest.php => TagUrlFieldCest.php} (80%) rename tests/unit/Tag/{TagWeekFieldTest.php => TagWeekFieldCest.php} (80%) diff --git a/_toCheck/tests/_support/Helper/Unit.php b/_toCheck/tests/_support/Helper/Unit.php index e2d2a4b4112..e54acc693d2 100644 --- a/_toCheck/tests/_support/Helper/Unit.php +++ b/_toCheck/tests/_support/Helper/Unit.php @@ -93,38 +93,4 @@ public function cleanFile($path, $fileName) unlink($file); } } - - /** - * Runs the test for a Tag::$function with $options - * - * @param string $function - * @param mixed $options - * @param string $expected - * @param boolean $xhtml - * @param string $set - */ - public function testFieldParameter($function, $options, $expected, $xhtml, $set = '') - { - Tag::resetInput(); - - if ($xhtml) { - Tag::setDocType(Tag::XHTML10_STRICT); - $expected .= ' />'; - } else { - Tag::setDocType(Tag::HTML5); - $expected .= '>'; - } - - if ($set) { - Tag::displayTo('x_name', 'x_value'); - } - - $actual = Tag::$function($options); - - if ($set) { - Tag::$set('x_name', ''); - } - - $this->assertEquals($expected, $actual); - } } diff --git a/tests/unit/Debug/Helper/ClassProperties.php b/tests/unit/Debug/Helper/ClassProperties.php index 9c7d61c8b2b..701dfa42c43 100644 --- a/tests/unit/Debug/Helper/ClassProperties.php +++ b/tests/unit/Debug/Helper/ClassProperties.php @@ -4,7 +4,7 @@ class ClassProperties { - public $foo = 1; + public $foo = 1; protected $bar = 2; - private $baz = 3; + private $baz = 3; } diff --git a/tests/unit/Tag/Helper/TagBase.php b/tests/unit/Tag/Helper/TagBase.php new file mode 100644 index 00000000000..e80888fb04c --- /dev/null +++ b/tests/unit/Tag/Helper/TagBase.php @@ -0,0 +1,53 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Tag\Helper; + +use Phalcon\Tag; +use UnitTester; + +class TagBase +{ + /** + * Runs the test for a Tag::$function with $options + * + * @param \UnitTester $I + * @param string $function + * @param mixed $options + * @param string $expected + * @param boolean $xhtml + * @param string $set + */ + protected function testFieldParameter(UnitTester $I, $function, $options, $expected, $xhtml, $set = '') + { + Tag::resetInput(); + + if ($xhtml) { + Tag::setDocType(Tag::XHTML10_STRICT); + $expected .= ' />'; + } else { + Tag::setDocType(Tag::HTML5); + $expected .= '>'; + } + + if ($set) { + Tag::displayTo('x_name', 'x_value'); + } + + $actual = Tag::$function($options); + + if ($set) { + Tag::$set('x_name', ''); + } + + $I->assertEquals($expected, $actual); + } +} diff --git a/tests/unit/Tag/TagCheckFieldCest.php b/tests/unit/Tag/TagCheckFieldCest.php new file mode 100644 index 00000000000..b09de24beac --- /dev/null +++ b/tests/unit/Tag/TagCheckFieldCest.php @@ -0,0 +1,378 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Tag; + +use Phalcon\Tag; +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; + +class TagCheckFieldCest extends TagBase +{ + /** + * Tests checkField with string as a parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testCheckFieldStringParameter(UnitTester $I) + { + $options = 'x_name'; + $expected = 'testFieldParameter( + $I, + 'checkField', + $options, + $expected, + false + ); + + $options = 'x_name'; + $expected = 'testFieldParameter( + $I, + 'checkField', + $options, + $expected, + true + ); + } + + /** + * Tests checkField with array as a parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testCheckFieldArrayParameter(UnitTester $I) + { + $options = [ + 'x_name', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'checkField', + $options, + $expected, + false + ); + + $options = [ + 'x_name', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'checkField', + $options, + $expected, + true + ); + } + + /** + * Tests checkField with array as a parameters and id in it + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testCheckFieldArrayParameterWithId(UnitTester $I) + { + $options = [ + 'x_name', + 'id' => 'x_id', + 'class' => 'x_class', + 'size' => '10' + ]; + $expected = 'testFieldParameter( + $I, + 'checkField', + $options, + $expected, + true + ); + + $options = [ + 'x_name', + 'id' => 'x_id', + 'class' => 'x_class', + 'size' => '10' + ]; + $expected = 'testFieldParameter( + $I, + 'checkField', + $options, + $expected, + true + ); + } + + /** + * Tests checkField with name and no id in parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testCheckFieldArrayParameterWithNameNoId(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'checkField', + $options, + $expected, + false + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'checkField', + $options, + $expected, + false + ); + } + + /** + * Tests checkField with setDefault + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testCheckFieldWithSetDefault(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'checkField', + $options, + $expected, + false, + 'setDefault' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'checkField', + $options, + $expected, + true, + 'setDefault' + ); + } + + /** + * Tests checkField with displayTo + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testCheckFieldWithDisplayTo(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'checkField', + $options, + $expected, + false, + 'displayTo' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'checkField', + $options, + $expected, + true, + 'displayTo' + ); + } + + /** + * Tests checkField with setDefault and element not present + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testCheckFieldWithSetDefaultElementNotPresent(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'checkField', + $options, + $expected, + false, + 'setDefault' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'checkField', + $options, + $expected, + true, + 'setDefault' + ); + } + + /** + * Tests checkField with displayTo and element not present + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testCheckFieldWithDisplayToElementNotPresent(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'checkField', + $options, + $expected, + false, + 'displayTo' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'checkField', + $options, + $expected, + true, + 'displayTo' + ); + } + + /** + * Tests checkField with setDefault and with a value of zero + * + * @test + * @issue https://github.com/phalcon/cphalcon/issues/12316 + * @author Serghei Iakovlev + * @since 2016-12-19 + */ + public function shouldGenerateCheckFieldAsCheckedWhenValueIsZeroAndDefaultIsZero(UnitTester $I) + { + $examples = [ + [ 0, "0", ''], + [ 0, 0, ''], + ["0", 0, ''], + ["0", "0", ''], + ]; + + foreach ($examples as $example) { + $value = $example[0]; + $default = $example[1]; + $expected = $example[2]; + + Tag::resetInput(); + Tag::setDocType(Tag::HTML5); + Tag::setDefault("demo-0", $default); + + $actual = Tag::checkField(['demo-0', 'value' => $value]); + $I->assertEquals($expected, $actual); + } + } +} diff --git a/tests/unit/Tag/TagCheckFieldTest.php b/tests/unit/Tag/TagCheckFieldTest.php deleted file mode 100644 index 7732ef82d55..00000000000 --- a/tests/unit/Tag/TagCheckFieldTest.php +++ /dev/null @@ -1,436 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Tag - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class TagCheckFieldTest extends UnitTest -{ - /** - * Tests checkField with string as a parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testCheckFieldStringParameter() - { - $this->specify( - "checkField with string parameter returns invalid HTML Strict", - function () { - $options = 'x_name'; - $expected = 'tester->testFieldParameter( - 'checkField', - $options, - $expected, - false - ); - } - ); - $this->specify( - "checkField with string parameter returns invalid HTML XHTML", - function () { - $options = 'x_name'; - $expected = 'tester->testFieldParameter( - 'checkField', - $options, - $expected, - true - ); - } - ); - } - /** - * Tests checkField with array as a parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testCheckFieldArrayParameter() - { - $this->specify( - "checkField with array parameter returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'checkField', - $options, - $expected, - false - ); - } - ); - $this->specify( - "checkField with array parameter returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'checkField', - $options, - $expected, - true - ); - } - ); - } - /** - * Tests checkField with array as a parameters and id in it - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testCheckFieldArrayParameterWithId() - { - $this->specify( - "checkField with array parameter with id returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'id' => 'x_id', - 'class' => 'x_class', - 'size' => '10' - ]; - $expected = 'tester->testFieldParameter( - 'checkField', - $options, - $expected, - true - ); - } - ); - $this->specify( - "checkField with array parameter with id returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'id' => 'x_id', - 'class' => 'x_class', - 'size' => '10' - ]; - $expected = 'tester->testFieldParameter( - 'checkField', - $options, - $expected, - true - ); - } - ); - } - /** - * Tests checkField with name and no id in parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testCheckFieldArrayParameterWithNameNoId() - { - $this->specify( - "checkField with array parameter with name no id returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'checkField', - $options, - $expected, - false - ); - } - ); - $this->specify( - "checkField with array parameter with name no id returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'checkField', - $options, - $expected, - false - ); - } - ); - } - /** - * Tests checkField with setDefault - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testCheckFieldWithSetDefault() - { - $this->specify( - "checkField with setDefault returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'checkField', - $options, - $expected, - false, - 'setDefault' - ); - } - ); - $this->specify( - "checkField with setDefault returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'checkField', - $options, - $expected, - true, - 'setDefault' - ); - } - ); - } - /** - * Tests checkField with displayTo - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testCheckFieldWithDisplayTo() - { - $this->specify( - "checkField with displayTo returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'checkField', - $options, - $expected, - false, - 'displayTo' - ); - } - ); - $this->specify( - "checkField with displayTo returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'checkField', - $options, - $expected, - true, - 'displayTo' - ); - } - ); - } - /** - * Tests checkField with setDefault and element not present - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testCheckFieldWithSetDefaultElementNotPresent() - { - $this->specify( - "checkField with setDefault and element not present returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'checkField', - $options, - $expected, - false, - 'setDefault' - ); - } - ); - $this->specify( - "checkField with setDefault and element not present returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'checkField', - $options, - $expected, - true, - 'setDefault' - ); - } - ); - } - /** - * Tests checkField with displayTo and element not present - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testCheckFieldWithDisplayToElementNotPresent() - { - $this->specify( - "checkField with displayTo and element not present returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'checkField', - $options, - $expected, - false, - 'displayTo' - ); - } - ); - $this->specify( - "checkField with displayTo and element not present returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'checkField', - $options, - $expected, - true, - 'displayTo' - ); - } - ); - } - - /** - * Tests checkField with setDefault and with a value of zero - * - * @test - * @issue https://github.com/phalcon/cphalcon/issues/12316 - * @author Serghei Iakovlev - * @since 2016-12-19 - */ - public function shouldGenerateCheckFieldAsCheckedWhenValueIsZeroAndDefaultIsZero() - { - $this->specify( - 'The checkbox cannot have value 0 and be checked', - function ($value, $default, $expected) { - Tag::resetInput(); - Tag::setDocType(Tag::HTML5); - Tag::setDefault("demo-0", $default); - - expect(Tag::checkField(['demo-0', 'value' => $value]))->equals($expected); - }, - ['examples' => $this->nullableValueProvider()] - ); - } - - protected function nullableValueProvider() - { - return [ - [ 0, "0", ''], - [ 0, 0, ''], - ["0", 0, ''], - ["0", "0", ''], - ]; - } -} diff --git a/tests/unit/Tag/TagColorFieldCest.php b/tests/unit/Tag/TagColorFieldCest.php new file mode 100644 index 00000000000..c3571a1d2ac --- /dev/null +++ b/tests/unit/Tag/TagColorFieldCest.php @@ -0,0 +1,362 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Tag; + +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; + +class TagColorFieldCest extends TagBase +{ + /** + * Tests colorField with string as a parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testColorFieldStringParameter(UnitTester $I) + { + $options = 'x_name'; + $expected = 'testFieldParameter( + $I, + 'colorField', + $options, + $expected, + false + ); + + $options = 'x_name'; + $expected = 'testFieldParameter( + $I, + 'colorField', + $options, + $expected, + true + ); + } + + /** + * Tests colorField with array as a parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testColorFieldArrayParameter(UnitTester $I) + { + $options = [ + 'x_name', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'colorField', + $options, + $expected, + false + ); + + $options = [ + 'x_name', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'colorField', + $options, + $expected, + true + ); + } + + /** + * Tests colorField with array as a parameters and id in it + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testColorFieldArrayParameterWithId(UnitTester $I) + { + $options = [ + 'x_name', + 'id' => 'x_id', + 'class' => 'x_class', + 'size' => '10' + ]; + $expected = 'testFieldParameter( + $I, + 'colorField', + $options, + $expected, + true + ); + + $options = [ + 'x_name', + 'id' => 'x_id', + 'class' => 'x_class', + 'size' => '10' + ]; + $expected = 'testFieldParameter( + $I, + 'colorField', + $options, + $expected, + true + ); + } + + /** + * Tests colorField with name and no id in parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testColorFieldArrayParameterWithNameNoId(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'colorField', + $options, + $expected, + false + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'colorField', + $options, + $expected, + false + ); + } + + /** + * Tests colorField with setDefault + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testColorFieldWithSetDefault(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'colorField', + $options, + $expected, + false, + 'setDefault' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'colorField', + $options, + $expected, + true, + 'setDefault' + ); + } + + /** + * Tests colorField with displayTo + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testColorFieldWithDisplayTo(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'colorField', + $options, + $expected, + false, + 'displayTo' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'colorField', + $options, + $expected, + true, + 'displayTo' + ); + } + + /** + * Tests colorField with setDefault and element not present + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testColorFieldWithSetDefaultElementNotPresent(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'colorField', + $options, + $expected, + false, + 'setDefault' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'colorField', + $options, + $expected, + true, + 'setDefault' + ); + } + + /** + * Tests colorField with displayTo and element not present + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testColorFieldWithDisplayToElementNotPresent(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'colorField', + $options, + $expected, + false, + 'displayTo' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'colorField', + $options, + $expected, + true, + 'displayTo' + ); + } +} diff --git a/tests/unit/Tag/TagColorFieldTest.php b/tests/unit/Tag/TagColorFieldTest.php deleted file mode 100644 index 51312acf4a7..00000000000 --- a/tests/unit/Tag/TagColorFieldTest.php +++ /dev/null @@ -1,433 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Tag - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class TagColorFieldTest extends UnitTest -{ - /** - * Tests colorField with string as a parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testColorFieldStringParameter() - { - $this->specify( - "colorField with string parameter returns invalid HTML Strict", - function () { - $options = 'x_name'; - $expected = 'tester->testFieldParameter( - 'colorField', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "colorField with string parameter returns invalid HTML XHTML", - function () { - $options = 'x_name'; - $expected = 'tester->testFieldParameter( - 'colorField', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests colorField with array as a parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testColorFieldArrayParameter() - { - $this->specify( - "colorField with array parameter returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'colorField', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "colorField with array parameter returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'colorField', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests colorField with array as a parameters and id in it - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testColorFieldArrayParameterWithId() - { - $this->specify( - "colorField with array parameter with id returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'id' => 'x_id', - 'class' => 'x_class', - 'size' => '10' - ]; - $expected = 'tester->testFieldParameter( - 'colorField', - $options, - $expected, - true - ); - } - ); - - $this->specify( - "colorField with array parameter with id returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'id' => 'x_id', - 'class' => 'x_class', - 'size' => '10' - ]; - $expected = 'tester->testFieldParameter( - 'colorField', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests colorField with name and no id in parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testColorFieldArrayParameterWithNameNoId() - { - $this->specify( - "colorField with array parameter with name no id returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'colorField', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "colorField with array parameter with name no id returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'colorField', - $options, - $expected, - false - ); - } - ); - } - - /** - * Tests colorField with setDefault - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testColorFieldWithSetDefault() - { - $this->specify( - "colorField with setDefault returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'colorField', - $options, - $expected, - false, - 'setDefault' - ); - } - ); - - $this->specify( - "colorField with setDefault returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'colorField', - $options, - $expected, - true, - 'setDefault' - ); - } - ); - } - - /** - * Tests colorField with displayTo - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testColorFieldWithDisplayTo() - { - $this->specify( - "colorField with displayTo returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'colorField', - $options, - $expected, - false, - 'displayTo' - ); - } - ); - - $this->specify( - "colorField with displayTo returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'colorField', - $options, - $expected, - true, - 'displayTo' - ); - } - ); - } - - /** - * Tests colorField with setDefault and element not present - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testColorFieldWithSetDefaultElementNotPresent() - { - $this->specify( - "colorField with setDefault and element not present returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'colorField', - $options, - $expected, - false, - 'setDefault' - ); - } - ); - - $this->specify( - "colorField with setDefault and element not present returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'colorField', - $options, - $expected, - true, - 'setDefault' - ); - } - ); - } - - /** - * Tests colorField with displayTo and element not present - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testColorFieldWithDisplayToElementNotPresent() - { - $this->specify( - "colorField with displayTo and element not present returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'colorField', - $options, - $expected, - false, - 'displayTo' - ); - } - ); - - $this->specify( - "colorField with displayTo and element not present returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'colorField', - $options, - $expected, - true, - 'displayTo' - ); - } - ); - } -} diff --git a/tests/unit/Tag/TagDateFieldCest.php b/tests/unit/Tag/TagDateFieldCest.php new file mode 100644 index 00000000000..2f49ebccf40 --- /dev/null +++ b/tests/unit/Tag/TagDateFieldCest.php @@ -0,0 +1,362 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Tag; + +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; + +class TagDateFieldCest extends TagBase +{ + /** + * Tests dateField with string as a parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateFieldStringParameter(UnitTester $I) + { + $options = 'x_name'; + $expected = 'testFieldParameter( + $I, + 'dateField', + $options, + $expected, + false + ); + + $options = 'x_name'; + $expected = 'testFieldParameter( + $I, + 'dateField', + $options, + $expected, + true + ); + } + + /** + * Tests dateField with array as a parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateFieldArrayParameter(UnitTester $I) + { + $options = [ + 'x_name', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'dateField', + $options, + $expected, + false + ); + + $options = [ + 'x_name', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'dateField', + $options, + $expected, + true + ); + } + + /** + * Tests dateField with array as a parameters and id in it + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateFieldArrayParameterWithId(UnitTester $I) + { + $options = [ + 'x_name', + 'id' => 'x_id', + 'class' => 'x_class', + 'size' => '10' + ]; + $expected = 'testFieldParameter( + $I, + 'dateField', + $options, + $expected, + true + ); + + $options = [ + 'x_name', + 'id' => 'x_id', + 'class' => 'x_class', + 'size' => '10' + ]; + $expected = 'testFieldParameter( + $I, + 'dateField', + $options, + $expected, + true + ); + } + + /** + * Tests dateField with name and no id in parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateFieldArrayParameterWithNameNoId(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateField', + $options, + $expected, + false + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateField', + $options, + $expected, + false + ); + } + + /** + * Tests dateField with setDefault + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateFieldWithSetDefault(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateField', + $options, + $expected, + false, + 'setDefault' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateField', + $options, + $expected, + true, + 'setDefault' + ); + } + + /** + * Tests dateField with displayTo + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateFieldWithDisplayTo(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateField', + $options, + $expected, + false, + 'displayTo' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateField', + $options, + $expected, + true, + 'displayTo' + ); + } + + /** + * Tests dateField with setDefault and element not present + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateFieldWithSetDefaultElementNotPresent(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateField', + $options, + $expected, + false, + 'setDefault' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateField', + $options, + $expected, + true, + 'setDefault' + ); + } + + /** + * Tests dateField with displayTo and element not present + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateFieldWithDisplayToElementNotPresent(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateField', + $options, + $expected, + false, + 'displayTo' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateField', + $options, + $expected, + true, + 'displayTo' + ); + } +} diff --git a/tests/unit/Tag/TagDateFieldTest.php b/tests/unit/Tag/TagDateFieldTest.php deleted file mode 100644 index 162fdf71d53..00000000000 --- a/tests/unit/Tag/TagDateFieldTest.php +++ /dev/null @@ -1,433 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Tag - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class TagDateFieldTest extends UnitTest -{ - /** - * Tests dateField with string as a parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateFieldStringParameter() - { - $this->specify( - "dateField with string parameter returns invalid HTML Strict", - function () { - $options = 'x_name'; - $expected = 'tester->testFieldParameter( - 'dateField', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "dateField with string parameter returns invalid HTML XHTML", - function () { - $options = 'x_name'; - $expected = 'tester->testFieldParameter( - 'dateField', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests dateField with array as a parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateFieldArrayParameter() - { - $this->specify( - "dateField with array parameter returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'dateField', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "dateField with array parameter returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'dateField', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests dateField with array as a parameters and id in it - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateFieldArrayParameterWithId() - { - $this->specify( - "dateField with array parameter with id returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'id' => 'x_id', - 'class' => 'x_class', - 'size' => '10' - ]; - $expected = 'tester->testFieldParameter( - 'dateField', - $options, - $expected, - true - ); - } - ); - - $this->specify( - "dateField with array parameter with id returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'id' => 'x_id', - 'class' => 'x_class', - 'size' => '10' - ]; - $expected = 'tester->testFieldParameter( - 'dateField', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests dateField with name and no id in parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateFieldArrayParameterWithNameNoId() - { - $this->specify( - "dateField with array parameter with name no id returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateField', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "dateField with array parameter with name no id returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateField', - $options, - $expected, - false - ); - } - ); - } - - /** - * Tests dateField with setDefault - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateFieldWithSetDefault() - { - $this->specify( - "dateField with setDefault returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateField', - $options, - $expected, - false, - 'setDefault' - ); - } - ); - - $this->specify( - "dateField with setDefault returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateField', - $options, - $expected, - true, - 'setDefault' - ); - } - ); - } - - /** - * Tests dateField with displayTo - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateFieldWithDisplayTo() - { - $this->specify( - "dateField with displayTo returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateField', - $options, - $expected, - false, - 'displayTo' - ); - } - ); - - $this->specify( - "dateField with displayTo returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateField', - $options, - $expected, - true, - 'displayTo' - ); - } - ); - } - - /** - * Tests dateField with setDefault and element not present - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateFieldWithSetDefaultElementNotPresent() - { - $this->specify( - "dateField with setDefault and element not present returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateField', - $options, - $expected, - false, - 'setDefault' - ); - } - ); - - $this->specify( - "dateField with setDefault and element not present returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateField', - $options, - $expected, - true, - 'setDefault' - ); - } - ); - } - - /** - * Tests dateField with displayTo and element not present - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateFieldWithDisplayToElementNotPresent() - { - $this->specify( - "dateField with displayTo and element not present returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateField', - $options, - $expected, - false, - 'displayTo' - ); - } - ); - - $this->specify( - "dateField with displayTo and element not present returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateField', - $options, - $expected, - true, - 'displayTo' - ); - } - ); - } -} diff --git a/tests/unit/Tag/TagDateTimeFieldCest.php b/tests/unit/Tag/TagDateTimeFieldCest.php new file mode 100644 index 00000000000..1d13e3a5fe9 --- /dev/null +++ b/tests/unit/Tag/TagDateTimeFieldCest.php @@ -0,0 +1,362 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Tag; + +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; + +class TagDateTimeFieldCest extends TagBase +{ + /** + * Tests dateTimeField with string as a parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateTimeFieldStringParameter(UnitTester $I) + { + $options = 'x_name'; + $expected = 'testFieldParameter( + $I, + 'dateTimeField', + $options, + $expected, + false + ); + + $options = 'x_name'; + $expected = 'testFieldParameter( + $I, + 'dateTimeField', + $options, + $expected, + true + ); + } + + /** + * Tests dateTimeField with array as a parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateTimeFieldArrayParameter(UnitTester $I) + { + $options = [ + 'x_name', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeField', + $options, + $expected, + false + ); + + $options = [ + 'x_name', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeField', + $options, + $expected, + true + ); + } + + /** + * Tests dateTimeField with array as a parameters and id in it + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateTimeFieldArrayParameterWithId(UnitTester $I) + { + $options = [ + 'x_name', + 'id' => 'x_id', + 'class' => 'x_class', + 'size' => '10' + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeField', + $options, + $expected, + true + ); + + $options = [ + 'x_name', + 'id' => 'x_id', + 'class' => 'x_class', + 'size' => '10' + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeField', + $options, + $expected, + true + ); + } + + /** + * Tests dateTimeField with name and no id in parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateTimeFieldArrayParameterWithNameNoId(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeField', + $options, + $expected, + false + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeField', + $options, + $expected, + false + ); + } + + /** + * Tests dateTimeField with setDefault + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateTimeFieldWithSetDefault(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeField', + $options, + $expected, + false, + 'setDefault' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeField', + $options, + $expected, + true, + 'setDefault' + ); + } + + /** + * Tests dateTimeField with displayTo + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateTimeFieldWithDisplayTo(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeField', + $options, + $expected, + false, + 'displayTo' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeField', + $options, + $expected, + true, + 'displayTo' + ); + } + + /** + * Tests dateTimeField with setDefault and element not present + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateTimeFieldWithSetDefaultElementNotPresent(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeField', + $options, + $expected, + false, + 'setDefault' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeField', + $options, + $expected, + true, + 'setDefault' + ); + } + + /** + * Tests dateTimeField with displayTo and element not present + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateTimeFieldWithDisplayToElementNotPresent(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeField', + $options, + $expected, + false, + 'displayTo' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeField', + $options, + $expected, + true, + 'displayTo' + ); + } +} diff --git a/tests/unit/Tag/TagDateTimeFieldTest.php b/tests/unit/Tag/TagDateTimeFieldTest.php deleted file mode 100644 index 5a6876947c3..00000000000 --- a/tests/unit/Tag/TagDateTimeFieldTest.php +++ /dev/null @@ -1,433 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Tag - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class TagDateTimeFieldTest extends UnitTest -{ - /** - * Tests dateTimeField with string as a parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateTimeFieldStringParameter() - { - $this->specify( - "dateTimeField with string parameter returns invalid HTML Strict", - function () { - $options = 'x_name'; - $expected = 'tester->testFieldParameter( - 'dateTimeField', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "dateTimeField with string parameter returns invalid HTML XHTML", - function () { - $options = 'x_name'; - $expected = 'tester->testFieldParameter( - 'dateTimeField', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests dateTimeField with array as a parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateTimeFieldArrayParameter() - { - $this->specify( - "dateTimeField with array parameter returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeField', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "dateTimeField with array parameter returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeField', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests dateTimeField with array as a parameters and id in it - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateTimeFieldArrayParameterWithId() - { - $this->specify( - "dateTimeField with array parameter with id returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'id' => 'x_id', - 'class' => 'x_class', - 'size' => '10' - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeField', - $options, - $expected, - true - ); - } - ); - - $this->specify( - "dateTimeField with array parameter with id returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'id' => 'x_id', - 'class' => 'x_class', - 'size' => '10' - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeField', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests dateTimeField with name and no id in parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateTimeFieldArrayParameterWithNameNoId() - { - $this->specify( - "dateTimeField with array parameter with name no id returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeField', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "dateTimeField with array parameter with name no id returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeField', - $options, - $expected, - false - ); - } - ); - } - - /** - * Tests dateTimeField with setDefault - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateTimeFieldWithSetDefault() - { - $this->specify( - "dateTimeField with setDefault returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeField', - $options, - $expected, - false, - 'setDefault' - ); - } - ); - - $this->specify( - "dateTimeField with setDefault returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeField', - $options, - $expected, - true, - 'setDefault' - ); - } - ); - } - - /** - * Tests dateTimeField with displayTo - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateTimeFieldWithDisplayTo() - { - $this->specify( - "dateTimeField with displayTo returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeField', - $options, - $expected, - false, - 'displayTo' - ); - } - ); - - $this->specify( - "dateTimeField with displayTo returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeField', - $options, - $expected, - true, - 'displayTo' - ); - } - ); - } - - /** - * Tests dateTimeField with setDefault and element not present - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateTimeFieldWithSetDefaultElementNotPresent() - { - $this->specify( - "dateTimeField with setDefault and element not present returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeField', - $options, - $expected, - false, - 'setDefault' - ); - } - ); - - $this->specify( - "dateTimeField with setDefault and element not present returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeField', - $options, - $expected, - true, - 'setDefault' - ); - } - ); - } - - /** - * Tests dateTimeField with displayTo and element not present - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateTimeFieldWithDisplayToElementNotPresent() - { - $this->specify( - "dateTimeField with displayTo and element not present returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeField', - $options, - $expected, - false, - 'displayTo' - ); - } - ); - - $this->specify( - "dateTimeField with displayTo and element not present returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeField', - $options, - $expected, - true, - 'displayTo' - ); - } - ); - } -} diff --git a/tests/unit/Tag/TagDateTimeLocalFieldCest.php b/tests/unit/Tag/TagDateTimeLocalFieldCest.php new file mode 100644 index 00000000000..f372b4dfa9c --- /dev/null +++ b/tests/unit/Tag/TagDateTimeLocalFieldCest.php @@ -0,0 +1,364 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Tag; + +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; + +class TagDateTimeLocalFieldCest extends TagBase +{ + /** + * Tests dateTimeLocalField with string as a parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateTimeLocalFieldStringParameter(UnitTester $I) + { + $options = 'x_name'; + $expected = 'testFieldParameter( + $I, + 'dateTimeLocalField', + $options, + $expected, + false + ); + + $options = 'x_name'; + $expected = 'testFieldParameter( + $I, + 'dateTimeLocalField', + $options, + $expected, + true + ); + } + + /** + * Tests dateTimeLocalField with array as a parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateTimeLocalFieldArrayParameter(UnitTester $I) + { + $options = [ + 'x_name', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeLocalField', + $options, + $expected, + false + ); + + $options = [ + 'x_name', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeLocalField', + $options, + $expected, + true + ); + } + + /** + * Tests dateTimeLocalField with array as a parameters and id in it + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateTimeLocalFieldArrayParameterWithId(UnitTester $I) + { + $options = [ + 'x_name', + 'id' => 'x_id', + 'class' => 'x_class', + 'size' => '10' + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeLocalField', + $options, + $expected, + true + ); + + $options = [ + 'x_name', + 'id' => 'x_id', + 'class' => 'x_class', + 'size' => '10' + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeLocalField', + $options, + $expected, + true + ); + } + + /** + * Tests dateTimeLocalField with name and no id in parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateTimeLocalFieldArrayParameterWithNameNoId(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeLocalField', + $options, + $expected, + false + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeLocalField', + $options, + $expected, + false + ); + } + + /** + * Tests dateTimeLocalField with setDefault + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateTimeLocalFieldWithSetDefault(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeLocalField', + $options, + $expected, + false, + 'setDefault' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeLocalField', + $options, + $expected, + true, + 'setDefault' + ); + } + + /** + * Tests dateTimeLocalField with displayTo + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateTimeLocalFieldWithDisplayTo(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeLocalField', + $options, + $expected, + false, + 'displayTo' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeLocalField', + $options, + $expected, + true, + 'displayTo' + ); + } + + /** + * Tests dateTimeLocalField with setDefault and element not present + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateTimeLocalFieldWithSetDefaultElementNotPresent(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeLocalField', + $options, + $expected, + false, + 'setDefault' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeLocalField', + $options, + $expected, + true, + 'setDefault' + ); + } + + /** + * Tests dateTimeLocalField with displayTo and element not present + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testDateTimeLocalFieldWithDisplayToElementNotPresent(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeLocalField', + $options, + $expected, + false, + 'displayTo' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'dateTimeLocalField', + $options, + $expected, + true, + 'displayTo' + ); + } +} diff --git a/tests/unit/Tag/TagDateTimeLocalFieldTest.php b/tests/unit/Tag/TagDateTimeLocalFieldTest.php deleted file mode 100644 index c7af3af2edd..00000000000 --- a/tests/unit/Tag/TagDateTimeLocalFieldTest.php +++ /dev/null @@ -1,435 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Tag - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class TagDateTimeLocalFieldTest extends UnitTest -{ - /** - * Tests dateTimeLocalField with string as a parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateTimeLocalFieldStringParameter() - { - $this->specify( - "dateTimeLocalField with string parameter returns invalid HTML Strict", - function () { - $options = 'x_name'; - $expected = 'tester->testFieldParameter( - 'dateTimeLocalField', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "dateTimeLocalField with string parameter returns invalid HTML XHTML", - function () { - $options = 'x_name'; - $expected = 'tester->testFieldParameter( - 'dateTimeLocalField', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests dateTimeLocalField with array as a parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateTimeLocalFieldArrayParameter() - { - $this->specify( - "dateTimeLocalField with array parameter returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeLocalField', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "dateTimeLocalField with array parameter returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeLocalField', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests dateTimeLocalField with array as a parameters and id in it - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateTimeLocalFieldArrayParameterWithId() - { - $this->specify( - "dateTimeLocalField with array parameter with id returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'id' => 'x_id', - 'class' => 'x_class', - 'size' => '10' - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeLocalField', - $options, - $expected, - true - ); - } - ); - - $this->specify( - "dateTimeLocalField with array parameter with id returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'id' => 'x_id', - 'class' => 'x_class', - 'size' => '10' - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeLocalField', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests dateTimeLocalField with name and no id in parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateTimeLocalFieldArrayParameterWithNameNoId() - { - $this->specify( - "dateTimeLocalField with array parameter with name no id returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeLocalField', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "dateTimeLocalField with array parameter with name no id returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeLocalField', - $options, - $expected, - false - ); - } - ); - } - - /** - * Tests dateTimeLocalField with setDefault - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateTimeLocalFieldWithSetDefault() - { - $this->specify( - "dateTimeLocalField with setDefault returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeLocalField', - $options, - $expected, - false, - 'setDefault' - ); - } - ); - - $this->specify( - "dateTimeLocalField with setDefault returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeLocalField', - $options, - $expected, - true, - 'setDefault' - ); - } - ); - } - - /** - * Tests dateTimeLocalField with displayTo - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateTimeLocalFieldWithDisplayTo() - { - $this->specify( - "dateTimeLocalField with displayTo returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeLocalField', - $options, - $expected, - false, - 'displayTo' - ); - } - ); - - $this->specify( - "dateTimeLocalField with displayTo returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeLocalField', - $options, - $expected, - true, - 'displayTo' - ); - } - ); - } - - /** - * Tests dateTimeLocalField with setDefault and element not present - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateTimeLocalFieldWithSetDefaultElementNotPresent() - { - $this->specify( - "dateTimeLocalField with setDefault and element not present returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeLocalField', - $options, - $expected, - false, - 'setDefault' - ); - } - ); - - $this->specify( - "dateTimeLocalField with setDefault and element not present returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeLocalField', - $options, - $expected, - true, - 'setDefault' - ); - } - ); - } - - /** - * Tests dateTimeLocalField with displayTo and element not present - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testDateTimeLocalFieldWithDisplayToElementNotPresent() - { - $this->specify( - "dateTimeLocalField with displayTo and element not present returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeLocalField', - $options, - $expected, - false, - 'displayTo' - ); - } - ); - - $this->specify( - "dateTimeLocalField with displayTo and element not present returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'dateTimeLocalField', - $options, - $expected, - true, - 'displayTo' - ); - } - ); - } -} diff --git a/tests/unit/Tag/TagDoctypeTest.php b/tests/unit/Tag/TagDoctypeCest.php similarity index 60% rename from tests/unit/Tag/TagDoctypeTest.php rename to tests/unit/Tag/TagDoctypeCest.php index 460a1065908..da52c1b31f7 100644 --- a/tests/unit/Tag/TagDoctypeTest.php +++ b/tests/unit/Tag/TagDoctypeCest.php @@ -1,33 +1,26 @@ - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Tag + * This file is part of the Phalcon Framework. * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt + * (c) Phalcon Team * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. */ -class TagDoctypeTest extends UnitTest + +namespace Phalcon\Test\Unit\Tag; + +use Phalcon\Tag; +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; + +class TagDoctypeCest extends TagBase { /** * executed after each test */ - protected function _after() + protected function _after(UnitTester $I) { // Setting the doctype to HTML5 for other tests to run smoothly Tag::setDocType(Tag::HTML5); @@ -39,14 +32,9 @@ protected function _after() * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testDoctypeSet32Final() + public function testDoctypeSet32Final(UnitTester $I) { - $this->specify( - "setDoctype to 3.2 is not correct", - function () { - $this->runDoctypeTest(Tag::HTML32); - } - ); + $this->runDoctypeTest($I, Tag::HTML32); } /** @@ -55,14 +43,9 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-04 */ - public function testDoctypeSet401() + public function testDoctypeSet401(UnitTester $I) { - $this->specify( - "setDoctype to HTML 4.01 Strict is not correct", - function () { - $this->runDoctypeTest(Tag::HTML401_STRICT); - } - ); + $this->runDoctypeTest($I, Tag::HTML401_STRICT); } /** @@ -71,14 +54,9 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-04 */ - public function testDoctypeSet401Transitional() + public function testDoctypeSet401Transitional(UnitTester $I) { - $this->specify( - "setDoctype to HTML 4.01 Transitional is not correct", - function () { - $this->runDoctypeTest(Tag::HTML401_TRANSITIONAL); - } - ); + $this->runDoctypeTest($I, Tag::HTML401_TRANSITIONAL); } /** @@ -87,14 +65,9 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-04 */ - public function testDoctypeSet401Frameset() + public function testDoctypeSet401Frameset(UnitTester $I) { - $this->specify( - "setDoctype to HTML 4.01 Frameset is not correct", - function () { - $this->runDoctypeTest(Tag::HTML401_FRAMESET); - } - ); + $this->runDoctypeTest($I, Tag::HTML401_FRAMESET); } /** @@ -103,14 +76,9 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-04 */ - public function testDoctypeSet5() + public function testDoctypeSet5(UnitTester $I) { - $this->specify( - "setDoctype to HTLM5 is not correct", - function () { - $this->runDoctypeTest(Tag::HTML5); - } - ); + $this->runDoctypeTest($I, Tag::HTML5); } /** @@ -119,14 +87,9 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-04 */ - public function testDoctypeSet10Strict() + public function testDoctypeSet10Strict(UnitTester $I) { - $this->specify( - "setDoctype to XHTML 1.0 Strict is not correct", - function () { - $this->runDoctypeTest(Tag::XHTML10_STRICT); - } - ); + $this->runDoctypeTest($I, Tag::XHTML10_STRICT); } /** @@ -135,14 +98,9 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-04 */ - public function testDoctypeSet10Transitional() + public function testDoctypeSet10Transitional(UnitTester $I) { - $this->specify( - "setDoctype to XHTML 1.0 Transitional is not correct", - function () { - $this->runDoctypeTest(Tag::XHTML10_TRANSITIONAL); - } - ); + $this->runDoctypeTest($I, Tag::XHTML10_TRANSITIONAL); } /** @@ -151,14 +109,9 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-04 */ - public function testDoctypeSet10Frameset() + public function testDoctypeSet10Frameset(UnitTester $I) { - $this->specify( - "setDoctype to XHTML 1.0 Frameset is not correct", - function () { - $this->runDoctypeTest(Tag::XHTML10_FRAMESET); - } - ); + $this->runDoctypeTest($I, Tag::XHTML10_FRAMESET); } /** @@ -167,14 +120,9 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-04 */ - public function testDoctypeSet11() + public function testDoctypeSet11(UnitTester $I) { - $this->specify( - "setDoctype to XHTML 1.1 is not correct", - function () { - $this->runDoctypeTest(Tag::XHTML11); - } - ); + $this->runDoctypeTest($I, Tag::XHTML11); } /** @@ -183,14 +131,9 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-04 */ - public function testDoctypeSet20() + public function testDoctypeSet20(UnitTester $I) { - $this->specify( - "setDoctype to XHTML 2.0 is not correct", - function () { - $this->runDoctypeTest(Tag::XHTML20); - } - ); + $this->runDoctypeTest($I, Tag::XHTML20); } /** @@ -199,14 +142,9 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-04 */ - public function testDoctypeSetWrongParameter() + public function testDoctypeSetWrongParameter(UnitTester $I) { - $this->specify( - "setDoctype to a wrong setting is not correct", - function () { - $this->runDoctypeTest(99); - } - ); + $this->runDoctypeTest($I, 99); } /** @@ -214,7 +152,7 @@ function () { * * @param integer $doctype */ - protected function runDoctypeTest($doctype) + protected function runDoctypeTest(UnitTester $I, $doctype) { Tag::resetInput(); Tag::setDocType($doctype); @@ -224,7 +162,7 @@ protected function runDoctypeTest($doctype) Tag::setDocType(Tag::HTML5); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } /** diff --git a/tests/unit/Tag/TagEmailFieldCest.php b/tests/unit/Tag/TagEmailFieldCest.php new file mode 100644 index 00000000000..c74d9c96e30 --- /dev/null +++ b/tests/unit/Tag/TagEmailFieldCest.php @@ -0,0 +1,362 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Tag; + +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; + +class TagEmailFieldCest extends TagBase +{ + /** + * Tests emailField with string as a parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testEmailFieldStringParameter(UnitTester $I) + { + $options = 'x_name'; + $expected = 'testFieldParameter( + $I, + 'emailField', + $options, + $expected, + false + ); + + $options = 'x_name'; + $expected = 'testFieldParameter( + $I, + 'emailField', + $options, + $expected, + true + ); + } + + /** + * Tests emailField with array as a parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testEmailFieldArrayParameter(UnitTester $I) + { + $options = [ + 'x_name', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'emailField', + $options, + $expected, + false + ); + + $options = [ + 'x_name', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'emailField', + $options, + $expected, + true + ); + } + + /** + * Tests emailField with array as a parameters and id in it + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testEmailFieldArrayParameterWithId(UnitTester $I) + { + $options = [ + 'x_name', + 'id' => 'x_id', + 'class' => 'x_class', + 'size' => '10' + ]; + $expected = 'testFieldParameter( + $I, + 'emailField', + $options, + $expected, + true + ); + + $options = [ + 'x_name', + 'id' => 'x_id', + 'class' => 'x_class', + 'size' => '10' + ]; + $expected = 'testFieldParameter( + $I, + 'emailField', + $options, + $expected, + true + ); + } + + /** + * Tests emailField with name and no id in parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testEmailFieldArrayParameterWithNameNoId(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'emailField', + $options, + $expected, + false + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'emailField', + $options, + $expected, + false + ); + } + + /** + * Tests emailField with setDefault + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testEmailFieldWithSetDefault(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'emailField', + $options, + $expected, + false, + 'setDefault' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'emailField', + $options, + $expected, + true, + 'setDefault' + ); + } + + /** + * Tests emailField with displayTo + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testEmailFieldWithDisplayTo(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'emailField', + $options, + $expected, + false, + 'displayTo' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'emailField', + $options, + $expected, + true, + 'displayTo' + ); + } + + /** + * Tests emailField with setDefault and element not present + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testEmailFieldWithSetDefaultElementNotPresent(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'emailField', + $options, + $expected, + false, + 'setDefault' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'emailField', + $options, + $expected, + true, + 'setDefault' + ); + } + + /** + * Tests emailField with displayTo and element not present + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testEmailFieldWithDisplayToElementNotPresent(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'emailField', + $options, + $expected, + false, + 'displayTo' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'emailField', + $options, + $expected, + true, + 'displayTo' + ); + } +} diff --git a/tests/unit/Tag/TagEmailFieldTest.php b/tests/unit/Tag/TagEmailFieldTest.php deleted file mode 100644 index 25257deea92..00000000000 --- a/tests/unit/Tag/TagEmailFieldTest.php +++ /dev/null @@ -1,433 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Tag - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class TagEmailFieldTest extends UnitTest -{ - /** - * Tests emailField with string as a parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testEmailFieldStringParameter() - { - $this->specify( - "emailField with string parameter returns invalid HTML Strict", - function () { - $options = 'x_name'; - $expected = 'tester->testFieldParameter( - 'emailField', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "emailField with string parameter returns invalid HTML XHTML", - function () { - $options = 'x_name'; - $expected = 'tester->testFieldParameter( - 'emailField', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests emailField with array as a parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testEmailFieldArrayParameter() - { - $this->specify( - "emailField with array parameter returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'emailField', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "emailField with array parameter returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'emailField', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests emailField with array as a parameters and id in it - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testEmailFieldArrayParameterWithId() - { - $this->specify( - "emailField with array parameter with id returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'id' => 'x_id', - 'class' => 'x_class', - 'size' => '10' - ]; - $expected = 'tester->testFieldParameter( - 'emailField', - $options, - $expected, - true - ); - } - ); - - $this->specify( - "emailField with array parameter with id returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'id' => 'x_id', - 'class' => 'x_class', - 'size' => '10' - ]; - $expected = 'tester->testFieldParameter( - 'emailField', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests emailField with name and no id in parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testEmailFieldArrayParameterWithNameNoId() - { - $this->specify( - "emailField with array parameter with name no id returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'emailField', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "emailField with array parameter with name no id returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'emailField', - $options, - $expected, - false - ); - } - ); - } - - /** - * Tests emailField with setDefault - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testEmailFieldWithSetDefault() - { - $this->specify( - "emailField with setDefault returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'emailField', - $options, - $expected, - false, - 'setDefault' - ); - } - ); - - $this->specify( - "emailField with setDefault returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'emailField', - $options, - $expected, - true, - 'setDefault' - ); - } - ); - } - - /** - * Tests emailField with displayTo - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testEmailFieldWithDisplayTo() - { - $this->specify( - "emailField with displayTo returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'emailField', - $options, - $expected, - false, - 'displayTo' - ); - } - ); - - $this->specify( - "emailField with displayTo returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'emailField', - $options, - $expected, - true, - 'displayTo' - ); - } - ); - } - - /** - * Tests emailField with setDefault and element not present - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testEmailFieldWithSetDefaultElementNotPresent() - { - $this->specify( - "emailField with setDefault and element not present returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'emailField', - $options, - $expected, - false, - 'setDefault' - ); - } - ); - - $this->specify( - "emailField with setDefault and element not present returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'emailField', - $options, - $expected, - true, - 'setDefault' - ); - } - ); - } - - /** - * Tests emailField with displayTo and element not present - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testEmailFieldWithDisplayToElementNotPresent() - { - $this->specify( - "emailField with displayTo and element not present returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'emailField', - $options, - $expected, - false, - 'displayTo' - ); - } - ); - - $this->specify( - "emailField with displayTo and element not present returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'emailField', - $options, - $expected, - true, - 'displayTo' - ); - } - ); - } -} diff --git a/tests/unit/Tag/TagFileFieldCest.php b/tests/unit/Tag/TagFileFieldCest.php new file mode 100644 index 00000000000..292ebe365fe --- /dev/null +++ b/tests/unit/Tag/TagFileFieldCest.php @@ -0,0 +1,362 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Tag; + +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; + +class TagFileFieldCest extends TagBase +{ + /** + * Tests fileField with string as a parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testFileFieldStringParameter(UnitTester $I) + { + $options = 'x_name'; + $expected = 'testFieldParameter( + $I, + 'fileField', + $options, + $expected, + false + ); + + $options = 'x_name'; + $expected = 'testFieldParameter( + $I, + 'fileField', + $options, + $expected, + true + ); + } + + /** + * Tests fileField with array as a parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testFileFieldArrayParameter(UnitTester $I) + { + $options = [ + 'x_name', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'fileField', + $options, + $expected, + false + ); + + $options = [ + 'x_name', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'fileField', + $options, + $expected, + true + ); + } + + /** + * Tests fileField with array as a parameters and id in it + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testFileFieldArrayParameterWithId(UnitTester $I) + { + $options = [ + 'x_name', + 'id' => 'x_id', + 'class' => 'x_class', + 'size' => '10' + ]; + $expected = 'testFieldParameter( + $I, + 'fileField', + $options, + $expected, + true + ); + + $options = [ + 'x_name', + 'id' => 'x_id', + 'class' => 'x_class', + 'size' => '10' + ]; + $expected = 'testFieldParameter( + $I, + 'fileField', + $options, + $expected, + true + ); + } + + /** + * Tests fileField with name and no id in parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testFileFieldArrayParameterWithNameNoId(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'fileField', + $options, + $expected, + false + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'fileField', + $options, + $expected, + false + ); + } + + /** + * Tests fileField with setDefault + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testFileFieldWithSetDefault(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'fileField', + $options, + $expected, + false, + 'setDefault' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'fileField', + $options, + $expected, + true, + 'setDefault' + ); + } + + /** + * Tests fileField with displayTo + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testFileFieldWithDisplayTo(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'fileField', + $options, + $expected, + false, + 'displayTo' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'fileField', + $options, + $expected, + true, + 'displayTo' + ); + } + + /** + * Tests fileField with setDefault and element not present + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testFileFieldWithSetDefaultElementNotPresent(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'fileField', + $options, + $expected, + false, + 'setDefault' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'fileField', + $options, + $expected, + true, + 'setDefault' + ); + } + + /** + * Tests fileField with displayTo and element not present + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testFileFieldWithDisplayToElementNotPresent(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'fileField', + $options, + $expected, + false, + 'displayTo' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'fileField', + $options, + $expected, + true, + 'displayTo' + ); + } +} diff --git a/tests/unit/Tag/TagFileFieldTest.php b/tests/unit/Tag/TagFileFieldTest.php deleted file mode 100644 index 51393b5ead6..00000000000 --- a/tests/unit/Tag/TagFileFieldTest.php +++ /dev/null @@ -1,433 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Tag - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class TagFileFieldTest extends UnitTest -{ - /** - * Tests fileField with string as a parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testFileFieldStringParameter() - { - $this->specify( - "fileField with string parameter returns invalid HTML Strict", - function () { - $options = 'x_name'; - $expected = 'tester->testFieldParameter( - 'fileField', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "fileField with string parameter returns invalid HTML XHTML", - function () { - $options = 'x_name'; - $expected = 'tester->testFieldParameter( - 'fileField', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests fileField with array as a parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testFileFieldArrayParameter() - { - $this->specify( - "fileField with array parameter returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'fileField', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "fileField with array parameter returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'fileField', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests fileField with array as a parameters and id in it - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testFileFieldArrayParameterWithId() - { - $this->specify( - "fileField with array parameter with id returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'id' => 'x_id', - 'class' => 'x_class', - 'size' => '10' - ]; - $expected = 'tester->testFieldParameter( - 'fileField', - $options, - $expected, - true - ); - } - ); - - $this->specify( - "fileField with array parameter with id returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'id' => 'x_id', - 'class' => 'x_class', - 'size' => '10' - ]; - $expected = 'tester->testFieldParameter( - 'fileField', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests fileField with name and no id in parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testFileFieldArrayParameterWithNameNoId() - { - $this->specify( - "fileField with array parameter with name no id returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'fileField', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "fileField with array parameter with name no id returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'fileField', - $options, - $expected, - false - ); - } - ); - } - - /** - * Tests fileField with setDefault - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testFileFieldWithSetDefault() - { - $this->specify( - "fileField with setDefault returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'fileField', - $options, - $expected, - false, - 'setDefault' - ); - } - ); - - $this->specify( - "fileField with setDefault returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'fileField', - $options, - $expected, - true, - 'setDefault' - ); - } - ); - } - - /** - * Tests fileField with displayTo - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testFileFieldWithDisplayTo() - { - $this->specify( - "fileField with displayTo returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'fileField', - $options, - $expected, - false, - 'displayTo' - ); - } - ); - - $this->specify( - "fileField with displayTo returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'fileField', - $options, - $expected, - true, - 'displayTo' - ); - } - ); - } - - /** - * Tests fileField with setDefault and element not present - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testFileFieldWithSetDefaultElementNotPresent() - { - $this->specify( - "fileField with setDefault and element not present returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'fileField', - $options, - $expected, - false, - 'setDefault' - ); - } - ); - - $this->specify( - "fileField with setDefault and element not present returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'fileField', - $options, - $expected, - true, - 'setDefault' - ); - } - ); - } - - /** - * Tests fileField with displayTo and element not present - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testFileFieldWithDisplayToElementNotPresent() - { - $this->specify( - "fileField with displayTo and element not present returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'fileField', - $options, - $expected, - false, - 'displayTo' - ); - } - ); - - $this->specify( - "fileField with displayTo and element not present returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'fileField', - $options, - $expected, - true, - 'displayTo' - ); - } - ); - } -} diff --git a/tests/unit/Tag/TagFriendlyTitleCest.php b/tests/unit/Tag/TagFriendlyTitleCest.php new file mode 100644 index 00000000000..40c18fbac44 --- /dev/null +++ b/tests/unit/Tag/TagFriendlyTitleCest.php @@ -0,0 +1,194 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Tag; + +use Phalcon\Tag; +use Phalcon\Tag\Exception; +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; + +class TagFriendlyTitleCest extends TagBase +{ + /** + * Tests friendlyTitle with string as a parameter and no separator + * + * @author Nikolaos Dimopoulos + * @since 2014-09-11 + */ + public function testFriendlyTitleStringParameterNoSeparator(UnitTester $I) + { + Tag::resetInput(); + $options = 'This is a Test'; + $expected = 'this-is-a-test'; + $actual = Tag::friendlyTitle($options); + $I->assertEquals($expected, $actual); + } + + /** + * Tests friendlyTitle with string as a parameter and a separator + * + * @author Nikolaos Dimopoulos + * @since 2014-09-11 + */ + public function testFriendlyTitleStringParameterSeparator(UnitTester $I) + { + Tag::resetInput(); + $options = 'This is a Test'; + $expected = 'this_is_a_test'; + $actual = Tag::friendlyTitle($options, '_'); + + $I->assertEquals($expected, $actual); + } + + /** + * Tests friendlyTitle with string as a parameter lowercase + * + * @author Nikolaos Dimopoulos + * @since 2014-09-11 + */ + public function testFriendlyTitleStringParameterLowercase(UnitTester $I) + { + Tag::resetInput(); + $options = 'This is a Test'; + $expected = 'this_is_a_test'; + $actual = Tag::friendlyTitle($options, '_', true); + + $I->assertEquals($expected, $actual); + } + + /** + * Tests friendlyTitle with string as a parameter uppercase + * + * @author Nikolaos Dimopoulos + * @since 2014-09-11 + */ + public function testFriendlyTitleStringParameterUppercase(UnitTester $I) + { + Tag::resetInput(); + $options = 'This is a Test'; + $expected = 'This_is_a_Test'; + $actual = Tag::friendlyTitle($options, '_', false); + + $I->assertEquals($expected, $actual); + } + + /** + * Tests friendlyTitle with string as a parameter with replace as string + * + * @author Nikolaos Dimopoulos + * @since 2014-09-11 + */ + public function testFriendlyTitleStringParameterReplaceString(UnitTester $I) + { + Tag::resetInput(); + $options = 'This is a Test'; + $expected = 'th_s_s_a_test'; + $actual = Tag::friendlyTitle($options, '_', true, 'i'); + + $I->assertEquals($expected, $actual); + } + + /** + * Tests friendlyTitle with string as a parameter with replace as array + * + * @author Nikolaos Dimopoulos + * @since 2014-09-11 + */ + public function testFriendlyTitleStringParameterReplaceArray(UnitTester $I) + { + Tag::resetInput(); + $options = 'This is a Test'; + $expected = 't_s_s_a_test'; + $actual = Tag::friendlyTitle( + $options, + '_', + true, + ['i', 'h'] + ); + + $I->assertEquals($expected, $actual); + } + + /** + * Tests friendlyTitle with special characters and escaping + * + * @author Nikolaos Dimopoulos + * @since 2014-09-11 + */ + public function testFriendlyTitleWithSpecialCharactersAndEscaping(UnitTester $I) + { + Tag::resetInput(); + $options = "Mess'd up --text-- just (to) stress /test/ ?our! " + . "`little` \\clean\\ url fun.ction!?-->"; + $expected = 'messd-up-text-just-to-stress-test-our-little-' + . 'clean-url-function'; + $actual = Tag::friendlyTitle($options); + + $I->assertEquals($expected, $actual); + } + + /** + * Tests friendlyTitle with accented characters and replace string + * + * @author Nikolaos Dimopoulos + * @since 2014-09-11 + */ + public function testFriendlyTitleWithAccentedCharactersAndReplaceString(UnitTester $I) + { + Tag::resetInput(); + $options = "Perché l'erba è verde?"; + $expected = 'perche-l-erba-e-verde'; + $actual = Tag::friendlyTitle($options, "-", true, "'"); + + $I->assertEquals($expected, $actual); + } + + /** + * Tests friendlyTitle with accented characters and replace array + * + * @author Nikolaos Dimopoulos + * @since 2014-09-11 + */ + public function testFriendlyTitleWithAccentedCharactersAndReplaceArray(UnitTester $I) + { + Tag::resetInput(); + $options = "Perché l'erba è verde?"; + $expected = 'P_rch_l_rb_v_rd'; + $actual = Tag::friendlyTitle( + $options, + "_", + false, + ['e', 'a'] + ); + + $I->assertEquals($expected, $actual); + } + + /** + * Tests friendlyTitle with string as a parameter with replace as boolean + * + * @author Nikolaos Dimopoulos + * @since 2014-09-11 + */ + public function testFriendlyTitleStringParameterReplaceBoolean(UnitTester $I) + { + $I->expectThrowable( + new Exception('Parameter replace must be an array or a string'), + function () { + Tag::resetInput(); + $options = 'This is a Test'; + $expected = 't_s_s_a_test'; + $actual = Tag::friendlyTitle($options, '_', true, true); + } + ); + } +} diff --git a/tests/unit/Tag/TagFriendlyTitleTest.php b/tests/unit/Tag/TagFriendlyTitleTest.php deleted file mode 100644 index beceebfec9f..00000000000 --- a/tests/unit/Tag/TagFriendlyTitleTest.php +++ /dev/null @@ -1,251 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Tag - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class TagFriendlyTitleTest extends UnitTest -{ - /** - * Tests friendlyTitle with string as a parameter and no separator - * - * @author Nikolaos Dimopoulos - * @since 2014-09-11 - */ - public function testFriendlyTitleStringParameterNoSeparator() - { - $this->specify( - "friendlyTitle with string parameter and no separator returns incorrect text", - function () { - Tag::resetInput(); - $options = 'This is a Test'; - $expected = 'this-is-a-test'; - $actual = Tag::friendlyTitle($options); - - expect($actual)->equals($expected); - } - ); - } - - /** - * Tests friendlyTitle with string as a parameter and a separator - * - * @author Nikolaos Dimopoulos - * @since 2014-09-11 - */ - public function testFriendlyTitleStringParameterSeparator() - { - $this->specify( - "friendlyTitle with string parameter and a separator returns incorrect text", - function () { - Tag::resetInput(); - $options = 'This is a Test'; - $expected = 'this_is_a_test'; - $actual = Tag::friendlyTitle($options, '_'); - - expect($actual)->equals($expected); - } - ); - } - - /** - * Tests friendlyTitle with string as a parameter lowercase - * - * @author Nikolaos Dimopoulos - * @since 2014-09-11 - */ - public function testFriendlyTitleStringParameterLowercase() - { - $this->specify( - "friendlyTitle with string parameter lowercase returns incorrect text", - function () { - Tag::resetInput(); - $options = 'This is a Test'; - $expected = 'this_is_a_test'; - $actual = Tag::friendlyTitle($options, '_', true); - - expect($actual)->equals($expected); - } - ); - } - - /** - * Tests friendlyTitle with string as a parameter uppercase - * - * @author Nikolaos Dimopoulos - * @since 2014-09-11 - */ - public function testFriendlyTitleStringParameterUppercase() - { - $this->specify( - "friendlyTitle with string parameter uppercase returns incorrect text", - function () { - Tag::resetInput(); - $options = 'This is a Test'; - $expected = 'This_is_a_Test'; - $actual = Tag::friendlyTitle($options, '_', false); - - expect($actual)->equals($expected); - } - ); - } - - /** - * Tests friendlyTitle with string as a parameter with replace as string - * - * @author Nikolaos Dimopoulos - * @since 2014-09-11 - */ - public function testFriendlyTitleStringParameterReplaceString() - { - $this->specify( - "friendlyTitle with string parameter with replace returns incorrect text", - function () { - Tag::resetInput(); - $options = 'This is a Test'; - $expected = 'th_s_s_a_test'; - $actual = Tag::friendlyTitle($options, '_', true, 'i'); - - expect($actual)->equals($expected); - } - ); - } - - /** - * Tests friendlyTitle with string as a parameter with replace as array - * - * @author Nikolaos Dimopoulos - * @since 2014-09-11 - */ - public function testFriendlyTitleStringParameterReplaceArray() - { - $this->specify( - "friendlyTitle with string parameter with replace array returns incorrect text", - function () { - Tag::resetInput(); - $options = 'This is a Test'; - $expected = 't_s_s_a_test'; - $actual = Tag::friendlyTitle( - $options, - '_', - true, - ['i', 'h'] - ); - - expect($actual)->equals($expected); - } - ); - } - - /** - * Tests friendlyTitle with special characters and escaping - * - * @author Nikolaos Dimopoulos - * @since 2014-09-11 - */ - public function testFriendlyTitleWithSpecialCharactersAndEscaping() - { - $this->specify( - "friendlyTitle with special characters and escaping returns incorrect text", - function () { - Tag::resetInput(); - $options = "Mess'd up --text-- just (to) stress /test/ ?our! " - . "`little` \\clean\\ url fun.ction!?-->"; - $expected = 'messd-up-text-just-to-stress-test-our-little-' - . 'clean-url-function'; - $actual = Tag::friendlyTitle($options); - - expect($actual)->equals($expected); - } - ); - } - - /** - * Tests friendlyTitle with accented characters and replace string - * - * @author Nikolaos Dimopoulos - * @since 2014-09-11 - */ - public function testFriendlyTitleWithAccentedCharactersAndReplaceString() - { - $this->specify( - "friendlyTitle with accented characters and replace string returns incorrect text", - function () { - Tag::resetInput(); - $options = "Perché l'erba è verde?"; - $expected = 'perche-l-erba-e-verde'; - $actual = Tag::friendlyTitle($options, "-", true, "'"); - - expect($actual)->equals($expected); - } - ); - } - - /** - * Tests friendlyTitle with accented characters and replace array - * - * @author Nikolaos Dimopoulos - * @since 2014-09-11 - */ - public function testFriendlyTitleWithAccentedCharactersAndReplaceArray() - { - $this->specify( - "friendlyTitle with accented characters and replace array returns incorrect text", - function () { - Tag::resetInput(); - $options = "Perché l'erba è verde?"; - $expected = 'P_rch_l_rb_v_rd'; - $actual = Tag::friendlyTitle( - $options, - "_", - false, - ['e', 'a'] - ); - - expect($actual)->equals($expected); - } - ); - } - - /** - * Tests friendlyTitle with string as a parameter with replace as boolean - * - * @author Nikolaos Dimopoulos - * @since 2014-09-11 - * - * @expectedException \Phalcon\Tag\Exception - * @expectedExceptionMessage Parameter replace must be an array or a string - */ - public function testFriendlyTitleStringParameterReplaceBoolean() - { - $this->specify( - "friendlyTitle with string parameter with replace array returns incorrect text", - function () { - Tag::resetInput(); - $options = 'This is a Test'; - $expected = 't_s_s_a_test'; - $actual = Tag::friendlyTitle($options, '_', true, true); - - expect($actual)->equals($expected); - } - ); - } -} diff --git a/tests/unit/Tag/TagHiddenFieldCest.php b/tests/unit/Tag/TagHiddenFieldCest.php new file mode 100644 index 00000000000..8387c02cab3 --- /dev/null +++ b/tests/unit/Tag/TagHiddenFieldCest.php @@ -0,0 +1,362 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Tag; + +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; + +class TagHiddenFieldCest extends TagBase +{ + /** + * Tests hiddenField with string as a parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testHiddenFieldStringParameter(UnitTester $I) + { + $options = 'x_name'; + $expected = 'testFieldParameter( + $I, + 'hiddenField', + $options, + $expected, + false + ); + + $options = 'x_name'; + $expected = 'testFieldParameter( + $I, + 'hiddenField', + $options, + $expected, + true + ); + } + + /** + * Tests hiddenField with array as a parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testHiddenFieldArrayParameter(UnitTester $I) + { + $options = [ + 'x_name', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'hiddenField', + $options, + $expected, + false + ); + + $options = [ + 'x_name', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'hiddenField', + $options, + $expected, + true + ); + } + + /** + * Tests hiddenField with array as a parameters and id in it + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testHiddenFieldArrayParameterWithId(UnitTester $I) + { + $options = [ + 'x_name', + 'id' => 'x_id', + 'class' => 'x_class', + 'size' => '10' + ]; + $expected = 'testFieldParameter( + $I, + 'hiddenField', + $options, + $expected, + true + ); + + $options = [ + 'x_name', + 'id' => 'x_id', + 'class' => 'x_class', + 'size' => '10' + ]; + $expected = 'testFieldParameter( + $I, + 'hiddenField', + $options, + $expected, + true + ); + } + + /** + * Tests hiddenField with name and no id in parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testHiddenFieldArrayParameterWithNameNoId(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'hiddenField', + $options, + $expected, + false + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'hiddenField', + $options, + $expected, + false + ); + } + + /** + * Tests hiddenField with setDefault + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testHiddenFieldWithSetDefault(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'hiddenField', + $options, + $expected, + false, + 'setDefault' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'hiddenField', + $options, + $expected, + true, + 'setDefault' + ); + } + + /** + * Tests hiddenField with displayTo + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testHiddenFieldWithDisplayTo(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'hiddenField', + $options, + $expected, + false, + 'displayTo' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'hiddenField', + $options, + $expected, + true, + 'displayTo' + ); + } + + /** + * Tests hiddenField with setDefault and element not present + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testHiddenFieldWithSetDefaultElementNotPresent(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'hiddenField', + $options, + $expected, + false, + 'setDefault' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'hiddenField', + $options, + $expected, + true, + 'setDefault' + ); + } + + /** + * Tests hiddenField with displayTo and element not present + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testHiddenFieldWithDisplayToElementNotPresent(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'hiddenField', + $options, + $expected, + false, + 'displayTo' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'hiddenField', + $options, + $expected, + true, + 'displayTo' + ); + } +} diff --git a/tests/unit/Tag/TagHiddenFieldTest.php b/tests/unit/Tag/TagHiddenFieldTest.php deleted file mode 100644 index 7c7df5b3f8d..00000000000 --- a/tests/unit/Tag/TagHiddenFieldTest.php +++ /dev/null @@ -1,433 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Tag - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class TagHiddenFieldTest extends UnitTest -{ - /** - * Tests hiddenField with string as a parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testHiddenFieldStringParameter() - { - $this->specify( - "hiddenField with string parameter returns invalid HTML Strict", - function () { - $options = 'x_name'; - $expected = 'tester->testFieldParameter( - 'hiddenField', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "hiddenField with string parameter returns invalid HTML XHTML", - function () { - $options = 'x_name'; - $expected = 'tester->testFieldParameter( - 'hiddenField', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests hiddenField with array as a parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testHiddenFieldArrayParameter() - { - $this->specify( - "hiddenField with array parameter returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'hiddenField', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "hiddenField with array parameter returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'hiddenField', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests hiddenField with array as a parameters and id in it - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testHiddenFieldArrayParameterWithId() - { - $this->specify( - "hiddenField with array parameter with id returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'id' => 'x_id', - 'class' => 'x_class', - 'size' => '10' - ]; - $expected = 'tester->testFieldParameter( - 'hiddenField', - $options, - $expected, - true - ); - } - ); - - $this->specify( - "hiddenField with array parameter with id returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'id' => 'x_id', - 'class' => 'x_class', - 'size' => '10' - ]; - $expected = 'tester->testFieldParameter( - 'hiddenField', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests hiddenField with name and no id in parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testHiddenFieldArrayParameterWithNameNoId() - { - $this->specify( - "hiddenField with array parameter with name no id returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'hiddenField', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "hiddenField with array parameter with name no id returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'hiddenField', - $options, - $expected, - false - ); - } - ); - } - - /** - * Tests hiddenField with setDefault - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testHiddenFieldWithSetDefault() - { - $this->specify( - "hiddenField with setDefault returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'hiddenField', - $options, - $expected, - false, - 'setDefault' - ); - } - ); - - $this->specify( - "hiddenField with setDefault returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'hiddenField', - $options, - $expected, - true, - 'setDefault' - ); - } - ); - } - - /** - * Tests hiddenField with displayTo - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testHiddenFieldWithDisplayTo() - { - $this->specify( - "hiddenField with displayTo returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'hiddenField', - $options, - $expected, - false, - 'displayTo' - ); - } - ); - - $this->specify( - "hiddenField with displayTo returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'hiddenField', - $options, - $expected, - true, - 'displayTo' - ); - } - ); - } - - /** - * Tests hiddenField with setDefault and element not present - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testHiddenFieldWithSetDefaultElementNotPresent() - { - $this->specify( - "hiddenField with setDefault and element not present returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'hiddenField', - $options, - $expected, - false, - 'setDefault' - ); - } - ); - - $this->specify( - "hiddenField with setDefault and element not present returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'hiddenField', - $options, - $expected, - true, - 'setDefault' - ); - } - ); - } - - /** - * Tests hiddenField with displayTo and element not present - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testHiddenFieldWithDisplayToElementNotPresent() - { - $this->specify( - "hiddenField with displayTo and element not present returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'hiddenField', - $options, - $expected, - false, - 'displayTo' - ); - } - ); - - $this->specify( - "hiddenField with displayTo and element not present returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'hiddenField', - $options, - $expected, - true, - 'displayTo' - ); - } - ); - } -} diff --git a/tests/unit/Tag/TagImageCest.php b/tests/unit/Tag/TagImageCest.php new file mode 100644 index 00000000000..3731d015ed2 --- /dev/null +++ b/tests/unit/Tag/TagImageCest.php @@ -0,0 +1,433 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Tag; + +use Phalcon\Tag; +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; + +class TagImageCest extends TagBase +{ + /** + * Tests image with string as a parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testImageStringParameter(UnitTester $I) + { + $options = 'img/hello.gif'; + $expected = 'testFieldParameter( + $I, + 'image', + $options, + $expected, + false + ); + + $options = 'img/hello.gif'; + $expected = 'testFieldParameter( + $I, + 'image', + $options, + $expected, + true + ); + } + + /** + * Tests image with array as a parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testImageArrayParameter(UnitTester $I) + { + $options = [ + 'img/hello.gif', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'image', + $options, + $expected, + false + ); + + $options = [ + 'img/hello.gif', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'image', + $options, + $expected, + true + ); + } + + /** + * Tests image with array as a parameters and src in it + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testImageArrayParameterWithSrc(UnitTester $I) + { + $options = [ + 'img/hello.gif', + 'src' => 'img/goodbye.gif', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'image', + $options, + $expected, + true + ); + + $options = [ + 'img/hello.gif', + 'src' => 'img/goodbye.gif', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'image', + $options, + $expected, + true + ); + } + + /** + * Tests image with name and no src in parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testImageArrayParameterWithNameNoSrc(UnitTester $I) + { + $options = [ + 'img/hello.gif', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'image', + $options, + $expected, + false + ); + + $options = [ + 'img/hello.gif', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'image', + $options, + $expected, + false + ); + } + + /** + * Tests image with setDefault + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testImageWithSetDefault(UnitTester $I) + { + $options = [ + 'img/hello.gif', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'image', + $options, + $expected, + false, + 'setDefault' + ); + + $options = [ + 'img/hello.gif', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'image', + $options, + $expected, + true, + 'setDefault' + ); + } + + /** + * Tests image with displayTo + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testImageWithDisplayTo(UnitTester $I) + { + $options = [ + 'img/hello.gif', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'image', + $options, + $expected, + false, + 'displayTo' + ); + + $options = [ + 'img/hello.gif', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'image', + $options, + $expected, + true, + 'displayTo' + ); + } + + /** + * Tests image with setDefault and element not present + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testImageWithSetDefaultElementNotPresent(UnitTester $I) + { + $options = [ + 'img/hello.gif', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'image', + $options, + $expected, + false, + 'setDefault' + ); + + $options = [ + 'img/hello.gif', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'image', + $options, + $expected, + true, + 'setDefault' + ); + } + + /** + * Tests image with displayTo and element not present + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testImageWithDisplayToElementNotPresent(UnitTester $I) + { + $options = [ + 'img/hello.gif', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'image', + $options, + $expected, + false, + 'displayTo' + ); + + $options = [ + 'img/hello.gif', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'image', + $options, + $expected, + true, + 'displayTo' + ); + } + + /** + * Tests image with string parameter and local link + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testImageStringParameterLocalLink(UnitTester $I) + { + $options = 'img/hello.gif'; + $expected = ''; + + Tag::setDocType(Tag::XHTML10_STRICT); + $actual = Tag::image($options, true); + + $I->assertEquals($expected, $actual); + + $options = 'img/hello.gif'; + $expected = ''; + + Tag::setDocType(Tag::HTML5); + $actual = Tag::image($options, true); + + $I->assertEquals($expected, $actual); + } + + /** + * Tests image with string parameter and remote link + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testImageStringParameterRemoteLink(UnitTester $I) + { + $options = 'http://phalconphp.com/img/hello.gif'; + $expected = ''; + + Tag::setDocType(Tag::XHTML10_STRICT); + $actual = Tag::image($options, false); + + $I->assertEquals($expected, $actual); + + $options = 'http://phalconphp.com/img/hello.gif'; + $expected = ''; + + Tag::setDocType(Tag::HTML5); + $actual = Tag::image($options, false); + + $I->assertEquals($expected, $actual); + } + + /** + * Tests image with array parameter and local link + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testImageArrayParameterLocalLink(UnitTester $I) + { + $options = [ + 'img/hello.gif', + 'alt' => 'Hello' + ]; + $expected = 'Hello'; + + Tag::setDocType(Tag::XHTML10_STRICT); + $actual = Tag::image($options, true); + + $I->assertEquals($expected, $actual); + + $options = [ + 'img/hello.gif', + 'alt' => 'Hello' + ]; + $expected = 'Hello'; + + Tag::setDocType(Tag::HTML5); + $actual = Tag::image($options, true); + + $I->assertEquals($expected, $actual); + } + + /** + * Tests image with array parameter and remote link + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testImageArrayParameterRemoteLink(UnitTester $I) + { + $options = [ + 'http://phalconphp.com/img/hello.gif', + 'alt' => 'Hello' + ]; + $expected = ''; + + Tag::setDocType(Tag::XHTML10_STRICT); + $actual = Tag::image($options, false); + + $I->assertEquals($expected, $actual); + + $options = [ + 'http://phalconphp.com/img/hello.gif', + 'alt' => 'Hello' + ]; + $expected = ''; + + Tag::setDocType(Tag::HTML5); + $actual = Tag::image($options, false); + + $I->assertEquals($expected, $actual); + } +} diff --git a/tests/unit/Tag/TagImageInputCest.php b/tests/unit/Tag/TagImageInputCest.php new file mode 100644 index 00000000000..0253332092f --- /dev/null +++ b/tests/unit/Tag/TagImageInputCest.php @@ -0,0 +1,354 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +namespace Phalcon\Test\Unit\Tag; + +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; + +class TagImageInputCest extends TagBase +{ + /** + * Tests imageInput with string as a parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testImageInputStringParameter(UnitTester $I) + { + $options = 'x_name'; + $expected = 'testFieldParameter( + $I, + 'imageInput', + $options, + $expected, + false + ); + + $options = 'x_name'; + $expected = 'testFieldParameter( + $I, + 'imageInput', + $options, + $expected, + true + ); + } + + /** + * Tests imageInput with array as a parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testImageInputArrayParameter(UnitTester $I) + { + $options = [ + 'x_name', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'imageInput', + $options, + $expected, + false + ); + + $options = [ + 'x_name', + 'class' => 'x_class', + ]; + $expected = 'testFieldParameter( + $I, + 'imageInput', + $options, + $expected, + true + ); + } + + /** + * Tests imageInput with array as a parameters and id in it + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testImageInputArrayParameterWithId(UnitTester $I) + { + $options = [ + 'x_name', + 'id' => 'x_id', + 'class' => 'x_class', + 'size' => '10' + ]; + $expected = 'testFieldParameter( + $I, + 'imageInput', + $options, + $expected, + true + ); + + $options = [ + 'x_name', + 'id' => 'x_id', + 'class' => 'x_class', + 'size' => '10' + ]; + $expected = 'testFieldParameter( + $I, + 'imageInput', + $options, + $expected, + true + ); + } + + /** + * Tests imageInput with name and no id in parameter + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testImageInputArrayParameterWithNameNoId(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'imageInput', + $options, + $expected, + false + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'imageInput', + $options, + $expected, + false + ); + } + + /** + * Tests imageInput with setDefault + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testImageInputWithSetDefault(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'imageInput', + $options, + $expected, + false, + 'setDefault' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'imageInput', + $options, + $expected, + true, + 'setDefault' + ); + } + + /** + * Tests imageInput with displayTo + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testImageInputWithDisplayTo(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'imageInput', + $options, + $expected, + false, + 'displayTo' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'imageInput', + $options, + $expected, + true, + 'displayTo' + ); + } + + /** + * Tests imageInput with setDefault and element not present + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testImageInputWithSetDefaultElementNotPresent(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'imageInput', + $options, + $expected, + false, + 'setDefault' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'imageInput', + $options, + $expected, + true, + 'setDefault' + ); + } + + /** + * Tests imageInput with displayTo and element not present + * + * @author Nikolaos Dimopoulos + * @since 2014-09-05 + */ + public function testImageInputWithDisplayToElementNotPresent(UnitTester $I) + { + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'imageInput', + $options, + $expected, + false, + 'displayTo' + ); + + $options = [ + 'x_name', + 'name' => 'x_other', + 'class' => 'x_class', + 'size' => '10', + ]; + $expected = 'testFieldParameter( + $I, + 'imageInput', + $options, + $expected, + true, + 'displayTo' + ); + } +} diff --git a/tests/unit/Tag/TagImageInputTest.php b/tests/unit/Tag/TagImageInputTest.php deleted file mode 100644 index 15808008384..00000000000 --- a/tests/unit/Tag/TagImageInputTest.php +++ /dev/null @@ -1,425 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Tag - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class TagImageInputTest extends UnitTest -{ - /** - * Tests imageInput with string as a parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testImageInputStringParameter() - { - $this->specify( - "imageInput with string parameter returns invalid HTML Strict", - function () { - $options = 'x_name'; - $expected = 'tester->testFieldParameter( - 'imageInput', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "imageInput with string parameter returns invalid HTML XHTML", - function () { - $options = 'x_name'; - $expected = 'tester->testFieldParameter( - 'imageInput', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests imageInput with array as a parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testImageInputArrayParameter() - { - $this->specify( - "imageInput with array parameter returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'imageInput', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "imageInput with array parameter returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'imageInput', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests imageInput with array as a parameters and id in it - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testImageInputArrayParameterWithId() - { - $this->specify( - "imageInput with array parameter with id returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'id' => 'x_id', - 'class' => 'x_class', - 'size' => '10' - ]; - $expected = 'tester->testFieldParameter( - 'imageInput', - $options, - $expected, - true - ); - } - ); - - $this->specify( - "imageInput with array parameter with id returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'id' => 'x_id', - 'class' => 'x_class', - 'size' => '10' - ]; - $expected = 'tester->testFieldParameter( - 'imageInput', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests imageInput with name and no id in parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testImageInputArrayParameterWithNameNoId() - { - $this->specify( - "imageInput with array parameter with name no id returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'imageInput', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "imageInput with array parameter with name no id returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'imageInput', - $options, - $expected, - false - ); - } - ); - } - - /** - * Tests imageInput with setDefault - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testImageInputWithSetDefault() - { - $this->specify( - "imageInput with setDefault returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'imageInput', - $options, - $expected, - false, - 'setDefault' - ); - } - ); - - $this->specify( - "imageInput with setDefault returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'imageInput', - $options, - $expected, - true, - 'setDefault' - ); - } - ); - } - - /** - * Tests imageInput with displayTo - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testImageInputWithDisplayTo() - { - $this->specify( - "imageInput with displayTo returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'imageInput', - $options, - $expected, - false, - 'displayTo' - ); - } - ); - - $this->specify( - "imageInput with displayTo returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'imageInput', - $options, - $expected, - true, - 'displayTo' - ); - } - ); - } - - /** - * Tests imageInput with setDefault and element not present - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testImageInputWithSetDefaultElementNotPresent() - { - $this->specify( - "imageInput with setDefault and element not present returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'imageInput', - $options, - $expected, - false, - 'setDefault' - ); - } - ); - - $this->specify( - "imageInput with setDefault and element not present returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'imageInput', - $options, - $expected, - true, - 'setDefault' - ); - } - ); - } - - /** - * Tests imageInput with displayTo and element not present - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testImageInputWithDisplayToElementNotPresent() - { - $this->specify( - "imageInput with displayTo and element not present returns invalid HTML Strict", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'imageInput', - $options, - $expected, - false, - 'displayTo' - ); - } - ); - - $this->specify( - "imageInput with displayTo and element not present returns invalid HTML XHTML", - function () { - $options = [ - 'x_name', - 'name' => 'x_other', - 'class' => 'x_class', - 'size' => '10', - ]; - $expected = 'tester->testFieldParameter( - 'imageInput', - $options, - $expected, - true, - 'displayTo' - ); - } - ); - } -} diff --git a/tests/unit/Tag/TagImageTest.php b/tests/unit/Tag/TagImageTest.php deleted file mode 100644 index e368c65b74e..00000000000 --- a/tests/unit/Tag/TagImageTest.php +++ /dev/null @@ -1,544 +0,0 @@ - - * @author Nikolaos Dimopoulos - * @package Phalcon\Test\Unit\Tag - * - * The contents of this file are subject to the New BSD License that is - * bundled with this package in the file LICENSE.txt - * - * If you did not receive a copy of the license and are unable to obtain it - * through the world-wide-web, please send an email to license@phalconphp.com - * so that we can send you a copy immediately. - */ -class TagImageTest extends UnitTest -{ - /** - * Tests image with string as a parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testImageStringParameter() - { - $this->specify( - "image with string parameter returns invalid HTML Strict", - function () { - $options = 'img/hello.gif'; - $expected = 'tester->testFieldParameter( - 'image', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "image with string parameter returns invalid HTML XHTML", - function () { - $options = 'img/hello.gif'; - $expected = 'tester->testFieldParameter( - 'image', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests image with array as a parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testImageArrayParameter() - { - $this->specify( - "image with array parameter returns invalid HTML Strict", - function () { - $options = [ - 'img/hello.gif', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'image', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "image with array parameter returns invalid HTML XHTML", - function () { - $options = [ - 'img/hello.gif', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'image', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests image with array as a parameters and src in it - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testImageArrayParameterWithSrc() - { - $this->specify( - "image with array parameter with src returns invalid HTML Strict", - function () { - $options = [ - 'img/hello.gif', - 'src' => 'img/goodbye.gif', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'image', - $options, - $expected, - true - ); - } - ); - - $this->specify( - "image with array parameter with src returns invalid HTML XHTML", - function () { - $options = [ - 'img/hello.gif', - 'src' => 'img/goodbye.gif', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'image', - $options, - $expected, - true - ); - } - ); - } - - /** - * Tests image with name and no src in parameter - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testImageArrayParameterWithNameNoSrc() - { - $this->specify( - "image with array parameter with name no src returns invalid HTML Strict", - function () { - $options = [ - 'img/hello.gif', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'image', - $options, - $expected, - false - ); - } - ); - - $this->specify( - "image with array parameter with name no src returns invalid HTML XHTML", - function () { - $options = [ - 'img/hello.gif', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'image', - $options, - $expected, - false - ); - } - ); - } - - /** - * Tests image with setDefault - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testImageWithSetDefault() - { - $this->specify( - "image with setDefault returns invalid HTML Strict", - function () { - $options = [ - 'img/hello.gif', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'image', - $options, - $expected, - false, - 'setDefault' - ); - } - ); - - $this->specify( - "image with setDefault returns invalid HTML XHTML", - function () { - $options = [ - 'img/hello.gif', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'image', - $options, - $expected, - true, - 'setDefault' - ); - } - ); - } - - /** - * Tests image with displayTo - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testImageWithDisplayTo() - { - $this->specify( - "image with displayTo returns invalid HTML Strict", - function () { - $options = [ - 'img/hello.gif', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'image', - $options, - $expected, - false, - 'displayTo' - ); - } - ); - - $this->specify( - "image with displayTo returns invalid HTML XHTML", - function () { - $options = [ - 'img/hello.gif', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'image', - $options, - $expected, - true, - 'displayTo' - ); - } - ); - } - - /** - * Tests image with setDefault and element not present - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testImageWithSetDefaultElementNotPresent() - { - $this->specify( - "image with setDefault and element not present returns invalid HTML Strict", - function () { - $options = [ - 'img/hello.gif', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'image', - $options, - $expected, - false, - 'setDefault' - ); - } - ); - - $this->specify( - "image with setDefault and element not present returns invalid HTML XHTML", - function () { - $options = [ - 'img/hello.gif', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'image', - $options, - $expected, - true, - 'setDefault' - ); - } - ); - } - - /** - * Tests image with displayTo and element not present - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testImageWithDisplayToElementNotPresent() - { - $this->specify( - "image with displayTo and element not present returns invalid HTML Strict", - function () { - $options = [ - 'img/hello.gif', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'image', - $options, - $expected, - false, - 'displayTo' - ); - } - ); - - $this->specify( - "image with displayTo and element not present returns invalid HTML XHTML", - function () { - $options = [ - 'img/hello.gif', - 'class' => 'x_class', - ]; - $expected = 'tester->testFieldParameter( - 'image', - $options, - $expected, - true, - 'displayTo' - ); - } - ); - } - - /** - * Tests image with string parameter and local link - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testImageStringParameterLocalLink() - { - $this->specify( - "image with string parameter and local link returns invalid HTML Strict", - function () { - $options = 'img/hello.gif'; - $expected = ''; - - Tag::setDocType(Tag::XHTML10_STRICT); - $actual = Tag::image($options, true); - - expect($actual)->equals($expected); - } - ); - - $this->specify( - "image with string parameter and local link returns invalid HTML XHTML", - function () { - $options = 'img/hello.gif'; - $expected = ''; - - Tag::setDocType(Tag::HTML5); - $actual = Tag::image($options, true); - - expect($actual)->equals($expected); - } - ); - } - - /** - * Tests image with string parameter and remote link - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testImageStringParameterRemoteLink() - { - $this->specify( - "image with string parameter and remote link returns invalid HTML Strict", - function () { - $options = 'http://phalconphp.com/img/hello.gif'; - $expected = ''; - - Tag::setDocType(Tag::XHTML10_STRICT); - $actual = Tag::image($options, false); - - expect($actual)->equals($expected); - } - ); - - $this->specify( - "image with string parameter and local link returns invalid HTML XHTML", - function () { - $options = 'http://phalconphp.com/img/hello.gif'; - $expected = ''; - - Tag::setDocType(Tag::HTML5); - $actual = Tag::image($options, false); - - expect($actual)->equals($expected); - } - ); - } - - /** - * Tests image with array parameter and local link - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testImageArrayParameterLocalLink() - { - $this->specify( - "image with array parameter and local link returns invalid HTML Strict", - function () { - $options = [ - 'img/hello.gif', - 'alt' => 'Hello' - ]; - $expected = 'Hello'; - - Tag::setDocType(Tag::XHTML10_STRICT); - $actual = Tag::image($options, true); - - expect($actual)->equals($expected); - } - ); - - $this->specify( - "image with array parameter and local link returns invalid HTML XHTML", - function () { - $options = [ - 'img/hello.gif', - 'alt' => 'Hello' - ]; - $expected = 'Hello'; - - Tag::setDocType(Tag::HTML5); - $actual = Tag::image($options, true); - - expect($actual)->equals($expected); - } - ); - } - - /** - * Tests image with array parameter and remote link - * - * @author Nikolaos Dimopoulos - * @since 2014-09-05 - */ - public function testImageArrayParameterRemoteLink() - { - $this->specify( - "image with array parameter and remote link returns invalid HTML Strict", - function () { - $options = [ - 'http://phalconphp.com/img/hello.gif', - 'alt' => 'Hello' - ]; - $expected = ''; - - Tag::setDocType(Tag::XHTML10_STRICT); - $actual = Tag::image($options, false); - - expect($actual)->equals($expected); - } - ); - - $this->specify( - "image with array parameter and local link returns invalid HTML XHTML", - function () { - $options = [ - 'http://phalconphp.com/img/hello.gif', - 'alt' => 'Hello' - ]; - $expected = ''; - - Tag::setDocType(Tag::HTML5); - $actual = Tag::image($options, false); - - expect($actual)->equals($expected); - } - ); - } -} diff --git a/tests/unit/Tag/TagJavascriptIncludeTest.php b/tests/unit/Tag/TagJavascriptIncludeCest.php similarity index 77% rename from tests/unit/Tag/TagJavascriptIncludeTest.php rename to tests/unit/Tag/TagJavascriptIncludeCest.php index 28ec0d3d762..754a141800a 100644 --- a/tests/unit/Tag/TagJavascriptIncludeTest.php +++ b/tests/unit/Tag/TagJavascriptIncludeCest.php @@ -1,9 +1,19 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + namespace Phalcon\Test\Unit\Tag; use Phalcon\Tag; -use Phalcon\Test\Module\UnitTest; +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; /** * \Phalcon\Test\Unit\Tag\TagJavascriptIncludeTest @@ -22,7 +32,7 @@ * through the world-wide-web, please send an email to license@phalconphp.com * so that we can send you a copy immediately. */ -class TagJavascriptIncludeTest extends UnitTest +class TagJavascriptIncludeTest extends TagBase { /** * Tests iavascriptInclude with string as a parameter @@ -30,17 +40,17 @@ class TagJavascriptIncludeTest extends UnitTest * @author Nikolaos Dimopoulos * @since 2014-09-29 */ - public function testJavascriptIncludeLocal() + public function testJavascriptIncludeLocal(UnitTester $I) { $this->specify( "iavascriptInclude with string parameter local link returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $options = 'js/phalcon.js'; $expected = '' . PHP_EOL; $actual = Tag::javascriptInclude($options); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -51,17 +61,17 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-29 */ - public function testJavascriptIncludeWithArrayLocal() + public function testJavascriptIncludeWithArrayLocal(UnitTester $I) { $this->specify( "javascriptInclude with array parameter local link returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $options = ['js/phalcon.js']; $expected = '' . PHP_EOL; $actual = Tag::javascriptInclude($options); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -72,17 +82,17 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-29 */ - public function testJavascriptIncludeWithStringAsSecondParameterLocal() + public function testJavascriptIncludeWithStringAsSecondParameterLocal(UnitTester $I) { $this->specify( "javascriptInclude with a string as the second parameter local link returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $options = ['js/phalcon.js']; $expected = '' . PHP_EOL; $actual = Tag::javascriptInclude($options, 'hello'); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -93,17 +103,17 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-29 */ - public function testJavascriptIncludeRemote() + public function testJavascriptIncludeRemote(UnitTester $I) { $this->specify( "iavascriptInclude with a string parameter remote link returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $options = 'http://my.local.com/js/phalcon.js'; $expected = '' . PHP_EOL; $actual = Tag::javascriptInclude($options, false); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -114,17 +124,17 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-29 */ - public function testJavascriptIncludeWithArrayRemote() + public function testJavascriptIncludeWithArrayRemote(UnitTester $I) { $this->specify( "iavascriptInclude with array second parameter remote link returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $options = ['http://my.local.com/js/phalcon.js']; $expected = '' . PHP_EOL; $actual = Tag::javascriptInclude($options, false); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } diff --git a/tests/unit/Tag/TagLinkToTest.php b/tests/unit/Tag/TagLinkToCest.php similarity index 80% rename from tests/unit/Tag/TagLinkToTest.php rename to tests/unit/Tag/TagLinkToCest.php index 88a07f36ac7..3c0a534158c 100644 --- a/tests/unit/Tag/TagLinkToTest.php +++ b/tests/unit/Tag/TagLinkToCest.php @@ -1,9 +1,19 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + namespace Phalcon\Test\Unit\Tag; use Phalcon\Tag; -use Phalcon\Test\Module\UnitTest; +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; /** * \Phalcon\Test\Unit\Tag\TagLinkToTest @@ -22,7 +32,7 @@ * through the world-wide-web, please send an email to license@phalconphp.com * so that we can send you a copy immediately. */ -class TagLinkToTest extends UnitTest +class TagLinkToTest extends TagBase { /** * Tests linkTo with string as URL and name @@ -30,11 +40,11 @@ class TagLinkToTest extends UnitTest * @author Nikolaos Dimopoulos * @since 2014-09-29 */ - public function testLinkToWithStringAsURLAndName() + public function testLinkToWithStringAsURLAndName(UnitTester $I) { $this->specify( "linkTo with string as URL and name returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $url = 'x_url'; $name = 'x_name'; @@ -42,7 +52,7 @@ function () { $expected = 'x_name'; $actual = Tag::linkTo($url, $name); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -55,11 +65,11 @@ function () { * @author Dreamszhu * @since 2014-03-10 */ - public function testLinkToWithQueryParam() + public function testLinkToWithQueryParam(UnitTester $I) { $this->specify( "linkTo with query param name returns invalid HTML", - function () { + function (UnitTester $I) { $actual = Tag::linkTo([ 'signup/register', 'Register Here!', @@ -78,11 +88,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-29 */ - public function testLinkToWithEmptyStringAsURLAndStringAsName() + public function testLinkToWithEmptyStringAsURLAndStringAsName(UnitTester $I) { $this->specify( "linkTo with empty string as URL and string as name parameter returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $url = ''; $name = 'x_name'; @@ -90,7 +100,7 @@ function () { $expected = 'x_name'; $actual = Tag::linkTo($url, $name); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -101,11 +111,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-29 */ - public function testLinkToArrayParameter() + public function testLinkToArrayParameter(UnitTester $I) { $this->specify( "linkTo with array parameter returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $options = [ 'x_url', @@ -114,7 +124,7 @@ function () { $expected = 'x_name'; $actual = Tag::linkTo($options); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -125,11 +135,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-29 */ - public function testLinkToNamedArrayParameter() + public function testLinkToNamedArrayParameter(UnitTester $I) { $this->specify( "linkTo with named array parameter returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $options = [ 'action' => 'x_url', @@ -139,7 +149,7 @@ function () { $expected = 'x_name'; $actual = Tag::linkTo($options); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -153,24 +163,24 @@ function () { * @author Dreamszhu * @since 2014-09-29 */ - public function testLinkToWithComplexLocalUrl() + public function testLinkToWithComplexLocalUrl(UnitTester $I) { $this->specify( "linkTo with complex local URL string parameter returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $url = "x_action/x_param"; $name = 'x_name'; $actual = Tag::linkTo($url, $name); $expected = 'x_name'; - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); $this->specify( "linkTo with complex local URL array parameter returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $options = [ "x_action/x_param", @@ -179,13 +189,13 @@ function () { $actual = Tag::linkTo($options); $expected = 'x_name'; - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); $this->specify( "linkTo with complex local URL array named parameter returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $options = [ "x_action/x_param", @@ -195,7 +205,7 @@ function () { $actual = Tag::linkTo($options); $expected = 'x_name'; - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -209,24 +219,24 @@ function () { * @author Dreamszhu * @since 2014-09-29 */ - public function testLinkToWithComplexRemoteUrl() + public function testLinkToWithComplexRemoteUrl(UnitTester $I) { $this->specify( "linkTo with complex remote URL string parameter returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $url = "http://phalconphp.com/en/"; $name = 'x_name'; $actual = Tag::linkTo($url, $name, false); $expected = 'x_name'; - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); $this->specify( "linkTo with complex remote URL array parameter returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $options = [ "http://phalconphp.com/en/", @@ -236,13 +246,13 @@ function () { $actual = Tag::linkTo($options); $expected = 'x_name'; - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); $this->specify( "linkTo with complex remote URL array named parameter returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $options = [ "http://phalconphp.com/en/", @@ -252,20 +262,20 @@ function () { $actual = Tag::linkTo($options); $expected = 'x_name'; - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); $this->specify( "linkTo with mailto URL string parameter returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $url = "mailto:someone@phalconphp.com"; $name = 'someone@phalconphp.com'; $actual = Tag::linkTo($url, $name, false); $expected = 'someone@phalconphp.com'; - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } diff --git a/tests/unit/Tag/TagMonthFieldTest.php b/tests/unit/Tag/TagMonthFieldCest.php similarity index 80% rename from tests/unit/Tag/TagMonthFieldTest.php rename to tests/unit/Tag/TagMonthFieldCest.php index 912dacb78d7..df5c764da11 100644 --- a/tests/unit/Tag/TagMonthFieldTest.php +++ b/tests/unit/Tag/TagMonthFieldCest.php @@ -1,8 +1,18 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + namespace Phalcon\Test\Unit\Tag; -use Phalcon\Test\Module\UnitTest; +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; /** * \Phalcon\Test\Unit\Tag\TagMonthFieldTest @@ -21,7 +31,7 @@ * through the world-wide-web, please send an email to license@phalconphp.com * so that we can send you a copy immediately. */ -class TagMonthFieldTest extends UnitTest +class TagMonthFieldTest extends TagBase { /** * Tests monthField with string as a parameter @@ -29,16 +39,17 @@ class TagMonthFieldTest extends UnitTest * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testMonthFieldStringParameter() + public function testMonthFieldStringParameter(UnitTester $I) { $this->specify( "monthField with string parameter returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = 'x_name'; $expected = 'tester->testFieldParameter( - 'monthField', + $this->testFieldParameter( + $I, + 'monthField', $options, $expected, false @@ -48,12 +59,13 @@ function () { $this->specify( "monthField with string parameter returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = 'x_name'; $expected = 'tester->testFieldParameter( - 'monthField', + $this->testFieldParameter( + $I, + 'monthField', $options, $expected, true @@ -68,11 +80,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testMonthFieldArrayParameter() + public function testMonthFieldArrayParameter(UnitTester $I) { $this->specify( "monthField with array parameter returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'class' => 'x_class', @@ -80,8 +92,9 @@ function () { $expected = 'tester->testFieldParameter( - 'monthField', + $this->testFieldParameter( + $I, + 'monthField', $options, $expected, false @@ -91,7 +104,7 @@ function () { $this->specify( "monthField with array parameter returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'class' => 'x_class', @@ -99,8 +112,9 @@ function () { $expected = 'tester->testFieldParameter( - 'monthField', + $this->testFieldParameter( + $I, + 'monthField', $options, $expected, true @@ -115,11 +129,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testMonthFieldArrayParameterWithId() + public function testMonthFieldArrayParameterWithId(UnitTester $I) { $this->specify( "monthField with array parameter with id returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'id' => 'x_id', @@ -129,8 +143,9 @@ function () { $expected = 'tester->testFieldParameter( - 'monthField', + $this->testFieldParameter( + $I, + 'monthField', $options, $expected, true @@ -140,7 +155,7 @@ function () { $this->specify( "monthField with array parameter with id returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'id' => 'x_id', @@ -150,8 +165,9 @@ function () { $expected = 'tester->testFieldParameter( - 'monthField', + $this->testFieldParameter( + $I, + 'monthField', $options, $expected, true @@ -166,11 +182,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testMonthFieldArrayParameterWithNameNoId() + public function testMonthFieldArrayParameterWithNameNoId(UnitTester $I) { $this->specify( "monthField with array parameter with name no id returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -180,8 +196,9 @@ function () { $expected = 'tester->testFieldParameter( - 'monthField', + $this->testFieldParameter( + $I, + 'monthField', $options, $expected, false @@ -191,7 +208,7 @@ function () { $this->specify( "monthField with array parameter with name no id returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -201,8 +218,9 @@ function () { $expected = 'tester->testFieldParameter( - 'monthField', + $this->testFieldParameter( + $I, + 'monthField', $options, $expected, false @@ -217,11 +235,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testMonthFieldWithSetDefault() + public function testMonthFieldWithSetDefault(UnitTester $I) { $this->specify( "monthField with setDefault returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -232,8 +250,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'monthField', + $this->testFieldParameter( + $I, + 'monthField', $options, $expected, false, @@ -244,7 +263,7 @@ function () { $this->specify( "monthField with setDefault returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -255,8 +274,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'monthField', + $this->testFieldParameter( + $I, + 'monthField', $options, $expected, true, @@ -272,11 +292,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testMonthFieldWithDisplayTo() + public function testMonthFieldWithDisplayTo(UnitTester $I) { $this->specify( "monthField with displayTo returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -287,8 +307,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'monthField', + $this->testFieldParameter( + $I, + 'monthField', $options, $expected, false, @@ -299,7 +320,7 @@ function () { $this->specify( "monthField with displayTo returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -310,8 +331,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'monthField', + $this->testFieldParameter( + $I, + 'monthField', $options, $expected, true, @@ -327,11 +349,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testMonthFieldWithSetDefaultElementNotPresent() + public function testMonthFieldWithSetDefaultElementNotPresent(UnitTester $I) { $this->specify( "monthField with setDefault and element not present returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -342,8 +364,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'monthField', + $this->testFieldParameter( + $I, + 'monthField', $options, $expected, false, @@ -354,7 +377,7 @@ function () { $this->specify( "monthField with setDefault and element not present returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -365,8 +388,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'monthField', + $this->testFieldParameter( + $I, + 'monthField', $options, $expected, true, @@ -382,11 +406,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testMonthFieldWithDisplayToElementNotPresent() + public function testMonthFieldWithDisplayToElementNotPresent(UnitTester $I) { $this->specify( "monthField with displayTo and element not present returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -397,8 +421,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'monthField', + $this->testFieldParameter( + $I, + 'monthField', $options, $expected, false, @@ -409,7 +434,7 @@ function () { $this->specify( "monthField with displayTo and element not present returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -420,8 +445,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'monthField', + $this->testFieldParameter( + $I, + 'monthField', $options, $expected, true, diff --git a/tests/unit/Tag/TagNumericFieldTest.php b/tests/unit/Tag/TagNumericFieldCest.php similarity index 80% rename from tests/unit/Tag/TagNumericFieldTest.php rename to tests/unit/Tag/TagNumericFieldCest.php index 4ec4ed1d4ed..c2da5ff947d 100644 --- a/tests/unit/Tag/TagNumericFieldTest.php +++ b/tests/unit/Tag/TagNumericFieldCest.php @@ -1,8 +1,18 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + namespace Phalcon\Test\Unit\Tag; -use Phalcon\Test\Module\UnitTest; +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; /** * \Phalcon\Test\Unit\Tag\TagNumericFieldTest @@ -21,7 +31,7 @@ * through the world-wide-web, please send an email to license@phalconphp.com * so that we can send you a copy immediately. */ -class TagNumericFieldTest extends UnitTest +class TagNumericFieldTest extends TagBase { /** * Tests numericField with string as a parameter @@ -29,16 +39,17 @@ class TagNumericFieldTest extends UnitTest * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testNumericFieldStringParameter() + public function testNumericFieldStringParameter(UnitTester $I) { $this->specify( "numericField with string parameter returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = 'x_name'; $expected = 'tester->testFieldParameter( - 'numericField', + $this->testFieldParameter( + $I, + 'numericField', $options, $expected, false @@ -48,12 +59,13 @@ function () { $this->specify( "numericField with string parameter returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = 'x_name'; $expected = 'tester->testFieldParameter( - 'numericField', + $this->testFieldParameter( + $I, + 'numericField', $options, $expected, true @@ -68,11 +80,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testNumericFieldArrayParameter() + public function testNumericFieldArrayParameter(UnitTester $I) { $this->specify( "numericField with array parameter returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'class' => 'x_class', @@ -80,8 +92,9 @@ function () { $expected = 'tester->testFieldParameter( - 'numericField', + $this->testFieldParameter( + $I, + 'numericField', $options, $expected, false @@ -91,7 +104,7 @@ function () { $this->specify( "numericField with array parameter returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'class' => 'x_class', @@ -99,8 +112,9 @@ function () { $expected = 'tester->testFieldParameter( - 'numericField', + $this->testFieldParameter( + $I, + 'numericField', $options, $expected, true @@ -115,11 +129,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testNumericFieldArrayParameterWithId() + public function testNumericFieldArrayParameterWithId(UnitTester $I) { $this->specify( "numericField with array parameter with id returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'id' => 'x_id', @@ -129,8 +143,9 @@ function () { $expected = 'tester->testFieldParameter( - 'numericField', + $this->testFieldParameter( + $I, + 'numericField', $options, $expected, true @@ -140,7 +155,7 @@ function () { $this->specify( "numericField with array parameter with id returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'id' => 'x_id', @@ -150,8 +165,9 @@ function () { $expected = 'tester->testFieldParameter( - 'numericField', + $this->testFieldParameter( + $I, + 'numericField', $options, $expected, true @@ -166,11 +182,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testNumericFieldArrayParameterWithNameNoId() + public function testNumericFieldArrayParameterWithNameNoId(UnitTester $I) { $this->specify( "numericField with array parameter with name no id returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -180,8 +196,9 @@ function () { $expected = 'tester->testFieldParameter( - 'numericField', + $this->testFieldParameter( + $I, + 'numericField', $options, $expected, false @@ -191,7 +208,7 @@ function () { $this->specify( "numericField with array parameter with name no id returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -201,8 +218,9 @@ function () { $expected = 'tester->testFieldParameter( - 'numericField', + $this->testFieldParameter( + $I, + 'numericField', $options, $expected, false @@ -217,11 +235,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testNumericFieldWithSetDefault() + public function testNumericFieldWithSetDefault(UnitTester $I) { $this->specify( "numericField with setDefault returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -232,8 +250,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'numericField', + $this->testFieldParameter( + $I, + 'numericField', $options, $expected, false, @@ -244,7 +263,7 @@ function () { $this->specify( "numericField with setDefault returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -255,8 +274,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'numericField', + $this->testFieldParameter( + $I, + 'numericField', $options, $expected, true, @@ -272,11 +292,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testNumericFieldWithDisplayTo() + public function testNumericFieldWithDisplayTo(UnitTester $I) { $this->specify( "numericField with displayTo returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -287,8 +307,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'numericField', + $this->testFieldParameter( + $I, + 'numericField', $options, $expected, false, @@ -299,7 +320,7 @@ function () { $this->specify( "numericField with displayTo returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -310,8 +331,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'numericField', + $this->testFieldParameter( + $I, + 'numericField', $options, $expected, true, @@ -327,11 +349,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testNumericFieldWithSetDefaultElementNotPresent() + public function testNumericFieldWithSetDefaultElementNotPresent(UnitTester $I) { $this->specify( "numericField with setDefault and element not present returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -342,8 +364,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'numericField', + $this->testFieldParameter( + $I, + 'numericField', $options, $expected, false, @@ -354,7 +377,7 @@ function () { $this->specify( "numericField with setDefault and element not present returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -365,8 +388,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'numericField', + $this->testFieldParameter( + $I, + 'numericField', $options, $expected, true, @@ -382,11 +406,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testNumericFieldWithDisplayToElementNotPresent() + public function testNumericFieldWithDisplayToElementNotPresent(UnitTester $I) { $this->specify( "numericField with displayTo and element not present returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -397,8 +421,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'numericField', + $this->testFieldParameter( + $I, + 'numericField', $options, $expected, false, @@ -409,7 +434,7 @@ function () { $this->specify( "numericField with displayTo and element not present returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -420,8 +445,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'numericField', + $this->testFieldParameter( + $I, + 'numericField', $options, $expected, true, diff --git a/tests/unit/Tag/TagPasswordFieldTest.php b/tests/unit/Tag/TagPasswordFieldCest.php similarity index 80% rename from tests/unit/Tag/TagPasswordFieldTest.php rename to tests/unit/Tag/TagPasswordFieldCest.php index 36030f76f36..1165c5f9a74 100644 --- a/tests/unit/Tag/TagPasswordFieldTest.php +++ b/tests/unit/Tag/TagPasswordFieldCest.php @@ -1,8 +1,18 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + namespace Phalcon\Test\Unit\Tag; -use Phalcon\Test\Module\UnitTest; +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; /** * \Phalcon\Test\Unit\Tag\TagPasswordFieldTest @@ -21,7 +31,7 @@ * through the world-wide-web, please send an email to license@phalconphp.com * so that we can send you a copy immediately. */ -class TagPasswordFieldTest extends UnitTest +class TagPasswordFieldTest extends TagBase { /** * Tests passwordField with string as a parameter @@ -29,16 +39,17 @@ class TagPasswordFieldTest extends UnitTest * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testPasswordFieldStringParameter() + public function testPasswordFieldStringParameter(UnitTester $I) { $this->specify( "passwordField with string parameter returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = 'x_name'; $expected = 'tester->testFieldParameter( - 'passwordField', + $this->testFieldParameter( + $I, + 'passwordField', $options, $expected, false @@ -48,12 +59,13 @@ function () { $this->specify( "passwordField with string parameter returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = 'x_name'; $expected = 'tester->testFieldParameter( - 'passwordField', + $this->testFieldParameter( + $I, + 'passwordField', $options, $expected, true @@ -68,11 +80,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testPasswordFieldArrayParameter() + public function testPasswordFieldArrayParameter(UnitTester $I) { $this->specify( "passwordField with array parameter returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'class' => 'x_class', @@ -80,8 +92,9 @@ function () { $expected = 'tester->testFieldParameter( - 'passwordField', + $this->testFieldParameter( + $I, + 'passwordField', $options, $expected, false @@ -91,7 +104,7 @@ function () { $this->specify( "passwordField with array parameter returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'class' => 'x_class', @@ -99,8 +112,9 @@ function () { $expected = 'tester->testFieldParameter( - 'passwordField', + $this->testFieldParameter( + $I, + 'passwordField', $options, $expected, true @@ -115,11 +129,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testPasswordFieldArrayParameterWithId() + public function testPasswordFieldArrayParameterWithId(UnitTester $I) { $this->specify( "passwordField with array parameter with id returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'id' => 'x_id', @@ -129,8 +143,9 @@ function () { $expected = 'tester->testFieldParameter( - 'passwordField', + $this->testFieldParameter( + $I, + 'passwordField', $options, $expected, true @@ -140,7 +155,7 @@ function () { $this->specify( "passwordField with array parameter with id returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'id' => 'x_id', @@ -150,8 +165,9 @@ function () { $expected = 'tester->testFieldParameter( - 'passwordField', + $this->testFieldParameter( + $I, + 'passwordField', $options, $expected, true @@ -166,11 +182,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testPasswordFieldArrayParameterWithNameNoId() + public function testPasswordFieldArrayParameterWithNameNoId(UnitTester $I) { $this->specify( "passwordField with array parameter with name no id returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -180,8 +196,9 @@ function () { $expected = 'tester->testFieldParameter( - 'passwordField', + $this->testFieldParameter( + $I, + 'passwordField', $options, $expected, false @@ -191,7 +208,7 @@ function () { $this->specify( "passwordField with array parameter with name no id returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -201,8 +218,9 @@ function () { $expected = 'tester->testFieldParameter( - 'passwordField', + $this->testFieldParameter( + $I, + 'passwordField', $options, $expected, false @@ -217,11 +235,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testPasswordFieldWithSetDefault() + public function testPasswordFieldWithSetDefault(UnitTester $I) { $this->specify( "passwordField with setDefault returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -232,8 +250,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'passwordField', + $this->testFieldParameter( + $I, + 'passwordField', $options, $expected, false, @@ -244,7 +263,7 @@ function () { $this->specify( "passwordField with setDefault returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -255,8 +274,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'passwordField', + $this->testFieldParameter( + $I, + 'passwordField', $options, $expected, true, @@ -272,11 +292,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testPasswordFieldWithDisplayTo() + public function testPasswordFieldWithDisplayTo(UnitTester $I) { $this->specify( "passwordField with displayTo returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -287,8 +307,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'passwordField', + $this->testFieldParameter( + $I, + 'passwordField', $options, $expected, false, @@ -299,7 +320,7 @@ function () { $this->specify( "passwordField with displayTo returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -310,8 +331,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'passwordField', + $this->testFieldParameter( + $I, + 'passwordField', $options, $expected, true, @@ -327,11 +349,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testPasswordFieldWithSetDefaultElementNotPresent() + public function testPasswordFieldWithSetDefaultElementNotPresent(UnitTester $I) { $this->specify( "passwordField with setDefault and element not present returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -342,8 +364,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'passwordField', + $this->testFieldParameter( + $I, + 'passwordField', $options, $expected, false, @@ -354,7 +377,7 @@ function () { $this->specify( "passwordField with setDefault and element not present returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -365,8 +388,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'passwordField', + $this->testFieldParameter( + $I, + 'passwordField', $options, $expected, true, @@ -382,11 +406,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testPasswordFieldWithDisplayToElementNotPresent() + public function testPasswordFieldWithDisplayToElementNotPresent(UnitTester $I) { $this->specify( "passwordField with displayTo and element not present returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -397,8 +421,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'passwordField', + $this->testFieldParameter( + $I, + 'passwordField', $options, $expected, false, @@ -409,7 +434,7 @@ function () { $this->specify( "passwordField with displayTo and element not present returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -420,8 +445,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'passwordField', + $this->testFieldParameter( + $I, + 'passwordField', $options, $expected, true, diff --git a/tests/unit/Tag/TagRadioFieldTest.php b/tests/unit/Tag/TagRadioFieldCest.php similarity index 80% rename from tests/unit/Tag/TagRadioFieldTest.php rename to tests/unit/Tag/TagRadioFieldCest.php index 06551e71d62..9959c4a66a6 100644 --- a/tests/unit/Tag/TagRadioFieldTest.php +++ b/tests/unit/Tag/TagRadioFieldCest.php @@ -1,8 +1,18 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + namespace Phalcon\Test\Unit\Tag; -use Phalcon\Test\Module\UnitTest; +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; /** * \Phalcon\Test\Unit\Tag\TagRadioFieldTest @@ -21,7 +31,7 @@ * through the world-wide-web, please send an email to license@phalconphp.com * so that we can send you a copy immediately. */ -class TagRadioFieldTest extends UnitTest +class TagRadioFieldTest extends TagBase { /** * Tests radioField with string as a parameter @@ -29,16 +39,17 @@ class TagRadioFieldTest extends UnitTest * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testRadioFieldStringParameter() + public function testRadioFieldStringParameter(UnitTester $I) { $this->specify( "radioField with string parameter returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = 'x_name'; $expected = 'tester->testFieldParameter( - 'radioField', + $this->testFieldParameter( + $I, + 'radioField', $options, $expected, false @@ -48,12 +59,13 @@ function () { $this->specify( "radioField with string parameter returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = 'x_name'; $expected = 'tester->testFieldParameter( - 'radioField', + $this->testFieldParameter( + $I, + 'radioField', $options, $expected, true @@ -68,11 +80,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testRadioFieldArrayParameter() + public function testRadioFieldArrayParameter(UnitTester $I) { $this->specify( "radioField with array parameter returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'class' => 'x_class', @@ -80,8 +92,9 @@ function () { $expected = 'tester->testFieldParameter( - 'radioField', + $this->testFieldParameter( + $I, + 'radioField', $options, $expected, false @@ -91,7 +104,7 @@ function () { $this->specify( "radioField with array parameter returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'class' => 'x_class', @@ -99,8 +112,9 @@ function () { $expected = 'tester->testFieldParameter( - 'radioField', + $this->testFieldParameter( + $I, + 'radioField', $options, $expected, true @@ -115,11 +129,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testRadioFieldArrayParameterWithId() + public function testRadioFieldArrayParameterWithId(UnitTester $I) { $this->specify( "radioField with array parameter with id returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'id' => 'x_id', @@ -129,8 +143,9 @@ function () { $expected = 'tester->testFieldParameter( - 'radioField', + $this->testFieldParameter( + $I, + 'radioField', $options, $expected, true @@ -140,7 +155,7 @@ function () { $this->specify( "radioField with array parameter with id returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'id' => 'x_id', @@ -150,8 +165,9 @@ function () { $expected = 'tester->testFieldParameter( - 'radioField', + $this->testFieldParameter( + $I, + 'radioField', $options, $expected, true @@ -166,11 +182,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testRadioFieldArrayParameterWithNameNoId() + public function testRadioFieldArrayParameterWithNameNoId(UnitTester $I) { $this->specify( "radioField with array parameter with name no id returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -180,8 +196,9 @@ function () { $expected = 'tester->testFieldParameter( - 'radioField', + $this->testFieldParameter( + $I, + 'radioField', $options, $expected, false @@ -191,7 +208,7 @@ function () { $this->specify( "radioField with array parameter with name no id returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -201,8 +218,9 @@ function () { $expected = 'tester->testFieldParameter( - 'radioField', + $this->testFieldParameter( + $I, + 'radioField', $options, $expected, false @@ -217,11 +235,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testRadioFieldWithSetDefault() + public function testRadioFieldWithSetDefault(UnitTester $I) { $this->specify( "radioField with setDefault returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -232,8 +250,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10" checked="checked"'; - $this->tester->testFieldParameter( - 'radioField', + $this->testFieldParameter( + $I, + 'radioField', $options, $expected, false, @@ -244,7 +263,7 @@ function () { $this->specify( "radioField with setDefault returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -255,8 +274,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10" checked="checked"'; - $this->tester->testFieldParameter( - 'radioField', + $this->testFieldParameter( + $I, + 'radioField', $options, $expected, true, @@ -272,11 +292,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testRadioFieldWithDisplayTo() + public function testRadioFieldWithDisplayTo(UnitTester $I) { $this->specify( "radioField with displayTo returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -287,8 +307,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10" checked="checked"'; - $this->tester->testFieldParameter( - 'radioField', + $this->testFieldParameter( + $I, + 'radioField', $options, $expected, false, @@ -299,7 +320,7 @@ function () { $this->specify( "radioField with displayTo returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -310,8 +331,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10" checked="checked"'; - $this->tester->testFieldParameter( - 'radioField', + $this->testFieldParameter( + $I, + 'radioField', $options, $expected, true, @@ -327,11 +349,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testRadioFieldWithSetDefaultElementNotPresent() + public function testRadioFieldWithSetDefaultElementNotPresent(UnitTester $I) { $this->specify( "radioField with setDefault and element not present returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -342,8 +364,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10" checked="checked"'; - $this->tester->testFieldParameter( - 'radioField', + $this->testFieldParameter( + $I, + 'radioField', $options, $expected, false, @@ -354,7 +377,7 @@ function () { $this->specify( "radioField with setDefault and element not present returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -365,8 +388,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10" checked="checked"'; - $this->tester->testFieldParameter( - 'radioField', + $this->testFieldParameter( + $I, + 'radioField', $options, $expected, true, @@ -382,11 +406,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testRadioFieldWithDisplayToElementNotPresent() + public function testRadioFieldWithDisplayToElementNotPresent(UnitTester $I) { $this->specify( "radioField with displayTo and element not present returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -397,8 +421,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10" checked="checked"'; - $this->tester->testFieldParameter( - 'radioField', + $this->testFieldParameter( + $I, + 'radioField', $options, $expected, false, @@ -409,7 +434,7 @@ function () { $this->specify( "radioField with displayTo and element not present returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -420,8 +445,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10" checked="checked"'; - $this->tester->testFieldParameter( - 'radioField', + $this->testFieldParameter( + $I, + 'radioField', $options, $expected, true, diff --git a/tests/unit/Tag/TagRangeFieldTest.php b/tests/unit/Tag/TagRangeFieldCest.php similarity index 80% rename from tests/unit/Tag/TagRangeFieldTest.php rename to tests/unit/Tag/TagRangeFieldCest.php index bcd274f8ebf..0a2a93b77a5 100644 --- a/tests/unit/Tag/TagRangeFieldTest.php +++ b/tests/unit/Tag/TagRangeFieldCest.php @@ -1,8 +1,18 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + namespace Phalcon\Test\Unit\Tag; -use Phalcon\Test\Module\UnitTest; +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; /** * \Phalcon\Test\Unit\Tag\TagRangeFieldTest @@ -21,7 +31,7 @@ * through the world-wide-web, please send an email to license@phalconphp.com * so that we can send you a copy immediately. */ -class TagRangeFieldTest extends UnitTest +class TagRangeFieldTest extends TagBase { /** * Tests rangeField with string as a parameter @@ -29,16 +39,17 @@ class TagRangeFieldTest extends UnitTest * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testRangeFieldStringParameter() + public function testRangeFieldStringParameter(UnitTester $I) { $this->specify( "rangeField with string parameter returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = 'x_name'; $expected = 'tester->testFieldParameter( - 'rangeField', + $this->testFieldParameter( + $I, + 'rangeField', $options, $expected, false @@ -48,12 +59,13 @@ function () { $this->specify( "rangeField with string parameter returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = 'x_name'; $expected = 'tester->testFieldParameter( - 'rangeField', + $this->testFieldParameter( + $I, + 'rangeField', $options, $expected, true @@ -68,11 +80,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testRangeFieldArrayParameter() + public function testRangeFieldArrayParameter(UnitTester $I) { $this->specify( "rangeField with array parameter returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'class' => 'x_class', @@ -80,8 +92,9 @@ function () { $expected = 'tester->testFieldParameter( - 'rangeField', + $this->testFieldParameter( + $I, + 'rangeField', $options, $expected, false @@ -91,7 +104,7 @@ function () { $this->specify( "rangeField with array parameter returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'class' => 'x_class', @@ -99,8 +112,9 @@ function () { $expected = 'tester->testFieldParameter( - 'rangeField', + $this->testFieldParameter( + $I, + 'rangeField', $options, $expected, true @@ -115,11 +129,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testRangeFieldArrayParameterWithId() + public function testRangeFieldArrayParameterWithId(UnitTester $I) { $this->specify( "rangeField with array parameter with id returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'id' => 'x_id', @@ -129,8 +143,9 @@ function () { $expected = 'tester->testFieldParameter( - 'rangeField', + $this->testFieldParameter( + $I, + 'rangeField', $options, $expected, true @@ -140,7 +155,7 @@ function () { $this->specify( "rangeField with array parameter with id returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'id' => 'x_id', @@ -150,8 +165,9 @@ function () { $expected = 'tester->testFieldParameter( - 'rangeField', + $this->testFieldParameter( + $I, + 'rangeField', $options, $expected, true @@ -166,11 +182,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testRangeFieldArrayParameterWithNameNoId() + public function testRangeFieldArrayParameterWithNameNoId(UnitTester $I) { $this->specify( "rangeField with array parameter with name no id returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -180,8 +196,9 @@ function () { $expected = 'tester->testFieldParameter( - 'rangeField', + $this->testFieldParameter( + $I, + 'rangeField', $options, $expected, false @@ -191,7 +208,7 @@ function () { $this->specify( "rangeField with array parameter with name no id returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -201,8 +218,9 @@ function () { $expected = 'tester->testFieldParameter( - 'rangeField', + $this->testFieldParameter( + $I, + 'rangeField', $options, $expected, false @@ -217,11 +235,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testRangeFieldWithSetDefault() + public function testRangeFieldWithSetDefault(UnitTester $I) { $this->specify( "rangeField with setDefault returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -232,8 +250,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'rangeField', + $this->testFieldParameter( + $I, + 'rangeField', $options, $expected, false, @@ -244,7 +263,7 @@ function () { $this->specify( "rangeField with setDefault returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -255,8 +274,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'rangeField', + $this->testFieldParameter( + $I, + 'rangeField', $options, $expected, true, @@ -272,11 +292,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testRangeFieldWithDisplayTo() + public function testRangeFieldWithDisplayTo(UnitTester $I) { $this->specify( "rangeField with displayTo returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -287,8 +307,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'rangeField', + $this->testFieldParameter( + $I, + 'rangeField', $options, $expected, false, @@ -299,7 +320,7 @@ function () { $this->specify( "rangeField with displayTo returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -310,8 +331,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'rangeField', + $this->testFieldParameter( + $I, + 'rangeField', $options, $expected, true, @@ -327,11 +349,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testRangeFieldWithSetDefaultElementNotPresent() + public function testRangeFieldWithSetDefaultElementNotPresent(UnitTester $I) { $this->specify( "rangeField with setDefault and element not present returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -342,8 +364,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'rangeField', + $this->testFieldParameter( + $I, + 'rangeField', $options, $expected, false, @@ -354,7 +377,7 @@ function () { $this->specify( "rangeField with setDefault and element not present returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -365,8 +388,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'rangeField', + $this->testFieldParameter( + $I, + 'rangeField', $options, $expected, true, @@ -382,11 +406,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testRangeFieldWithDisplayToElementNotPresent() + public function testRangeFieldWithDisplayToElementNotPresent(UnitTester $I) { $this->specify( "rangeField with displayTo and element not present returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -397,8 +421,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'rangeField', + $this->testFieldParameter( + $I, + 'rangeField', $options, $expected, false, @@ -409,7 +434,7 @@ function () { $this->specify( "rangeField with displayTo and element not present returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -420,8 +445,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'rangeField', + $this->testFieldParameter( + $I, + 'rangeField', $options, $expected, true, diff --git a/tests/unit/Tag/TagResetInputTest.php b/tests/unit/Tag/TagResetInputCest.php similarity index 78% rename from tests/unit/Tag/TagResetInputTest.php rename to tests/unit/Tag/TagResetInputCest.php index a81b182df89..9945fbc807b 100644 --- a/tests/unit/Tag/TagResetInputTest.php +++ b/tests/unit/Tag/TagResetInputCest.php @@ -1,9 +1,19 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + namespace Phalcon\Test\Unit\Tag; use Phalcon\Tag; -use Phalcon\Test\Module\UnitTest; +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; /** * \Phalcon\Test\Unit\Tag\TagResetInputTest @@ -22,7 +32,7 @@ * through the world-wide-web, please send an email to license@phalconphp.com * so that we can send you a copy immediately. */ -class TagResetInputTest extends UnitTest +class TagResetInputTest extends TagBase { /** * Tests Tag::resetInput @@ -34,11 +44,11 @@ class TagResetInputTest extends UnitTest * @author Serghei Iakovlev * @since 2016-01-20 */ - public function testResetInput() + public function testResetInput(UnitTester $I) { $this->specify( 'The resetInput does not work as expected', - function () { + function (UnitTester $I) { $_POST = ['a' => '1', 'b' => '2']; Tag::resetInput(); expect($_POST)->equals(['a' => '1', 'b' => '2']); @@ -53,11 +63,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testResetInputWithSetDefault() + public function testResetInputWithSetDefault(UnitTester $I) { $this->specify( "resetInput with setDefault returns invalid HTML Strict", - function () { + function (UnitTester $I) { Tag::setDocType(Tag::XHTML10_STRICT); $options = 'x_name'; @@ -66,18 +76,18 @@ function () { $actual = Tag::textField($options); Tag::resetInput(); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); $expected = ''; $actual = Tag::textField($options); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); $this->specify( "resetInput with setDefault returns invalid HTML XHTML", - function () { + function (UnitTester $I) { Tag::setDocType(Tag::HTML5); $options = 'x_name'; @@ -87,12 +97,12 @@ function () { $actual = Tag::textField($options); Tag::resetInput(); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); $expected = ''; $actual = Tag::textField($options); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -103,11 +113,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testResetInputWithDisplayTo() + public function testResetInputWithDisplayTo(UnitTester $I) { $this->specify( "resetInput with displayTo returns invalid HTML Strict", - function () { + function (UnitTester $I) { Tag::setDocType(Tag::XHTML10_STRICT); $options = 'x_name'; @@ -117,18 +127,18 @@ function () { $actual = Tag::textField($options); Tag::resetInput(); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); $expected = ''; $actual = Tag::textField($options); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); $this->specify( "resetInput with displayTo returns invalid HTML XHTML", - function () { + function (UnitTester $I) { Tag::setDocType(Tag::HTML5); $options = 'x_name'; @@ -138,12 +148,12 @@ function () { $actual = Tag::textField($options); Tag::resetInput(); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); $expected = ''; $actual = Tag::textField($options); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } diff --git a/tests/unit/Tag/TagSearchFieldTest.php b/tests/unit/Tag/TagSearchFieldCest.php similarity index 80% rename from tests/unit/Tag/TagSearchFieldTest.php rename to tests/unit/Tag/TagSearchFieldCest.php index 04babc2ac25..ec10006bb1a 100644 --- a/tests/unit/Tag/TagSearchFieldTest.php +++ b/tests/unit/Tag/TagSearchFieldCest.php @@ -1,8 +1,18 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + namespace Phalcon\Test\Unit\Tag; -use Phalcon\Test\Module\UnitTest; +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; /** * \Phalcon\Test\Unit\Tag\TagSearchFieldTest @@ -21,7 +31,7 @@ * through the world-wide-web, please send an email to license@phalconphp.com * so that we can send you a copy immediately. */ -class TagSearchFieldTest extends UnitTest +class TagSearchFieldTest extends TagBase { /** * Tests searchField with string as a parameter @@ -29,16 +39,17 @@ class TagSearchFieldTest extends UnitTest * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSearchFieldStringParameter() + public function testSearchFieldStringParameter(UnitTester $I) { $this->specify( "searchField with string parameter returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = 'x_name'; $expected = 'tester->testFieldParameter( - 'searchField', + $this->testFieldParameter( + $I, + 'searchField', $options, $expected, false @@ -48,12 +59,13 @@ function () { $this->specify( "searchField with string parameter returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = 'x_name'; $expected = 'tester->testFieldParameter( - 'searchField', + $this->testFieldParameter( + $I, + 'searchField', $options, $expected, true @@ -68,11 +80,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSearchFieldArrayParameter() + public function testSearchFieldArrayParameter(UnitTester $I) { $this->specify( "searchField with array parameter returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'class' => 'x_class', @@ -80,8 +92,9 @@ function () { $expected = 'tester->testFieldParameter( - 'searchField', + $this->testFieldParameter( + $I, + 'searchField', $options, $expected, false @@ -91,7 +104,7 @@ function () { $this->specify( "searchField with array parameter returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'class' => 'x_class', @@ -99,8 +112,9 @@ function () { $expected = 'tester->testFieldParameter( - 'searchField', + $this->testFieldParameter( + $I, + 'searchField', $options, $expected, true @@ -115,11 +129,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSearchFieldArrayParameterWithId() + public function testSearchFieldArrayParameterWithId(UnitTester $I) { $this->specify( "searchField with array parameter with id returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'id' => 'x_id', @@ -129,8 +143,9 @@ function () { $expected = 'tester->testFieldParameter( - 'searchField', + $this->testFieldParameter( + $I, + 'searchField', $options, $expected, true @@ -140,7 +155,7 @@ function () { $this->specify( "searchField with array parameter with id returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'id' => 'x_id', @@ -150,8 +165,9 @@ function () { $expected = 'tester->testFieldParameter( - 'searchField', + $this->testFieldParameter( + $I, + 'searchField', $options, $expected, true @@ -166,11 +182,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSearchFieldArrayParameterWithNameNoId() + public function testSearchFieldArrayParameterWithNameNoId(UnitTester $I) { $this->specify( "searchField with array parameter with name no id returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -180,8 +196,9 @@ function () { $expected = 'tester->testFieldParameter( - 'searchField', + $this->testFieldParameter( + $I, + 'searchField', $options, $expected, false @@ -191,7 +208,7 @@ function () { $this->specify( "searchField with array parameter with name no id returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -201,8 +218,9 @@ function () { $expected = 'tester->testFieldParameter( - 'searchField', + $this->testFieldParameter( + $I, + 'searchField', $options, $expected, false @@ -217,11 +235,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSearchFieldWithSetDefault() + public function testSearchFieldWithSetDefault(UnitTester $I) { $this->specify( "searchField with setDefault returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -232,8 +250,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'searchField', + $this->testFieldParameter( + $I, + 'searchField', $options, $expected, false, @@ -244,7 +263,7 @@ function () { $this->specify( "searchField with setDefault returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -255,8 +274,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'searchField', + $this->testFieldParameter( + $I, + 'searchField', $options, $expected, true, @@ -272,11 +292,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSearchFieldWithDisplayTo() + public function testSearchFieldWithDisplayTo(UnitTester $I) { $this->specify( "searchField with displayTo returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -287,8 +307,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'searchField', + $this->testFieldParameter( + $I, + 'searchField', $options, $expected, false, @@ -299,7 +320,7 @@ function () { $this->specify( "searchField with displayTo returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -310,8 +331,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'searchField', + $this->testFieldParameter( + $I, + 'searchField', $options, $expected, true, @@ -327,11 +349,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSearchFieldWithSetDefaultElementNotPresent() + public function testSearchFieldWithSetDefaultElementNotPresent(UnitTester $I) { $this->specify( "searchField with setDefault and element not present returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -342,8 +364,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'searchField', + $this->testFieldParameter( + $I, + 'searchField', $options, $expected, false, @@ -354,7 +377,7 @@ function () { $this->specify( "searchField with setDefault and element not present returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -365,8 +388,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'searchField', + $this->testFieldParameter( + $I, + 'searchField', $options, $expected, true, @@ -382,11 +406,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSearchFieldWithDisplayToElementNotPresent() + public function testSearchFieldWithDisplayToElementNotPresent(UnitTester $I) { $this->specify( "searchField with displayTo and element not present returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -397,8 +421,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'searchField', + $this->testFieldParameter( + $I, + 'searchField', $options, $expected, false, @@ -409,7 +434,7 @@ function () { $this->specify( "searchField with displayTo and element not present returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -420,8 +445,9 @@ function () { . 'name="x_other" value="x_value" class="x_class" ' . 'size="10"'; - $this->tester->testFieldParameter( - 'searchField', + $this->testFieldParameter( + $I, + 'searchField', $options, $expected, true, diff --git a/tests/unit/Tag/TagSelectStaticTest.php b/tests/unit/Tag/TagSelectStaticCest.php similarity index 88% rename from tests/unit/Tag/TagSelectStaticTest.php rename to tests/unit/Tag/TagSelectStaticCest.php index 2bdc1d2db17..95846a383ba 100644 --- a/tests/unit/Tag/TagSelectStaticTest.php +++ b/tests/unit/Tag/TagSelectStaticCest.php @@ -1,9 +1,19 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + namespace Phalcon\Test\Unit\Tag; use Phalcon\Tag; -use Phalcon\Test\Module\UnitTest; +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; /** * \Phalcon\Test\Unit\Tag\TagSelectStaticTest @@ -22,7 +32,7 @@ * through the world-wide-web, please send an email to license@phalconphp.com * so that we can send you a copy immediately. */ -class TagSelectStaticTest extends UnitTest +class TagSelectStaticTest extends TagBase { /** * Tests selectStatic with string as a parameter @@ -30,11 +40,11 @@ class TagSelectStaticTest extends UnitTest * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSelectStaticStringParameter() + public function testSelectStaticStringParameter(UnitTester $I) { $this->specify( "selectStatic with string parameter returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $name = 'x_name'; $options = [ @@ -49,7 +59,7 @@ function () { $actual = Tag::selectStatic($name, $options); Tag::resetInput(); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -60,11 +70,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSelectStaticArrayParameter() + public function testSelectStaticArrayParameter(UnitTester $I) { $this->specify( "selectStatic with array parameter returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $params = [ 'x_name', @@ -82,7 +92,7 @@ function () { $actual = Tag::selectStatic($params, $options); Tag::resetInput(); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -94,11 +104,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSelectStaticArrayParameterWithId() + public function testSelectStaticArrayParameterWithId(UnitTester $I) { $this->specify( "selectStatic with array parameter with id returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $params = [ 'x_name', @@ -117,7 +127,7 @@ function () { $actual = Tag::selectStatic($params, $options); Tag::resetInput(); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -129,11 +139,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSelectStaticArrayParameterWithNameNoId() + public function testSelectStaticArrayParameterWithNameNoId(UnitTester $I) { $this->specify( "selectStatic with array parameter with name no id returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $params = [ 'x_name', @@ -152,7 +162,7 @@ function () { $actual = Tag::selectStatic($params, $options); Tag::resetInput(); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -163,11 +173,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSelectStaticArrayParameterWithValue() + public function testSelectStaticArrayParameterWithValue(UnitTester $I) { $this->specify( "selectStatic with array parameter with value returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $params = [ 'x_name', @@ -186,7 +196,7 @@ function () { $actual = Tag::selectStatic($params, $options); Tag::resetInput(); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -197,11 +207,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSelectStaticWithSetDefault() + public function testSelectStaticWithSetDefault(UnitTester $I) { $this->specify( "selectStatic with setDefault returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $params = [ 'x_name', @@ -220,7 +230,7 @@ function () { $actual = Tag::selectStatic($params, $options); Tag::resetInput(); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -231,11 +241,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSelectStaticWithDisplayTo() + public function testSelectStaticWithDisplayTo(UnitTester $I) { $this->specify( "selectStatic with setDefault returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $params = [ 'x_name', @@ -254,7 +264,7 @@ function () { $actual = Tag::selectStatic($params, $options); Tag::resetInput(); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -265,11 +275,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSelectStaticWithSetDefaultElementNotPresent() + public function testSelectStaticWithSetDefaultElementNotPresent(UnitTester $I) { $this->specify( "selectStatic with setDefault and element not present returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $params = [ 'x_name', @@ -289,7 +299,7 @@ function () { $actual = Tag::selectStatic($params, $options); Tag::resetInput(); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -300,11 +310,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSelectStaticWithDisplayToElementNotPresent() + public function testSelectStaticWithDisplayToElementNotPresent(UnitTester $I) { $this->specify( "selectStatic with displayTo and element not present returns invalid HTML Strict", - function () { + function (UnitTester $I) { Tag::resetInput(); $params = [ 'x_name', @@ -324,7 +334,7 @@ function () { $actual = Tag::selectStatic($params, $options); Tag::resetInput(); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -335,11 +345,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSelectStaticOptGroupArrayParameter() + public function testSelectStaticOptGroupArrayParameter(UnitTester $I) { $this->specify( "selectStatic with array parameter returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $params = [ "x_name", @@ -362,7 +372,7 @@ function () { $actual = Tag::selectStatic($params); Tag::resetInput(); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -374,11 +384,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSelectStaticOptGroupArrayParameterWithId() + public function testSelectStaticOptGroupArrayParameterWithId(UnitTester $I) { $this->specify( "selectStatic with array parameter with id returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $params = [ 'x_name', @@ -403,7 +413,7 @@ function () { $actual = Tag::selectStatic($params, $options); Tag::resetInput(); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -415,11 +425,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSelectStaticOptGroupArrayParameterWithNameNoId() + public function testSelectStaticOptGroupArrayParameterWithNameNoId(UnitTester $I) { $this->specify( "selectStatic with array parameter with name no id returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $params = [ 'x_name', @@ -444,7 +454,7 @@ function () { $actual = Tag::selectStatic($params, $options); Tag::resetInput(); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -455,11 +465,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSelectStaticOptGroupArrayParameterWithValue() + public function testSelectStaticOptGroupArrayParameterWithValue(UnitTester $I) { $this->specify( "selectStatic with array parameter with value returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $params = [ 'x_name', @@ -484,7 +494,7 @@ function () { $actual = Tag::selectStatic($params, $options); Tag::resetInput(); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -495,11 +505,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSelectStaticOptGroupWithSetDefault() + public function testSelectStaticOptGroupWithSetDefault(UnitTester $I) { $this->specify( "selectStatic with setDefault returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $params = [ 'x_name', @@ -525,7 +535,7 @@ function () { $actual = Tag::selectStatic($params, $options); Tag::resetInput(); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -536,11 +546,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSelectStaticOptGroupWithDisplayTo() + public function testSelectStaticOptGroupWithDisplayTo(UnitTester $I) { $this->specify( "selectStatic with setDefault returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $params = [ 'x_name', @@ -566,7 +576,7 @@ function () { $actual = Tag::selectStatic($params, $options); Tag::resetInput(); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -577,11 +587,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSelectStaticOptGroupWithSetDefaultElementNotPresent() + public function testSelectStaticOptGroupWithSetDefaultElementNotPresent(UnitTester $I) { $this->specify( "selectStatic with setDefault and element not present returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $params = [ 'x_name', @@ -609,7 +619,7 @@ function () { $actual = Tag::selectStatic($params, $options); Tag::resetInput(); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -620,11 +630,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSelectStaticOptGroupWithDisplayToElementNotPresent() + public function testSelectStaticOptGroupWithDisplayToElementNotPresent(UnitTester $I) { $this->specify( "selectStatic with displayTo and element not present returns invalid HTML", - function () { + function (UnitTester $I) { Tag::resetInput(); $params = [ 'x_name', @@ -651,7 +661,7 @@ function () { $actual = Tag::selectStatic($params, $options); Tag::resetInput(); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } diff --git a/tests/unit/Tag/TagSetDefaultTest.php b/tests/unit/Tag/TagSetDefaultCest.php similarity index 66% rename from tests/unit/Tag/TagSetDefaultTest.php rename to tests/unit/Tag/TagSetDefaultCest.php index 41c17247913..01ecabfa348 100644 --- a/tests/unit/Tag/TagSetDefaultTest.php +++ b/tests/unit/Tag/TagSetDefaultCest.php @@ -1,9 +1,19 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + namespace Phalcon\Test\Unit\Tag; use Phalcon\Tag; -use Phalcon\Test\Module\UnitTest; +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; /** * \Phalcon\Test\Unit\Tag\TagSetDefaultTest @@ -22,7 +32,7 @@ * through the world-wide-web, please send an email to license@phalconphp.com * so that we can send you a copy immediately. */ -class TagSetDefaultTest extends UnitTest +class TagSetDefaultTest extends TagBase { /** * Tests setDefault @@ -31,19 +41,19 @@ class TagSetDefaultTest extends UnitTest * @author Dmitry Patsura * @since 2014-05-10 */ - public function testDisplayValues() + public function testDisplayValues(UnitTester $I) { $this->specify( "setDefault does not assigns default values to generated tags by helpers", - function () { + function (UnitTester $I) { Tag::setDefault('property1', 'testVal1'); Tag::setDefault('property2', 'testVal2'); Tag::setDefault('property3', 'testVal3'); - expect(Tag::hasValue('property1'))->true(); - expect(Tag::hasValue('property2'))->true(); - expect(Tag::hasValue('property3'))->true(); - expect(Tag::hasValue('property4'))->false(); + expect(Tag::hasValue('property1'))->true(UnitTester $I); + expect(Tag::hasValue('property2'))->true(UnitTester $I); + expect(Tag::hasValue('property3'))->true(UnitTester $I); + expect(Tag::hasValue('property4'))->false(UnitTester $I); expect(Tag::getValue('property1'))->equals('testVal1'); expect(Tag::getValue('property2'))->equals('testVal2'); diff --git a/tests/unit/Tag/TagStylesheetlinkTest.php b/tests/unit/Tag/TagStylesheetlinkCest.php similarity index 81% rename from tests/unit/Tag/TagStylesheetlinkTest.php rename to tests/unit/Tag/TagStylesheetlinkCest.php index 1013ddcd532..96f18911f13 100644 --- a/tests/unit/Tag/TagStylesheetlinkTest.php +++ b/tests/unit/Tag/TagStylesheetlinkCest.php @@ -1,9 +1,19 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + namespace Phalcon\Test\Unit\Tag; use Phalcon\Tag; -use Phalcon\Test\Module\UnitTest; +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; /** * \Phalcon\Test\Unit\Tag\TagStylesheetLinkTest @@ -22,7 +32,7 @@ * through the world-wide-web, please send an email to license@phalconphp.com * so that we can send you a copy immediately. */ -class TagStylesheetlinkTest extends UnitTest +class TagStylesheetlinkTest extends TagBase { /** * Tests stylesheetLink with string parameter for a local link @@ -32,11 +42,11 @@ class TagStylesheetlinkTest extends UnitTest * @author Dreamszhu * @since 2014-09-12 */ - public function testStylesheetLinkStringParameterLocal() + public function testStylesheetLinkStringParameterLocal(UnitTester $I) { $this->specify( "stylesheetLink with string parameter local returns invalid HTML Strict", - function () { + function (UnitTester $I) { Tag::resetInput(); $options = 'css/phalcon.css'; $expected = 'equals($expected); + $I->assertEquals($expected, $actual); } ); $this->specify( "stylesheetLink with string parameter local returns invalid HTML HTML5", - function () { + function (UnitTester $I) { Tag::resetInput(); $options = 'css/phalcon.css'; $expected = 'equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -75,11 +85,11 @@ function () { * @author Dreamszhu * @since 2014-09-12 */ - public function testStylesheetLinkArrayParameterLocal() + public function testStylesheetLinkArrayParameterLocal(UnitTester $I) { $this->specify( "stylesheetLink with array parameter local returns invalid HTML Strict", - function () { + function (UnitTester $I) { Tag::resetInput(); $options = ['css/phalcon.css']; $expected = 'equals($expected); + $I->assertEquals($expected, $actual); } ); $this->specify( "stylesheetLink with array parameter local returns invalid HTML HTML5", - function () { + function (UnitTester $I) { Tag::resetInput(); $options = ['css/phalcon.css']; $expected = 'equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -116,11 +126,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-12 */ - public function testStylesheetLinkStringParameterRemote() + public function testStylesheetLinkStringParameterRemote(UnitTester $I) { $this->specify( "stylesheetLink with string parameter remote returns invalid HTML Strict", - function () { + function (UnitTester $I) { Tag::resetInput(); $options = 'http://phalconphp.com/css/phalcon.css'; $expected = 'equals($expected); + $I->assertEquals($expected, $actual); } ); $this->specify( "stylesheetLink with string parameter remote returns invalid HTML HTML5", - function () { + function (UnitTester $I) { Tag::resetInput(); $options = 'http://phalconphp.com/css/phalcon.css'; $expected = 'equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -157,11 +167,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-12 */ - public function testStylesheetLinkArrayParameterRemote() + public function testStylesheetLinkArrayParameterRemote(UnitTester $I) { $this->specify( "stylesheetLink with array parameter remote returns invalid HTML Strict", - function () { + function (UnitTester $I) { Tag::resetInput(); $options = ['http://phalconphp.com/css/phalcon.css']; $expected = 'equals($expected); + $I->assertEquals($expected, $actual); } ); $this->specify( "stylesheetLink with array parameter remote returns invalid HTML HTML5", - function () { + function (UnitTester $I) { Tag::resetInput(); $options = ['http://phalconphp.com/css/phalcon.css']; $expected = 'equals($expected); + $I->assertEquals($expected, $actual); } ); } @@ -200,11 +210,11 @@ function () { * @author Dreamszhu * @since 2014-09-12 */ - public function testStylesheetLinkOverrideRelLink() + public function testStylesheetLinkOverrideRelLink(UnitTester $I) { $this->specify( "stylesheetLink overriding rel local returns invalid HTML Strict", - function () { + function (UnitTester $I) { Tag::resetInput(); $options = [ 'css/phalcon.css', @@ -217,13 +227,13 @@ function () { Tag::setDocType(Tag::XHTML10_STRICT); $actual = Tag::stylesheetLink($options); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); $this->specify( "stylesheetLink overriding rel local returns invalid HTML Strict", - function () { + function (UnitTester $I) { Tag::resetInput(); $options = [ 'css/phalcon.css', @@ -236,7 +246,7 @@ function () { Tag::setDocType(Tag::HTML5); $actual = Tag::stylesheetLink($options); - expect($actual)->equals($expected); + $I->assertEquals($expected, $actual); } ); } diff --git a/tests/unit/Tag/TagSubmitButtonTest.php b/tests/unit/Tag/TagSubmitButtonCest.php similarity index 79% rename from tests/unit/Tag/TagSubmitButtonTest.php rename to tests/unit/Tag/TagSubmitButtonCest.php index d59217a787e..bbfe615aa45 100644 --- a/tests/unit/Tag/TagSubmitButtonTest.php +++ b/tests/unit/Tag/TagSubmitButtonCest.php @@ -1,8 +1,18 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + namespace Phalcon\Test\Unit\Tag; -use Phalcon\Test\Module\UnitTest; +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; /** * \Phalcon\Test\Unit\Tag\TagSubmitButtonTest @@ -21,7 +31,7 @@ * through the world-wide-web, please send an email to license@phalconphp.com * so that we can send you a copy immediately. */ -class TagSubmitButtonTest extends UnitTest +class TagSubmitButtonTest extends TagBase { /** * Tests submitField with string as a parameter @@ -29,16 +39,17 @@ class TagSubmitButtonTest extends UnitTest * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSubmitButtonStringParameter() + public function testSubmitButtonStringParameter(UnitTester $I) { $this->specify( "submitButton with string parameter returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = 'x_name'; $expected = 'tester->testFieldParameter( - 'submitButton', + $this->testFieldParameter( + $I, + 'submitButton', $options, $expected, false @@ -48,12 +59,13 @@ function () { $this->specify( "submitButton with string parameter returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = 'x_name'; $expected = 'tester->testFieldParameter( - 'submitButton', + $this->testFieldParameter( + $I, + 'submitButton', $options, $expected, true @@ -68,11 +80,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSubmitButtonArrayParameter() + public function testSubmitButtonArrayParameter(UnitTester $I) { $this->specify( "submitButton with array parameter returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'class' => 'x_class', @@ -80,8 +92,9 @@ function () { $expected = 'tester->testFieldParameter( - 'submitButton', + $this->testFieldParameter( + $I, + 'submitButton', $options, $expected, false @@ -91,7 +104,7 @@ function () { $this->specify( "submitButton with array parameter returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'class' => 'x_class', @@ -99,8 +112,9 @@ function () { $expected = 'tester->testFieldParameter( - 'submitButton', + $this->testFieldParameter( + $I, + 'submitButton', $options, $expected, true @@ -115,11 +129,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSubmitButtonArrayParameterWithId() + public function testSubmitButtonArrayParameterWithId(UnitTester $I) { $this->specify( "submitButton with array parameter with id returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'id' => 'x_id', @@ -129,8 +143,9 @@ function () { $expected = 'tester->testFieldParameter( - 'submitButton', + $this->testFieldParameter( + $I, + 'submitButton', $options, $expected, true @@ -140,7 +155,7 @@ function () { $this->specify( "submitButton with array parameter with id returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'id' => 'x_id', @@ -150,8 +165,9 @@ function () { $expected = 'tester->testFieldParameter( - 'submitButton', + $this->testFieldParameter( + $I, + 'submitButton', $options, $expected, true @@ -166,11 +182,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSubmitButtonArrayParameterWithNameNoId() + public function testSubmitButtonArrayParameterWithNameNoId(UnitTester $I) { $this->specify( "submitButton with array parameter with name no id returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -180,8 +196,9 @@ function () { $expected = 'tester->testFieldParameter( - 'submitButton', + $this->testFieldParameter( + $I, + 'submitButton', $options, $expected, false @@ -191,7 +208,7 @@ function () { $this->specify( "submitButton with array parameter with name no id returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -201,8 +218,9 @@ function () { $expected = 'tester->testFieldParameter( - 'submitButton', + $this->testFieldParameter( + $I, + 'submitButton', $options, $expected, false @@ -217,11 +235,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSubmitButtonWithSetDefault() + public function testSubmitButtonWithSetDefault(UnitTester $I) { $this->specify( "submitButton with setDefault returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -231,8 +249,9 @@ function () { $expected = 'tester->testFieldParameter( - 'submitButton', + $this->testFieldParameter( + $I, + 'submitButton', $options, $expected, false, @@ -243,7 +262,7 @@ function () { $this->specify( "submitButton with setDefault returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -253,8 +272,9 @@ function () { $expected = 'tester->testFieldParameter( - 'submitButton', + $this->testFieldParameter( + $I, + 'submitButton', $options, $expected, true, @@ -270,11 +290,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSubmitButtonWithDisplayTo() + public function testSubmitButtonWithDisplayTo(UnitTester $I) { $this->specify( "submitButton with displayTo returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -284,8 +304,9 @@ function () { $expected = 'tester->testFieldParameter( - 'submitButton', + $this->testFieldParameter( + $I, + 'submitButton', $options, $expected, false, @@ -296,7 +317,7 @@ function () { $this->specify( "submitButton with displayTo returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -306,8 +327,9 @@ function () { $expected = 'tester->testFieldParameter( - 'submitButton', + $this->testFieldParameter( + $I, + 'submitButton', $options, $expected, true, @@ -323,11 +345,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSubmitButtonWithSetDefaultElementNotPresent() + public function testSubmitButtonWithSetDefaultElementNotPresent(UnitTester $I) { $this->specify( "submitButton with setDefault and element not present returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -337,8 +359,9 @@ function () { $expected = 'tester->testFieldParameter( - 'submitButton', + $this->testFieldParameter( + $I, + 'submitButton', $options, $expected, false, @@ -349,7 +372,7 @@ function () { $this->specify( "submitButton with setDefault and element not present returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -359,8 +382,9 @@ function () { $expected = 'tester->testFieldParameter( - 'submitButton', + $this->testFieldParameter( + $I, + 'submitButton', $options, $expected, true, @@ -376,11 +400,11 @@ function () { * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testSubmitButtonWithDisplayToElementNotPresent() + public function testSubmitButtonWithDisplayToElementNotPresent(UnitTester $I) { $this->specify( "submitButton with displayTo and element not present returns invalid HTML Strict", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -390,8 +414,9 @@ function () { $expected = 'tester->testFieldParameter( - 'submitButton', + $this->testFieldParameter( + $I, + 'submitButton', $options, $expected, false, @@ -402,7 +427,7 @@ function () { $this->specify( "submitButton with displayTo and element not present returns invalid HTML XHTML", - function () { + function (UnitTester $I) { $options = [ 'x_name', 'name' => 'x_other', @@ -412,8 +437,9 @@ function () { $expected = 'tester->testFieldParameter( - 'submitButton', + $this->testFieldParameter( + $I, + 'submitButton', $options, $expected, true, diff --git a/tests/unit/Tag/TagTagHtmlTest.php b/tests/unit/Tag/TagTagHtmlCest.php similarity index 78% rename from tests/unit/Tag/TagTagHtmlTest.php rename to tests/unit/Tag/TagTagHtmlCest.php index 0448e460d83..17ea2ef0e63 100644 --- a/tests/unit/Tag/TagTagHtmlTest.php +++ b/tests/unit/Tag/TagTagHtmlCest.php @@ -1,9 +1,19 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + namespace Phalcon\Test\Unit\Tag; use Phalcon\Tag; -use Phalcon\Test\Module\UnitTest; +use Phalcon\Test\Unit\Tag\Helper\TagBase; +use UnitTester; /** * \Phalcon\Test\Unit\Tag\TagTagHtmlTest @@ -22,7 +32,7 @@ * through the world-wide-web, please send an email to license@phalconphp.com * so that we can send you a copy immediately. */ -class TagTagHtmlTest extends UnitTest +class TagTagHtmlTest extends TagBase { /** * Tests tagHtml with name parameter @@ -30,11 +40,11 @@ class TagTagHtmlTest extends UnitTest * @author Nikolaos Dimopoulos * @since 2014-09-05 */ - public function testTagHtmlName() + public function testTagHtmlName(UnitTester $I) { $this->specify( "tagHtml with name parameter returns invalid HTML Strict", - function () { + function (UnitTester $I) { Tag::resetInput(); $name = 'aside'; $expected = '