From c8eea9bdc95567eeea00a241fe534932e7951f3c Mon Sep 17 00:00:00 2001 From: freek Date: Wed, 4 Mar 2020 10:58:17 +0100 Subject: [PATCH] wip --- .github/workflows/run-tests.yml | 48 +++++++++++++++++++ .travis.yml | 21 -------- README.md | 2 +- composer.json | 22 ++++----- .../WebSocketsStatisticsControllerTest.php | 2 +- 5 files changed, 61 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/run-tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 0000000..a925ac3 --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,48 @@ +name: run-tests + +on: [push, pull_request] + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + php: [7.4] + laravel: [5.8.*, 6.*, 7.*] + dependency-version: [prefer-lowest, prefer-stable] + include: + - laravel: 7.* + testbench: 5.* + - laravel: 6.* + testbench: 4.* + - laravel: 5.8.* + testbench: 3.8.* + + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v1 + + - name: Cache dependencies + uses: actions/cache@v1 + with: + path: ~/.composer/cache/files + key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick + coverage: none + + - name: Install dependencies + run: | + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest + + - name: Execute tests + run: vendor/bin/phpunit diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 24c2d6c..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: php - -php: - - 7.1 - - 7.2 - - 7.3 - -env: - matrix: - - COMPOSER_FLAGS="--prefer-lowest" - - COMPOSER_FLAGS="" - -before_script: - - travis_retry composer self-update - - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source - -script: - - vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover - -after_script: - - php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover diff --git a/README.md b/README.md index cc2c0e0..1500ff9 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Laravel WebSockets 🛰 [![Latest Version on Packagist](https://img.shields.io/packagist/v/beyondcode/laravel-websockets.svg?style=flat-square)](https://packagist.org/packages/beyondcode/laravel-websockets) -[![Build Status](https://img.shields.io/travis/beyondcode/laravel-websockets/master.svg?style=flat-square)](https://travis-ci.org/beyondcode/laravel-websockets) +![GitHub Workflow Status](https://img.shields.io/github/workflow/status/beyondcode/laravel-websockets/run-tests?label=tests) [![Quality Score](https://img.shields.io/scrutinizer/g/beyondcode/laravel-websockets.svg?style=flat-square)](https://scrutinizer-ci.com/g/beyondcode/laravel-websockets) [![Total Downloads](https://img.shields.io/packagist/dt/beyondcode/laravel-websockets.svg?style=flat-square)](https://packagist.org/packages/beyondcode/laravel-websockets) diff --git a/composer.json b/composer.json index 87aa7ba..e8c98e1 100644 --- a/composer.json +++ b/composer.json @@ -22,26 +22,26 @@ } ], "require": { - "php": "^7.1", + "php": "^7.2", "ext-json": "*", "cboden/ratchet": "^0.4.1", "clue/buzz-react": "^2.5", "facade/ignition-contracts": "^1.0", "guzzlehttp/psr7": "^1.5", - "illuminate/broadcasting": "5.7.* || 5.8.* || ^6.0", - "illuminate/console": "5.7.* || 5.8.* || ^6.0", - "illuminate/http": "5.7.* || 5.8.* || ^6.0", - "illuminate/routing": "5.7.* || 5.8.* || ^6.0", - "illuminate/support": "5.7.* || 5.8.* || ^6.0", - "pusher/pusher-php-server": "~3.0 || ~4.0", + "illuminate/broadcasting": "5.8.*|^6.0|^7.0", + "illuminate/console": "5.8.*|^6.0|^7.0", + "illuminate/http": "5.8.*|^6.0|^7.0", + "illuminate/routing": "5.8.*|^6.0|^7.0", + "illuminate/support": "5.8.*|^6.0|^7.0", + "pusher/pusher-php-server": "^3.0|^4.0", "react/dns": "^1.1", - "symfony/http-kernel": "~4.0", + "symfony/http-kernel": "^4.0|^5.0", "symfony/psr-http-message-bridge": "^1.1" }, "require-dev": { - "mockery/mockery": "^1.2", - "orchestra/testbench": "3.7.* || 3.8.* || ^4.0", - "phpunit/phpunit": "^7.0 || ^8.0" + "mockery/mockery": "^1.3", + "orchestra/testbench": "3.8.*|^4.0 |^5.0", + "phpunit/phpunit": "^8.0|^8.0" }, "autoload": { "psr-4": { diff --git a/tests/Statistics/Controllers/WebSocketsStatisticsControllerTest.php b/tests/Statistics/Controllers/WebSocketsStatisticsControllerTest.php index 482f50b..fb67fcb 100644 --- a/tests/Statistics/Controllers/WebSocketsStatisticsControllerTest.php +++ b/tests/Statistics/Controllers/WebSocketsStatisticsControllerTest.php @@ -22,7 +22,7 @@ class WebSocketsStatisticsControllerTest extends TestCase $this->assertCount(1, $entries); - $this->assertArraySubset($this->payload(), $entries->first()->attributesToArray()); + $this->assertArrayHasKey('app_id', $entries->first()->attributesToArray()); } protected function payload(): array