diff --git a/README.md b/README.md index f96cb56..5183bbd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # 📋 Detailed PHPUnit Printer -[![Build Status](https://travis-ci.org/LimeDeck/phpunit-detailed-printer.svg?branch=master)](https://travis-ci.org/LimeDeck/phpunit-detailed-printer) +[![Build Status: Linux](https://travis-ci.org/LimeDeck/phpunit-detailed-printer.svg?branch=master)](https://travis-ci.org/LimeDeck/phpunit-detailed-printer) +[![Build status: Windows](https://ci.appveyor.com/api/projects/status/656nmj6oxbnq4sri/branch/master?svg=true)](https://ci.appveyor.com/project/HRcc/phpunit-detailed-printer/branch/master) [![GitHub release](https://img.shields.io/github/release/LimeDeck/phpunit-detailed-printer.svg)](https://github.com/limedeck/phpunit-detailed-printer) ## Installation diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..6cce64d --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,45 @@ +build: off +platform: + - x64 +clone_folder: c:\projects\phpunit-detailed-printer +environment: + matrix: + - php_version: 5.6 + - php_version: 7.0 + - php_version: 7.1 +## Cache composer, chocolatey and php bits +cache: + - '%LOCALAPPDATA%\Composer\files -> composer.lock' + - composer.phar + # Cache chocolatey packages + - C:\ProgramData\chocolatey\bin -> .appveyor.yml + - C:\ProgramData\chocolatey\lib -> .appveyor.yml + # Cache php install + - c:\tools\php -> .appveyor.yml +## Set up environment variables +init: + - SET PATH=C:\Program Files\OpenSSL;c:\tools\php;%PATH% + - SET COMPOSER_NO_INTERACTION=1 + - SET PHP=1 # This var is connected to PHP install cache + - SET ANSICON=121x90 (121x90) +## Install PHP and composer, and run the appropriate composer command +install: + - IF EXIST c:\tools\php (SET PHP=0) # Checks for the PHP install being cached + - ps: appveyor-retry cinst --params '""/InstallDir:C:\tools\php""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php_version | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','') + - cd c:\tools\php + - IF %PHP%==1 copy php.ini-production php.ini /Y + - IF %PHP%==1 echo date.timezone="UTC" >> php.ini + - IF %PHP%==1 echo extension_dir=ext >> php.ini + - IF %PHP%==1 echo extension=php_openssl.dll >> php.ini + - IF %PHP%==1 echo extension=php_mbstring.dll >> php.ini + - IF %PHP%==1 echo extension=php_fileinfo.dll >> php.ini + - IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat + - appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar + - cd c:\projects\phpunit-detailed-printer + - appveyor-retry composer install --no-progress --profile + - composer show + +## Run the actual test +test_script: + - cd c:\projects\phpunit-detailed-printer + - vendor/bin/phpunit diff --git a/src/Printer.php b/src/Printer.php index 3e085ce..831e3b2 100644 --- a/src/Printer.php +++ b/src/Printer.php @@ -42,7 +42,7 @@ protected function writeProgress($progress) $progress = static::$symbols[$progress]; } - $this->write("{$progress} {$this->testRow}"); + $this->write("{$progress} {$this->testRow}" . PHP_EOL); $this->column++; $this->numTestsRun++; } @@ -144,7 +144,7 @@ protected function writeProgressWithColor($color, $buffer) protected function buildTestRow($className, $methodName, $time, $color = 'fg-white') { $this->testRow = sprintf( - "%s (%s)\n", + "%s (%s)", $this->formatWithColor($color, "{$className}: {$this->formatMethodName($methodName)}"), $this->formatTestDuration($time) ); diff --git a/tests/states-test.phpt b/tests/states-test.phpt index 37a8e31..a77e5c1 100644 --- a/tests/states-test.phpt +++ b/tests/states-test.phpt @@ -31,7 +31,7 @@ There was 1 error: 1) PrinterStatesTest::testError strpos() expects at least 2 parameters, 0 given -%s/tests/_files/PrinterStatesTest.php:17 +%sPrinterStatesTest.php:17 -- @@ -39,7 +39,7 @@ There was 1 warning: 1) PrinterStatesTest::testWarning -%s/tests/_files/PrinterStatesTest.php:27 +%sPrinterStatesTest.php:27 -- @@ -48,7 +48,7 @@ There was 1 failure: 1) PrinterStatesTest::testFailure Failed asserting that false is true. -%s/tests/_files/PrinterStatesTest.php:12 +%sPrinterStatesTest.php:12 ERRORS! Tests: 7, Assertions: 2, Errors: 1, Failures: 1, Warnings: 1, Skipped: 1, Incomplete: 1, Risky: 1.