-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from SimonFrings/test_suite
Update tests suite to PHPUnit 9.6 and improve documentation
- Loading branch information
Showing
10 changed files
with
106 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,6 @@ | |
"email": "[email protected]" | ||
} | ||
], | ||
"autoload": { | ||
"psr-4": { "Clue\\React\\Sse\\": "src/" } | ||
}, | ||
"require": { | ||
"php": ">=5.3", | ||
"react/event-loop": "^1.0", | ||
|
@@ -21,6 +18,16 @@ | |
}, | ||
"require-dev": { | ||
"clue/redis-react": "^2.4", | ||
"phpunit/phpunit": "^5.0 || ^4.8" | ||
"phpunit/phpunit": "^9.6 || ^7.5 || ^4.8.36" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Clue\\React\\Sse\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Clue\\React\\Tests\\Sse\\": "tests/" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit bootstrap="tests/bootstrap.php" | ||
<!-- PHPUnit configuration file with new format for PHPUnit 9.6+ --> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd" | ||
bootstrap="vendor/autoload.php" | ||
cacheResult="false" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
> | ||
convertDeprecationsToExceptions="true"> | ||
<testsuites> | ||
<testsuite name="SSE Test Suite"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist> | ||
<coverage> | ||
<include> | ||
<directory>./src/</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> | ||
</include> | ||
</coverage> | ||
<php> | ||
<ini name="error_reporting" value="-1" /> | ||
</php> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- PHPUnit configuration file with old format for legacy PHPUnit --> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/4.8/phpunit.xsd" | ||
bootstrap="vendor/autoload.php" | ||
colors="true"> | ||
<testsuites> | ||
<testsuite name="SSE Test Suite"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist> | ||
<directory>./src/</directory> | ||
</whitelist> | ||
</filter> | ||
<php> | ||
<ini name="error_reporting" value="-1" /> | ||
</php> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace Clue\React\Tests\Sse; | ||
|
||
use PHPUnit\Framework\TestCase as BaseTestCase; | ||
|
||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
class TestCase extends BaseTestCase | ||
{ | ||
protected function expectCallableOnce() | ||
{ | ||
$mock = $this->createCallableMock(); | ||
|
||
$mock | ||
->expects($this->once()) | ||
->method('__invoke'); | ||
|
||
return $mock; | ||
} | ||
|
||
protected function createCallableMock() | ||
{ | ||
if (method_exists('PHPUnit\Framework\MockObject\MockBuilder', 'addMethods')) { | ||
// PHPUnit 9+ | ||
return $this->getMockBuilder('stdClass')->addMethods(array('__invoke'))->getMock(); | ||
} else { | ||
// legacy PHPUnit 4 - PHPUnit 8 | ||
return $this->getMockBuilder('stdClass')->setMethods(array('__invoke'))->getMock(); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.