Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPUnit Compatibility Layer #11

Merged
merged 18 commits into from
Dec 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
build: false
platform:
- x64
clone_folder: C:\projects\filesystem

branches:
except:
- gh-pages

## Build matrix for lowest and highest possible targets
environment:
PHPBuild: "x64"
VC: "vc15"
WINCACHE: "2.0.0.8"
matrix:
- php_ver_target: 5.3.10
- php_ver_target: 5.3.29
- php_ver_target: 5.4.45
- php_ver_target: 7.0.33
- php_ver_target: 7.1.33
- php_ver_target: 7.2.34
- php_ver_target: 7.3.33
- php_ver_target: 7.4.26
- php_ver_target: 8.0.13

init:
- SET PATH=C:\Program Files\OpenSSL;C:\tools\php;%PATH%
- SET COMPOSER_NO_INTERACTION=1
- SET PHP=1 # This var relates to caching the php install
- SET ANSICON=121x90 (121x90)

## Install PHP and composer, and run the appropriate composer command
install:
- IF EXIST C:\tools\php (SET PHP=0)
- ps: >-
If ($env:PHP -eq "1") {
appveyor-retry cinst php --version=$env:php_ver_target --package-parameters='""/InstallDir:C:\tools\php""' --ignore-checksums -y --no-progress --limit-output
}
- 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 extension=php_ftp.dll >> php.ini
- IF %PHP%==1 echo extension=php_gd2.dll >> php.ini
- IF %PHP%==1 echo extension=php_gmp.dll >> php.ini
- IF %PHP%==1 echo extension=php_pgsql.dll >> php.ini
- IF %PHP%==1 echo extension=php_curl.dll >> php.ini
- IF %PHP%==1 echo zend_extension=php_opcache.dll >> php.ini
- IF %PHP%==1 echo opcache.enable_cli=1 >> php.ini
- IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat
- IF %PHP%==1 php -r "readfile('http://getcomposer.org/installer');" | php
- cd C:\projects\filesystem
- IF NOT %php_ver_target%=="8.0.0" composer update --prefer-stable --no-progress
- IF %php_ver_target%=="8.0.0" composer update --prefer-stable --no-progress --ignore-platform-req=php

test_script:
- cd C:\projects\filesystem
- vendor\bin\phpunit
149 changes: 149 additions & 0 deletions .drone.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
local volumes = [
{
name: "composer-cache",
path: "/tmp/composer-cache",
},
];

local hostvolumes = [
{
name: "composer-cache",
host: {path: "/tmp/composer-cache"}
},
];

local composer(phpversion, params) = {
name: "composer",
image: "joomlaprojects/docker-images:php" + phpversion,
volumes: volumes,
commands: [
"php -v",
"composer update " + params,
if phpversion == "8.0" then "composer require --dev --with-all-dependencies phpunit/phpunit:^8.0",
if phpversion == "8.1" then "composer require --dev --with-all-dependencies phpunit/phpunit:^8.0",
]
};

local phpunit(phpversion) = {
name: "PHPUnit",
image: "joomlaprojects/docker-images:php" + phpversion,
[if phpversion == "8.0" then "failure"]: "ignore",
[if phpversion == "8.1" then "failure"]: "ignore",
commands: ["vendor/bin/phpunit"]
};

local pipeline(name, phpversion, params) = {
kind: "pipeline",
name: "PHP " + name,
volumes: hostvolumes,
steps: [
composer(phpversion, params),
phpunit(phpversion)
],
};

[
{
kind: "pipeline",
name: "Codequality",
volumes: hostvolumes,
steps: [
{
name: "composer",
image: "joomlaprojects/docker-images:php7.4",
volumes: volumes,
commands: [
"php -v",
"composer update --prefer-stable",
"composer require phpmd/phpmd phpstan/phpstan"
]
},
{
name: "phpcs (loose)",
image: "joomlaprojects/docker-images:php7.4",
depends: [ "composer" ],
commands: [
"vendor/bin/phpcs --config-set installed_paths vendor/joomla/coding-standards",
"vendor/bin/phpcs -p --report=full --extensions=php --standard=ruleset.xml src/"
]
},
{
name: "phpcs (strict)",
image: "joomlaprojects/docker-images:php7.4",
depends: [ "composer" ],
failure: "ignore",
commands: [
"vendor/bin/phpcs --config-set installed_paths vendor/joomla/coding-standards",
"vendor/bin/phpcs -p --report=full --extensions=php --standard=Joomla src/"
]
},
{
name: "phpmd",
image: "joomlaprojects/docker-images:php7.4",
depends: [ "composer" ],
failure: "ignore",
commands: [
"vendor/bin/phpmd src text cleancode",
"vendor/bin/phpmd src text codesize",
"vendor/bin/phpmd src text controversial",
"vendor/bin/phpmd src text design",
"vendor/bin/phpmd src text unusedcode",
]
},
{
name: "phpstan",
image: "joomlaprojects/docker-images:php7.4",
depends: [ "composer" ],
failure: "ignore",
commands: [
"vendor/bin/phpstan analyse src",
]
},
{
name: "phploc",
image: "joomlaprojects/docker-images:php7.4",
depends: [ "composer" ],
failure: "ignore",
commands: [
"phploc src",
]
},
{
name: "phpcpd",
image: "joomlaprojects/docker-images:php7.4",
depends: [ "composer" ],
failure: "ignore",
commands: [
"phpcpd src",
]
}
]
},
{
kind: "pipeline",
name: "PHP 5.3 lowest",
volumes: hostvolumes,
steps: [
{
name: "composer",
image: "joomlaprojects/docker-images:php5.3",
volumes: volumes,
commands: [
"php -v",
"composer update --prefer-stable --prefer-lowest",
"composer update phpunit/phpunit-mock-objects"
]
},
phpunit("5.3")
]
},
pipeline("5.3", "5.3", "--prefer-stable"),
pipeline("5.6", "5.6", "--prefer-stable"),
pipeline("7.0", "7.0", "--prefer-stable"),
pipeline("7.1", "7.1", "--prefer-stable"),
pipeline("7.2", "7.2", "--prefer-stable"),
pipeline("7.3", "7.3", "--prefer-stable"),
pipeline("7.4", "7.4", "--prefer-stable"),
pipeline("8.0", "8.0", "--prefer-stable"),
pipeline("8.1", "8.1", "--prefer-stable")
]
Loading