Merge branch 'master' into v0.3.1
This commit is contained in:
commit
0473a4c224
43
.github/workflows/ci.yml
vendored
Normal file
43
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
PHPUnit:
|
||||
name: PHPUnit (PHP ${{ matrix.php }})(${{ matrix.env }})
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
env:
|
||||
- client
|
||||
- server
|
||||
php:
|
||||
- 7.4
|
||||
- 7.3
|
||||
- 7.2
|
||||
- 7.1
|
||||
- 7.0
|
||||
- 5.6
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php }}
|
||||
coverage: xdebug
|
||||
- run: docker pull crossbario/autobahn-testsuite
|
||||
- run: composer install
|
||||
|
||||
- run: sh tests/ab/run_ab_tests.sh
|
||||
env:
|
||||
ABTEST: ${{ matrix.env }}
|
||||
SKIP_DEFLATE: _skip_deflate
|
||||
if: ${{ matrix.php <= 5.6 }}
|
||||
|
||||
- run: sh tests/ab/run_ab_tests.sh
|
||||
env:
|
||||
ABTEST: ${{ matrix.env }}
|
||||
if: ${{ matrix.php >= 7.0 }}
|
||||
- run: vendor/bin/phpunit --verbose
|
30
.travis.yml
30
.travis.yml
@ -1,30 +0,0 @@
|
||||
language: php
|
||||
|
||||
services: docker
|
||||
|
||||
php:
|
||||
- 5.6
|
||||
- 7.0
|
||||
- 7.1
|
||||
- 7.2
|
||||
- 7.3
|
||||
- 7.4
|
||||
- nightly
|
||||
|
||||
env:
|
||||
- ABTEST=client
|
||||
- ABTEST=server
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- php: nightly
|
||||
|
||||
before_install:
|
||||
- docker pull crossbario/autobahn-testsuite
|
||||
|
||||
before_script:
|
||||
- composer install
|
||||
- sh tests/ab/run_ab_tests.sh
|
||||
|
||||
script:
|
||||
- vendor/bin/phpunit
|
@ -1,6 +1,6 @@
|
||||
# RFC6455 - The WebSocket Protocol
|
||||
|
||||
[](https://travis-ci.org/ratchetphp/RFC6455)
|
||||
[](https://github.com/ratchetphp/RFC6455/actions)
|
||||
[](http://socketo.me/reports/rfc-server/index.html)
|
||||
|
||||
This library a protocol handler for the RFC6455 specification.
|
||||
|
@ -12,11 +12,13 @@ class Message implements \IteratorAggregate, MessageInterface {
|
||||
*/
|
||||
private $len;
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function __construct() {
|
||||
$this->_frames = new \SplDoublyLinkedList;
|
||||
$this->len = 0;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function getIterator() {
|
||||
return $this->_frames;
|
||||
}
|
||||
@ -24,6 +26,7 @@ class Message implements \IteratorAggregate, MessageInterface {
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function count() {
|
||||
return count($this->_frames);
|
||||
}
|
||||
@ -31,6 +34,7 @@ class Message implements \IteratorAggregate, MessageInterface {
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function isCoalesced() {
|
||||
if (count($this->_frames) == 0) {
|
||||
return false;
|
||||
|
@ -1,14 +1,6 @@
|
||||
set -x
|
||||
cd tests/ab
|
||||
|
||||
SKIP_DEFLATE=
|
||||
if [ "$TRAVIS" = "true" ]; then
|
||||
if [ $(phpenv version-name) = "hhvm" -o $(phpenv version-name) = "5.4" -o $(phpenv version-name) = "5.5" -o $(phpenv version-name) = "5.6" ]; then
|
||||
echo "Skipping deflate autobahn tests for $(phpenv version-name)"
|
||||
SKIP_DEFLATE=_skip_deflate
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$ABTEST" = "client" ]; then
|
||||
docker run --rm \
|
||||
-d \
|
||||
|
@ -321,7 +321,11 @@ class MessageBufferTest extends TestCase
|
||||
* @requires PHP 7.0
|
||||
*/
|
||||
public function testIniSizes($phpConfigurationValue, $expectedLimit) {
|
||||
ini_set('memory_limit', $phpConfigurationValue);
|
||||
$value = @ini_set('memory_limit', $phpConfigurationValue);
|
||||
if ($value === false) {
|
||||
$this->markTestSkipped("Does not support setting the memory_limit lower than current memory_usage");
|
||||
}
|
||||
|
||||
$messageBuffer = new MessageBuffer(
|
||||
new CloseFrameChecker(),
|
||||
function (Message $message) {},
|
||||
@ -348,7 +352,11 @@ class MessageBufferTest extends TestCase
|
||||
* @requires PHP 7.0
|
||||
*/
|
||||
public function testInvalidIniSize() {
|
||||
ini_set('memory_limit', 'lots of memory');
|
||||
$value = @ini_set('memory_limit', 'lots of memory');
|
||||
if ($value === false) {
|
||||
$this->markTestSkipped("Does not support setting the memory_limit lower than current memory_usage");
|
||||
}
|
||||
|
||||
$messageBuffer = new MessageBuffer(
|
||||
new CloseFrameChecker(),
|
||||
function (Message $message) {},
|
||||
|
Loading…
Reference in New Issue
Block a user