diff --git a/LICENSE b/LICENSE index e97bd1f..404ba10 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014-2021, Stream.io Inc, and individual contributors. +Copyright (c) 2014-2022, Stream.io Inc, and individual contributors. All rights reserved. diff --git a/README.md b/README.md index e49f3ee..5e621db 100644 --- a/README.md +++ b/README.md @@ -20,11 +20,11 @@ ## 📝 About Stream -You can sign up for a Stream account at our [Get Started](https://getstream.io/chat/get_started/) page. +You can sign up for a Stream account at our [Get Started](https://getstream.io/activity-feeds/) page. -You can use this library to access chat API endpoints server-side. +You can use this library to access Feeds API endpoints server-side. -For the client-side integrations (web and mobile) have a look at the JavaScript, iOS and Android SDK libraries ([docs](https://getstream.io/chat/)). +For the client-side integrations (web and mobile) have a look at the JavaScript, iOS and Android SDK libraries ([docs](https://getstream.io/activity-feeds/docs/?language=php)). 💡 Note that there is also a higher level [Laravel integration](https://github.com/getstream/stream-laravel) which hooks into the Eloquent ORM. @@ -256,6 +256,8 @@ The `stream-laravel` integration helps you to hook into the Laravel's Eloquent O ## ✍️ Contributing +Project is licensed under the [BSD 3-Clause](LICENSE). + We welcome code changes that improve this library or fix a problem, please make sure to follow all best practices and add tests if applicable before submitting a Pull Request on Github. We are very happy to merge your code in the official repository. Make sure to sign our [Contributor License Agreement (CLA)](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) first. See our [license file](./LICENSE) for more details. ## 🧑‍💻 We are hiring! diff --git a/tests/integration/CollectionTest.php b/tests/integration/CollectionTest.php index 4337401..b66522c 100644 --- a/tests/integration/CollectionTest.php +++ b/tests/integration/CollectionTest.php @@ -2,15 +2,11 @@ namespace GetStream\Integration; -use DateTime; -use DateTimeZone; -use Firebase\JWT\JWT; use GetStream\Stream\Client; use GetStream\Stream\Feed; -use PHPUnit\Framework\TestCase; use GuzzleHttp\Exception\ClientException; -class CollectionTest extends TestCase +class CollectionTest extends TestBase { /** * @var Client @@ -76,11 +72,6 @@ public function cleanUp() } } - private function generateGuid() - { - return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex(random_bytes(16)), 4)); - } - public function testUpsert() { $collection = $this->collections->upsert('animals', [['id' => '1', 'name' => 'bear', 'color' => 'blue']]); diff --git a/tests/integration/FeedTest.php b/tests/integration/FeedTest.php index 40c397d..70f5e04 100644 --- a/tests/integration/FeedTest.php +++ b/tests/integration/FeedTest.php @@ -7,9 +7,8 @@ use Firebase\JWT\JWT; use GetStream\Stream\Client; use GetStream\Stream\Feed; -use PHPUnit\Framework\TestCase; -class FeedTest extends TestCase +class FeedTest extends TestBase { /** * @var Client @@ -52,11 +51,6 @@ protected function setUp():void $this->flat3 = $this->client->feed('flat', $this->generateGuid()); } - private function generateGuid() - { - return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex(random_bytes(16)), 4)); - } - public function testRedirectUrl() { $targetUrl = 'http://google.com/?a=1'; diff --git a/tests/integration/ReactionTest.php b/tests/integration/ReactionTest.php index acb8958..a604cab 100644 --- a/tests/integration/ReactionTest.php +++ b/tests/integration/ReactionTest.php @@ -2,14 +2,10 @@ namespace GetStream\Integration; -use DateTime; -use DateTimeZone; -use Firebase\JWT\JWT; use GetStream\Stream\Client; use GetStream\Stream\Feed; -use PHPUnit\Framework\TestCase; -class ReactionTest extends TestCase +class ReactionTest extends TestBase { /** * @var Client @@ -72,11 +68,6 @@ protected function setUp():void $this->reactions = $this->client->reactions(); } - private function generateGuid() - { - return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex(random_bytes(16)), 4)); - } - public function testSimpleAddReaction() { $reaction = $this->reactions->add('like', $this->activity_id, 'bob'); diff --git a/tests/integration/TestBase.php b/tests/integration/TestBase.php new file mode 100644 index 0000000..d788db8 --- /dev/null +++ b/tests/integration/TestBase.php @@ -0,0 +1,13 @@ +user1 = $this->client->feed('user', $this->generateGuid()); } - private function generateGuid() - { - return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex(random_bytes(16)), 4)); - } - public function testSimpleAddUser() { $uuid = $this->generateGuid();