Skip to content

GHA Workflow instead of TravisCI #11

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

Merged
merged 13 commits into from
Jan 25, 2022
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
115 changes: 115 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
on:
pull_request:
schedule:
- cron: "0 0 * * *"

concurrency:
group: ${{ github.head_ref || 'cron' }}
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- '8.1'
- '8.0'
- '7.4'
- '7.3'
- '7.2'
- '7.1'
- '7.0'
mockery-version:
- '1.5.0'
- '1.4.0'
- '1.3.0'
- '1.2.0'
- '1.1.0'
- '1.0.0'
- '0.9.0'
- '0.8.0'

exclude:
# PHP 8.1 Exclusions
- php-version: '8.1'
mockery-version: '1.3.0'
- php-version: '8.1'
mockery-version: '1.2.0'
- php-version: '8.1'
mockery-version: '1.1.0'
- php-version: '8.1'
mockery-version: '1.0.0'
- php-version: '8.1'
mockery-version: '0.9.0'
- php-version: '8.1'
mockery-version: '0.8.0'

# PHP 8.0 Exclusions
- php-version: '8.0'
mockery-version: '1.1.0'
- php-version: '8.0'
mockery-version: '1.0.0'
- php-version: '8.0'
mockery-version: '0.9.0'
- php-version: '8.0'
mockery-version: '0.8.0'

# PHP 7.4 Exclusions
- php-version: '7.4'
mockery-version: '1.1.0'
- php-version: '7.4'
mockery-version: '1.0.0'
- php-version: '7.4'
mockery-version: '0.9.0'
- php-version: '7.4'
mockery-version: '0.8.0'

# PHP 7.2 Exclusions
- php-version: '7.2'
mockery-version: '1.5.0'
- php-version: '7.2'
mockery-version: '1.4.0'

# PHP 7.1 Exclusions
- php-version: '7.1'
mockery-version: '1.5.0'
- php-version: '7.1'
mockery-version: '1.4.0'

# PHP 7.0 Exclusions
- php-version: '7.0'
mockery-version: '1.5.0'
- php-version: '7.0'
mockery-version: '1.4.0'

name: Mockery ${{ matrix.mockery-version }} on PHP ${{ matrix.php-version }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
ini-values: zend.assertions=1

- name: Install Dependencies
run: composer require mockery/mockery:~${{ matrix.mockery-version }} squizlabs/php_codesniffer phpmd/phpmd cundd/test-flight

- name: PHPUnit
run: vendor/bin/phpunit

- name: Test Flight
if: matrix.php-version != '8.1'
run: |
vendor/bin/test-flight README.md
vendor/bin/test-flight classes/

- name: PHPCS
run: vendor/bin/phpcs --standard=PSR2 classes/ tests/

- name: PHPMD
run: vendor/bin/phpmd classes/ text cleancode,codesize,controversial,design,naming,unusedcode
55 changes: 0 additions & 55 deletions .travis.yml

This file was deleted.

16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
[![.github/workflows/tests.yml](https://github.com/php-mock/php-mock-mockery/actions/workflows/tests.yml/badge.svg)](https://github.com/php-mock/php-mock-mockery/actions/workflows/tests.yml)

# Mock PHP built-in functions with Mockery

This package integrates the function mock library
[PHP-Mock](https://github.com/php-mock/php-mock) with Mockery.

# Installation
## Installation

Use [Composer](https://getcomposer.org/):

```sh
composer require --dev php-mock/php-mock-mockery
```

# Usage
## Usage

[`PHPMockery::mock()`](http://php-mock.github.io/php-mock-mockery/api/class-phpmock.mockery.PHPMockery.html#_mock)
let's you build a function mock which can be equiped
with Mockery's expectations. After your test you'll have to disable all created
function mocks by calling `Mockery::close()`.

## Example
### Example

```php
namespace foo;
Expand All @@ -31,7 +33,7 @@ assert (3 == time());
\Mockery::close();
```

## Restrictions
### Restrictions

This library comes with the same restrictions as the underlying
[`php-mock`](https://github.com/php-mock/php-mock#requirements-and-restrictions):
Expand All @@ -46,14 +48,12 @@ This library comes with the same restrictions as the underlying
this issue you can call [`PHPMockery::define()`](http://php-mock.github.io/php-mock-mockery/api/class-phpmock.mockery.PHPMockery.html#_define)
before that first call. This would define a side effectless namespaced function.

# License and authors
## License and authors

This project is free and under the WTFPL.
Responsable for this project is Markus Malkusch [email protected].

## Donations
### Donations

If you like this project and feel generous donate a few Bitcoins here:
[1335STSwu9hST4vcMRppEPgENMHD2r1REK](bitcoin:1335STSwu9hST4vcMRppEPgENMHD2r1REK)

[![Build Status](https://travis-ci.org/php-mock/php-mock-mockery.svg?branch=master)](https://travis-ci.org/php-mock/php-mock-mockery)
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"php-mock/php-mock-integration": "^2"
},
"require-dev": {
"phpunit/phpunit": "^4|^5"
"phpunit/phpunit": "^4|^5|^8"
},
"archive": {
"exclude": ["/tests"]
Expand Down
4 changes: 1 addition & 3 deletions tests/PHPMockeryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ protected function mockFunction($namespace, $functionName, callable $function)
PHPMockery::mock($namespace, $functionName)->andReturnUsing($function);
}

protected function setUp()
protected function setUpCompat()
{
parent::setUp();

$this->workaroundMockeryIssue268();
}

Expand Down