Skip to content

Commit

Permalink
Merge 1.6.x branch into main (#1277)
Browse files Browse the repository at this point in the history
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
  • Loading branch information
ghostwriter committed Jun 6, 2023
2 parents 612a8f9 + 24f373d commit 84670f3
Show file tree
Hide file tree
Showing 56 changed files with 7,322 additions and 199 deletions.
55 changes: 55 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Docs https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#creating-issue-forms
name: Bug report
description: File a bug report to help us improve Mockery
labels:
- bug
- triage
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: input
attributes:
label: Mockery Version
description: What version of Mockery do you have installed?
validations:
required: true
- type: dropdown
attributes:
label: PHP Version
description: What version of PHP do you have installed?
multiple: true
options:
- PHP 8.0
- PHP 8.1
- PHP 8.2
- PHP 8.3
validations:
required: true
- type: textarea
attributes:
label: Issue Description
description: Please describe the issue you are experiencing.
validations:
required: true
- type: textarea
attributes:
label: Steps to Reproduce
description: Please provide clear steps to reproduce the issue, if applicable.
- type: textarea
attributes:
label: Expected Behavior
description: Please describe what you expected to happen.
- type: textarea
attributes:
label: Actual Behavior
description: Please describe what actually happened.
- type: textarea
attributes:
label: Exception or Error
description: Please provide error logs, if applicable.
- type: textarea
attributes:
label: Additional Information
description: Please provide any additional information that may be helpful in resolving this issue.
31 changes: 31 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Codecov
on:
pull_request:
push:
branches:
- "[0-9]+.[0-9]+.x"

jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up php 8.1
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'

- name: Install dependencies
run: composer self-update && composer install && composer dump-autoload

- name: Run tests and collect coverage
run: composer phpunit

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ${{ github.workspace }}/.cache/phpunit/
verbose: true
33 changes: 33 additions & 0 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Psalm Static analysis

on:
pull_request:
push:
branches:
- "[0-9]+.[0-9]+.x"
# Allow manually triggering the workflow.
workflow_dispatch:

concurrency:
group: psalm-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
psalm:
name: Psalm
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up php
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
coverage: xdebug

- name: Install dependencies
run: composer install

- name: Run Psalm
run: composer psalm
23 changes: 13 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Tests

on:
push:
pull_request:
push:
branches:
- "[0-9]+.[0-9]+.x"
# Allow manually triggering the workflow.
workflow_dispatch:

Expand All @@ -13,13 +15,14 @@ jobs:

strategy:
matrix:
php: ['7.4', '8.0', '8.1', '8.2']
php: ['7.4', '8.0', '8.1', '8.2', '8.3']
dev: ['8.3']

continue-on-error: ${{ matrix.php == '8.2' }}
continue-on-error: ${{ matrix.php == matrix.dev }}

steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
Expand All @@ -34,20 +37,20 @@ jobs:
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Install Dependencies
if: ${{ matrix.php != '8.2' }}
uses: nick-invision/retry@v1
if: ${{ matrix.php != matrix.dev }}
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --no-interaction --no-progress

- name: Install Dependencies (ignore platform)
if: ${{ matrix.php == '8.2' }}
uses: nick-invision/retry@v1
- name: Install Dependencies (ignore platform php:${{ matrix.dev }})
if: ${{ matrix.php == matrix.dev }}
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --no-interaction --no-progress --ignore-platform-req=php

- name: Execute PHPUnit
run: vendor/bin/phpunit
run: vendor/bin/phpunit
24 changes: 12 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
*~
pearfarm.spec
*.sublime-project
library/Hamcrest/*
composer.lock
vendor/
composer.phar
test.php
build/
phpunit.xml
*.DS_store
*.sublime-project
*~
.cache/
.idea/*
.php_cs.cache
.phpdoc/
.phpunit.result.cache
build/
composer.phar
docs/api
library/Hamcrest/*
pearfarm.spec
phpDocumentor.phar*
.phpunit.result.cache
.phpdoc/
phpunit.xml
test.php
vendor/
31 changes: 31 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

use Symfony\CS\Config\Config;
use Symfony\CS\Finder\DefaultFinder;

if (class_exists('PhpCsFixer\Finder')) { // PHP-CS-Fixer 2.x
$finder = PhpCsFixer\Finder::create()->in([
'library',
'tests',
]);


return (new PhpCsFixer\Config())
->setRules(array(
'@PSR2' => true,
))
->setUsingCache(true)
->setFinder($finder)
;
}

$finder = DefaultFinder::create()->in(
[
'library',
'tests',
]);

return Config::create()
->level('psr2')
->setUsingCache(true)
->finder($finder);
38 changes: 35 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,40 @@
# Change Log

## 1.5.2 (2022-xx-xx)

* Updated changelog for version 1.5.1 to include changes from #1180
## 1.6.1 (2023-06-05)

* [#1267 Drops support for PHP <7.4](https://github.com/mockery/mockery/pull/1267)
* [#1192 Updated changelog for version 1.5.1 to include changes from #1180](https://github.com/mockery/mockery/pull/1192)
* [#1196 Update example in README.md](https://github.com/mockery/mockery/pull/1196)
* [#1199 Fix function parameter default enum value](https://github.com/mockery/mockery/pull/1199)
* [#1205 Deal with null type in PHP8.2](https://github.com/mockery/mockery/pull/1205)
* [#1208 Import MockeryTestCase fully qualified class name](https://github.com/mockery/mockery/pull/1208)
* [#1210 Add support for target class attributes](https://github.com/mockery/mockery/pull/1210)
* [#1212 docs: Add missing comma](https://github.com/mockery/mockery/pull/1212)
* [#1216 Fixes code generation for intersection types](https://github.com/mockery/mockery/pull/1216)
* [#1217 Add MockeryExceptionInterface](https://github.com/mockery/mockery/pull/1217)
* [#1218 tidy: avoids require](https://github.com/mockery/mockery/pull/1218)
* [#1222 Add .editorconfig](https://github.com/mockery/mockery/pull/1222)
* [#1225 Switch to PSR-4 autoload](https://github.com/mockery/mockery/pull/1225)
* [#1226 Refactoring risky tests](https://github.com/mockery/mockery/pull/1226)
* [#1230 Add vimeo/psalm and psalm/plugin-phpunit](https://github.com/mockery/mockery/pull/1230)
* [#1232 Split PHPUnit TestSuites for PHP 8.2](https://github.com/mockery/mockery/pull/1232)
* [#1233 Bump actions/checkout to v3](https://github.com/mockery/mockery/pull/1233)
* [#1234 Bump nick-invision/retry to v2](https://github.com/mockery/mockery/pull/1234)
* [#1235 Setup Codecov for code coverage](https://github.com/mockery/mockery/pull/1235)
* [#1236 Add Psalm CI Check](https://github.com/mockery/mockery/pull/1236)
* [#1237 Unignore composer.lock file](https://github.com/mockery/mockery/pull/1237)
* [#1239 Prevent CI run duplication](https://github.com/mockery/mockery/pull/1239)
* [#1241 Add PHPUnit workflow for PHP 8.3](https://github.com/mockery/mockery/pull/1241)
* [#1244 Improve ClassAttributesPass for Dynamic Properties](https://github.com/mockery/mockery/pull/1244)
* [#1245 Deprecate hamcrest/hamcrest-php package](https://github.com/mockery/mockery/pull/1245)
* [#1246 Add BUG_REPORT.yml Issue template](https://github.com/mockery/mockery/pull/1246)
* [#1250 Deprecate PHP <=8.0](https://github.com/mockery/mockery/issues/1250)
* [#1253 Prevent array to string conversion when serialising a Subset matcher](https://github.com/mockery/mockery/issues/1253)

## 1.6.0 (2023-06-05) [DELETED]

This tag was deleted due to a mistake with the composer.json PHP version
constraint, see [#1266](https://github.com/mockery/mockery/issues/1266)

## 1.3.6 (2022-09-07)
* PHP 8.2 | Fix "Use of "parent" in callables is deprecated" notice #1169
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ To run the unit tests for Mockery, clone the git repository, download Composer u
the instructions at [http://getcomposer.org/download/](http://getcomposer.org/download/),
then install the dependencies with `php /path/to/composer.phar install`.

This will install the required PHPUnit and Hamcrest dev dependencies and create the
This will install the required dev dependencies and create the
autoload files required by the unit tests. You may run the `vendor/bin/phpunit` command
to run the unit tests. If everything goes to plan, there will be no failed tests!

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ Mockery
=======

[![Build Status](https://github.com/mockery/mockery/actions/workflows/tests.yml/badge.svg)](https://github.com/mockery/mockery/actions)
[![Supported PHP Version](https://badgen.net/packagist/php/mockery/mockery?color=8892bf)](https://www.php.net/supported-versions)
[![Code Coverage](https://codecov.io/gh/mockery/mockery/branch/1.6.x/graph/badge.svg?token=oxHwVM56bT)](https://codecov.io/gh/mockery/mockery)
[![Type Coverage](https://shepherd.dev/github/mockery/mockery/coverage.svg)](https://shepherd.dev/github/mockery/mockery)
[![Latest Stable Version](https://poser.pugx.org/mockery/mockery/v/stable.svg)](https://packagist.org/packages/mockery/mockery)
[![Total Downloads](https://poser.pugx.org/mockery/mockery/downloads.svg)](https://packagist.org/packages/mockery/mockery)

Expand Down
6 changes: 6 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
comment:
layout: "diff, files"
behavior: default
require_changes: true # if true: only post the comment if coverage changes
require_base: yes # [yes :: must have a base report to post]
require_head: yes # [yes :: must have a head report to post]

0 comments on commit 84670f3

Please sign in to comment.