From 22f71b8089516a624660044538bb737612e240e9 Mon Sep 17 00:00:00 2001 From: emprove Date: Wed, 23 Dec 2020 10:30:53 +0300 Subject: [PATCH] remove tests --- .gitattributes | 9 ---- .styleci.yml | 1 - README.md | 6 +-- composer.json | 13 ++---- phpunit.xml.dist | 28 ------------ tests/CentrifugeTest.php | 96 ---------------------------------------- tests/TestCase.php | 37 ---------------- tests/config.json | 12 ----- 8 files changed, 6 insertions(+), 196 deletions(-) delete mode 100644 .gitattributes delete mode 100644 .styleci.yml delete mode 100644 phpunit.xml.dist delete mode 100644 tests/CentrifugeTest.php delete mode 100644 tests/TestCase.php delete mode 100644 tests/config.json diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index b59f38a..0000000 --- a/.gitattributes +++ /dev/null @@ -1,9 +0,0 @@ - -# Path-based git attributes -# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html - -# Ignore all test and documentation with "export-ignore". -/.gitattributes export-ignore -/.gitignore export-ignore -/phpunit.xml.dist export-ignore -/tests export-ignore \ No newline at end of file diff --git a/.styleci.yml b/.styleci.yml deleted file mode 100644 index c3bb259..0000000 --- a/.styleci.yml +++ /dev/null @@ -1 +0,0 @@ -preset: laravel \ No newline at end of file diff --git a/README.md b/README.md index bc3083b..2ce2893 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,12 @@ 3. Update generateToken(user id, timestamp, info) method (v2 uses only jwt auth workflow). ## Introduction -Centrifuge broadcaster for laravel >= 5.7 +Centrifuge broadcaster for laravel ^6 ## Requirements -- PHP 7.1.3+ or newer (tested on 7.2.10) -- Laravel 5.3+ or newer (tested on 5.7.8) +- PHP 7.2+ +- Laravel 6+ - Centrifugo Server 2 or newer (see [here](https://github.com/centrifugal/centrifugo)) ## Installation diff --git a/composer.json b/composer.json index 7e804b5..fbabeb8 100644 --- a/composer.json +++ b/composer.json @@ -19,22 +19,15 @@ "php": "^7.2", "illuminate/broadcasting": "^6.0", "guzzlehttp/guzzle": "^6.3.3", - "lcobucci/jwt": "^3.4" - }, - "require-dev": { - "orchestra/testbench": "^3.3", - "phpunit/phpunit": "^5.7|^6.1" + "lcobucci/jwt": "3.4.*" }, + "require-dev": {}, "autoload": { "psr-4": { "LaraComponents\\Centrifuge\\": "src/" } }, - "autoload-dev": { - "psr-4": { - "LaraComponents\\Centrifuge\\Test\\": "tests/" - } - }, + "autoload-dev": {}, "extra": { "laravel": { "providers": [ diff --git a/phpunit.xml.dist b/phpunit.xml.dist deleted file mode 100644 index 9951a3a..0000000 --- a/phpunit.xml.dist +++ /dev/null @@ -1,28 +0,0 @@ - - - - - tests - - - - - src/ - - - - - - - - - \ No newline at end of file diff --git a/tests/CentrifugeTest.php b/tests/CentrifugeTest.php deleted file mode 100644 index a9fdb57..0000000 --- a/tests/CentrifugeTest.php +++ /dev/null @@ -1,96 +0,0 @@ - 'Nikita', - 'last_name' => 'Stenin', - ]); - $client = '0c951315-be0e-4516-b99e-05e60b0cc307'; - $channel = 'test-channel'; - - $clientToken1 = $this->centrifuge->generateToken($user_id, $timestamp); - $this->assertEquals('558880399d21bd215e4d1558dd95efad9b82f829a1d44910fb611eeeffac3c50', $clientToken1); - - $clientToken2 = $this->centrifuge->generateToken($user_id, $timestamp, $info); - $this->assertEquals('37722e22cee00160d777fd8d594dd831a9d5404016d5515a2cffc7c102ea67ee', $clientToken2); - - $channelSign = $this->centrifuge->generateToken($client, $channel); - $this->assertEquals('02fc39b64c252108e80cfdcab2ef774f13a181f5149d21cebabd6eca08d231d2', $channelSign); - } - - public function testGenerateApiSign() - { - $json = json_encode(['method' => 'publish', 'params' => [ - 'channel' => 'test-channel', - ]]); - - $apiSign = $this->centrifuge->generateApiSign($json); - $this->assertEquals('11950468714031c2e0b95e284482ba6e8d9e17e1a6115eb0db6feded7581ebba', $apiSign); - } - - public function testCentrifugeApi() - { - $publish = $this->centrifuge->publish('test-channel', ['event' => 'test-event']); - $this->assertEquals($publish, [ - 'method' => 'publish', - 'error' => null, - 'body' => null, - ]); - - $broadcast = $this->centrifuge->broadcast(['test-channel-1', 'test-channel-2'], ['event' => 'test-event']); - $this->assertEquals($broadcast, [ - 'method' => 'broadcast', - 'error' => null, - 'body' => null, - ]); - - $presence = $this->centrifuge->presence('test-channel'); - $this->assertEquals($presence, [ - 'method' => 'presence', - 'error' => null, - 'body' => [ - 'channel' => 'test-channel', - 'data' => [], - ], - ]); - - $history = $this->centrifuge->history('test-channel'); - $this->assertEquals($history['method'], 'history'); - $this->assertEquals($history['error'], 'not available'); - $this->assertEquals($history['body']['channel'], 'test-channel'); - - $channels = $this->centrifuge->channels(); - $this->assertEquals($channels, [ - 'method' => 'channels', - 'error' => null, - 'body' => [ - 'data' => [], - ], - ]); - - $unsubscribe = $this->centrifuge->unsubscribe(1); - $this->assertEquals($unsubscribe, [ - 'method' => 'unsubscribe', - 'error' => null, - 'body' => null, - ]); - - $disconnect = $this->centrifuge->disconnect(1); - $this->assertEquals($disconnect, [ - 'method' => 'disconnect', - 'error' => null, - 'body' => null, - ]); - - $stats = $this->centrifuge->stats(); - $this->assertEquals($stats['method'], 'stats'); - $this->assertEquals($stats['error'], null); - } -} diff --git a/tests/TestCase.php b/tests/TestCase.php deleted file mode 100644 index 363ea61..0000000 --- a/tests/TestCase.php +++ /dev/null @@ -1,37 +0,0 @@ -centrifuge = $this->app->make('centrifuge'); - } - - protected function getPackageProviders($app) - { - return [ - CentrifugeServiceProvider::class, - ]; - } - - protected function getEnvironmentSetUp($app) - { - $app['config']->set('broadcasting.default', 'centrifuge'); - $app['config']->set('broadcasting.connections.centrifuge', [ - 'driver' => 'centrifuge', - 'secret' => 'f95bf295-bee6-4259-8912-0a58f4ecd30e', - 'url' => 'http://localhost:8000', - ]); - } -} diff --git a/tests/config.json b/tests/config.json deleted file mode 100644 index dbd2f2d..0000000 --- a/tests/config.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "address": "localhost", - "anonymous": true, - "engine": "memory", - "insecure": true, - "join_leave": true, - "port": 8000, - "presence": true, - "publish": true, - "secret": "f95bf295-bee6-4259-8912-0a58f4ecd30e", - "watch": true -}