Skip to content

Update to Laravel 8. #372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .scrutinizer.yml

This file was deleted.

25 changes: 13 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,28 @@
],
"require": {
"php": ">=7.3",
"genealabs/laravel-pivot-events": "^0.3.0",
"illuminate/cache": "^7.0",
"illuminate/config": "^7.0",
"illuminate/console": "^7.0",
"illuminate/container": "^7.0",
"illuminate/database": "^7.0",
"illuminate/http": "^7.0",
"illuminate/support": "^7.0"
"genealabs/laravel-pivot-events": "^8.0",
"illuminate/cache": "^8.0",
"illuminate/config": "^8.0",
"illuminate/console": "^8.0",
"illuminate/container": "^8.0",
"illuminate/database": "^8.0",
"illuminate/http": "^8.0",
"illuminate/support": "^8.0"
},
"require-dev": {
"doctrine/dbal": "^2.10",
"fzaninotto/faker": "^1.9",
"laravel/nova": "^3.0",
"orchestra/testbench-browser-kit": "^5.0",
"orchestra/testbench": "^5.0",
"laravel/nova": "^3.9",
"orchestra/testbench-browser-kit": "^6.0",
"orchestra/testbench": "^6.0",
"php-coveralls/php-coveralls" : "^2.2",
"phpmd/phpmd": "^2.7",
"phpunit/phpunit": "^8.0",
"sebastian/phpcpd": "^5.0",
"squizlabs/php_codesniffer": "^3.4",
"symfony/thanks": "^1.2"
"symfony/thanks": "^1.2",
"laravel/legacy-factories": "^1.0"
},
"autoload": {
"psr-4": {
Expand Down
18 changes: 18 additions & 0 deletions tests/Feature/PaginationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ class PaginationTest extends FeatureTestCase
{
public function testPaginationProvidesDifferentLinksOnDifferentPages()
{
// Checking the version start with 8.0.
if (preg_match("/^(8\.)/", app()->version())) {
$page1ActiveLink = '<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5">1</span>';
$page2ActiveLink = '<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5">2</span>';
}

// Checking the version start with 5.6, 5.7, 5.8 or 6.
if (preg_match("/^((5\.[6-8])|(6\.)|(7\.))/", app()->version())) {
$page1ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">1</span></li>';
Expand All @@ -33,6 +39,12 @@ public function testPaginationProvidesDifferentLinksOnDifferentPages()

public function testAdvancedPagination()
{
// Checking the version start with 8.0.
if (preg_match("/^(8\.)/", app()->version())) {
$page1ActiveLink = '<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5">1</span>';
$page2ActiveLink = '<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5">2</span>';
}

if (preg_match("/^((5\.[6-8])|(6\.)|(7\.))/", app()->version())) {
$page1ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">1</span></li>';
$page2ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">2</span></li>';
Expand All @@ -50,6 +62,12 @@ public function testAdvancedPagination()

public function testCustomPagination()
{
// Checking the version start with 8.0.
if (preg_match("/^(8\.)/", app()->version())) {
$page1ActiveLink = '<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5">1</span>';
$page2ActiveLink = '<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5">2</span>';
}

if (preg_match("/^((5\.[6-8])|(6\.)|(7\.))/", app()->version())) {
$page1ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">1</span></li>';
$page2ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">2</span></li>';
Expand Down
18 changes: 18 additions & 0 deletions tests/Integration/CachedBuilder/PaginateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ public function testPaginationIsCached()

public function testPaginationReturnsCorrectLinks()
{
if (preg_match("/^(8\.)/", app()->version())) {
$page1ActiveLink = '<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5">1</span>';
$page2ActiveLink = '<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5">2</span>';
$page24ActiveLink = '<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5">24</span>';
}

if (preg_match("/^((5\.[6-8])|(6\.)|(7\.))/", app()->version())) {
$page1ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">1</span></li>';
$page2ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">2</span></li>';
Expand Down Expand Up @@ -65,6 +71,12 @@ public function testPaginationReturnsCorrectLinks()

public function testPaginationWithOptionsReturnsCorrectLinks()
{
if (preg_match("/^(8\.)/", app()->version())) {
$page1ActiveLink = '<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5">1</span>';
$page2ActiveLink = '<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5">2</span>';
$page24ActiveLink = '<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5">24</span>';
}

if (preg_match("/^((5\.[6-8])|(6\.)|(7\.))/", app()->version())) {
$page1ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">1</span></li>';
$page2ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">2</span></li>';
Expand Down Expand Up @@ -94,6 +106,12 @@ public function testPaginationWithOptionsReturnsCorrectLinks()

public function testPaginationWithCustomOptionsReturnsCorrectLinks()
{
if (preg_match("/^(8\.)/", app()->version())) {
$page1ActiveLink = '<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5">1</span>';
$page2ActiveLink = '<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5">2</span>';
$page24ActiveLink = '<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5">24</span>';
}

if (preg_match("/^((5\.[6-8])|(6\.)|(7\.))/", app()->version())) {
$page1ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">1</span></li>';
$page2ActiveLink = '<li class="page-item active" aria-current="page"><span class="page-link">2</span></li>';
Expand Down