Skip to content

Commit

Permalink
Update dependencies and fix codestyle (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
SmetDenis committed Mar 8, 2023
1 parent 7732436 commit 3d40844
Show file tree
Hide file tree
Showing 60 changed files with 415 additions and 2,385 deletions.
5 changes: 2 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#
# JBZoo Toolbox - PHPUnit
# JBZoo Toolbox - PHPUnit.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @package PHPUnit
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @link https://github.com/JBZoo/PHPUnit
# @see https://github.com/JBZoo/PHPUnit
#

# EditorConfig is awesome: http://EditorConfig.org
Expand Down
5 changes: 2 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#
# JBZoo Toolbox - PHPUnit
# JBZoo Toolbox - PHPUnit.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @package PHPUnit
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @link https://github.com/JBZoo/PHPUnit
# @see https://github.com/JBZoo/PHPUnit
#

/.github export-ignore
Expand Down
31 changes: 22 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#
# JBZoo Toolbox - PHPUnit
# JBZoo Toolbox - PHPUnit.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @package PHPUnit
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @link https://github.com/JBZoo/PHPUnit
# @see https://github.com/JBZoo/PHPUnit
#

name: CI
Expand All @@ -21,7 +20,7 @@ on:
branches:
- 'master'
schedule:
- cron: '35 */8 * * *'
- cron: '37 */8 * * *'

env:
COLUMNS: 120
Expand All @@ -35,7 +34,7 @@ jobs:
JBZOO_COMPOSER_UPDATE_FLAGS: ${{ matrix.composer_flags }}
strategy:
matrix:
php-version: [ 8.0, 8.1, 8.2 ]
php-version: [ 8.1, 8.2 ]
coverage: [ xdebug, none ]
composer_flags: [ "--prefer-lowest", "" ]
steps:
Expand All @@ -50,21 +49,30 @@ jobs:
php-version: ${{ matrix.php-version }}
coverage: ${{ matrix.coverage }}
tools: composer
extensions: ast

- name: Build the Project
run: make update --no-print-directory

- name: Start web-server
run: make server-start --no-print-directory

- name: 🧪 PHPUnit Tests
run: make server-start test --no-print-directory
run: make test --no-print-directory

- name: Stop web-server
run: make server-stop --no-print-directory

- name: Uploading coverage to coveralls
if: ${{ matrix.coverage == 'xdebug' }}
continue-on-error: true
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make report-coveralls --no-print-directory
run: make report-coveralls --no-print-directory || true

- name: Upload Artifacts
uses: actions/upload-artifact@v3
continue-on-error: true
with:
name: PHPUnit - ${{ matrix.php-version }} - ${{ matrix.coverage }}
path: build/
Expand All @@ -75,7 +83,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ 8.0, 8.1, 8.2 ]
php-version: [ 8.1, 8.2 ]
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -86,6 +94,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none
tools: composer
extensions: ast

Expand All @@ -97,6 +106,7 @@ jobs:

- name: Upload Artifacts
uses: actions/upload-artifact@v3
continue-on-error: true
with:
name: Linters - ${{ matrix.php-version }}
path: build/
Expand All @@ -107,7 +117,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ 8.0, 8.1, 8.2 ]
php-version: [ 8.1, 8.2 ]
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -118,7 +128,9 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug
tools: composer
extensions: ast

- name: Build the Project
run: make update --no-print-directory
Expand All @@ -128,6 +140,7 @@ jobs:

- name: Upload Artifacts
uses: actions/upload-artifact@v3
continue-on-error: true
with:
name: Reports - ${{ matrix.php-version }}
path: build/
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#
# JBZoo Toolbox - PHPUnit
# JBZoo Toolbox - PHPUnit.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @package PHPUnit
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @link https://github.com/JBZoo/PHPUnit
# @see https://github.com/JBZoo/PHPUnit
#

.idea
Expand Down
9 changes: 4 additions & 5 deletions .phan.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
<?php

/**
* JBZoo Toolbox - PHPUnit
* JBZoo Toolbox - PHPUnit.
*
* This file is part of the JBZoo Toolbox project.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package PHPUnit
* @license MIT
* @copyright Copyright (C) JBZoo.com, All rights reserved.
* @link https://github.com/JBZoo/PHPUnit
* @see https://github.com/JBZoo/PHPUnit
*/

declare(strict_types=1);

$default = include __DIR__ . '/vendor/jbzoo/codestyle/src/phan/default.php';

