Skip to content

Commit ec2f833

Browse files
authored
feat: bump versions (#93)
1 parent 92b4bcd commit ec2f833

File tree

9 files changed

+67
-32
lines changed

9 files changed

+67
-32
lines changed

.github/workflows/ci.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
3+
on: [pull_request]
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.head_ref }}
7+
cancel-in-progress: true
8+
9+
jobs:
10+
basic:
11+
name: Run tests on PHP ${{ matrix.php_version }}
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
php_version: ['7.3' ,'7.4', '8.1']
16+
fail-fast: false
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: Setup PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: ${{ matrix.php_version }}
24+
tools: composer
25+
26+
- name: Install dependencies
27+
run: composer install
28+
29+
- name: Run tests
30+
run: ./vendor/bin/phpunit

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
/vendor
22
/composer.lock
3+
.phpunit.result.cache
4+
.vscode
5+
.devcontainer

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,19 @@ $specialFeed = FeedManager::getClient->feed('special', '42')
491491
$specialFeed->followFeed('timeline', '60')
492492
```
493493

494+
### Contributing
495+
496+
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 for more details.
497+
498+
Getting started:
499+
500+
```shell
501+
$ composer install
502+
$ ./vendor/bin/phpunit
503+
```
504+
494505
### Copyright and License Information
495506

496-
Copyright (c) 2014-2019 Stream.io Inc, and individual contributors. All rights reserved.
507+
Copyright (c) 2014-2022 Stream.io Inc, and individual contributors. All rights reserved.
497508

498509
See the file "LICENSE" for information on the history of this software, terms & conditions for usage, and a DISCLAIMER OF ALL WARRANTIES.

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
}
1212
],
1313
"require": {
14-
"php": ">=7.2.0",
14+
"php": ">=7.3",
1515
"illuminate/support": ">=4.2",
1616
"illuminate/database": ">=4.2",
17-
"get-stream/stream": "^4.0.1"
17+
"get-stream/stream": "^5.0.0"
1818
},
1919
"require-dev": {
20-
"phpunit/phpunit": "~4.0",
21-
"mockery/mockery": "~0.9"
20+
"phpunit/phpunit": "^9.5",
21+
"mockery/mockery": "^1.4"
2222
},
2323
"autoload": {
2424
"psr-0": {

phpunit.xml.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
convertWarningsToExceptions="true"
99
processIsolation="false"
1010
stopOnFailure="false"
11-
syntaxCheck="false"
1211
>
1312
<testsuites>
1413
<testsuite name="Package Test Suite">

tests/.gitkeep

Whitespace-only changes.

tests/ActivityTest.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
<?php
22

3+
use PHPUnit\Framework\TestCase;
4+
use GetStream\Stream\Client;
35
use GetStream\StreamLaravel\Eloquent\Activity;
4-
use GetStream\Stream\Feed;
56

67
class _Activity extends Activity
78
{
89
public $author = null;
910
public $created_at = null;
1011
public $id = 42;
12+
13+
public function __construct()
14+
{
15+
$this->client = new Client(null, null);
16+
}
1117
public function getKey()
1218
{
1319
return $this->id;
@@ -18,13 +24,13 @@ public function activityActorMethodName()
1824
}
1925
public function activityNotify()
2026
{
21-
return array(new Feed(null, 'feed', '1', 'token', null));
27+
return array($this->client->feed('feed', '1'));
2228
}
2329
}
2430

25-
class ActivityTest extends \PHPUnit_Framework_TestCase
31+
class ActivityTest extends TestCase
2632
{
27-
public function setUp()
33+
public function setUp(): void
2834
{
2935
parent::setUp();
3036
$this->instance = new _Activity;

tests/EnrichedActivityTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?php
22

3+
use PHPUnit\Framework\TestCase;
34
use GetStream\StreamLaravel\EnrichedActivity;
45

5-
class EnrichedActivityTest extends \PHPUnit_Framework_TestCase
6+
class EnrichedActivityTest extends TestCase
67
{
78
public function testArrayImplementation()
89
{
@@ -29,7 +30,7 @@ public function testTrackNotEnrichedField()
2930

3031
public function testIterable()
3132
{
32-
$activity = new EnrichedActivity(array('1'=>1, '2'=> 3));
33+
$activity = new EnrichedActivity(array('1' => 1, '2' => 3));
3334
$sum = 0;
3435
foreach ($activity as $field => $value) {
3536
$sum += $value;

tests/ManagerTest.php

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?php
22

3+
use PHPUnit\Framework\TestCase;
34
use GetStream\StreamLaravel\StreamLaravelManager;
45
use Mockery as m;
56

6-
class ManagerTest extends PHPUnit_Framework_TestCase
7+
class ManagerTest extends TestCase
78
{
8-
public function setUp()
9+
public function setUp(): void
910
{
1011
parent::setUp();
1112
$config = m::mock('ConfigMock');
@@ -16,7 +17,7 @@ public function setUp()
1617
$config->shouldReceive('get')->once()->with('stream-laravel.location')
1718
->andReturn('');
1819
$config->shouldReceive('get')->once()->with('stream-laravel.news_feeds')
19-
->andReturn(array('flat'=>'flat', 'aggregated'=>'aggregated'));
20+
->andReturn(array('flat' => 'flat', 'aggregated' => 'aggregated'));
2021
$config->shouldReceive('get')->once()->with('stream-laravel.timeout', 3)
2122
->andReturn(3);
2223
$this->manager = new StreamLaravelManager('key', 'secret', $config);
@@ -39,7 +40,7 @@ public function testCustomTimeout()
3940
$config->shouldReceive('get')->once()->with('stream-laravel.location')
4041
->andReturn('');
4142
$config->shouldReceive('get')->once()->with('stream-laravel.news_feeds')
42-
->andReturn(array('flat'=>'flat', 'aggregated'=>'aggregated'));
43+
->andReturn(array('flat' => 'flat', 'aggregated' => 'aggregated'));
4344
$config->shouldReceive('get')->once()->with('stream-laravel.timeout', 3)
4445
->andReturn(6);
4546
$manager = new StreamLaravelManager('key', 'secret', $config);
@@ -68,25 +69,9 @@ public function testGetNewsFeeds()
6869
$this->assertSame($feeds['flat']->getId(), 'flat:42');
6970
}
7071

71-
public function testFollowUser()
72-
{
73-
}
74-
75-
public function testUnfollowUser()
76-
{
77-
}
78-
7972
public function testGetFeed()
8073
{
8174
$feed = $this->manager->getFeed('myfeed', 42);
8275
$this->assertSame($feed->getId(), 'myfeed:42');
8376
}
84-
85-
public function testActivityCreated()
86-
{
87-
}
88-
89-
public function testActivityDeleted()
90-
{
91-
}
9277
}

0 commit comments

Comments
 (0)