Skip to content

Commit

Permalink
update php 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
HillLiu committed Feb 23, 2023
1 parent 8a1a922 commit 570ee5c
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 43 deletions.
12 changes: 8 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ jobs:
name: PHPUnit
command: |
ENABLE_COVERAGE=false
if [ "<< parameters.php-version >>" == "8.1" ] && [ "$ENABLE_COVERAGE" == "true" ]; then
XDEBUG_MODE=coverage phpunit --coverage-clover clover.xml
coveralls --coverage_clover=clover.xml -v -o coveralls-upload.json
if [ "<< parameters.php-version >>" == "8.2" ]; then
if [ "$ENABLE_COVERAGE" == "true" ]; then
XDEBUG_MODE=coverage phpunit --coverage-clover clover.xml
coveralls --coverage_clover=clover.xml -v -o coveralls-upload.json
else
phpunit --display-deprecations
fi
else
phpunit
fi
Expand All @@ -47,4 +51,4 @@ workflows:
- unittest:
matrix:
parameters:
php-version: ["8.1", "8.0", "5.6"]
php-version: ["8.2", "8.1", "8.0", "5.6"]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ vendor
composer.lock
.php_cs.cache
.phpunit.result.cache
.phpunit.cache
.*.sw?
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Latest Stable Version](https://poser.pugx.org/pmvc-plugin/dispatcher/v/stable)](https://packagist.org/packages/pmvc-plugin/dispatcher)
[![Latest Unstable Version](https://poser.pugx.org/pmvc-plugin/dispatcher/v/unstable)](https://packagist.org/packages/pmvc-plugin/dispatcher)
[![CircleCI](https://circleci.com/gh/pmvc-plugin/dispatcher/tree/master.svg?style=svg)](https://circleci.com/gh/pmvc-plugin/dispatcher/tree/master)
[![CircleCI](https://circleci.com/gh/pmvc-plugin/dispatcher/tree/main.svg?style=svg)](https://circleci.com/gh/pmvc-plugin/dispatcher/tree/main)
[![License](https://poser.pugx.org/pmvc-plugin/dispatcher/license)](https://packagist.org/packages/pmvc-plugin/dispatcher)
[![Total Downloads](https://poser.pugx.org/pmvc-plugin/dispatcher/downloads)](https://packagist.org/packages/pmvc-plugin/dispatcher)

Expand All @@ -19,7 +19,7 @@ PMVC Dispatcher / Observable Plugin
```
{
"require": {
"pmvc-plugin/dispatcher": "dev-master"
"pmvc-plugin/dispatcher": "dev-main"
}
}
```
Expand Down
49 changes: 23 additions & 26 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
bootstrap="tests/include.php"
convertErrorsToExceptions="false"
convertNoticesToExceptions="false"
convertWarningsToExceptions="false"
processIsolation="false"
stopOnFailure="false"
>
<testsuites>
<testsuite name="Application Test Suite">
<directory>./tests/</directory>
<file>./tests/test.php</file>
</testsuite>
</testsuites>
<php>
<ini name="error_reporting" value="E_ALL"/>
<ini name="display_errors" value="true"/>
<ini name="display_startup_errors" value="true"/>
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
</php>
<?xml version="1.0" encoding="UTF-8" ?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="tests/include.php"
processIsolation="false"
stopOnFailure="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
>
<testsuites>
<testsuite name="Application Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<php>
<ini name="error_reporting" value="E_ALL" />
<ini name="display_errors" value="true" />
<ini name="display_startup_errors" value="true" />
<env name="APP_ENV" value="testing" />
</php>
</phpunit>
22 changes: 11 additions & 11 deletions tests/test.php → tests/ObserverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ function testFireEvent()
$event = 'Test';
$dispatcher = PMVC\plug($this->_plug);

$mockObserver = $this->getMockBuilder(__NAMESPACE__.'\MockObserver')
->setMethods(['on'.$event])
$mockObserver = $this->getPMVCMockBuilder(__NAMESPACE__.'\MockObserver')
->pmvc_onlyMethods(['on'.$event])
->getMock();
$mockObserver->expects($this->once())
->method('on'.$event);
Expand All @@ -39,8 +39,8 @@ public function testFireWithoutClean()
$event = 'Test';
$dispatcher = PMVC\plug($this->_plug);

$mockObserver = $this->getMockBuilder(__NAMESPACE__.'\MockObserver')
->setMethods(['on'.$event])
$mockObserver = $this->getPMVCMockBuilder(__NAMESPACE__.'\MockObserver')
->pmvc_onlyMethods(['on'.$event])
->getMock();
$mockObserver->expects($this->once())
->method('on'.$event);
Expand All @@ -54,8 +54,8 @@ public function testFireWithClean()
$event = 'Test';
$dispatcher = PMVC\plug($this->_plug);

$mockObserver = $this->getMockBuilder(__NAMESPACE__.'\MockObserver')
->setMethods(['on'.$event])
$mockObserver = $this->getPMVCMockBuilder(__NAMESPACE__.'\MockObserver')
->pmvc_onlyMethods(['on'.$event])
->getMock();
$mockObserver->expects($this->once())
->method('on'.$event);
Expand All @@ -68,8 +68,8 @@ function testFireEventBySetOption()
{
$key = 'foo';
$dispatcher = PMVC\plug($this->_plug);
$mockObserver = $this->getMockBuilder(__NAMESPACE__.'\MockObserver')->
setMethods([
$mockObserver = $this->getPMVCMockBuilder(__NAMESPACE__.'\MockObserver')->
pmvc_onlyMethods([
'on'.$dispatcher->getOptionKey(),
'on'.$dispatcher->getOptionKey($key)
])->
Expand All @@ -87,8 +87,8 @@ function testAttachAfter()
{
$event = 'Test';
$dispatcher = PMVC\plug($this->_plug);
$mockObserver = $this->getMockBuilder(__NAMESPACE__.'\MockObserver')
->setMethods(['on'.$event])
$mockObserver = $this->getPMVCMockBuilder(__NAMESPACE__.'\MockObserver')
->pmvc_onlyMethods(['on'.$event])
->getMock();
$mockObserver->expects($this->once())
->method('on'.$event);
Expand Down Expand Up @@ -198,7 +198,7 @@ function onSetConfig()

}

function onSetConfig__foo()
function onSetConfig_foo()
{

}
Expand Down

0 comments on commit 570ee5c

Please sign in to comment.