Skip to content

Commit

Permalink
Merge pull request #9 from fabiang/php82
Browse files Browse the repository at this point in the history
Added support for PHP 8.2 (closes #8)
  • Loading branch information
fabiang authored May 12, 2023
2 parents b278ad1 + 9654e05 commit 8925e21
Show file tree
Hide file tree
Showing 46 changed files with 978 additions and 1,096 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[*]
indent_size = 4
indent_style = space
tab_width = 4
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2

[Vagrantfile]
indent_size = 2
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.editorconfig export-ignore
.gitignore export-ignore
.gitattributes export-ignore
.scrutinizer.yml export-ignore
Expand Down
32 changes: 17 additions & 15 deletions .github/workflows/behat.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
name: Integration Tests

on:
push:
branches:
- '*'
pull_request:
- '*'
on: [push, pull_request]

jobs:
integrationtest:
runs-on: ubuntu-latest

name: Behat

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2

- name: Cache Composer packages
id: composer-cache
Expand All @@ -33,12 +26,21 @@ jobs:
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Build the stack
run: docker-compose up -d
- name: Run containers
run: docker-compose up -d --quiet-pull

- name: Sleep for 10 minutes
run: sleep 10m
shell: bash
- name: Wait for XMPP to become available
uses: iFaxity/wait-on-action@v1
with:
resource: tcp:localhost:15222
timeout: 1800000
interval: 10000
delay: 60000
log: true

- name: Run test suite
run: ./vendor/bin/behat

- name: Stop containers
if: always()
run: docker-compose down --volumes
4 changes: 2 additions & 2 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Psalm
uses: docker://vimeo/psalm-github-actions
Expand All @@ -18,7 +18,7 @@ jobs:
composer_ignore_platform_reqs: true

- name: Upload Security Analysis results to GitHub
uses: github/codeql-action/upload-sarif@v1
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif

Expand Down
28 changes: 17 additions & 11 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: Unit Tests

on:
push:
branches:
- '*'
pull_request:
- '*'
on: [push, pull_request]

jobs:
unittest:
Expand Down Expand Up @@ -43,7 +38,7 @@ jobs:
coverage: false
- version: 7.3
phpunit: 9.5
coverage: true
coverage: false
- version: 7.4
phpunit: 9.5
coverage: false
Expand All @@ -52,13 +47,16 @@ jobs:
coverage: false
- version: 8.1
phpunit: 9.5
coverage: true
- version: 8.2
phpunit: 10.0
coverage: false
prefer-lowest: ['', '--prefer-lowest']

name: Unit Tests - PHP ${{ matrix.php.version }} ${{ matrix.prefer-lowest }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -71,7 +69,7 @@ jobs:

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
Expand All @@ -95,11 +93,19 @@ jobs:

- name: Run test suite
if: ${{ ! matrix.php.coverage }}
run: ./vendor/bin/phpunit --verbose
run: |
./vendor/bin/phpunit \
--no-configuration \
tests/src/
- name: Run test suite with code coverage
if: ${{ matrix.php.coverage }}
run: ./vendor/bin/phpunit --verbose --coverage-clover=build/logs/clover.xml
run: |
./vendor/bin/phpunit \
--no-configuration \
--coverage-clover build/logs/clover.xml \
--coverage-filter src/ \
tests/src/
env:
XDEBUG_MODE: coverage

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ php-coveralls.phar*
codeclimate-test-reporter.phar
codeclimate-test-reporter.phar*
composer.phar
composer.lock
38 changes: 19 additions & 19 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
imports:
- php
- php

filter:
paths:
- src/*
paths:
- src/*

checks:
php: true
php: true

tools:
php_code_sniffer:
config:
standard: PSR2
php_sim: true
php_cpd: true
php_loc: true
php_hhvm: false
php_mess_detector: true
php_pdepend: true
php_analyzer: true
sensiolabs_security_checker: true
php_changetracking: true
external_code_coverage:
runs: 2
timeout: 120
php_code_sniffer:
config:
standard: PSR2
php_sim: true
php_cpd: true
php_loc: true
php_hhvm: false
php_mess_detector: true
php_pdepend: true
php_analyzer: true
sensiolabs_security_checker: true
php_changetracking: true
external_code_coverage:
runs: 2
timeout: 120

build:
environment:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Modified BSD License

Copyright (c) 2002-2003 Richard Heyes,
2014 Jaussoin Timothée,
2014-2022 Fabian Grutschus
2014-2023 Fabian Grutschus
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ docker-compose up -d

**Note:** ejabberd takes around *ten minutes* to start.

### Vagrant
### Vagrant (Deprecated)

To launch the servers you can use the provided Vagrant box.
Just [install Vagrant](https://www.vagrantup.com/downloads) and run:
Expand Down
38 changes: 19 additions & 19 deletions behat.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
default:
suites:
authentication_features:
paths: [ "%paths.base%/tests/features/" ]
contexts:
- Fabiang\Sasl\Behat\XmppContext:
- localhost
- 15222
- ubuntu-xenial
- testuser
- testpass
- "%paths.base%/tests/log/features/"
- Fabiang\Sasl\Behat\Pop3Context:
- localhost
- 11110
- vmail
- pass
- "%paths.base%/tests/log/features/"
testers:
strict: true
suites:
authentication_features:
paths: [ "%paths.base%/tests/features/" ]
contexts:
- Fabiang\Sasl\Behat\XmppContext:
- localhost
- 15222
- ubuntu-xenial
- testuser
- testpass
- "%paths.base%/tests/log/features/"
- Fabiang\Sasl\Behat\Pop3Context:
- localhost
- 11110
- vmail
- pass
- "%paths.base%/tests/log/features/"
testers:
strict: true
11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@
},
"autoload-dev": {
"psr-4": {
"Fabiang\\Sasl\\Behat\\": "tests/features/bootstrap"
"Fabiang\\Sasl\\Behat\\": "tests/features/bootstrap",
"Fabiang\\Sasl\\": "tests/src"
},
"files": ["tests/compat.php"]
},
"require": {
"php": "^5.3.3 || ^7.0 || ~8.0.0 || ~8.1.0"
"php": "^5.3.3 || ^7.0 || ~8.0.0 || ~8.1.0 || ~8.2.0"
},
"require-dev": {
"behat/behat": "^3.6",
Expand All @@ -57,10 +58,10 @@
"phpunit": "phpunit",
"behat": "behat",
"test": [
"@phpunit",
"@behat",
"@psalm",
"@phpcs"
"@phpcs",
"@phpunit",
"@behat"
]
}
}
Loading

0 comments on commit 8925e21

Please sign in to comment.