Skip to content
This repository has been archived by the owner on Jan 4, 2022. It is now read-only.

Enhancement: Synchronize with ergebnis/php-library-template #179

Merged
merged 1 commit into from
Jan 20, 2020
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
6 changes: 0 additions & 6 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@ update_configs:
commit_message:
include_scope: true
prefix: "Build"
default_assignees:
- "ergebnis-bot"
- "localheinz"
default_labels:
- "dependency"
default_reviewers:
- "ergebnis-bot"
- "localheinz"
directory: "/"
package_manager: "php:composer"
update_schedule: "live"
Expand Down
2 changes: 2 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ repository:
allow_merge_commit: true
allow_rebase_merge: false
allow_squash_merge: false
archived: false
default_branch: "master"
delete_branch_on_merge: true
description: ":eyeglasses: Provides utilities for tests."
has_downloads: true
has_issues: true
Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
uses: "actions/[email protected]"

- name: "Install PHP with extensions"
uses: "shivammathur/[email protected].0"
uses: "shivammathur/[email protected].3"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
uses: "actions/[email protected]"

- name: "Install PHP with extensions"
uses: "shivammathur/[email protected].0"
uses: "shivammathur/[email protected].3"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
uses: "actions/[email protected]"

- name: "Install PHP with extensions"
uses: "shivammathur/[email protected].0"
uses: "shivammathur/[email protected].3"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
Expand Down Expand Up @@ -205,7 +205,7 @@ jobs:
uses: "actions/[email protected]"

- name: "Install PHP with extensions"
uses: "shivammathur/[email protected].0"
uses: "shivammathur/[email protected].3"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
Expand Down Expand Up @@ -257,7 +257,7 @@ jobs:
uses: "actions/[email protected]"

- name: "Install PHP with extensions"
uses: "shivammathur/[email protected].0"
uses: "shivammathur/[email protected].3"
with:
coverage: "xdebug"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
Expand Down Expand Up @@ -311,7 +311,7 @@ jobs:
uses: "actions/[email protected]"

- name: "Install PHP with extensions"
uses: "shivammathur/[email protected].0"
uses: "shivammathur/[email protected].3"
with:
coverage: "xdebug"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
Expand Down Expand Up @@ -339,8 +339,8 @@ jobs:
- name: "Run mutation tests with Xdebug and infection/infection"
run: "vendor/bin/infection --ignore-msi-with-no-mutations --min-covered-msi=${{ env.MIN_COVERED_MSI }} --min-msi=${{ env.MIN_MSI }}"

approve:
name: "Approve"
review:
name: "Review"

runs-on: "ubuntu-latest"

Expand All @@ -358,3 +358,9 @@ jobs:
if: "(github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]') && github.event_name == 'pull_request' && startsWith(github.event.pull_request.title, 'Build(deps-dev)')"
with:
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"

- name: "Approve pull requests created by @ergebnis-bot that update the license year"
uses: "hmarr/[email protected]"
if: "github.actor == 'ergebnis-bot' && github.event_name == 'pull_request' && github.event.pull_request.title == 'Enhancement: Update license year'"
with:
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
85 changes: 85 additions & 0 deletions .github/workflows/license.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

name: "License"

on:
schedule:
- cron: "1 0 1 1 *"

env:
REQUIRED_PHP_EXTENSIONS: "mbstring"

jobs:
license:
name: "License"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.1"

dependencies:
- "locked"

steps:
- name: "Checkout"
uses: "actions/[email protected]"

- name: "Install PHP with extensions"
uses: "shivammathur/[email protected]"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

- name: "Validate composer.json and composer.lock"
run: "composer validate --strict"

- name: "Cache dependencies installed with composer"
uses: "actions/[email protected]"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install lowest dependencies with composer"
if: "matrix.dependencies == 'lowest'"
run: "composer update --no-interaction --no-progress --no-suggest --prefer-lowest"

- name: "Install locked dependencies with composer"
if: "matrix.dependencies == 'locked'"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Install highest dependencies with composer"
if: "matrix.dependencies == 'highest'"
run: "composer update --no-interaction --no-progress --no-suggest"

- name: "Create cache directory for friendsofphp/php-cs-fixer"
run: "mkdir -p .build/php-cs-fixer"

- name: "Cache cache directory for friendsofphp/php-cs-fixer"
uses: "actions/[email protected]"
with:
path: ".build/php-cs-fixer"
key: "php-${{ matrix.php-version }}-php-cs-fixer-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-php-cs-fixer-"

- name: "Run friendsofphp/php-cs-fixer"
run: "vendor/bin/php-cs-fixer fix --config=.php_cs --diff --diff-format=udiff --dry-run --verbose"

- name: "Open pull request updating license year"
uses: "gr2m/[email protected]"
with:
author: "ergebnis-bot <[email protected]>"
branch: "feature/license-year"
body: |
This PR

* [x] updates the license year
commit-message: "Enhancement: Update license year"
path: "."
title: "Enhancement: Update license year"
env:
GITHUB_TOKEN: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
24 changes: 14 additions & 10 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,30 @@
declare(strict_types=1);

