diff --git a/.travis.yml b/.travis.yml index cacbcaa..e4cd2e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: php php: - 5.6 - - hhvm + - 7.0 sudo: false @@ -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 - diff --git a/src/ModerationScope.php b/src/ModerationScope.php index 6b57bc9..3d6a123 100644 --- a/src/ModerationScope.php +++ b/src/ModerationScope.php @@ -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. diff --git a/tests/ModerationScopeTest.php b/tests/ModerationScopeTest.php index ef3b65d..072d22c 100644 --- a/tests/ModerationScopeTest.php +++ b/tests/ModerationScopeTest.php @@ -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(); @@ -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(); @@ -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(); @@ -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();