Skip to content

Commit d4b289b

Browse files
committed
Added L5.7 compatibility
1 parent 841bd8d commit d4b289b

File tree

10 files changed

+63
-14
lines changed

10 files changed

+63
-14
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@ language: php
22

33
matrix:
44
include:
5+
- php: 7.1.3
6+
env: PU_FILE=57 REDIS_HOST=127.0.0.1
57
- php: 7.1.3
68
env: PU_FILE=56 REDIS_HOST=127.0.0.1
79
- php: 7.1.3
810
env: PU_FILE=55 REDIS_HOST=127.0.0.1
911
- php: 7.1.3
1012
env: PU_FILE=54 REDIS_HOST=127.0.0.1
13+
- php: 7.2
14+
env: PU_FILE=57 REDIS_HOST=127.0.0.1
1115
- php: 7.2
1216
env: PU_FILE=56 REDIS_HOST=127.0.0.1
1317
- php: 7.2

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [0.3.0] - 10 Sep 2018
8+
### Added
9+
- Laravel 5.7 compatibility.
10+
711
## [0.2.64] - 25 Jul 2018
812
### Fixed
913
- caching of subqueries of `->whereNotIn()` and `->whereIn()`.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ relationships. This package is an attempt to address those requirements.
2424

2525
## Requirements
2626
- PHP >= 7.1.3
27-
- Laravel 5.4 - 5.6
27+
- Laravel 5.4 - 5.7
2828

2929
### Possible Conflicting Packages
3030
Any packages that also override `newEloquentModel()` from the `Model` class will

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
"codedungeon/phpunit-result-printer": "*",
2222
"fzaninotto/faker": "*",
2323
"mockery/mockery": "*",
24-
"orchestra/database": "3.6.*",
25-
"orchestra/testbench-browser-kit": "3.6.*",
26-
"orchestra/testbench": "3.6.*",
24+
"orchestra/database": "3.7.x-dev",
25+
"orchestra/testbench-browser-kit": "3.7.x-dev",
26+
"orchestra/testbench": "3.7.*",
2727
"php-coveralls/php-coveralls" : "*",
2828
"phpmd/phpmd": "*",
2929
"phpunit/phpunit": "7.*",

tests/CreatesApplication.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ protected function getPackageProviders($app)
7272

7373
protected function getEnvironmentSetUp($app)
7474
{
75+
$app['config']->set('database.redis.cache', [
76+
'host' => env('REDIS_HOST', '192.168.10.10'),
77+
]);
7578
$app['config']->set('database.redis.default', [
7679
'host' => env('REDIS_HOST', '192.168.10.10'),
7780
]);

tests/Feature/PaginationTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ class PaginationTest extends FeatureTestCase
77
{
88
public function testPaginationProvidesDifferentLinksOnDifferentPages()
99
{
10-
if (starts_with(app()->version(), "5.6")) {
10+
if (starts_with(app()->version(), "5.6")
11+
|| starts_with(app()->version(), "5.7")
12+
) {
1113
$page1ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">1</span></li>';
1214
$page2ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">2</span></li>';
1315
}
@@ -36,7 +38,9 @@ public function testPaginationProvidesDifferentLinksOnDifferentPages()
3638

3739
public function testAdvancedPagination()
3840
{
39-
if (starts_with(app()->version(), "5.6")) {
41+
if (starts_with(app()->version(), "5.6")
42+
|| starts_with(app()->version(), "5.7")
43+
) {
4044
$page1ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">1</span></li>';
4145
$page2ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">2</span></li>';
4246
}

tests/Integration/CachedBuilder/PaginateTest.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ public function testPaginationIsCached()
4646

4747
public function testPaginationReturnsCorrectLinks()
4848
{
49-
if (starts_with(app()->version(), "5.6")) {
49+
if (starts_with(app()->version(), "5.6")
50+
|| starts_with(app()->version(), "5.7")
51+
) {
5052
$page1ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">1</span></li>';
5153
$page2ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">2</span></li>';
5254
$page24ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">24</span></li>';
@@ -81,7 +83,9 @@ public function testPaginationReturnsCorrectLinks()
8183

8284
public function testPaginationWithOptionsReturnsCorrectLinks()
8385
{
84-
if (starts_with(app()->version(), "5.6")) {
86+
if (starts_with(app()->version(), "5.6")
87+
|| starts_with(app()->version(), "5.7")
88+
) {
8589
$page1ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">1</span></li>';
8690
$page2ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">2</span></li>';
8791
$page24ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">24</span></li>';
@@ -116,7 +120,9 @@ public function testPaginationWithOptionsReturnsCorrectLinks()
116120

117121
public function testPaginationWithCustomOptionsReturnsCorrectLinks()
118122
{
119-
if (starts_with(app()->version(), "5.6")) {
123+
if (starts_with(app()->version(), "5.6")
124+
|| starts_with(app()->version(), "5.7")
125+
) {
120126
$page1ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">1</span></li>';
121127
$page2ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">2</span></li>';
122128
$page24ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">24</span></li>';

tests/Integration/Console/Commands/FlushTest.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,28 @@
1212

1313
class FlushTest extends IntegrationTestCase
1414
{
15-
15+
public function setUp()
16+
{
17+
parent::setUp();
18+
19+
if (starts_with($this->app->version(), '5.7')) {
20+
$this->withoutMockingConsoleOutput();
21+
}
22+
}
1623

1724
public function testGivenModelIsFlushed()
1825
{
1926
$authors = (new Author)->all();
2027
$key = sha1('genealabs:laravel-model-caching:testing::memory::genealabslaravelmodelcachingtestsfixturesauthor');
2128
$tags = ['genealabs:laravel-model-caching:testing::memory::genealabslaravelmodelcachingtestsfixturesauthor'];
2229

23-
$cachedResults = $this->cache
30+
$cachedResults = $this
31+
->cache
2432
->tags($tags)
2533
->get($key)['value'];
2634
$result = $this->artisan('modelCache:clear', ['--model' => Author::class]);
27-
$flushedResults = $this->cache
35+
$flushedResults = $this
36+
->cache
2837
->tags($tags)
2938
->get($key)['value'];
3039

tests/Integration/Traits/CachableTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
class CachableTest extends IntegrationTestCase
1919
{
20-
21-
2220
public function testSpecifyingAlternateCacheDriver()
2321
{
2422
$configCacheStores = config('cache.stores');

tests/pu-57.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
cp composer.json original-composer.json
4+
5+
composer require codedungeon/phpunit-result-printer --no-update --dev
6+
composer require "orchestra/database:3.7.x-dev" --no-update --dev
7+
composer require "orchestra/testbench:3.7.*" --no-update --dev
8+
composer require "orchestra/testbench-browser-kit:3.7.x-dev" --no-update --dev
9+
composer require "illuminate/cache:5.7.*" --no-update
10+
composer require "illuminate/config:5.7.*" --no-update
11+
composer require "illuminate/console:5.7.*" --no-update
12+
composer require "illuminate/database:5.7.*" --no-update
13+
composer require "illuminate/support:5.7.*" --no-update
14+
composer require "phpunit/phpunit:7.*" --no-update --dev
15+
composer update --prefer-source --no-interaction
16+
17+
rm composer.json
18+
mv original-composer.json composer.json
19+
20+
mkdir -p ./build/logs
21+
php -n vendor/bin/phpunit --configuration phpunit.xml --coverage-text --coverage-clover ./build/logs/clover.xml

0 commit comments

Comments
 (0)