├── .editorconfig ├── .gitattributes ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── LICENSE ├── README.md ├── Vagrantfile ├── build.xml ├── composer.json ├── phpjunitmerge ├── resources └── vagrant │ ├── provision.sh │ └── puppet │ ├── Puppetfile │ ├── hiera.yaml │ ├── manifests │ └── site.pp │ ├── modules-local │ └── .gitkeep │ └── modules │ └── .gitignore └── src ├── Console ├── Application.php └── Command.php └── Test ├── Unit ├── BaseTest.php ├── Fixtures │ ├── empty-file │ │ ├── phpunit-junit-1.xml │ │ ├── phpunit-junit-2.xml │ │ ├── phpunit-junit-3.xml │ │ └── result.xml │ └── normal │ │ ├── phpcs-junit-1.xml │ │ ├── phpunit-junit-1.xml │ │ ├── phpunit-junit-2.xml │ │ ├── phpunit-junit-3.xml │ │ └── result.xml └── tmp │ └── .gitignore ├── bootstrap.php └── phpunit.xml.dist /.editorconfig: -------------------------------------------------------------------------------- 1 | ; top-most EditorConfig file 2 | root = true 3 | 4 | ; Unix-style newlines 5 | [*] 6 | end_of_line = LF 7 | 8 | [*.php] 9 | indent_style = space 10 | indent_size = 4 11 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # IDEs 2 | .buildpath 3 | .project 4 | .settings 5 | .build 6 | .idea 7 | 8 | # OS generated files 9 | desktop.ini 10 | .DS_Store* 11 | ehthumbs.db 12 | Icon? 13 | Thumbs.db 14 | 15 | # Vagrant 16 | /.vagrant 17 | 18 | # Build files 19 | /build 20 | 21 | # Composer 22 | /composer.phar 23 | composer.lock 24 | /vendor 25 | 26 | # Misc 27 | phpunit.xml 28 | phinx.yml 29 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 5.6 5 | - 7.0 6 | - 7.1 7 | - 7.2 8 | 9 | before_script: 10 | - travis_retry composer self-update 11 | - travis_retry composer install --no-interaction --prefer-source 12 | 13 | script: 14 | - vendor/bin/phpunit --verbose --stderr --configuration src/Test/phpunit.xml.dist 15 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Version 1.0 2 | 3 | This is the list of changes for the Version 1.0 release series. 4 | 5 | ## Version 1.0.0 6 | 7 | * Initial release. 8 | 9 | ## Version 1.0.1 10 | 11 | * Small improvements 12 | * Bump fdomdocument version to 1.6.0 13 | 14 | ## Version 1.0.2 15 | 16 | * Bump library version 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018, Andreas Weber 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # andreas-weber/php-junit-merge 2 | 3 | [![Build Status](https://travis-ci.org/andreas-weber/php-junit-merge.svg?branch=master)](https://travis-ci.org/andreas-weber/php-junit-merge) 4 | 5 | **php-junit-merge** is a library that merges multiple junit result xml files. 6 | 7 | ## Installation 8 | 9 | Simply add a dependency on `andreas-weber/php-junit-merge` to your project's `composer.json` file if you use [Composer](http://getcomposer.org/) to manage the dependencies of your project. 10 | 11 | ## Usage 12 | 13 | After updating dependencies by composer a new binary `php-junit-merge` is available for usage. 14 | 15 | root@dev:~/projects/sample/vendor/bin ./phpjunitmerge 16 | phpjunitmerge 1.0.5 by Andreas Weber 17 | 18 | Usage: 19 | phpjunitmerge [--names="..."] [--ignore="..."] dir file 20 | 21 | Arguments: 22 | dir Directory where all files ready to get merged are stored 23 | file The target file in which the merged result should be written 24 | 25 | Options: 26 | --names A comma-separated list of file names to check (default: "*.xml") 27 | --ignore A comma-separated list of file names to ignore (default: "result.xml") 28 | --help (-h) Display this help message 29 | --quiet (-q) Do not output any message 30 | --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug 31 | --version (-V) Display this application version 32 | --ansi Force ANSI output 33 | --no-ansi Disable ANSI output 34 | --no-interaction (-n) Do not ask any interactive question 35 | --no-suffix Do not add suffix for test suites with duplicate names 36 | 37 | 38 | The binary expects at least two parameters: 39 | 40 | - `dir` is the directory, where the application should search for xml files 41 | - `file` is the result file, in which the application should write the merged content 42 | 43 | A simple call could look like this: 44 | 45 | root@dev:~/projects/sample/vendor/bin ./phpjunitmerge src/Tests/Unit/Fixtures result.xml 46 | phpjunitmerge 1.0.0 by Andreas Weber 47 | 48 | Found and processed 3 files. Wrote merged content in 'result.xml'. 49 | 50 | ## Example 51 | 52 | ### Single Result Files 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | ### Merged Result File 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | ## Developer 125 | 126 | ### Environment 127 | 128 | Boot: 129 | 130 | ``` 131 | vagrant up 132 | ``` 133 | 134 | Enter virtual machine: 135 | 136 | ``` 137 | vagrant ssh 138 | ``` 139 | 140 | Run tests: 141 | 142 | ``` 143 | cd /vagrant 144 | vendor/bin/phpunit src/Test/ 145 | ``` 146 | 147 | ### Build targets 148 | 149 | ``` 150 | vagrant@andreas-weber:/vagrant$ ant 151 | Buildfile: /vagrant/build.xml 152 | 153 | help: 154 | [echo] 155 | [echo] The following commands are available: 156 | [echo] 157 | [echo] | +++ Build +++ 158 | [echo] |-- build (Run the build) 159 | [echo] | |-- dependencies (Install dependencies) 160 | [echo] | |-- tests (Lint all files and run tests) 161 | [echo] | |-- metrics (Generate quality metrics) 162 | [echo] |-- cleanup (Cleanup the build directory) 163 | [echo] | 164 | [echo] | +++ Composer +++ 165 | [echo] |-- composer -> composer-download, composer-install 166 | [echo] |-- composer-download (Downloads composer.phar to project) 167 | [echo] |-- composer-install (Install all dependencies) 168 | [echo] | 169 | [echo] | +++ Testing +++ 170 | [echo] |-- phpunit -> phpunit-full 171 | [echo] |-- phpunit-tests (Run unit tests) 172 | [echo] |-- phpunit-full (Run unit tests and generate code coverage report / logs) 173 | [echo] | 174 | [echo] | +++ Metrics +++ 175 | [echo] |-- coverage (Show code coverage metric) 176 | [echo] |-- phploc (Show lines of code metric) 177 | [echo] |-- qa (Run quality assurance tools) 178 | [echo] |-- |-- phpcpd (Show copy paste metric) 179 | [echo] |-- |-- phpcs (Show code sniffer metric) 180 | [echo] |-- |-- phpmd (Show mess detector metric) 181 | [echo] | 182 | [echo] | +++ Metric Reports +++ 183 | [echo] |-- phploc-report (Generate lines of code metric report) 184 | [echo] |-- phpcpd-report (Generate copy paste metric report) 185 | [echo] |-- phpcs-report (Generate code sniffer metric report) 186 | [echo] |-- phpmd-report (Generate mess detector metric report) 187 | [echo] | 188 | [echo] | +++ Tools +++ 189 | [echo] |-- lint (Lint all php files) 190 | [echo] 191 | ``` 192 | 193 | ## Attributions 194 | Thanks to [Sebastian Bergmann](https://gist.github.com/sebastianbergmann) for his gist [merge-phpunit-xml.php](https://gist.github.com/sebastianbergmann/4405658), which was the base and inspired me to develop this library. 195 | 196 | ## Thoughts 197 | Pull requests are highly appreciated. Built with love. Hope you'll enjoy.. :-) 198 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # 2 | # Environment 3 | # 4 | 5 | VAGRANTFILE_API_VERSION = "2" 6 | 7 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 8 | 9 | config.vm.box = "chef/debian-7.4" 10 | config.vm.box_url = "chef/debian-7.4" 11 | config.ssh.forward_agent = true 12 | 13 | config.vm.provider :virtualbox do |virtualbox| 14 | virtualbox.customize ["modifyvm", :id, "--memory", 1024] 15 | end 16 | 17 | config.vm.provision "shell", path: "resources/vagrant/provision.sh" 18 | config.vm.provision :puppet do |puppet| 19 | puppet.manifests_path = "resources/vagrant/puppet/manifests" 20 | puppet.module_path = "resources/vagrant/puppet/modules" 21 | puppet.manifest_file = "site.pp" 22 | puppet.hiera_config_path = "resources/vagrant/puppet/hiera.yaml" 23 | puppet.options = "--parser future" 24 | end 25 | 26 | config.vm.define "core" do |core| 27 | core.vm.host_name = "php-junit-merge.andreas-weber.dev" 28 | core.vm.network "private_network", ip: "192.168.49.43" 29 | 30 | core.vm.provider :virtualbox do |virtualbox| 31 | virtualbox.customize ["modifyvm", :id, "--name", "php-junit-merge.andreas-weber.dev"] 32 | end 33 | end 34 | 35 | end 36 | -------------------------------------------------------------------------------- /build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "andreas-weber/php-junit-merge", 3 | "type": "library", 4 | "description": "PHP-Unit J-Unit XML File Merger", 5 | "homepage": "https://github.com/andreas-weber/php-junit-merge", 6 | "license": "MIT", 7 | "authors": [ 8 | { 9 | "name": "Andreas Weber", 10 | "email": "code@andreas-weber.me", 11 | "role": "lead" 12 | } 13 | ], 14 | "support": { 15 | "issues": "https://github.com/andreas-weber/php-junit-merge/issues" 16 | }, 17 | "require": { 18 | "php": ">=5.6", 19 | "symfony/console": "^3.0 || ^4.0", 20 | "symfony/finder": "^3.0 || ^4.0", 21 | "theseer/fdomdocument": "1.6.*" 22 | }, 23 | "require-dev": { 24 | "phpunit/phpunit": "^5.0", 25 | "phploc/phploc": "4.*", 26 | "squizlabs/php_codesniffer": "1.5.*", 27 | "phpmd/phpmd": "2.*", 28 | "sebastian/phpcpd": "2.0.*" 29 | }, 30 | "autoload": { 31 | "classmap": [ 32 | "src/" 33 | ] 34 | }, 35 | "config": { 36 | "bin-dir": "vendor/bin/" 37 | }, 38 | "bin": [ 39 | "phpjunitmerge" 40 | ], 41 | "extra": { 42 | "branch-alias": { 43 | "dev-master": "1.0.x-dev" 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /phpjunitmerge: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | . 9 | * 10 | * Permission is hereby granted, free of charge, to any person obtaining a copy 11 | * of this software and associated documentation files (the "Software"), to deal 12 | * in the Software without restriction, including without limitation the rights 13 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | * copies of the Software, and to permit persons to whom the Software is 15 | * furnished to do so, subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be included in all 18 | * copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | * SOFTWARE 27 | * 28 | * @package phpjunitmerge 29 | * @author Andreas Weber 30 | * @copyright 2014 Andreas Weber 31 | * @license http://opensource.org/licenses/MIT The MIT License 32 | * @since File available since Release 1.0.0 33 | */ 34 | 35 | $loaded = false; 36 | 37 | foreach (array('phar://' . __FILE__ . '/vendor/autoload.php', __DIR__ . '/../../autoload.php', __DIR__ . '/vendor/autoload.php') as $file) { 38 | if (file_exists($file)) { 39 | require $file; 40 | $loaded = true; 41 | break; 42 | } 43 | } 44 | 45 | if (!$loaded) { 46 | die( 47 | 'You need to set up the project dependencies using the following commands:' . PHP_EOL . 48 | '+ wget http://getcomposer.org/composer.phar' . PHP_EOL . 49 | '+ php composer.phar install' . PHP_EOL . 50 | 'If you have ANT installed on your system you also can simply use:' . PHP_EOL . 51 | '+ ant composer' . PHP_EOL . 52 | 'to set everything up.' 53 | ); 54 | } 55 | 56 | $application = new AndreasWeber\PHPJUNITMERGE\Console\Application; 57 | $application->run(); 58 | -------------------------------------------------------------------------------- /resources/vagrant/provision.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export DEBIAN_FRONTEND=noninteractive 4 | BASE_PATH='/vagrant' 5 | 6 | echo '[provision] Starting shell provisioning'; 7 | 8 | if [[ ! -d '/.provision' ]]; then 9 | mkdir '/.provision' 10 | echo '[provision] Created directory /.provision' 11 | fi 12 | 13 | # 14 | # Base packages 15 | # 16 | 17 | if [[ ! -f '/.provision/base-packages' ]]; then 18 | 19 | echo '[base-packages] Running apt-get update' 20 | apt-get update >/dev/null 21 | echo '[base-packages] Finished running apt-get update' 22 | 23 | echo '[base-packages] Installing git' 24 | apt-get -q -y install git-core >/dev/null 25 | echo '[base-packages] Finished installing git' 26 | 27 | echo '[base-packages] Installing rubygems' 28 | apt-get install -y rubygems >/dev/null 29 | echo '[base-packages] Finished installing rubygems' 30 | 31 | echo '[base-packages] Installing base packages for r10k' 32 | apt-get install -y build-essential ruby-dev >/dev/null 33 | gem install json >/dev/null 34 | echo '[base-packages] Finished installing base packages for r10k' 35 | 36 | echo '[base-packages] Installing r10k' 37 | gem install r10k >/dev/null 2>&1 38 | echo '[base-packages] Finished installing r10k' 39 | 40 | touch '/.provision/base-packages' 41 | echo '[base-packages] Provision complete' 42 | 43 | fi 44 | 45 | # 46 | # Puppet 47 | # 48 | 49 | if [[ ! -f '/.provision/puppet' ]]; then 50 | 51 | CODENAME='wheezy' 52 | 53 | echo "[puppet] Downloading http://apt.puppetlabs.com/puppetlabs-release-${CODENAME}.deb" 54 | wget --quiet --tries=5 --connect-timeout=10 -O "/.provision/puppetlabs-release-${CODENAME}.deb" "http://apt.puppetlabs.com/puppetlabs-release-${CODENAME}.deb" 55 | echo "[puppet] Finished downloading http://apt.puppetlabs.com/puppetlabs-release-${CODENAME}.deb" 56 | 57 | dpkg -i "/.provision/puppetlabs-release-${CODENAME}.deb" >/dev/null 58 | 59 | echo '[puppet] Running apt-get update' 60 | apt-get update >/dev/null 61 | echo '[puppet] Finished running apt-get update' 62 | 63 | echo '[puppet] Updating Puppet to version 3.4.x' 64 | apt-get install -y puppet-common=3.4.* puppet=3.4.* >/dev/null 65 | apt-mark hold puppet puppet-common >/dev/null 66 | PUPPET_VERSION=$(puppet help | grep 'Puppet v') 67 | echo "[puppet] Finished updating puppet to latest version: ${PUPPET_VERSION}" 68 | 69 | touch '/.provision/puppet' 70 | echo '[puppet] Provision complete' 71 | 72 | fi 73 | 74 | # 75 | # R10K 76 | # 77 | 78 | echo '[R10K] Running puppet modules installation/update' 79 | cd "${BASE_PATH}/resources/vagrant/puppet" && r10k --verbose INFO puppetfile install >/dev/null 80 | echo '[R10K] Finished running puppet modules update' 81 | 82 | # 83 | # Local Modules 84 | # 85 | 86 | cd "${BASE_PATH}/resources/vagrant/puppet" && cp -R modules-local/* modules >/dev/null 87 | echo '[puppet] Copied local modules to puppet module directory' 88 | 89 | # 90 | # Finish provisioning 91 | # 92 | 93 | echo '[provision] Shell provisioning complete'; 94 | -------------------------------------------------------------------------------- /resources/vagrant/puppet/Puppetfile: -------------------------------------------------------------------------------- 1 | forge 'http://forge.puppetlabs.com' 2 | 3 | # 4 | # Modules from the Puppet Forge 5 | # 6 | 7 | mod 'puppetlabs/stdlib', '4.3.2' 8 | mod 'puppetlabs/apt', '1.6.0' 9 | mod 'puppetlabs/ntp', '3.2.1' 10 | mod 'example42/puppi', '2.1.10' 11 | mod 'example42/timezone', '2.0.11' 12 | 13 | # 14 | # Modules from GitHub 15 | # 16 | 17 | mod 'aw_branding', :git => 'https://github.com/andreas-weber/puppet-branding.git' 18 | mod 'aw_packages', :git => 'https://github.com/andreas-weber/puppet-packages.git' 19 | mod 'aw_time', :git => 'https://github.com/andreas-weber/puppet-time.git' 20 | mod 'aw_editor', :git => 'https://github.com/andreas-weber/puppet-editor.git' 21 | mod 'aw_environment', :git => 'https://github.com/andreas-weber/puppet-environment.git' 22 | mod 'aw_apt_dotdeb', :git => 'https://github.com/andreas-weber/puppet-apt-dotdeb.git' 23 | mod 'aw_php', :git => 'https://github.com/andreas-weber/puppet-php.git' 24 | mod 'aw_composer', :git => 'https://github.com/andreas-weber/puppet-composer.git' 25 | -------------------------------------------------------------------------------- /resources/vagrant/puppet/hiera.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | :backends: 3 | - yaml 4 | :yaml: 5 | :datadir: '/vagrant/resources/vagrant' 6 | :hierarchy: 7 | - config 8 | :logger: console 9 | -------------------------------------------------------------------------------- /resources/vagrant/puppet/manifests/site.pp: -------------------------------------------------------------------------------- 1 | # 2 | # site.pp 3 | # Main entry point for puppet 4 | # 5 | 6 | node default 7 | { 8 | class { 'aw_branding': } 9 | 10 | class { 'aw_packages': } 11 | 12 | class { 'aw_editor': } 13 | 14 | class { 'aw_time': } 15 | 16 | class { 'aw_apt_dotdeb': } 17 | 18 | class { 'aw_environment': 19 | vars => { 20 | 'ENVIRONMENT' => 'dev', 21 | 'DEBUG' => 1 22 | } 23 | } 24 | 25 | class { 'aw_php': 26 | development => true, 27 | remove_apache => true, 28 | fpm => false 29 | } 30 | 31 | class { 'aw_composer': } 32 | } 33 | -------------------------------------------------------------------------------- /resources/vagrant/puppet/modules-local/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreaskweber/php-junit-merge/6ad39658b84f6bcb16b42f56a896ce3fc5ec907f/resources/vagrant/puppet/modules-local/.gitkeep -------------------------------------------------------------------------------- /resources/vagrant/puppet/modules/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /src/Console/Application.php: -------------------------------------------------------------------------------- 1 | . 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in all 17 | * copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | * SOFTWARE 26 | * 27 | * @package phpjunitmerge 28 | * @author Andreas Weber 29 | * @copyright 2015 Andreas Weber 30 | * @license http://opensource.org/licenses/MIT The MIT License 31 | * @since File available since Release 1.0.0 32 | */ 33 | 34 | namespace AndreasWeber\PHPJUNITMERGE\Console; 35 | 36 | use Symfony\Component\Console\Application as ConsoleApplication; 37 | use Symfony\Component\Console\Input\ArrayInput; 38 | use Symfony\Component\Console\Input\InputDefinition; 39 | use Symfony\Component\Console\Input\InputInterface; 40 | use Symfony\Component\Console\Output\OutputInterface; 41 | 42 | /** 43 | * Base application class. 44 | * 45 | * @author Andreas Weber 46 | * @copyright 2015 Andreas Weber 47 | * @license http://opensource.org/licenses/MIT The MIT License 48 | * @link https://github.com/andreas-weber/php-junit-merge 49 | * @since Class available since Release 1.0.0 50 | */ 51 | class Application extends ConsoleApplication 52 | { 53 | /** 54 | * __construct() 55 | */ 56 | public function __construct() 57 | { 58 | parent::__construct('phpjunitmerge', '1.0.6'); 59 | } 60 | 61 | /** 62 | * Gets the name of the command based on input. 63 | * 64 | * @param InputInterface $input 65 | * 66 | * @return string The command name 67 | */ 68 | protected function getCommandName(InputInterface $input) 69 | { 70 | return 'phpjunitmerge'; 71 | } 72 | 73 | /** 74 | * Gets the default commands that should always be available. 75 | * 76 | * @return array An array of default Command instances 77 | */ 78 | protected function getDefaultCommands() 79 | { 80 | $defaultCommands = parent::getDefaultCommands(); 81 | 82 | $defaultCommands[] = new Command; 83 | 84 | return $defaultCommands; 85 | } 86 | 87 | /** 88 | * Overridden so that the application doesn't expect the command 89 | * name to be the first argument. 90 | * 91 | * @return InputDefinition 92 | */ 93 | public function getDefinition() 94 | { 95 | $inputDefinition = parent::getDefinition(); 96 | $inputDefinition->setArguments(); 97 | 98 | return $inputDefinition; 99 | } 100 | 101 | /** 102 | * Runs the current application. 103 | * 104 | * @param InputInterface $input An Input instance 105 | * @param OutputInterface $output An Output instance 106 | * 107 | * @return int 0 if everything went fine, or an error code 108 | */ 109 | public function doRun(InputInterface $input, OutputInterface $output) 110 | { 111 | if (!$input->hasParameterOption('--quiet')) { 112 | $output->write( 113 | sprintf( 114 | "phpjunitmerge %s by Andreas Weber\n\n", 115 | $this->getVersion() 116 | ) 117 | ); 118 | } 119 | 120 | if ($input->hasParameterOption('--version') 121 | || $input->hasParameterOption('-V') 122 | ) { 123 | exit; 124 | } 125 | 126 | if (!$input->getFirstArgument()) { 127 | $input = new ArrayInput(array('--help')); 128 | } 129 | 130 | parent::doRun($input, $output); 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /src/Console/Command.php: -------------------------------------------------------------------------------- 1 | . 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in all 17 | * copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | * SOFTWARE 26 | * 27 | * @package phpjunitmerge 28 | * @author Andreas Weber 29 | * @copyright 2015 Andreas Weber 30 | * @license http://opensource.org/licenses/MIT The MIT License 31 | * @since File available since Release 1.0.0 32 | */ 33 | 34 | namespace AndreasWeber\PHPJUNITMERGE\Console; 35 | 36 | use Symfony\Component\Console\Command\Command as AbstractCommand; 37 | use Symfony\Component\Console\Input\InputArgument; 38 | use Symfony\Component\Console\Input\InputInterface; 39 | use Symfony\Component\Console\Input\InputOption; 40 | use Symfony\Component\Console\Output\OutputInterface; 41 | use Symfony\Component\Finder\Finder; 42 | use Symfony\Component\Finder\SplFileInfo; 43 | use TheSeer\fDOM\fDOMDocument; 44 | 45 | /** 46 | * Base command class. 47 | * 48 | * @author Andreas Weber 49 | * @copyright 2015 Andreas Weber 50 | * @license http://opensource.org/licenses/MIT The MIT License 51 | * @link https://github.com/andreas-weber/php-junit-merge 52 | * @since Class available since Release 1.0.0 53 | */ 54 | class Command extends AbstractCommand 55 | { 56 | /** 57 | * Configures the current command. 58 | */ 59 | protected function configure() 60 | { 61 | $this->setName('phpjunitmerge') 62 | ->setDefinition( 63 | array( 64 | new InputArgument( 65 | 'dir', 66 | InputArgument::REQUIRED, 67 | 'Directory where all files ready to get merged are stored' 68 | ), 69 | new InputArgument( 70 | 'file', 71 | InputArgument::REQUIRED, 72 | 'The target file in which the merged result should be written' 73 | ) 74 | ) 75 | ) 76 | ->addOption( 77 | 'names', 78 | null, 79 | InputOption::VALUE_REQUIRED, 80 | 'A comma-separated list of file names to check', 81 | '*.xml' 82 | ) 83 | ->addOption( 84 | 'ignore', 85 | null, 86 | InputOption::VALUE_REQUIRED, 87 | 'A comma-separated list of file names to ignore', 88 | 'result.xml' 89 | ) 90 | ->addOption( 91 | 'no-suffix', 92 | null, 93 | InputOption::VALUE_NONE, 94 | 'Do not add suffix for test suites with duplicate names', 95 | null 96 | ); 97 | } 98 | 99 | /** 100 | * Executes the current command. 101 | * 102 | * @param InputInterface $input An InputInterface instance 103 | * @param OutputInterface $output An OutputInterface instance 104 | * 105 | * @return null|integer null or 0 if everything went fine, or an error code 106 | */ 107 | protected function execute(InputInterface $input, OutputInterface $output) 108 | { 109 | $directory = $input->getArgument('dir'); 110 | $fileOut = $input->getArgument('file'); 111 | 112 | $names = $input->getOption('names'); 113 | if ($names) { 114 | $names = explode(',', $names); 115 | } else { 116 | $names = array(); 117 | } 118 | 119 | $ignoreNames = $input->getOption('ignore'); 120 | if ($ignoreNames) { 121 | $ignoreNames = explode(',', $ignoreNames); 122 | } else { 123 | $ignoreNames = array(); 124 | } 125 | 126 | $noSuffix = $input->hasParameterOption('--no-suffix'); 127 | // here is where the magic happens 128 | $files = $this->findFiles($directory, $names, $ignoreNames); 129 | $outXml = $this->mergeFiles(realpath($directory), $files, $noSuffix); 130 | $result = $this->writeFile($outXml, $fileOut); 131 | 132 | $output->writeln( 133 | 'Found and processed ' . count($files) . ' files. Wrote merged result in \'' . $fileOut . '\'.' 134 | ); 135 | 136 | return (true === $result) ? 0 : 1; 137 | } 138 | 139 | /** 140 | * Find all files to merge. 141 | * 142 | * @param string $directory 143 | * @param array $names 144 | * @param array $ignoreNames 145 | * 146 | * @return Finder 147 | */ 148 | private function findFiles($directory, array $names, array $ignoreNames) 149 | { 150 | $finder = new Finder(); 151 | $finder->files()->in($directory); 152 | 153 | foreach ($names as $name) { 154 | $finder->name($name); 155 | } 156 | 157 | foreach ($ignoreNames as $name) { 158 | $finder->notName($name); 159 | } 160 | 161 | $finder->sortByName(); 162 | 163 | return $finder; 164 | } 165 | 166 | /** 167 | * Merge all files. 168 | * 169 | * @param string $directory 170 | * @param Finder $finder 171 | * @param bool $noSuffix 172 | * 173 | * @return fDOMDocument 174 | */ 175 | private function mergeFiles($directory, Finder $finder, $noSuffix) 176 | { 177 | $outXml = new fDOMDocument; 178 | $outXml->formatOutput = true; 179 | 180 | $outTestSuites = $outXml->createElement('testsuites'); 181 | $outXml->appendChild($outTestSuites); 182 | 183 | $outTestSuite = $outXml->createElement('testsuite'); 184 | $outTestSuites->appendChild($outTestSuite); 185 | 186 | $tests = 0; 187 | $assertions = 0; 188 | $failures = 0; 189 | $errors = 0; 190 | $time = 0; 191 | 192 | /** @var SplFileInfo $file */ 193 | foreach ($finder as $file) { 194 | if ($this->isFileEmpty($file)) { 195 | continue; 196 | } 197 | 198 | $inXml = $this->loadFile($file->getRealpath()); 199 | foreach ($inXml->query('//testsuites/testsuite') as $inElement) { 200 | 201 | if (!$noSuffix) { 202 | $inName = $inElement->getAttribute('name'); 203 | $outName = $inName; 204 | $suffix = 2; 205 | while ($outTestSuite->query('//testsuite[@name="' . $outName . '"]')->length !== 0) { 206 | $outName = $inName . '_' . $suffix; 207 | $suffix++; 208 | } 209 | } 210 | 211 | $outElement = $outXml->importNode($inElement, true); 212 | if (!$noSuffix) { 213 | $outElement->setAttribute('name', $outName); 214 | } 215 | $outTestSuite->appendChild($outElement); 216 | 217 | $tests += $inElement->hasAttribute('tests') ? $inElement->getAttribute('tests') : 0; 218 | $assertions += $inElement->hasAttribute('assertions') ? $inElement->getAttribute('assertions') : 0; 219 | $failures += $inElement->hasAttribute('failures') ? $inElement->getAttribute('failures') : 0; 220 | $errors += $inElement->hasAttribute('errors') ? $inElement->getAttribute('errors') : 0; 221 | $time += $inElement->hasAttribute('time') ? $inElement->getAttribute('time') : 0; 222 | } 223 | } 224 | 225 | $outTestSuite->setAttribute('name', $directory); 226 | $outTestSuite->setAttribute('tests', $tests); 227 | $outTestSuite->setAttribute('assertions', $assertions); 228 | $outTestSuite->setAttribute('failures', $failures); 229 | $outTestSuite->setAttribute('errors', $errors); 230 | $outTestSuite->setAttribute('time', $time); 231 | 232 | return $outXml; 233 | } 234 | 235 | /** 236 | * Load an xml junit file. 237 | * 238 | * @param string $filename 239 | * 240 | * @return fDOMDocument 241 | */ 242 | private function loadFile($filename) 243 | { 244 | $dom = new fDOMDocument(); 245 | $dom->load($filename); 246 | 247 | return $dom; 248 | } 249 | 250 | /** 251 | * Checks if a file is empty. 252 | * 253 | * @param SplFileInfo $file 254 | * 255 | * @return bool 256 | */ 257 | private function isFileEmpty(SplFileInfo $file) 258 | { 259 | return $file->getSize() > 0 ? false : true; 260 | } 261 | 262 | /** 263 | * Writes the merged result file. 264 | * 265 | * @param fDOMDocument $dom 266 | * @param string $filename 267 | * 268 | * @return bool 269 | */ 270 | private function writeFile(fDOMDocument $dom, $filename) 271 | { 272 | $dom->formatOutput = true; 273 | $result = $dom->save($filename); 274 | 275 | return ($result !== false) ? true : false; 276 | } 277 | } 278 | -------------------------------------------------------------------------------- /src/Test/Unit/BaseTest.php: -------------------------------------------------------------------------------- 1 | . 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in all 17 | * copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | * SOFTWARE 26 | * 27 | * @package phpjunitmerge 28 | * @author Andreas Weber 29 | * @copyright 2015 Andreas Weber 30 | * @license http://opensource.org/licenses/MIT The MIT License 31 | * @since File available since Release 1.0.0 32 | */ 33 | 34 | namespace AndreasWeber\PHPJUNITMERGE\Tests\Unit; 35 | 36 | use AndreasWeber\PHPJUNITMERGE\Console\Application; 37 | use Symfony\Component\Console\Input\ArrayInput; 38 | use TheSeer\fDOM\fDOMDOcument; 39 | 40 | /** 41 | * Base tests class. 42 | * 43 | * @author Andreas Weber 44 | * @copyright 2015 Andreas Weber 45 | * @license http://opensource.org/licenses/MIT The MIT License 46 | * @link https://github.com/andreas-weber/php-junit-merge 47 | * @since Class available since Release 1.0.0 48 | */ 49 | class BaseTest extends \PHPUnit_Framework_TestCase 50 | { 51 | private $fixtures; 52 | private $resultFile; 53 | private $application; 54 | private $input; 55 | private $output; 56 | private $statusCode; 57 | 58 | /** 59 | * setUp() 60 | */ 61 | protected function setUp() 62 | { 63 | $this->fixtures = realpath(__DIR__ . '/Fixtures'); 64 | $this->resultFile = realpath($this->fixtures . '/../tmp') . '/tmp.xml'; 65 | $this->application = new Application(); 66 | } 67 | 68 | /** 69 | * Tests if merging multiple files works as expected. 70 | */ 71 | public function testIfMergingWorks() 72 | { 73 | $fixtures = $this->fixtures . '/normal'; 74 | 75 | $params = array( 76 | 'dir' => $fixtures, 77 | 'file' => $this->resultFile 78 | ); 79 | 80 | $this->runApplication($params); 81 | 82 | $expected = $this->loadFile($fixtures . '/result.xml'); 83 | $actual = $this->loadFile($this->resultFile); 84 | 85 | $this->assertEquals( 86 | $expected->__toString(), 87 | $actual->__toString() 88 | ); 89 | } 90 | 91 | /** 92 | * Tests if merging multiple files works as expected. 93 | * When an empty file is given, it should be skipped. 94 | */ 95 | public function testIfMergingWithEmptyFilesWorks() 96 | { 97 | $fixtures = $this->fixtures . '/empty-file'; 98 | 99 | $params = array( 100 | 'dir' => $fixtures, 101 | 'file' => $this->resultFile 102 | ); 103 | 104 | $this->runApplication($params); 105 | 106 | $expected = $this->loadFile($fixtures . '/result.xml'); 107 | $actual = $this->loadFile($this->resultFile); 108 | 109 | $this->assertEquals( 110 | $expected->__toString(), 111 | $actual->__toString() 112 | ); 113 | } 114 | 115 | /** 116 | * Load a test file. 117 | * 118 | * @param string $filename 119 | * 120 | * @return fDOMDocument 121 | */ 122 | private function loadFile($filename) 123 | { 124 | $dom = new fDOMDOcument(); 125 | $dom->load($filename); 126 | 127 | return $dom; 128 | } 129 | 130 | /** 131 | * Executes the application. 132 | * 133 | * @param array $input An array of arguments and options 134 | * 135 | * @return int The command exit code 136 | */ 137 | public function runApplication(array $input) 138 | { 139 | $this->input = new ArrayInput($input); 140 | 141 | return $this->statusCode = $this->application->run($this->input, $this->output); 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /src/Test/Unit/Fixtures/empty-file/phpunit-junit-1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/Test/Unit/Fixtures/empty-file/phpunit-junit-2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/Test/Unit/Fixtures/empty-file/phpunit-junit-3.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreaskweber/php-junit-merge/6ad39658b84f6bcb16b42f56a896ce3fc5ec907f/src/Test/Unit/Fixtures/empty-file/phpunit-junit-3.xml -------------------------------------------------------------------------------- /src/Test/Unit/Fixtures/empty-file/result.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Test/Unit/Fixtures/normal/phpcs-junit-1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/Test/Unit/Fixtures/normal/phpunit-junit-1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/Test/Unit/Fixtures/normal/phpunit-junit-2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/Test/Unit/Fixtures/normal/phpunit-junit-3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/Test/Unit/Fixtures/normal/result.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/Test/Unit/tmp/.gitignore: -------------------------------------------------------------------------------- 1 | tmp.xml 2 | -------------------------------------------------------------------------------- /src/Test/bootstrap.php: -------------------------------------------------------------------------------- 1 | . 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in all 17 | * copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | * SOFTWARE 26 | * 27 | * @package phpjunitmerge 28 | * @author Andreas Weber 29 | * @copyright 2015 Andreas Weber 30 | * @license http://opensource.org/licenses/MIT The MIT License 31 | * @since File available since Release 1.0.0 32 | */ 33 | 34 | // Error Reporting 35 | error_reporting(E_ALL); 36 | ini_set('display_errors', 1); 37 | 38 | // Define base path 39 | defined('BASE_PATH') 40 | || define('BASE_PATH', realpath(dirname(__FILE__) . '/../../')); 41 | 42 | // Autoloader 43 | require_once BASE_PATH . '/vendor/autoload.php'; 44 | -------------------------------------------------------------------------------- /src/Test/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | ./Unit 21 | 22 | 23 | 24 | 25 | 26 | ../ 27 | 28 | ../Tests 29 | 30 | 31 | 32 | 33 | 34 | --------------------------------------------------------------------------------