$index = array_search('NotFullyQualifiedUsagePlugin', $default['plugins'], true);
$index = \array_search('NotFullyQualifiedUsagePlugin', $default['plugins'], true);
unset($default['plugins'][$index]);

return array_merge($default, [
return \array_merge($default, [
'file_list' => [
'src/functions/defines.php',
'src/functions/aliases.php',
Expand Down
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#
# JBZoo Toolbox - PHPUnit
# JBZoo Toolbox - PHPUnit.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @package PHPUnit
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @link https://github.com/JBZoo/PHPUnit
# @see https://github.com/JBZoo/PHPUnit
#

ifneq (, $(wildcard ./vendor/jbzoo/codestyle/src/init.Makefile))
Expand All @@ -27,19 +26,19 @@ update: ##@Project Install/Update all 3rd party dependencies
@composer update $(JBZOO_COMPOSER_UPDATE_FLAGS)


server-start: ##@Project Run PHP web-server for PHPUnit tests
server-start: ##@ProjectSpecific Run PHP web-server for PHPUnit tests
@make server-fake-test
@make server-phpunit
@sleep 1


server-stop: ##@Project Run PHP web-server for PHPUnit tests
server-stop: ##@ProjectSpecific Run PHP web-server for PHPUnit tests
@-pgrep --full "$(JBZOO_TEST_SERVER_HOST):$(JBZOO_TEST_SERVER_FAKE)" | xargs kill -15 || true;
@-pgrep --full "$(JBZOO_TEST_SERVER_HOST):$(JBZOO_TEST_SERVER_PHPUNIT)" | xargs kill -15 || true;
@sleep 1


test-all: ##@Project Run all test
test-all: ##@ProjectSpecific Run all test
$(call title,"Run all tests")
@make test
@make report-composer-graph
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# JBZoo / PHPUnit

[![CI](https://github.com/JBZoo/PHPUnit/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/JBZoo/PHPUnit/actions/workflows/main.yml?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/JBZoo/PHPUnit/badge.svg?branch=master)](https://coveralls.io/github/JBZoo/PHPUnit?branch=master) [![Psalm Coverage](https://shepherd.dev/github/JBZoo/PHPUnit/coverage.svg)](https://shepherd.dev/github/JBZoo/PHPUnit) [![CodeFactor](https://www.codefactor.io/repository/github/jbzoo/phpunit/badge)](https://www.codefactor.io/repository/github/jbzoo/phpunit/issues) [![PHP Strict Types](https://img.shields.io/badge/strict__types-%3D1-brightgreen)](https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.strict)
[![Stable Version](https://poser.pugx.org/jbzoo/phpunit/version)](https://packagist.org/packages/jbzoo/phpunit) [![Total Downloads](https://poser.pugx.org/jbzoo/phpunit/downloads)](https://packagist.org/packages/jbzoo/phpunit/stats) [![Dependents](https://poser.pugx.org/jbzoo/phpunit/dependents)](https://packagist.org/packages/jbzoo/phpunit/dependents?order_by=downloads) [![Visitors](https://visitor-badge.glitch.me/badge?page_id=jbzoo.phpunit)]() [![GitHub License](https://img.shields.io/github/license/jbzoo/phpunit)](https://github.com/JBZoo/PHPUnit/blob/master/LICENSE)
[![CI](https://github.com/JBZoo/PHPUnit/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/JBZoo/PHPUnit/actions/workflows/main.yml?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/JBZoo/PHPUnit/badge.svg?branch=master)](https://coveralls.io/github/JBZoo/PHPUnit?branch=master) [![Psalm Coverage](https://shepherd.dev/github/JBZoo/PHPUnit/coverage.svg)](https://shepherd.dev/github/JBZoo/PHPUnit) [![Psalm Level](https://shepherd.dev/github/JBZoo/PHPUnit/level.svg)](https://shepherd.dev/github/JBZoo/PHPUnit) [![CodeFactor](https://www.codefactor.io/repository/github/jbzoo/phpunit/badge)](https://www.codefactor.io/repository/github/jbzoo/phpunit/issues)
[![Stable Version](https://poser.pugx.org/jbzoo/phpunit/version)](https://packagist.org/packages/jbzoo/phpunit/) [![Total Downloads](https://poser.pugx.org/jbzoo/phpunit/downloads)](https://packagist.org/packages/jbzoo/phpunit/stats) [![Dependents](https://poser.pugx.org/jbzoo/phpunit/dependents)](https://packagist.org/packages/jbzoo/phpunit/dependents?order_by=downloads) [![Visitors](https://visitor-badge.glitch.me/badge?page_id=jbzoo.phpunit)]() [![GitHub License](https://img.shields.io/github/license/jbzoo/phpunit)](https://github.com/JBZoo/PHPUnit/blob/master/LICENSE)


## Installation
Expand Down
5 changes: 2 additions & 3 deletions bin/fake-index.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<?php

/**
* JBZoo Toolbox - PHPUnit
* JBZoo Toolbox - PHPUnit.
*
* This file is part of the JBZoo Toolbox project.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package PHPUnit
* @license MIT
* @copyright Copyright (C) JBZoo.com, All rights reserved.
* @link https://github.com/JBZoo/PHPUnit
* @see https://github.com/JBZoo/PHPUnit
*/

declare(strict_types=1);
Expand Down
5 changes: 2 additions & 3 deletions bin/phpunit-server.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#!/usr/bin/env sh

#
# JBZoo Toolbox - PHPUnit
# JBZoo Toolbox - PHPUnit.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @package PHPUnit
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @link https://github.com/JBZoo/PHPUnit
# @see https://github.com/JBZoo/PHPUnit
#

if [ "$1" != "" ]; then HTTP_HOST=$1; else HTTP_HOST="127.0.0.1"; fi
Expand Down
68 changes: 32 additions & 36 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name" : "jbzoo/phpunit",
"type" : "library",
"description" : "PHPUnit toolbox with short assert aliases and useful functions around testing",
"license" : "MIT",
"keywords" : [
"name" : "jbzoo/phpunit",
"type" : "library",
"description" : "PHPUnit toolbox with short assert aliases and useful functions around testing",
"license" : "MIT",
"keywords" : [
"phpunit",
"jbzoo",
"aliases",
Expand All @@ -14,62 +14,58 @@
"debug"
],

"authors" : [
"authors" : [
{
"name" : "Denis Smetannikov",
"email" : "admin@jbzoo.com",
"role" : "lead"
}
],

"require" : {
"php" : ">=8.0",
"ext-filter" : "*",
"ext-mbstring" : "*",
"require" : {
"php" : "^8.1",
"ext-filter" : "*",
"ext-mbstring" : "*",

"phpunit/phpunit" : ">=9.5.20",
"codedungeon/phpunit-result-printer" : ">=0.32.0",
"mheap/phpunit-github-actions-printer" : ">=1.5.1",
"ulrichsg/getopt-php" : ">=4.0.2",
"jbzoo/markdown" : ">=1.1.1"
"phpunit/phpunit" : ">=9.5.20",
"ulrichsg/getopt-php" : ">=4.0.2",
"jbzoo/markdown" : "7.x-dev"
},

"require-dev" : {
"jbzoo/toolbox-dev" : "dev-master|7.x-dev",
"jbzoo/codestyle" : "dev-master|7.x-dev",
"jbzoo/http-client" : ">=3.6.2|dev-master|7.x-dev",
"jbzoo/data" : ">=4.4.0|dev-master|7.x-dev",
"jbzoo/utils" : ">=4.5.5|dev-master|7.x-dev",
"require-dev" : {
"jbzoo/toolbox-dev" : "7.x-dev",
"jbzoo/codestyle" : "7.x-dev",
"jbzoo/http-client" : "7.x-dev",
"jbzoo/data" : "7.x-dev",
"jbzoo/utils" : "7.x-dev",

"guzzlehttp/guzzle" : ">=7.4.3",
"symfony/process" : ">=5.4.8",

"phpunit/php-token-stream" : ">=4.0.4"
"guzzlehttp/guzzle" : ">=7.4.3",
"symfony/process" : ">=5.4.8"
},

"suggest" : {
"suggest" : {
"jbzoo/utils" : "^4.2.3"
},

"autoload" : {
"autoload" : {
"psr-4" : {"JBZoo\\PHPUnit\\" : "src"},
"files" : [
"src/functions/defines.php",
"src/functions/aliases.php",
"src/functions/tools.php"
],
"psr-4" : {
"JBZoo\\PHPUnit\\" : "src"
}
]
},

"config" : {
"autoload-dev" : {
"psr-4" : {"JBZoo\\PHPUnit\\" : "tests"}
},

"config" : {
"optimize-autoloader" : true,
"allow-plugins" : {
"composer/package-versions-deprecated" : true
}
"allow-plugins" : {"composer/package-versions-deprecated" : true}
},

"extra" : {
"extra" : {
"branch-alias" : {
"dev-master" : "7.x-dev"
}
Expand Down
Loading

0 comments on commit 3d40844

Please sign in to comment.