build: false
version: dev-{build}
shallow_clone: false
clone_folder: C:\projects\php-cs-fixer

environment:
    matrix:
        - php_ver: 7.3.1
        - php_ver: 5.6.40

cache:
    - '%APPDATA%\Composer'
    - '%LOCALAPPDATA%\Composer'
    - C:\tools\php -> .appveyor.yml
    - C:\tools\composer.phar -> .appveyor.yml

init:
    - SET PATH=C:\tools\php;%PATH%

install:
    - ps: Set-Service wuauserv -StartupType Manual
    - IF NOT EXIST C:\tools\php (choco install --yes --allow-empty-checksums php --version %php_ver% --params '/InstallDir:C:\tools\php')
    - cd C:\tools\php
    - copy php.ini-production php.ini
    - echo date.timezone="UTC" >> php.ini
    - echo memory_limit=512M >> php.ini
    - echo extension_dir=ext >> php.ini
    - echo extension=php_curl.dll >> php.ini
    - echo extension=php_openssl.dll >> php.ini
    - echo extension=php_mbstring.dll >> php.ini
    - IF NOT EXIST C:\tools\composer.phar (cd C:\tools && appveyor DownloadFile https://getcomposer.org/composer-stable.phar -FileName composer.phar)
    - cd C:\projects\php-cs-fixer
    - php C:\tools\composer.phar global show hirak/prestissimo -q || php C:\tools\composer.phar global require hirak/prestissimo

before_test:
    - cd C:\projects\php-cs-fixer
    - php C:\tools\composer.phar update --optimize-autoloader --no-interaction --no-progress --prefer-stable --no-ansi
    - php C:\tools\composer.phar info -D | sort

test_script:
    - cd C:\projects\php-cs-fixer
    - vendor\bin\phpunit
    - set PHP_CS_FIXER_FUTURE_MODE=1
    - php php-cs-fixer --diff --dry-run -v fix
