diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..a1e3c76 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,85 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + +[*] +# Change these settings to your own preference +indent_style = space +indent_size = 4 + +# We recommend you to keep these unchanged +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.feature] +indent_style = space +indent_size = 4 + +[*.js] +indent_style = space +indent_size = 2 + +[*.json] +indent_style = space +indent_size = 2 + +[*.md] +indent_style = space +indent_size = 4 +trim_trailing_whitespace = false + +[*.neon] +indent_style = space +indent_size = 4 + +[*.php] +indent_style = space +indent_size = 4 + +[*.sh] +indent_style = space +indent_size = 4 + +[*.{yaml,yml}] +indent_style = space +indent_size = 4 +trim_trailing_whitespace = false + +[.babelrc] +indent_style = space +indent_size = 2 + +[.gitmodules] +indent_style = tab +indent_size = 4 + +[.php_cs{,.dist}] +indent_style = space +indent_size = 4 + +[composer.json] +indent_style = space +indent_size = 4 + +[package.json] +indent_style = space +indent_size = 2 + +[phpspec.yml{,.dist}] +indent_style = space +indent_size = 4 + +[phpstan.neon] +indent_style = space +indent_size = 4 + +[phpunit.xml{,.dist}] +indent_style = space +indent_size = 4 + +[Makefile] +indent_style = tab diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..dc4289f --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,265 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +$header = <<<'HEADER' +This file is part of Monsieur Biz' Sales Reports plugin for Sylius. + +(c) Monsieur Biz + +For the full copyright and license information, please view the LICENSE.txt +file that was distributed with this source code. +HEADER; + +$finder = PhpCsFixer\Finder::create() + ->in(__DIR__) + ->exclude( + [ + 'tests/Application', + ] + ) +; + +$config = new PhpCsFixer\Config(); +$config + ->setRiskyAllowed(true) + ->setRules([ + '@DoctrineAnnotation' => true, + '@PHP71Migration' => true, + '@PHP71Migration:risky' => true, + '@PHPUnit60Migration:risky' => true, + '@Symfony' => true, + '@Symfony:risky' => true, + 'align_multiline_comment' => [ + 'comment_type' => 'phpdocs_like', + ], + 'array_indentation' => true, + 'array_syntax' => [ + 'syntax' => 'short', + ], + 'binary_operator_spaces' => true, + 'blank_line_after_opening_tag' => true, + 'blank_line_after_namespace' => true, + 'blank_line_before_statement' => true, + 'braces' => [ + 'allow_single_line_closure' => true, + ], + 'cast_spaces' => true, + 'class_attributes_separation' => true, + 'class_definition' => [ + 'single_item_single_line' => true, + 'multi_line_extends_each_single_line' => true, + ], + 'combine_consecutive_issets' => true, + 'combine_consecutive_unsets' => true, + 'comment_to_phpdoc' => true, + 'compact_nullable_typehint' => true, + 'concat_space' => [ + 'spacing' => 'one', + ], + 'constant_case' => [ + 'case' => 'lower', + ], + 'declare_equal_normalize' => true, + 'dir_constant' => true, + 'declare_strict_types' => true, + 'doctrine_annotation_array_assignment' => [ + 'operator' => '=', + ], + 'doctrine_annotation_spaces' => [ + 'after_array_assignments_equals' => false, + 'before_array_assignments_equals' => false, + ], + 'elseif' => true, + 'encoding' => true, + 'ereg_to_preg' => true, + 'error_suppression' => true, + 'explicit_indirect_variable' => true, + 'full_opening_tag' => true, + 'fully_qualified_strict_types' => true, + 'function_declaration' => true, + 'function_to_constant' => true, + 'function_typehint_space' => true, + 'general_phpdoc_tag_rename' => true, + 'header_comment' => [ + 'header' => $header, + 'location' => 'after_open', + ], + 'include' => true, + 'increment_style' => [ + 'style' => 'pre', + ], + 'indentation_type' => true, + 'is_null' => true, + 'line_ending' => true, + 'list_syntax' => [ + 'syntax' => 'short', + ], + 'logical_operators' => true, + 'lowercase_cast' => true, + 'lowercase_keywords' => true, + 'lowercase_static_reference' => true, + 'magic_constant_casing' => true, + 'method_argument_space' => true, + 'modernize_types_casting' => true, + 'multiline_comment_opening_closing' => true, + 'multiline_whitespace_before_semicolons' => [ + 'strategy' => 'new_line_for_chained_calls', + ], + 'native_constant_invocation' => true, + 'native_function_casing' => true, + 'new_with_braces' => true, + 'no_alias_functions' => true, + 'no_alternative_syntax' => true, + 'no_blank_lines_after_class_opening' => true, + 'no_blank_lines_after_phpdoc' => true, + 'no_break_comment' => true, + 'no_closing_tag' => true, + 'no_empty_comment' => true, + 'no_empty_phpdoc' => true, + 'no_empty_statement' => true, + 'no_extra_blank_lines' => [ + 'tokens' => [ + 'break', + 'case', + 'continue', + 'curly_brace_block', + 'default', + 'extra', + 'parenthesis_brace_block', + 'return', + 'square_brace_block', + 'switch', + 'throw', + 'use', + ], + ], + 'no_homoglyph_names' => true, + 'no_leading_import_slash' => true, + 'no_leading_namespace_whitespace' => true, + 'no_mixed_echo_print' => [ + 'use' => 'echo', + ], + 'no_multiline_whitespace_around_double_arrow' => true, + 'no_null_property_initialization' => true, + 'no_php4_constructor' => true, + 'no_singleline_whitespace_before_semicolons' => true, + 'no_short_bool_cast' => true, + 'no_spaces_after_function_name' => true, + 'no_spaces_around_offset' => true, + 'no_spaces_inside_parenthesis' => true, + 'no_superfluous_elseif' => true, + 'no_superfluous_phpdoc_tags' => [ + 'allow_mixed' => true, + ], + 'no_unset_cast' => true, + 'no_unneeded_control_parentheses' => true, + 'no_unneeded_curly_braces' => true, + 'no_unneeded_final_method' => true, + 'no_unset_on_property' => true, + 'no_unused_imports' => true, + 'no_useless_else' => true, + 'no_useless_return' => true, + 'no_trailing_comma_in_list_call' => true, + 'no_trailing_comma_in_singleline_array' => true, + 'no_trailing_whitespace' => true, + 'no_trailing_whitespace_in_comment' => true, + 'no_whitespace_before_comma_in_array' => true, + 'no_whitespace_in_blank_line' => true, + 'non_printable_character' => true, + 'normalize_index_brace' => true, + 'object_operator_without_whitespace' => true, + 'ordered_imports' => [ + 'imports_order' => [ + 'class', + 'function', + 'const', + ], + 'sort_algorithm' => 'alpha', + ], + 'php_unit_dedicate_assert' => true, + 'php_unit_fqcn_annotation' => true, + 'php_unit_method_casing' => [ + 'case' => 'camel_case', + ], + 'php_unit_set_up_tear_down_visibility' => true, + 'php_unit_test_annotation' => [ + 'style' => 'prefix', + ], + 'phpdoc_align' => [ + 'align' => 'left', + ], + 'phpdoc_add_missing_param_annotation' => [ + 'only_untyped' => true, + ], + 'phpdoc_indent' => true, + 'phpdoc_inline_tag_normalizer' => true, + 'phpdoc_no_access' => true, + 'phpdoc_no_alias_tag' => true, + 'phpdoc_no_empty_return' => true, + 'phpdoc_no_package' => true, + 'phpdoc_no_useless_inheritdoc' => true, + 'phpdoc_order' => true, + 'phpdoc_return_self_reference' => true, + 'phpdoc_scalar' => true, + 'phpdoc_separation' => true, + 'phpdoc_single_line_var_spacing' => true, + 'phpdoc_tag_type' => true, + 'phpdoc_to_comment' => false, + 'phpdoc_trim' => true, + 'phpdoc_trim_consecutive_blank_line_separation' => true, + 'phpdoc_types' => true, + 'phpdoc_types_order' => [ + 'null_adjustment' => 'always_last', + 'sort_algorithm' => 'none', + ], + 'phpdoc_var_annotation_correct_order' => true, + 'phpdoc_var_without_name' => true, + 'pow_to_exponentiation' => true, + 'protected_to_private' => true, + 'return_assignment' => true, + 'return_type_declaration' => true, + 'self_accessor' => true, + 'short_scalar_cast' => true, + 'single_blank_line_at_eof' => true, + 'single_blank_line_before_namespace' => true, + 'single_class_element_per_statement' => true, + 'single_import_per_statement' => true, + 'single_line_after_imports' => true, + 'single_line_comment_style' => true, + 'single_quote' => true, + 'space_after_semicolon' => true, + 'standardize_not_equals' => true, + 'strict_param' => true, + 'switch_case_semicolon_to_colon' => true, + 'switch_case_space' => true, + 'ternary_operator_spaces' => true, + 'ternary_to_null_coalescing' => true, + 'trailing_comma_in_multiline' => [ + 'elements' => ['arrays'], + ], + 'trim_array_spaces' => true, + 'unary_operator_spaces' => true, + 'visibility_required' => [ + 'elements' => [ + 'const', + 'property', + 'method', + ], + ], + 'void_return' => true, + 'whitespace_after_comma_in_array' => true, // alerady in symfony set + ]) + ->setFinder($finder) +; + +return $config; diff --git a/.php-version.dist b/.php-version.dist new file mode 100644 index 0000000..cc40bca --- /dev/null +++ b/.php-version.dist @@ -0,0 +1 @@ +8.0 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0b44fd7..0000000 --- a/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -language: php - -dist: trusty - -sudo: false - -php: - - '7.2' - -cache: - yarn: true - directories: - - ~/.composer/cache/files - - $SYLIUS_CACHE_DIR - -env: - global: - - APP_ENV=test - - SYLIUS_CACHE_DIR=$HOME/.sylius-cache - -before_install: - - phpenv config-rm xdebug.ini - - echo "memory_limit=4096M" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - - mkdir -p "${SYLIUS_CACHE_DIR}" - -install: - - composer install --no-interaction --prefer-dist - - (cd tests/Application && yarn install) - -before_script: - - ln -s tests/Application/node_modules node_modules - - (cd tests/Application && bin/console doctrine:database:create -vvv) - - (cd tests/Application && bin/console doctrine:schema:create -vvv) - - (cd tests/Application && bin/console assets:install public -vvv) - - (cd tests/Application && bin/console cache:warmup -vvv) - - (cd tests/Application && yarn build) - - # Run webserver - - (cd tests/Application && bin/console server:run 127.0.0.1:8080 --quiet > /dev/null 2>&1 &) - -script: - - composer validate --strict - - vendor/bin/phpstan analyse -c phpstan.neon src/ - - - vendor/bin/phpunit - - vendor/bin/phpspec run - -branches: - only: - - master diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 0000000..9971d62 --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,15 @@ +## Node + +Be sure you have node 14 on your machine. You can use NVM to easily switch versions. + +# Docker + +Be sure you have docker on your machine. + +# Symfony + +Be sure you have the Symfony binary on your machine. + +``` + curl -sS https://get.symfony.com/cli/installer | bash + ``` diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..1b1809b --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,7 @@ +Copyright 2021 Monsieur Biz + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..318074f --- /dev/null +++ b/Makefile @@ -0,0 +1,201 @@ +.DEFAULT_GOAL := help +SHELL=/bin/bash +APP_DIR=tests/Application +SYLIUS_VERSION=1.10 +SYMFONY=cd ${APP_DIR} && symfony +COMPOSER=symfony composer +CONSOLE=${SYMFONY} console +export COMPOSE_PROJECT_NAME=sales-reports +PLUGIN_NAME=sylius-${COMPOSE_PROJECT_NAME}-plugin +COMPOSE=docker-compose +YARN=yarn + +### +### DEVELOPMENT +### ¯¯¯¯¯¯¯¯¯¯¯ + +install: application platform sylius ## Install the plugin +.PHONY: install + +up: docker.up server.start ## Up the project (start docker, start symfony server) +stop: server.stop docker.stop ## Stop the project (stop docker, stop symfony server) +down: server.stop docker.down ## Down the project (removes docker containers, stop symfony server) + +reset: docker.down ## Stop docker and remove dependencies + rm -rf ${APP_DIR}/node_modules ${APP_DIR}/yarn.lock + rm -rf ${APP_DIR} + rm -rf vendor composer.lock +.PHONY: reset + +dependencies: vendor node_modules ## Setup the dependencies +.PHONY: dependencies + +.php-version: .php-version.dist + cp .php-version.dist .php-version + +php.ini: php.ini.dist + cp php.ini.dist php.ini + +vendor: composer.lock ## Install the PHP dependencies using composer +ifdef GITHUB_ACTIONS + ${COMPOSER} install --prefer-dist +else + ${COMPOSER} install --prefer-source +endif + +composer.lock: composer.json +ifdef GITHUB_ACTIONS + ${COMPOSER} update --prefer-dist +else + ${COMPOSER} update --prefer-source +endif + +yarn.install: ${APP_DIR}/yarn.lock + +${APP_DIR}/yarn.lock: + ln -sf ${APP_DIR}/node_modules node_modules + cd ${APP_DIR} && ${YARN} install && ${YARN} build +# No CSS and JS on this plugin yet +# ${YARN} install +# ${YARN} encore prod + +node_modules: ${APP_DIR}/node_modules ## Install the Node dependencies using yarn + +${APP_DIR}/node_modules: yarn.install + +### +### TEST APPLICATION +### ¯¯¯¯¯ + +application: .php-version php.ini ${APP_DIR} setup_application ${APP_DIR}/docker-compose.yaml + +${APP_DIR}: + (${COMPOSER} create-project --prefer-dist --no-scripts --no-progress --no-install sylius/sylius-standard="${SYLIUS_VERSION}" ${APP_DIR}) + +setup_application: + rm -f ${APP_DIR}/yarn.lock + (cd ${APP_DIR} && ${COMPOSER} config repositories.plugin '{"type": "path", "url": "../../"}') + (cd ${APP_DIR} && ${COMPOSER} config extra.symfony.allow-contrib true) + (cd ${APP_DIR} && ${COMPOSER} require --no-scripts --no-progress --no-install --no-update monsieurbiz/${PLUGIN_NAME}="*@dev") + $(MAKE) apply_dist + $(MAKE) ${APP_DIR}/.php-version + $(MAKE) ${APP_DIR}/php.ini + (cd ${APP_DIR} && ${COMPOSER} install) + +${APP_DIR}/docker-compose.yaml: + rm -f ${APP_DIR}/docker-compose.yml + rm -f ${APP_DIR}/docker-compose.yaml + cp docker-compose.yaml.dist ${APP_DIR}/docker-compose.yaml +.PHONY: ${APP_DIR}/docker-compose.yaml + +${APP_DIR}/.php-version: .php-version + (cd ${APP_DIR} && ln -sf ../../.php-version) + +${APP_DIR}/php.ini: php.ini + (cd ${APP_DIR} && ln -sf ../../php.ini) + +apply_dist: + cp -Rv dist/* ${APP_DIR} + +### +### TESTS +### ¯¯¯¯¯ + +test.all: test.composer test.phpstan test.phpmd test.phpunit test.phpspec test.phpcs test.yaml test.schema test.twig test.container ## Run all tests in once + +test.composer: ## Validate composer.json + ${COMPOSER} validate --strict + +test.phpstan: ## Run PHPStan + ${COMPOSER} phpstan + +test.phpmd: ## Run PHPMD + ${COMPOSER} phpmd + +test.phpunit: ## Run PHPUnit + ${COMPOSER} phpunit + +test.phpspec: ## Run PHPSpec + ${COMPOSER} phpspec + +test.phpcs: ## Run PHP CS Fixer in dry-run + ${COMPOSER} run -- phpcs --dry-run -v + +test.phpcs.fix: ## Run PHP CS Fixer and fix issues if possible + ${COMPOSER} run -- phpcs -v + +test.container: ## Lint the symfony container + ${CONSOLE} lint:container + +test.yaml: ## Lint the symfony Yaml files + ${CONSOLE} lint:yaml ../../recipes ../../src/Resources/config + +test.schema: ## Validate MySQL Schema + ${CONSOLE} doctrine:schema:validate + +test.twig: ## Validate Twig templates + ${CONSOLE} lint:twig --no-debug templates/ ../../src/Resources/views/ + +### +### SYLIUS +### ¯¯¯¯¯¯ + +sylius: dependencies sylius.database sylius.fixtures sylius.assets ## Install Sylius +.PHONY: sylius + +sylius.database: ## Setup the database + ${CONSOLE} doctrine:database:drop --if-exists --force + ${CONSOLE} doctrine:database:create --if-not-exists + ${CONSOLE} doctrine:migration:migrate -n + +sylius.fixtures: ## Run the fixtures + ${CONSOLE} sylius:fixtures:load -n default + +sylius.assets: ## Install all assets with symlinks + ${CONSOLE} assets:install --symlink + ${CONSOLE} sylius:install:assets + ${CONSOLE} sylius:theme:assets:install --symlink + +### +### PLATFORM +### ¯¯¯¯¯¯¯¯ + +platform: .php-version up ## Setup the platform tools +.PHONY: platform + +docker.pull: ## Pull the docker images + cd ${APP_DIR} && ${COMPOSE} pull + +docker.up: ## Start the docker containers + cd ${APP_DIR} && ${COMPOSE} up -d +.PHONY: docker.up + +docker.stop: ## Stop the docker containers + cd ${APP_DIR} && ${COMPOSE} stop +.PHONY: docker.stop + +docker.down: ## Stop and remove the docker containers + cd ${APP_DIR} && ${COMPOSE} down +.PHONY: docker.down + +docker.logs: ## Logs the docker containers + cd ${APP_DIR} && ${COMPOSE} logs -f +.PHONY: docker.logs + +server.start: ## Run the local webserver using Symfony + ${SYMFONY} local:server:start -d + +server.stop: ## Stop the local webserver + ${SYMFONY} local:server:stop + +### +### HELP +### ¯¯¯¯ + +help: SHELL=/bin/bash +help: ## Dislay this help + @IFS=$$'\n'; for line in `grep -h -E '^[a-zA-Z_#-]+:?.*?##.*$$' $(MAKEFILE_LIST)`; do if [ "$${line:0:2}" = "##" ]; then \ + echo $$line | awk 'BEGIN {FS = "## "}; {printf "\033[33m %s\033[0m\n", $$2}'; else \ + echo $$line | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m%s\n", $$1, $$2}'; fi; \ + done; unset IFS; +.PHONY: help diff --git a/TESTING copy.md b/TESTING copy.md new file mode 100644 index 0000000..dd1a5fc --- /dev/null +++ b/TESTING copy.md @@ -0,0 +1,58 @@ +# Testing + +## Requirements + +You'll need: + +- PHP 7.4 minimum. +- docker, for the database. +- symfony CLI, to run the local server. +- composer, to install PHP dependencies. +- npm and yarn, to install ui dependencies and build the JS/CSS files. + +## Installation + +```bash +make install +``` + +This will run a Sylius app (the one in `tests/Application/`) with the plugin +installed and all Sylius' sample data. It uses the symfony binary. + +## Usage + +### List all available commands + +```bash +make help +``` + +### Running minimum plugin tests + +- PHPUnit + + ```bash + make test.phpunit + ``` + +- PHP CS fixer + + ```bash + make test.phpcs + ``` + + > Tip: You can fix your code with `make test.phpcs.fix`! + +- PHPSpec + + ```bash + make test.phpspec + ``` + +- PHPStan + + ```bash + make test.phpstan + ``` + +> Tip: You can run all tests with `make test.all`! diff --git a/docker-compose.yaml.dist b/docker-compose.yaml.dist new file mode 100644 index 0000000..3135e79 --- /dev/null +++ b/docker-compose.yaml.dist @@ -0,0 +1,20 @@ +version: '3.8' +services: + database: + image: mysql:8.0 + ports: + - 3306 + environment: + MYSQL_ALLOW_EMPTY_PASSWORD: 1 + MYSQL_DATABASE: sylius + volumes: + - database:/var/lib/mysql + + mailer: + image: monsieurbiz/mailcatcher + ports: + - 1025 + - 1080 + +volumes: + database: {} diff --git a/php.ini.dist b/php.ini.dist new file mode 100644 index 0000000..b0fe7fe --- /dev/null +++ b/php.ini.dist @@ -0,0 +1 @@ +memory_limit=-1 diff --git a/phpmd.xml b/phpmd.xml new file mode 100644 index 0000000..0000ac5 --- /dev/null +++ b/phpmd.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/phpspec.yml.dist b/phpspec.yml.dist index afe587a..6dd2ee0 100644 --- a/phpspec.yml.dist +++ b/phpspec.yml.dist @@ -1,4 +1,6 @@ suites: main: - namespace: Monsieurbiz\SyliusSalesReportsPlugin - psr4_prefix: Monsieurbiz\SyliusSalesReportsPlugin + namespace: MonsieurBiz\SyliusSalesReportsPlugin + psr4_prefix: MonsieurBiz\SyliusSalesReportsPlugin + src_path: src + spec_path: tests diff --git a/phpstan.neon b/phpstan.neon index b1a6e6b..dd0fa13 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,16 +1,55 @@ -includes: - - vendor/phpstan/phpstan-doctrine/extension.neon - - vendor/phpstan/phpstan-webmozart-assert/extension.neon - -parameters: - level: max - paths: - - %rootDir%/src/ - - excludes_analyse: - # Makes PHPStan crash - - 'src/DependencyInjection/Configuration.php' - - # Test dependencies - - 'tests/Application/app/**.php' - - 'tests/Application/src/**.php' + + + + + + tests/Unit + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 29bd013..dd0fa13 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -6,15 +6,50 @@ bootstrap="tests/Application/config/bootstrap.php"> - tests + tests/Unit - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/Unit/.gitkeep b/tests/Unit/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..527ffd7 --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +use Symfony\Component\Dotenv\Dotenv; + +require dirname(__DIR__) . '/vendor/autoload.php'; + +if (file_exists(dirname(__DIR__) . '/config/bootstrap.php')) { + require dirname(__DIR__) . '/config/bootstrap.php'; +} elseif (method_exists(Dotenv::class, 'bootEnv')) { + (new Dotenv())->bootEnv(dirname(__DIR__) . '/.env'); +}