Skip to content

Commit

Permalink
Fix composer error on build and add L5.3 compatibility (#12)
Browse files Browse the repository at this point in the history
* Add env COMPOSER_DISCARD_CHANGES=1

* Run composer update instead of composer install

* Add L5.3 compatibility

* Fix hhvm version for the constant ARRAY_FILTER_USE_BOTH

* Revert "Fix hhvm version for the constant ARRAY_FILTER_USE_BOTH"

This reverts commit 5844546.

* update travis

* Fix travis syntax error
  • Loading branch information
stephane-monnot authored and hootlex committed Aug 26, 2016
1 parent dd39b26 commit d31121d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ language: php

php:
- 5.6
- hhvm
- 7.0

sudo: false

Expand All @@ -13,17 +13,17 @@ cache:
- $HOME/.composer/cache

before_install:
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-rm xdebug.ini; fi;
- phpenv config-rm xdebug.ini

install:
- composer install --dev --prefer-source --no-interaction
- COMPOSER_DISCARD_CHANGES=1 composer install --dev --prefer-source --no-interaction

before_script:
- cp tests/migrations/create_moderation_posts_table.php vendor/laravel/laravel/database/migrations/2015_11_19_053825_create_moderation_posts_table.php
- cp src/config/moderation.php vendor/laravel/laravel/config/moderation.php
- touch vendor/laravel/laravel/database/database.sqlite
- cd vendor/laravel/laravel
- composer install --dev --prefer-source --no-interaction
- composer update --dev --prefer-source --no-interaction
- yes | php artisan migrate
- cd -

Expand Down
4 changes: 2 additions & 2 deletions src/ModerationScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\ScopeInterface;
use Illuminate\Database\Eloquent\Scope;

class ModerationScope implements ScopeInterface
class ModerationScope implements Scope
{
/**
* All of the extensions to be added to the builder.
Expand Down
8 changes: 4 additions & 4 deletions tests/ModerationScopeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function it_returns_all_stories()
public function it_approves_stories()
{
$posts = $this->createPost([$this->status_column => Status::PENDING], 4);
$postsIds = $posts->lists('id')->all();
$postsIds = $posts->pluck('id')->all();

(new Post)->newQueryWithoutScope(new ModerationScope)->whereIn('id', $postsIds)->approve();

Expand All @@ -165,7 +165,7 @@ public function it_approves_stories()
public function it_rejects_stories()
{
$posts = $this->createPost([$this->status_column => Status::PENDING], 4);
$postsIds = $posts->lists('id')->all();
$postsIds = $posts->pluck('id')->all();

(new Post)->newQueryWithoutScope(new ModerationScope)->whereIn('id', $postsIds)->reject();

Expand All @@ -178,7 +178,7 @@ public function it_rejects_stories()
public function it_postpones_stories()
{
$posts = $this->createPost([$this->status_column => Status::PENDING], 4);
$postsIds = $posts->lists('id')->all();
$postsIds = $posts->pluck('id')->all();

(new Post)->newQueryWithoutScope(new ModerationScope)->whereIn('id', $postsIds)->postpone();

Expand Down Expand Up @@ -300,7 +300,7 @@ public function it_queries_pending_stories_by_default_when_not_in_strict_mode()
Post::$strictModeration = false;

$posts = $this->createPost([$this->status_column => Status::PENDING], 5);
$postsIds = $posts->lists('id')->all();
$postsIds = $posts->pluck('id')->all();

$postsReturned = Post::whereIn('id', $postsIds)->get();

Expand Down

3 comments on commit d31121d

@coopers98
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When will this get packaged into a release? Attempting to migrate to Laravel 5.3 and this is one of the packages holding that migration up.

@stephane-monnot
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hootlex, maybe need a new tag ?

@hootlex
Copy link
Owner

@hootlex hootlex commented on d31121d Jan 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coopers98 @stephane-monnot I just published v1.0.8.
Sorry, for the delay.

Please sign in to comment.