/**
* Copyright (c) 2017 Andreas Möller
* Copyright (c) 2017-2020 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
* the LICENSE.md file that was distributed with this source code.
*
* @see https://github.com/ergebnis/test-util
*/

use Ergebnis\License;
use Ergebnis\PhpCsFixer\Config;

$header = <<<'EOF'
Copyright (c) 2017 Andreas Möller
$license = License\Type\MIT::markdown(
__DIR__ . '/LICENSE.md',
License\Range::since(
License\Year::fromString('2017'),
new \DateTimeZone('UTC')
),
License\Holder::fromString('Andreas Möller'),
License\Url::fromString('https://github.com/ergebnis/test-util')
);

For the full copyright and license information, please view
the LICENSE file that was distributed with this source code.
$license->save();

@see https://github.com/ergebnis/test-util
EOF;

$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php71($header));
$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php71($license->header()));

$config->getFinder()
->ignoreDotFiles(false)
Expand Down
4 changes: 2 additions & 2 deletions .php_cs.fixture
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
declare(strict_types=1);

/**
* Copyright (c) 2017 Andreas Möller
* Copyright (c) 2017-2020 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
* the LICENSE.md file that was distributed with this source code.
*
* @see https://github.com/ergebnis/test-util
*/
Expand Down
8 changes: 4 additions & 4 deletions LICENSE → LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
The MIT License (MIT)
# The MIT License (MIT)

Copyright (c) 2017 Andreas Möller
Copyright (c) 2017-2020 Andreas Möller

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
documentation files (the _Software_), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
THE SOFTWARE IS PROVIDED **AS IS**, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

[![Continuous Deployment](https://github.com/ergebnis/test-util/workflows/Continuous%20Deployment/badge.svg)](https://github.com/ergebnis/test-util/actions)
[![Continuous Integration](https://github.com/ergebnis/test-util/workflows/Continuous%20Integration/badge.svg)](https://github.com/ergebnis/test-util/actions)

[![Code Coverage](https://codecov.io/gh/ergebnis/test-util/branch/master/graph/badge.svg)](https://codecov.io/gh/ergebnis/test-util)
[![Type Coverage](https://shepherd.dev/github/ergebnis/test-util/coverage.svg)](https://shepherd.dev/github/ergebnis/test-util)

[![Latest Stable Version](https://poser.pugx.org/ergebnis/test-util/v/stable)](https://packagist.org/packages/ergebnis/test-util)
[![Total Downloads](https://poser.pugx.org/ergebnis/test-util/downloads)](https://packagist.org/packages/ergebnis/test-util)

Expand Down Expand Up @@ -73,8 +75,7 @@ For reference, see [`fzaninotto/faker`](https://github.com/fzaninotto/Faker).

### Additional Assertions

In addition to the assertions made available by extending from `PHPUnit\Framework\TestCase`,
the `Helper` trait provides the following assertions:
In addition to the assertions made available by extending from `PHPUnit\Framework\TestCase`, the `Helper` trait provides the following assertions:

* `assertClassesAreAbstractOrFinal(string $directory, array $excludeClassNames = [])`
* `assertClassesHaveTests(string $directory, string $namespace, string $testNamespace, array $excludeClassyNames = [])`
Expand Down Expand Up @@ -106,10 +107,8 @@ Please have a look at [`CODE_OF_CONDUCT.md`](https://github.com/ergebnis/.github

## License

This package is licensed using the MIT License.
This package is licensed using the [MIT License](LICENSE.md).

## Credits

The [`SrcCodeTest`](test/AutoReview/SrcCodeTest.php) in this and other
projects I maintain or contribute to is inspired by [`ProjectCodeTest`](https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v2.0.0/tests/ProjectCodeTest.php)
in [`friends-of-php/php-cs-fixer`](https://github.com/FriendsOfPHP/PHP-CS-Fixer), and was initially created by [Dariusz Rumiński](https://github.com/keradus).
The [`SrcCodeTest`](test/AutoReview/SrcCodeTest.php) in this and other projects I maintain or contribute to is inspired by [`ProjectCodeTest`](https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v2.0.0/tests/ProjectCodeTest.php) in [`friends-of-php/php-cs-fixer`](https://github.com/FriendsOfPHP/PHP-CS-Fixer), and was initially created by [Dariusz Rumiński](https://github.com/keradus).
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
},
"require-dev": {
"ergebnis/composer-normalize": "^2.2.2",
"ergebnis/license": "~0.1.0",
"ergebnis/php-cs-fixer-config": "^2.0.0",
"ergebnis/phpstan-rules": "~0.14.2",
"infection/infection": "~0.13.6",
Expand Down
60 changes: 59 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Exception/InvalidExcludeClassName.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
declare(strict_types=1);

/**
* Copyright (c) 2017 Andreas Möller
* Copyright (c) 2017-2020 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
* the LICENSE.md file that was distributed with this source code.
*
* @see https://github.com/ergebnis/test-util
*/
Expand Down
Loading