Skip to content

Commit a51c538

Browse files
GHA Workflow instead of TravisCI (#11)
1 parent 1283ea0 commit a51c538

File tree

5 files changed

+125
-67
lines changed

5 files changed

+125
-67
lines changed

.github/workflows/tests.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
on:
2+
pull_request:
3+
schedule:
4+
- cron: "0 0 * * *"
5+
6+
concurrency:
7+
group: ${{ github.head_ref || 'cron' }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
tests:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
php-version:
16+
- '8.1'
17+
- '8.0'
18+
- '7.4'
19+
- '7.3'
20+
- '7.2'
21+
- '7.1'
22+
- '7.0'
23+
mockery-version:
24+
- '1.5.0'
25+
- '1.4.0'
26+
- '1.3.0'
27+
- '1.2.0'
28+
- '1.1.0'
29+
- '1.0.0'
30+
- '0.9.0'
31+
- '0.8.0'
32+
33+
exclude:
34+
# PHP 8.1 Exclusions
35+
- php-version: '8.1'
36+
mockery-version: '1.3.0'
37+
- php-version: '8.1'
38+
mockery-version: '1.2.0'
39+
- php-version: '8.1'
40+
mockery-version: '1.1.0'
41+
- php-version: '8.1'
42+
mockery-version: '1.0.0'
43+
- php-version: '8.1'
44+
mockery-version: '0.9.0'
45+
- php-version: '8.1'
46+
mockery-version: '0.8.0'
47+
48+
# PHP 8.0 Exclusions
49+
- php-version: '8.0'
50+
mockery-version: '1.1.0'
51+
- php-version: '8.0'
52+
mockery-version: '1.0.0'
53+
- php-version: '8.0'
54+
mockery-version: '0.9.0'
55+
- php-version: '8.0'
56+
mockery-version: '0.8.0'
57+
58+
# PHP 7.4 Exclusions
59+
- php-version: '7.4'
60+
mockery-version: '1.1.0'
61+
- php-version: '7.4'
62+
mockery-version: '1.0.0'
63+
- php-version: '7.4'
64+
mockery-version: '0.9.0'
65+
- php-version: '7.4'
66+
mockery-version: '0.8.0'
67+
68+
# PHP 7.2 Exclusions
69+
- php-version: '7.2'
70+
mockery-version: '1.5.0'
71+
- php-version: '7.2'
72+
mockery-version: '1.4.0'
73+
74+
# PHP 7.1 Exclusions
75+
- php-version: '7.1'
76+
mockery-version: '1.5.0'
77+
- php-version: '7.1'
78+
mockery-version: '1.4.0'
79+
80+
# PHP 7.0 Exclusions
81+
- php-version: '7.0'
82+
mockery-version: '1.5.0'
83+
- php-version: '7.0'
84+
mockery-version: '1.4.0'
85+
86+
name: Mockery ${{ matrix.mockery-version }} on PHP ${{ matrix.php-version }}
87+
steps:
88+
- name: Checkout
89+
uses: actions/checkout@v2
90+
with:
91+
ref: ${{ github.head_ref }}
92+
93+
- name: Install PHP
94+
uses: shivammathur/setup-php@v2
95+
with:
96+
php-version: ${{ matrix.php-version }}
97+
ini-values: zend.assertions=1
98+
99+
- name: Install Dependencies
100+
run: composer require mockery/mockery:~${{ matrix.mockery-version }} squizlabs/php_codesniffer phpmd/phpmd cundd/test-flight
101+
102+
- name: PHPUnit
103+
run: vendor/bin/phpunit
104+
105+
- name: Test Flight
106+
if: matrix.php-version != '8.1'
107+
run: |
108+
vendor/bin/test-flight README.md
109+
vendor/bin/test-flight classes/
110+
111+
- name: PHPCS
112+
run: vendor/bin/phpcs --standard=PSR2 classes/ tests/
113+
114+
- name: PHPMD
115+
run: vendor/bin/phpmd classes/ text cleancode,codesize,controversial,design,naming,unusedcode

.travis.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
1+
[![.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)
2+
13
# Mock PHP built-in functions with Mockery
24

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

6-
# Installation
8+
## Installation
79

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

1012
```sh
1113
composer require --dev php-mock/php-mock-mockery
1214
```
1315

14-
# Usage
16+
## Usage
1517

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

21-
## Example
23+
### Example
2224

2325
```php
2426
namespace foo;
@@ -31,7 +33,7 @@ assert (3 == time());
3133
\Mockery::close();
3234
```
3335

34-
## Restrictions
36+
### Restrictions
3537

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

49-
# License and authors
51+
## License and authors
5052

5153
This project is free and under the WTFPL.
5254
Responsable for this project is Markus Malkusch markus@malkusch.de.
5355

54-
## Donations
56+
### Donations
5557

5658
If you like this project and feel generous donate a few Bitcoins here:
5759
[1335STSwu9hST4vcMRppEPgENMHD2r1REK](bitcoin:1335STSwu9hST4vcMRppEPgENMHD2r1REK)
58-
59-
[![Build Status](https://travis-ci.org/php-mock/php-mock-mockery.svg?branch=master)](https://travis-ci.org/php-mock/php-mock-mockery)

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"php-mock/php-mock-integration": "^2"
2323
},
2424
"require-dev": {
25-
"phpunit/phpunit": "^4|^5"
25+
"phpunit/phpunit": "^4|^5|^8"
2626
},
2727
"archive": {
2828
"exclude": ["/tests"]

tests/PHPMockeryTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@ protected function mockFunction($namespace, $functionName, callable $function)
3232
PHPMockery::mock($namespace, $functionName)->andReturnUsing($function);
3333
}
3434

35-
protected function setUp()
35+
protected function setUpCompat()
3636
{
37-
parent::setUp();
38-
3937
$this->workaroundMockeryIssue268();
4038
}
4139

0 commit comments

Comments
 (0)