Skip to content

Commit

Permalink
feat: bump versions (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdeme authored Dec 16, 2021
1 parent 92b4bcd commit ec2f833
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 32 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

on: [pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
basic:
name: Run tests on PHP ${{ matrix.php_version }}
runs-on: ubuntu-latest
strategy:
matrix:
php_version: ['7.3' ,'7.4', '8.1']
fail-fast: false
steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
tools: composer

- name: Install dependencies
run: composer install

- name: Run tests
run: ./vendor/bin/phpunit
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/vendor
/composer.lock
.phpunit.result.cache
.vscode
.devcontainer
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,19 @@ $specialFeed = FeedManager::getClient->feed('special', '42')
$specialFeed->followFeed('timeline', '60')
```

### Contributing

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.

Getting started:

```shell
$ composer install
$ ./vendor/bin/phpunit
```

### Copyright and License Information

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

See the file "LICENSE" for information on the history of this software, terms & conditions for usage, and a DISCLAIMER OF ALL WARRANTIES.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
}
],
"require": {
"php": ">=7.2.0",
"php": ">=7.3",
"illuminate/support": ">=4.2",
"illuminate/database": ">=4.2",
"get-stream/stream": "^4.0.1"
"get-stream/stream": "^5.0.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"mockery/mockery": "~0.9"
"phpunit/phpunit": "^9.5",
"mockery/mockery": "^1.4"
},
"autoload": {
"psr-0": {
Expand Down
1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
>
<testsuites>
<testsuite name="Package Test Suite">
Expand Down
Empty file removed tests/.gitkeep
Empty file.
14 changes: 10 additions & 4 deletions tests/ActivityTest.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
<?php

use PHPUnit\Framework\TestCase;
use GetStream\Stream\Client;
use GetStream\StreamLaravel\Eloquent\Activity;
use GetStream\Stream\Feed;

class _Activity extends Activity
{
public $author = null;
public $created_at = null;
public $id = 42;

public function __construct()
{
$this->client = new Client(null, null);
}
public function getKey()
{
return $this->id;
Expand All @@ -18,13 +24,13 @@ public function activityActorMethodName()
}
public function activityNotify()
{
return array(new Feed(null, 'feed', '1', 'token', null));
return array($this->client->feed('feed', '1'));
}
}

class ActivityTest extends \PHPUnit_Framework_TestCase
class ActivityTest extends TestCase
{
public function setUp()
public function setUp(): void
{
parent::setUp();
$this->instance = new _Activity;
Expand Down
5 changes: 3 additions & 2 deletions tests/EnrichedActivityTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

use PHPUnit\Framework\TestCase;
use GetStream\StreamLaravel\EnrichedActivity;

class EnrichedActivityTest extends \PHPUnit_Framework_TestCase
class EnrichedActivityTest extends TestCase
{
public function testArrayImplementation()
{
Expand All @@ -29,7 +30,7 @@ public function testTrackNotEnrichedField()

public function testIterable()
{
$activity = new EnrichedActivity(array('1'=>1, '2'=> 3));
$activity = new EnrichedActivity(array('1' => 1, '2' => 3));
$sum = 0;
foreach ($activity as $field => $value) {
$sum += $value;
Expand Down
25 changes: 5 additions & 20 deletions tests/ManagerTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php

use PHPUnit\Framework\TestCase;
use GetStream\StreamLaravel\StreamLaravelManager;
use Mockery as m;

class ManagerTest extends PHPUnit_Framework_TestCase
class ManagerTest extends TestCase
{
public function setUp()
public function setUp(): void
{
parent::setUp();
$config = m::mock('ConfigMock');
Expand All @@ -16,7 +17,7 @@ public function setUp()
$config->shouldReceive('get')->once()->with('stream-laravel.location')
->andReturn('');
$config->shouldReceive('get')->once()->with('stream-laravel.news_feeds')
->andReturn(array('flat'=>'flat', 'aggregated'=>'aggregated'));
->andReturn(array('flat' => 'flat', 'aggregated' => 'aggregated'));
$config->shouldReceive('get')->once()->with('stream-laravel.timeout', 3)
->andReturn(3);
$this->manager = new StreamLaravelManager('key', 'secret', $config);
Expand All @@ -39,7 +40,7 @@ public function testCustomTimeout()
$config->shouldReceive('get')->once()->with('stream-laravel.location')
->andReturn('');
$config->shouldReceive('get')->once()->with('stream-laravel.news_feeds')
->andReturn(array('flat'=>'flat', 'aggregated'=>'aggregated'));
->andReturn(array('flat' => 'flat', 'aggregated' => 'aggregated'));
$config->shouldReceive('get')->once()->with('stream-laravel.timeout', 3)
->andReturn(6);
$manager = new StreamLaravelManager('key', 'secret', $config);
Expand Down Expand Up @@ -68,25 +69,9 @@ public function testGetNewsFeeds()
$this->assertSame($feeds['flat']->getId(), 'flat:42');
}

public function testFollowUser()
{
}

public function testUnfollowUser()
{
}

public function testGetFeed()
{
$feed = $this->manager->getFeed('myfeed', 42);
$this->assertSame($feed->getId(), 'myfeed:42');
}

public function testActivityCreated()
{
}

public function testActivityDeleted()
{
}
}

0 comments on commit ec2f833

Please sign in to comment.