From 15a719c78af351a7b7cf3e390d28c9f23ae8fbbb Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Wed, 27 Aug 2014 10:24:49 +0200 Subject: [PATCH] Cleanup --- .gitignore | 10 +- .travis.yml | 2 +- PHP/Token/Stream/Autoload.php | 226 ------------------ PHP/Token/Stream/Autoload.php.in | 65 ----- build.xml | 171 ++----------- .../ControlSignatureSniff.php | 22 -- .../Whitespace/ConcatenationSpacingSniff.php | 22 -- build/PHPCS/ruleset.xml | 35 --- build/phpmd.xml | 27 --- build/phpunit.xml | 17 ++ build/travis-ci.xml | 13 - composer.json | 15 +- package.xml | 69 ------ phpunit.xml.dist | 27 --- {PHP => src}/Token.php | 0 {PHP => src}/Token/Stream.php | 0 {PHP => src}/Token/Stream/CachingFactory.php | 0 {Tests => tests}/Token/ClassTest.php | 10 - {Tests => tests}/Token/ClosureTest.php | 10 - {Tests => tests}/Token/FunctionTest.php | 10 - {Tests => tests}/Token/IncludeTest.php | 10 - {Tests => tests}/Token/InterfaceTest.php | 10 - {Tests => tests}/Token/NamespaceTest.php | 10 - {Tests => tests}/TokenTest.php | 9 - .../_fixture}/classExtendsNamespacedClass.php | 0 .../_fixture}/classInNamespace.php | 0 .../_fixture}/classInScopedNamespace.php | 0 {Tests/_files => tests/_fixture}/closure.php | 0 {Tests/_files => tests/_fixture}/issue19.php | 0 {Tests/_files => tests/_fixture}/issue30.php | 0 ...tipleNamespacesWithOneClassUsingBraces.php | 0 ...espacesWithOneClassUsingNonBraceSyntax.php | 0 {Tests/_files => tests/_fixture}/source.php | 0 {Tests/_files => tests/_fixture}/source2.php | 0 {Tests/_files => tests/_fixture}/source3.php | 0 {Tests/_files => tests/_fixture}/source4.php | 0 {Tests/_files => tests/_fixture}/source5.php | 0 tests/bootstrap.php | 7 + 38 files changed, 56 insertions(+), 741 deletions(-) delete mode 100644 PHP/Token/Stream/Autoload.php delete mode 100644 PHP/Token/Stream/Autoload.php.in delete mode 100644 build/PHPCS/Sniffs/ControlStructures/ControlSignatureSniff.php delete mode 100644 build/PHPCS/Sniffs/Whitespace/ConcatenationSpacingSniff.php delete mode 100644 build/PHPCS/ruleset.xml delete mode 100644 build/phpmd.xml create mode 100644 build/phpunit.xml delete mode 100644 build/travis-ci.xml delete mode 100644 package.xml delete mode 100644 phpunit.xml.dist rename {PHP => src}/Token.php (100%) rename {PHP => src}/Token/Stream.php (100%) rename {PHP => src}/Token/Stream/CachingFactory.php (100%) rename {Tests => tests}/Token/ClassTest.php (94%) rename {Tests => tests}/Token/ClosureTest.php (95%) rename {Tests => tests}/Token/FunctionTest.php (96%) rename {Tests => tests}/Token/IncludeTest.php (94%) rename {Tests => tests}/Token/InterfaceTest.php (97%) rename {Tests => tests}/Token/NamespaceTest.php (95%) rename {Tests => tests}/TokenTest.php (93%) rename {Tests/_files => tests/_fixture}/classExtendsNamespacedClass.php (100%) rename {Tests/_files => tests/_fixture}/classInNamespace.php (100%) rename {Tests/_files => tests/_fixture}/classInScopedNamespace.php (100%) rename {Tests/_files => tests/_fixture}/closure.php (100%) rename {Tests/_files => tests/_fixture}/issue19.php (100%) rename {Tests/_files => tests/_fixture}/issue30.php (100%) rename {Tests/_files => tests/_fixture}/multipleNamespacesWithOneClassUsingBraces.php (100%) rename {Tests/_files => tests/_fixture}/multipleNamespacesWithOneClassUsingNonBraceSyntax.php (100%) rename {Tests/_files => tests/_fixture}/source.php (100%) rename {Tests/_files => tests/_fixture}/source2.php (100%) rename {Tests/_files => tests/_fixture}/source3.php (100%) rename {Tests/_files => tests/_fixture}/source4.php (100%) rename {Tests/_files => tests/_fixture}/source5.php (100%) create mode 100644 tests/bootstrap.php diff --git a/.gitignore b/.gitignore index 26d535f..103eecf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,4 @@ /.idea -build/api -build/code-browser -build/coverage -build/logs -build/pdepend -cache.properties -phpunit.xml +/composer.lock +/composer.phar +/vendor diff --git a/.travis.yml b/.travis.yml index 90a2d2b..e1bd2d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ before_script: - composer install --no-interaction --prefer-source --dev script: - - phpunit --configuration ./build/travis-ci.xml + - ./vendor/bin/phpunit --configuration ./build/phpunit.xml matrix: allow_failures: diff --git a/PHP/Token/Stream/Autoload.php b/PHP/Token/Stream/Autoload.php deleted file mode 100644 index 5c8cc21..0000000 --- a/PHP/Token/Stream/Autoload.php +++ /dev/null @@ -1,226 +0,0 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @package PHP_TokenStream - * @author Sebastian Bergmann - * @copyright 2009-2010 Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://github.com/sebastianbergmann/php-token-stream/tree - * @since File available since Release 1.1.0 - */ - -spl_autoload_register( - function ($class) - { - static $classes = NULL; - static $path = NULL;; - - if ($classes === NULL) { - $classes = array( - 'php_token' => '/Token.php', - 'php_token_abstract' => '/Token.php', - 'php_token_ampersand' => '/Token.php', - 'php_token_and_equal' => '/Token.php', - 'php_token_array' => '/Token.php', - 'php_token_array_cast' => '/Token.php', - 'php_token_as' => '/Token.php', - 'php_token_at' => '/Token.php', - 'php_token_backtick' => '/Token.php', - 'php_token_bad_character' => '/Token.php', - 'php_token_bool_cast' => '/Token.php', - 'php_token_boolean_and' => '/Token.php', - 'php_token_boolean_or' => '/Token.php', - 'php_token_break' => '/Token.php', - 'php_token_callable' => '/Token.php', - 'php_token_caret' => '/Token.php', - 'php_token_case' => '/Token.php', - 'php_token_catch' => '/Token.php', - 'php_token_character' => '/Token.php', - 'php_token_class' => '/Token.php', - 'php_token_class_c' => '/Token.php', - 'php_token_clone' => '/Token.php', - 'php_token_close_bracket' => '/Token.php', - 'php_token_close_curly' => '/Token.php', - 'php_token_close_square' => '/Token.php', - 'php_token_close_tag' => '/Token.php', - 'php_token_colon' => '/Token.php', - 'php_token_comma' => '/Token.php', - 'php_token_comment' => '/Token.php', - 'php_token_concat_equal' => '/Token.php', - 'php_token_const' => '/Token.php', - 'php_token_constant_encapsed_string' => '/Token.php', - 'php_token_continue' => '/Token.php', - 'php_token_curly_open' => '/Token.php', - 'php_token_dec' => '/Token.php', - 'php_token_declare' => '/Token.php', - 'php_token_default' => '/Token.php', - 'php_token_dir' => '/Token.php', - 'php_token_div' => '/Token.php', - 'php_token_div_equal' => '/Token.php', - 'php_token_dnumber' => '/Token.php', - 'php_token_do' => '/Token.php', - 'php_token_doc_comment' => '/Token.php', - 'php_token_dollar' => '/Token.php', - 'php_token_dollar_open_curly_braces' => '/Token.php', - 'php_token_dot' => '/Token.php', - 'php_token_double_arrow' => '/Token.php', - 'php_token_double_cast' => '/Token.php', - 'php_token_double_colon' => '/Token.php', - 'php_token_double_quotes' => '/Token.php', - 'php_token_echo' => '/Token.php', - 'php_token_else' => '/Token.php', - 'php_token_elseif' => '/Token.php', - 'php_token_empty' => '/Token.php', - 'php_token_encapsed_and_whitespace' => '/Token.php', - 'php_token_end_heredoc' => '/Token.php', - 'php_token_enddeclare' => '/Token.php', - 'php_token_endfor' => '/Token.php', - 'php_token_endforeach' => '/Token.php', - 'php_token_endif' => '/Token.php', - 'php_token_endswitch' => '/Token.php', - 'php_token_endwhile' => '/Token.php', - 'php_token_equal' => '/Token.php', - 'php_token_eval' => '/Token.php', - 'php_token_exclamation_mark' => '/Token.php', - 'php_token_exit' => '/Token.php', - 'php_token_extends' => '/Token.php', - 'php_token_file' => '/Token.php', - 'php_token_final' => '/Token.php', - 'php_token_for' => '/Token.php', - 'php_token_foreach' => '/Token.php', - 'php_token_func_c' => '/Token.php', - 'php_token_function' => '/Token.php', - 'php_token_global' => '/Token.php', - 'php_token_goto' => '/Token.php', - 'php_token_gt' => '/Token.php', - 'php_token_halt_compiler' => '/Token.php', - 'php_token_if' => '/Token.php', - 'php_token_implements' => '/Token.php', - 'php_token_inc' => '/Token.php', - 'php_token_include' => '/Token.php', - 'php_token_include_once' => '/Token.php', - 'php_token_includes' => '/Token.php', - 'php_token_inline_html' => '/Token.php', - 'php_token_instanceof' => '/Token.php', - 'php_token_insteadof' => '/Token.php', - 'php_token_int_cast' => '/Token.php', - 'php_token_interface' => '/Token.php', - 'php_token_is_equal' => '/Token.php', - 'php_token_is_greater_or_equal' => '/Token.php', - 'php_token_is_identical' => '/Token.php', - 'php_token_is_not_equal' => '/Token.php', - 'php_token_is_not_identical' => '/Token.php', - 'php_token_is_smaller_or_equal' => '/Token.php', - 'php_token_isset' => '/Token.php', - 'php_token_line' => '/Token.php', - 'php_token_list' => '/Token.php', - 'php_token_lnumber' => '/Token.php', - 'php_token_logical_and' => '/Token.php', - 'php_token_logical_or' => '/Token.php', - 'php_token_logical_xor' => '/Token.php', - 'php_token_lt' => '/Token.php', - 'php_token_method_c' => '/Token.php', - 'php_token_minus' => '/Token.php', - 'php_token_minus_equal' => '/Token.php', - 'php_token_mod_equal' => '/Token.php', - 'php_token_mul_equal' => '/Token.php', - 'php_token_mult' => '/Token.php', - 'php_token_namespace' => '/Token.php', - 'php_token_new' => '/Token.php', - 'php_token_ns_c' => '/Token.php', - 'php_token_ns_separator' => '/Token.php', - 'php_token_num_string' => '/Token.php', - 'php_token_object_cast' => '/Token.php', - 'php_token_object_operator' => '/Token.php', - 'php_token_open_bracket' => '/Token.php', - 'php_token_open_curly' => '/Token.php', - 'php_token_open_square' => '/Token.php', - 'php_token_open_tag' => '/Token.php', - 'php_token_open_tag_with_echo' => '/Token.php', - 'php_token_or_equal' => '/Token.php', - 'php_token_paamayim_nekudotayim' => '/Token.php', - 'php_token_percent' => '/Token.php', - 'php_token_pipe' => '/Token.php', - 'php_token_plus' => '/Token.php', - 'php_token_plus_equal' => '/Token.php', - 'php_token_print' => '/Token.php', - 'php_token_private' => '/Token.php', - 'php_token_protected' => '/Token.php', - 'php_token_public' => '/Token.php', - 'php_token_question_mark' => '/Token.php', - 'php_token_require' => '/Token.php', - 'php_token_require_once' => '/Token.php', - 'php_token_return' => '/Token.php', - 'php_token_semicolon' => '/Token.php', - 'php_token_sl' => '/Token.php', - 'php_token_sl_equal' => '/Token.php', - 'php_token_sr' => '/Token.php', - 'php_token_sr_equal' => '/Token.php', - 'php_token_start_heredoc' => '/Token.php', - 'php_token_static' => '/Token.php', - 'php_token_stream' => '/Token/Stream.php', - 'php_token_stream_cachingfactory' => '/Token/Stream/CachingFactory.php', - 'php_token_string' => '/Token.php', - 'php_token_string_cast' => '/Token.php', - 'php_token_string_varname' => '/Token.php', - 'php_token_switch' => '/Token.php', - 'php_token_throw' => '/Token.php', - 'php_token_tilde' => '/Token.php', - 'php_token_trait' => '/Token.php', - 'php_token_trait_c' => '/Token.php', - 'php_token_try' => '/Token.php', - 'php_token_unset' => '/Token.php', - 'php_token_unset_cast' => '/Token.php', - 'php_token_use' => '/Token.php', - 'php_token_var' => '/Token.php', - 'php_token_variable' => '/Token.php', - 'php_token_while' => '/Token.php', - 'php_token_whitespace' => '/Token.php', - 'php_token_xor_equal' => '/Token.php', - 'php_tokenwithscope' => '/Token.php', - 'php_tokenwithscopeandvisibility' => '/Token.php' - ); - - $path = dirname(dirname(dirname(__FILE__))); - } - - $cn = strtolower($class); - - if (isset($classes[$cn])) { - require $path . $classes[$cn]; - } - } -); diff --git a/PHP/Token/Stream/Autoload.php.in b/PHP/Token/Stream/Autoload.php.in deleted file mode 100644 index 1cb3981..0000000 --- a/PHP/Token/Stream/Autoload.php.in +++ /dev/null @@ -1,65 +0,0 @@ -. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Sebastian Bergmann nor the names of his - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * @package PHP_TokenStream - * @author Sebastian Bergmann - * @copyright 2009-2010 Sebastian Bergmann - * @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License - * @link http://github.com/sebastianbergmann/php-token-stream/tree - * @since File available since Release 1.1.0 - */ - -spl_autoload_register( - function ($class) - { - static $classes = NULL; - static $path = NULL;; - - if ($classes === NULL) { - $classes = array( - ___CLASSLIST___ - ); - - $path = dirname(dirname(dirname(__FILE__))); - } - - $cn = strtolower($class); - - if (isset($classes[$cn])) { - require $path . $classes[$cn]; - } - } -); diff --git a/build.xml b/build.xml index aca1cef..f02f4b5 100644 --- a/build.xml +++ b/build.xml @@ -1,162 +1,33 @@ - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - + + + diff --git a/build/PHPCS/Sniffs/ControlStructures/ControlSignatureSniff.php b/build/PHPCS/Sniffs/ControlStructures/ControlSignatureSniff.php deleted file mode 100644 index bf9d520..0000000 --- a/build/PHPCS/Sniffs/ControlStructures/ControlSignatureSniff.php +++ /dev/null @@ -1,22 +0,0 @@ -getTokens(); - - if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE || - $tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE) { - - $phpcsFile->addError( - 'Concatenation operator must be surrounded by whitespace', - $stackPtr - ); - } - } -} diff --git a/build/PHPCS/ruleset.xml b/build/PHPCS/ruleset.xml deleted file mode 100644 index 402f214..0000000 --- a/build/PHPCS/ruleset.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - Sebastian Bergmann's coding standard - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/phpmd.xml b/build/phpmd.xml deleted file mode 100644 index 23ecb8b..0000000 --- a/build/phpmd.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - Sebastian Bergmann's ruleset - - - - - - - - - - - - - - - - - - - diff --git a/build/phpunit.xml b/build/phpunit.xml new file mode 100644 index 0000000..139586d --- /dev/null +++ b/build/phpunit.xml @@ -0,0 +1,17 @@ + + + + + ../tests + + + + + + ../src + + + diff --git a/build/travis-ci.xml b/build/travis-ci.xml deleted file mode 100644 index 3085519..0000000 --- a/build/travis-ci.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - ../Tests - - - diff --git a/composer.json b/composer.json index 1ac0cee..9c1c700 100644 --- a/composer.json +++ b/composer.json @@ -2,29 +2,28 @@ "name": "phpunit/php-token-stream", "description": "Wrapper around PHP's tokenizer extension.", "type": "library", - "keywords": [ - "tokenizer" - ], + "keywords": ["tokenizer"], "homepage": "https://github.com/sebastianbergmann/php-token-stream/", "license": "BSD-3-Clause", "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], "support": { - "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "irc": "irc://irc.freenode.net/phpunit" + "issues": "https://github.com/sebastianbergmann/php-token-stream/issues" }, "require": { "php": ">=5.3.3", "ext-tokenizer": "*" }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, "autoload": { "classmap": [ - "PHP/" + "src/" ] }, "extra": { diff --git a/package.xml b/package.xml deleted file mode 100644 index 820638a..0000000 --- a/package.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - PHP_TokenStream - pear.phpunit.de - Wrapper around PHP's tokenizer extension. - Wrapper around PHP's tokenizer extension. - - Sebastian Bergmann - sb - sb@sebastian-bergmann.de - yes - - 2014-03-03 - - 1.2.2 - 1.2.0 - - - stable - stable - - The BSD 3-Clause License - http://github.com/sebastianbergmann/php-token-stream/tree - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5.3.3 - - - 1.9.4 - - - tokenizer - - - - - diff --git a/phpunit.xml.dist b/phpunit.xml.dist deleted file mode 100644 index 6d307c4..0000000 --- a/phpunit.xml.dist +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - Tests - - - - - - - - - - - - PHP - - - diff --git a/PHP/Token.php b/src/Token.php similarity index 100% rename from PHP/Token.php rename to src/Token.php diff --git a/PHP/Token/Stream.php b/src/Token/Stream.php similarity index 100% rename from PHP/Token/Stream.php rename to src/Token/Stream.php diff --git a/PHP/Token/Stream/CachingFactory.php b/src/Token/Stream/CachingFactory.php similarity index 100% rename from PHP/Token/Stream/CachingFactory.php rename to src/Token/Stream/CachingFactory.php diff --git a/Tests/Token/ClassTest.php b/tests/Token/ClassTest.php similarity index 94% rename from Tests/Token/ClassTest.php rename to tests/Token/ClassTest.php index f7230cc..afcd1a1 100644 --- a/Tests/Token/ClassTest.php +++ b/tests/Token/ClassTest.php @@ -42,16 +42,6 @@ * @since File available since Release 1.0.2 */ -if (!defined('TEST_FILES_PATH')) { - define( - 'TEST_FILES_PATH', - dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . - '_files' . DIRECTORY_SEPARATOR - ); -} - -require_once 'PHP/Token/Stream.php'; - /** * Tests for the PHP_Token_CLASS class. * diff --git a/Tests/Token/ClosureTest.php b/tests/Token/ClosureTest.php similarity index 95% rename from Tests/Token/ClosureTest.php rename to tests/Token/ClosureTest.php index 5c65092..895529a 100644 --- a/Tests/Token/ClosureTest.php +++ b/tests/Token/ClosureTest.php @@ -42,16 +42,6 @@ * @since File available since Release 1.0.0 */ -if (!defined('TEST_FILES_PATH')) { - define( - 'TEST_FILES_PATH', - dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . - '_files' . DIRECTORY_SEPARATOR - ); -} - -require_once 'PHP/Token/Stream.php'; - /** * Tests for the PHP_Token_FUNCTION class. * diff --git a/Tests/Token/FunctionTest.php b/tests/Token/FunctionTest.php similarity index 96% rename from Tests/Token/FunctionTest.php rename to tests/Token/FunctionTest.php index 988d962..d43abaa 100644 --- a/Tests/Token/FunctionTest.php +++ b/tests/Token/FunctionTest.php @@ -42,16 +42,6 @@ * @since File available since Release 1.0.0 */ -if (!defined('TEST_FILES_PATH')) { - define( - 'TEST_FILES_PATH', - dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . - '_files' . DIRECTORY_SEPARATOR - ); -} - -require_once 'PHP/Token/Stream.php'; - /** * Tests for the PHP_Token_FUNCTION class. * diff --git a/Tests/Token/IncludeTest.php b/tests/Token/IncludeTest.php similarity index 94% rename from Tests/Token/IncludeTest.php rename to tests/Token/IncludeTest.php index fc5ec09..440e1fa 100644 --- a/Tests/Token/IncludeTest.php +++ b/tests/Token/IncludeTest.php @@ -42,16 +42,6 @@ * @since File available since Release 1.0.2 */ -if (!defined('TEST_FILES_PATH')) { - define( - 'TEST_FILES_PATH', - dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . - '_files' . DIRECTORY_SEPARATOR - ); -} - -require_once 'PHP/Token/Stream.php'; - /** * Tests for the PHP_Token_REQUIRE_ONCE, PHP_Token_REQUIRE * PHP_Token_INCLUDE_ONCE and PHP_Token_INCLUDE_ONCE classes. diff --git a/Tests/Token/InterfaceTest.php b/tests/Token/InterfaceTest.php similarity index 97% rename from Tests/Token/InterfaceTest.php rename to tests/Token/InterfaceTest.php index 40e71c0..ebe1f63 100644 --- a/Tests/Token/InterfaceTest.php +++ b/tests/Token/InterfaceTest.php @@ -43,16 +43,6 @@ * @since File available since Release 1.0.0 */ -if (!defined('TEST_FILES_PATH')) { - define( - 'TEST_FILES_PATH', - dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . - '_files' . DIRECTORY_SEPARATOR - ); -} - -require_once 'PHP/Token/Stream.php'; - /** * Tests for the PHP_Token_INTERFACE class. * diff --git a/Tests/Token/NamespaceTest.php b/tests/Token/NamespaceTest.php similarity index 95% rename from Tests/Token/NamespaceTest.php rename to tests/Token/NamespaceTest.php index aedd962..7a0bb7c 100644 --- a/Tests/Token/NamespaceTest.php +++ b/tests/Token/NamespaceTest.php @@ -42,16 +42,6 @@ * @since File available since Release 1.0.0 */ -if (!defined('TEST_FILES_PATH')) { - define( - 'TEST_FILES_PATH', - dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . - '_files' . DIRECTORY_SEPARATOR - ); -} - -require_once 'PHP/Token/Stream.php'; - /** * Tests for the PHP_Token_NAMESPACE class. * diff --git a/Tests/TokenTest.php b/tests/TokenTest.php similarity index 93% rename from Tests/TokenTest.php rename to tests/TokenTest.php index bbad1ef..b0b3d03 100644 --- a/Tests/TokenTest.php +++ b/tests/TokenTest.php @@ -42,15 +42,6 @@ * @since File available since Release 1.0.0 */ -if (!defined('TEST_FILES_PATH')) { - define( - 'TEST_FILES_PATH', - dirname(__FILE__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR - ); -} - -require_once 'PHP/Token/Stream.php'; - /** * Tests for the PHP_Token class. * diff --git a/Tests/_files/classExtendsNamespacedClass.php b/tests/_fixture/classExtendsNamespacedClass.php similarity index 100% rename from Tests/_files/classExtendsNamespacedClass.php rename to tests/_fixture/classExtendsNamespacedClass.php diff --git a/Tests/_files/classInNamespace.php b/tests/_fixture/classInNamespace.php similarity index 100% rename from Tests/_files/classInNamespace.php rename to tests/_fixture/classInNamespace.php diff --git a/Tests/_files/classInScopedNamespace.php b/tests/_fixture/classInScopedNamespace.php similarity index 100% rename from Tests/_files/classInScopedNamespace.php rename to tests/_fixture/classInScopedNamespace.php diff --git a/Tests/_files/closure.php b/tests/_fixture/closure.php similarity index 100% rename from Tests/_files/closure.php rename to tests/_fixture/closure.php diff --git a/Tests/_files/issue19.php b/tests/_fixture/issue19.php similarity index 100% rename from Tests/_files/issue19.php rename to tests/_fixture/issue19.php diff --git a/Tests/_files/issue30.php b/tests/_fixture/issue30.php similarity index 100% rename from Tests/_files/issue30.php rename to tests/_fixture/issue30.php diff --git a/Tests/_files/multipleNamespacesWithOneClassUsingBraces.php b/tests/_fixture/multipleNamespacesWithOneClassUsingBraces.php similarity index 100% rename from Tests/_files/multipleNamespacesWithOneClassUsingBraces.php rename to tests/_fixture/multipleNamespacesWithOneClassUsingBraces.php diff --git a/Tests/_files/multipleNamespacesWithOneClassUsingNonBraceSyntax.php b/tests/_fixture/multipleNamespacesWithOneClassUsingNonBraceSyntax.php similarity index 100% rename from Tests/_files/multipleNamespacesWithOneClassUsingNonBraceSyntax.php rename to tests/_fixture/multipleNamespacesWithOneClassUsingNonBraceSyntax.php diff --git a/Tests/_files/source.php b/tests/_fixture/source.php similarity index 100% rename from Tests/_files/source.php rename to tests/_fixture/source.php diff --git a/Tests/_files/source2.php b/tests/_fixture/source2.php similarity index 100% rename from Tests/_files/source2.php rename to tests/_fixture/source2.php diff --git a/Tests/_files/source3.php b/tests/_fixture/source3.php similarity index 100% rename from Tests/_files/source3.php rename to tests/_fixture/source3.php diff --git a/Tests/_files/source4.php b/tests/_fixture/source4.php similarity index 100% rename from Tests/_files/source4.php rename to tests/_fixture/source4.php diff --git a/Tests/_files/source5.php b/tests/_fixture/source5.php similarity index 100% rename from Tests/_files/source5.php rename to tests/_fixture/source5.php diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..f92b7df --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,7 @@ +