diff --git a/README.md b/README.md index 0aad4e5..017ba72 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # PHP Language Server [![Version](https://img.shields.io/packagist/v/felixfbecker/language-server.svg)](https://packagist.org/packages/felixfbecker/language-server) -[![Build Status](https://travis-ci.org/felixfbecker/php-language-server.svg?branch=master)](https://travis-ci.org/felixfbecker/php-language-server) +[![Linux Build Status](https://travis-ci.org/felixfbecker/php-language-server.svg?branch=master)](https://travis-ci.org/felixfbecker/php-language-server) +[![Windows Build status](https://ci.appveyor.com/api/projects/status/2sp5ll052wdjqmdm/branch/master?svg=true)](https://ci.appveyor.com/project/felixfbecker/php-language-server/branch/master) [![Coverage](https://codecov.io/gh/felixfbecker/php-language-server/branch/master/graph/badge.svg)](https://codecov.io/gh/felixfbecker/php-language-server) [![Dependency Status](https://gemnasium.com/badges/github.com/felixfbecker/php-language-server.svg)](https://gemnasium.com/github.com/felixfbecker/php-language-server) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..13dfd74 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,51 @@ +version: '{build}' + +platform: + - x64 + +skip_tags: true +skip_branch_with_pr: true +clone_depth: 1 +max_jobs: 3 + +cache: + - '%LOCALAPPDATA%\Composer' + +environment: + ANSICON: 121x90 (121x90) + matrix: + - { PHP_VERSION: '7.1.11', VC_VERSION: '14', XDEBUG_VERSION: '2.5.5' } + +install: + # Enable Windows Update service, needed to install vcredist2015 (dependency of php) + - ps: Set-Service wuauserv -StartupType Manual + - choco install -y php --version %PHP_VERSION% + - choco install -y composer + - refreshenv + - composer install --no-interaction --no-progress --prefer-dist + # Install XDebug for code coverage + - ps: | + $client = New-Object System.Net.WebClient + $phpMinorVersion = $env:PHP_VERSION -replace '\.\d+$' + $xdebugUrl = "https://xdebug.org/files/php_xdebug-$env:XDEBUG_VERSION-$phpMinorVersion-vc14-nts-x86_64.dll" + $phpDir = (Get-Item (Get-Command php).Source).Directory.FullName + $xdebugPath = Join-Path $phpDir ext\xdebug.dll + $client.DownloadFile($xdebugUrl, $xdebugPath) + $phpIniPath = Join-Path $phpDir php.ini + Add-Content $phpIniPath @" + zend_extension=$xdebugPath + "@ + +build: off + +test_script: + - vendor\bin\phpunit --coverage-clover=coverage/coverage.xml + +after_test: + - ps: | + # Delete vendor because it causes problems with codecovs report search + # https://github.com/codecov/codecov-bash/issues/96 + Remove-Item -Recurse -Force vendor + $env:PATH = 'C:\msys64\usr\bin;' + $env:PATH + Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh + bash codecov.sh -f 'coverage/coverage.xml' diff --git a/tests/Validation/ValidationTest.php b/tests/Validation/ValidationTest.php index 3fc7429..9057c9d 100644 --- a/tests/Validation/ValidationTest.php +++ b/tests/Validation/ValidationTest.php @@ -96,7 +96,9 @@ class ValidationTest extends TestCase $testCasesDir = realpath(__DIR__ . '/cases'); foreach ($refsAndDefs['references'] as $key => $list) { $fixedPathRefs = array_map(function ($ref) use ($testCasesDir) { - return str_replace($testCasesDir, '.', $ref); + $ref = str_replace($testCasesDir, '.', $ref); + $ref = str_replace(DIRECTORY_SEPARATOR, '/', $ref); + return $ref; }, $list); $refsAndDefs['references']->$key = $fixedPathRefs; @@ -107,6 +109,7 @@ class ValidationTest extends TestCase if ($def !== null && $def->symbolInformation !== null && $def->symbolInformation->location !== null && $def->symbolInformation->location->uri !== null) { $def->symbolInformation->location->uri = str_replace($testCasesDir, '.', $def->symbolInformation->location->uri); + $def->symbolInformation->location->uri = str_replace(DIRECTORY_SEPARATOR, '/', $def->symbolInformation->location->uri); } }