Skip to content

PHP 8.0 support - update dependencies #8

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
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
27 changes: 27 additions & 0 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Check Coding Standards"

on:
pull_request:
push:

jobs:
coding-standards:
name: "Check Coding Standards"

runs-on: "ubuntu-latest"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Setup PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "7.4"
tools: composer:v2, cs2pr

- name: "Install dependencies"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Run phpcs"
run: vendor/bin/phpcs -q --report=checkstyle | cs2pr
27 changes: 27 additions & 0 deletions .github/workflows/phpmd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Check phpmd"

on:
pull_request:
push:

jobs:
coding-standards:
name: "Check phpmd"

runs-on: "ubuntu-latest"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Setup PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "7.4"
tools: composer:v2

- name: "Install dependencies"
run: "composer require phpmd/phpmd --no-interaction --no-progress --no-suggest"

- name: "Run phpmd"
run: vendor/bin/phpmd classes/ text cleancode,codesize,controversial,design,naming,unusedcode
46 changes: 46 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "PHPUnit tests"

on:
pull_request:
push:

jobs:
phpunit:
name: PHPUnit tests on PHP ${{ matrix.php-version }}

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.2"
- "7.3"
- "7.4"
- "8.0"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
php-version: "${{ matrix.php-version }}"
ini-values: memory_limit=-1
tools: composer:v2

- name: "Cache dependencies"
uses: "actions/cache@v2"
with:
path: |
~/.composer/cache
vendor
key: "php-${{ matrix.php-version }}"
restore-keys: "php-${{ matrix.php-version }}"

- name: "Install dependencies"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Tests"
run: vendor/bin/phpunit
30 changes: 30 additions & 0 deletions .github/workflows/test-flight.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "Check test-flight"

on:
pull_request:
push:

jobs:
coding-standards:
name: "Check test-flight"

runs-on: "ubuntu-latest"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Setup PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "7.4"
tools: composer:v2
ini-values: "zend.assertions=1"

- name: "Install dependencies"
run: "composer require cundd/test-flight --no-interaction --no-progress --no-suggest"

- name: "Run test-flight"
run: |
vendor/bin/test-flight README.md
vendor/bin/test-flight classes/
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.phpunit.result.cache
/composer.lock
/vendor/
59 changes: 0 additions & 59 deletions .travis.yml

This file was deleted.

2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,3 @@ Responsable for this project is Markus Malkusch markus@malkusch.de.

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-prophecy.svg?branch=master)](https://travis-ci.org/php-mock/php-mock-prophecy)
12 changes: 6 additions & 6 deletions classes/FunctionProphecy.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@
*/
final class FunctionProphecy implements ProphecyInterface
{

/**
* @var Prophet The prophet.
*/
private $prophet;

/**
* @var string The namespace.
*/
private $namespace;

/**
* @var Revelation[] The delegated prophecies.
*/
private $revelations = [];

/**
* Sets the prophet.
*
Expand All @@ -44,7 +44,7 @@ public function __construct($namespace, Prophet $prophet)
$this->prophet = $prophet;
$this->namespace = $namespace;
}

/**
* Creates a new function prophecy using the specified function name
* and arguments.
Expand All @@ -62,7 +62,7 @@ public function __call($functionName, array $arguments)
$this->revelations[] = new Revelation($this->namespace, $functionName, $prophecy);
return $prophecy->__call(MockDelegateFunctionBuilder::METHOD, $arguments);
}

/**
* Reveals the function prophecies.
*
Expand Down
12 changes: 6 additions & 6 deletions classes/PHPProphet.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ final class PHPProphet
* @var Prophet The prophet.
*/
private $prophet;

/**
* Builds the prophet.
*
Expand All @@ -50,12 +50,12 @@ public function __construct(Prophet $prophet = null)
if (is_null($prophet)) {
$prophet = new Prophet();
}

$revealer = new ReferencePreservingRevealer(self::getProperty($prophet, "revealer"));
$util = self::getProperty($prophet, "util");
$this->prophet = new Prophet($prophet->getDoubler(), $revealer, $util);
}

/**
* Creates a new function prophecy for a given namespace.
*
Expand All @@ -67,7 +67,7 @@ public function prophesize($namespace)
{
return new FunctionProphecy($namespace, $this->prophet);
}

/**
* Checks all predictions defined by prophecies of this Prophet.
*
Expand All @@ -81,7 +81,7 @@ public function checkPredictions()
Mock::disableAll();
$this->prophet->checkPredictions();
}

/**
* Defines the function prophecy in the given namespace.
*
Expand Down Expand Up @@ -110,7 +110,7 @@ public static function define($namespace, $name)
->build()
->define();
}

/**
* Returns a private property of a prophet.
*
Expand Down
4 changes: 2 additions & 2 deletions classes/ReferencePreservingRevealer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
*/
final class ReferencePreservingRevealer implements RevealerInterface
{

/**
* @var RevealerInterface The subject.
*/
private $revealer;

/**
* Sets the subject.
*
Expand Down
4 changes: 2 additions & 2 deletions classes/Revelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class Revelation implements ProphecyInterface
* @var ProphecyInterface The prophecy.
*/
private $prophecy;

/**
* Builds the revelation.
*
Expand All @@ -45,7 +45,7 @@ public function __construct($namespace, $functionName, ProphecyInterface $prophe
$this->functionName = $functionName;
$this->prophecy = $prophecy;
}

/**
* Reveals the function prophecy.
*
Expand Down
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@
}
},
"require": {
"php": ">=5.6",
"php-mock/php-mock-integration": "^1",
"phpspec/prophecy": "^1"
"php": ">=7.2",
"php-mock/php-mock-integration": "^2",
"phpspec/prophecy": "^1.12.1"
},
"require-dev": {
"phpunit/phpunit": "^4|^5"
"phpunit/phpunit": "^8.5.13 || ^9.5",
"squizlabs/php_codesniffer": "^3.5"
},
"archive": {
"exclude": ["/tests"]
Expand Down
10 changes: 10 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<ruleset name="Coding Standards">
<rule ref="PSR12"/>

<arg name="colors"/>
<arg value="p"/>

<file>classes</file>
<file>tests</file>
</ruleset>
6 changes: 3 additions & 3 deletions tests/PHPProphetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
* @license http://www.wtfpl.net/txt/copying/ WTFPL
* @see PHPProphet
*/
class PHPProphetTest extends AbstractMockTest
final class PHPProphetTest extends AbstractMockTest
{

/**
* @var PHPProphet The SUT.
*/
private $prophet;

protected function setup()
protected function setUp(): void
{
parent::setUp();

Expand Down
Loading