From a04cf0ef16fa8c228ef0617a7299d292d4e10436 Mon Sep 17 00:00:00 2001 From: Damilola Olowookere Date: Wed, 10 Jul 2019 04:34:22 +0100 Subject: [PATCH 1/3] reinstalled spatie/laravel-fractal --- composer.json | 129 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 65 insertions(+), 64 deletions(-) diff --git a/composer.json b/composer.json index 693f83e..2942442 100644 --- a/composer.json +++ b/composer.json @@ -1,66 +1,67 @@ { - "name": "laravel/laravel", - "description": "The Laravel Framework.", - "keywords": ["framework", "laravel"], - "license": "MIT", - "type": "project", - "require": { - "php": "^7.1.3", - "backup-manager/laravel": "^1.2", - "fideloper/proxy": "^4.0", - "laracasts/presenter": "^0.2.1", - "laravel/framework": "5.7.*", - "luthfi/formfield": "^1.0", - "riskihajar/terbilang": "^1.2", - "spatie/laravel-fractal": "^5.5" - }, - - "require-dev": { - "barryvdh/laravel-debugbar": "^3.1", - "doctrine/dbal": "^2.9", - "fzaninotto/faker": "^1.4", - "johnkary/phpunit-speedtrap": "^3.0", - "luthfi/simple-crud-generator": "1.2.*", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^7.0" - }, - "autoload": { - "classmap": [ - "database/seeds", - "database/factories" - ], - "psr-4": { - "App\\": "app/" - } - }, - "autoload-dev": { - "psr-4": { - "Tests\\": "tests/" - } - }, - "extra": { - "laravel": { - "dont-discover": [ - ] - } - }, - "scripts": { - "post-root-package-install": [ - "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" - ], - "post-create-project-cmd": [ - "@php artisan key:generate" - ], - "post-autoload-dump": [ - "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", - "@php artisan package:discover" - ] - }, - "config": { - "preferred-install": "dist", - "sort-packages": true, - "optimize-autoloader": true - }, - "minimum-stability": "dev", - "prefer-stable": true + "name": "laravel/laravel", + "description": "The Laravel Framework.", + "keywords": [ + "framework", + "laravel" + ], + "license": "MIT", + "type": "project", + "require": { + "php": "^7.1.3", + "backup-manager/laravel": "^1.2", + "fideloper/proxy": "^4.0", + "laracasts/presenter": "^0.2.1", + "laravel/framework": "5.7.*", + "luthfi/formfield": "^1.0", + "riskihajar/terbilang": "^1.2", + "spatie/laravel-fractal": "^5.5" + }, + "require-dev": { + "barryvdh/laravel-debugbar": "^3.1", + "doctrine/dbal": "^2.9", + "fzaninotto/faker": "^1.4", + "johnkary/phpunit-speedtrap": "^3.0", + "luthfi/simple-crud-generator": "1.2.*", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^7.0" + }, + "autoload": { + "classmap": [ + "database/seeds", + "database/factories" + ], + "psr-4": { + "App\\": "app/" + } + }, + "autoload-dev": { + "psr-4": { + "Tests\\": "tests/" + } + }, + "extra": { + "laravel": { + "dont-discover": [] + } + }, + "scripts": { + "post-root-package-install": [ + "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" + ], + "post-create-project-cmd": [ + "@php artisan key:generate" + ], + "post-autoload-dump": [ + "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", + "@php artisan package:discover" + ] + }, + "config": { + "preferred-install": "dist", + "sort-packages": true, + "optimize-autoloader": true + }, + "minimum-stability": "dev", + "prefer-stable": true } From 44edad4ca35989ab2e900538caf741285c0c1900 Mon Sep 17 00:00:00 2001 From: Damilola Olowookere Date: Fri, 18 Oct 2019 10:13:08 +0100 Subject: [PATCH 2/3] milestone commit --- composer.json | 8 +-- composer.lock | 196 ++-------------------------------------------------------- 2 files changed, 10 insertions(+), 194 deletions(-) diff --git a/composer.json b/composer.json index 2942442..06a0f33 100644 --- a/composer.json +++ b/composer.json @@ -8,14 +8,14 @@ "license": "MIT", "type": "project", "require": { - "php": "^7.1.3", - "backup-manager/laravel": "^1.2", + "php": "^7.2", + "backup-manager/laravel": "^1.4", "fideloper/proxy": "^4.0", "laracasts/presenter": "^0.2.1", - "laravel/framework": "5.7.*", + "laravel/framework": "^6.0", "luthfi/formfield": "^1.0", "riskihajar/terbilang": "^1.2", - "spatie/laravel-fractal": "^5.5" + "spatie/laravel-fractal": "^5.0" }, "require-dev": { "barryvdh/laravel-debugbar": "^3.1", diff --git a/composer.lock b/composer.lock index 29ec843..5f63e55 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "1d1a4abaa04c96f7c58ce16c09c55e73", + "content-hash": "67695798404e78891cb8a2a7e818fa6b", "packages": [ { "name": "backup-manager/backup-manager", @@ -1222,70 +1222,6 @@ "time": "2019-06-18T20:09:29+00:00" }, { - "name": "league/fractal", - "version": "0.18.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/fractal.git", - "reference": "4e553dae1a9402adbe11c81430a64675dc97b4fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/fractal/zipball/4e553dae1a9402adbe11c81430a64675dc97b4fc", - "reference": "4e553dae1a9402adbe11c81430a64675dc97b4fc", - "shasum": "" - }, - "require": { - "php": ">=5.4" - }, - "require-dev": { - "doctrine/orm": "^2.5", - "illuminate/contracts": "~5.0", - "mockery/mockery": "~0.9", - "pagerfanta/pagerfanta": "~1.0.0", - "phpunit/phpunit": "^4.8.35 || ^7.5", - "squizlabs/php_codesniffer": "~1.5", - "zendframework/zend-paginator": "~2.3" - }, - "suggest": { - "illuminate/pagination": "The Illuminate Pagination component.", - "pagerfanta/pagerfanta": "Pagerfanta Paginator", - "zendframework/zend-paginator": "Zend Framework Paginator" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.13-dev" - } - }, - "autoload": { - "psr-4": { - "League\\Fractal\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Phil Sturgeon", - "email": "me@philsturgeon.uk", - "homepage": "http://philsturgeon.uk/", - "role": "Developer" - } - ], - "description": "Handle the output of complex data structures ready for API output.", - "homepage": "http://fractal.thephpleague.com/", - "keywords": [ - "api", - "json", - "league", - "rest" - ], - "time": "2019-05-10T02:16:43+00:00" - }, - { "name": "luthfi/formfield", "version": "1.0.8", "source": { @@ -1526,16 +1462,16 @@ }, { "name": "opis/closure", - "version": "3.3.0", + "version": "3.3.1", "source": { "type": "git", "url": "https://github.com/opis/closure.git", - "reference": "f846725591203098246276b2e7b9e8b7814c4965" + "reference": "92927e26d7fc3f271efe1f55bdbb073fbb2f0722" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opis/closure/zipball/f846725591203098246276b2e7b9e8b7814c4965", - "reference": "f846725591203098246276b2e7b9e8b7814c4965", + "url": "https://api.github.com/repos/opis/closure/zipball/92927e26d7fc3f271efe1f55bdbb073fbb2f0722", + "reference": "92927e26d7fc3f271efe1f55bdbb073fbb2f0722", "shasum": "" }, "require": { @@ -1583,7 +1519,7 @@ "serialization", "serialize" ], - "time": "2019-05-31T20:04:32+00:00" + "time": "2019-07-09T21:58:11+00:00" }, { "name": "paragonie/random_compat", @@ -2221,126 +2157,6 @@ "time": "2018-03-19T00:13:25+00:00" }, { - "name": "spatie/fractalistic", - "version": "2.8.0", - "source": { - "type": "git", - "url": "https://github.com/spatie/fractalistic.git", - "reference": "9d29952f4552d6fc117e1f44f89d8dfdd36c393d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/fractalistic/zipball/9d29952f4552d6fc117e1f44f89d8dfdd36c393d", - "reference": "9d29952f4552d6fc117e1f44f89d8dfdd36c393d", - "shasum": "" - }, - "require": { - "league/fractal": "^0.18.0", - "php": "^7.0" - }, - "require-dev": { - "illuminate/pagination": "~5.3.0|~5.4.0", - "phpunit/phpunit": "^5.7.21" - }, - "type": "library", - "autoload": { - "psr-4": { - "Spatie\\Fractalistic\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "A developer friendly wrapper around Fractal", - "homepage": "https://github.com/spatie/fractalistic", - "keywords": [ - "api", - "fractal", - "fractalistic", - "spatie", - "transform" - ], - "time": "2019-05-13T07:08:06+00:00" - }, - { - "name": "spatie/laravel-fractal", - "version": "5.5.1", - "source": { - "type": "git", - "url": "https://github.com/spatie/laravel-fractal.git", - "reference": "d5061c2463379aeda7c83cb3960981b519eb9e3c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-fractal/zipball/d5061c2463379aeda7c83cb3960981b519eb9e3c", - "reference": "d5061c2463379aeda7c83cb3960981b519eb9e3c", - "shasum": "" - }, - "require": { - "illuminate/contracts": "~5.7.0|~5.8.0", - "illuminate/support": "~5.7.0|~5.8.0", - "php": "^7.2", - "spatie/fractalistic": "^2.5" - }, - "require-dev": { - "dms/phpunit-arraysubset-asserts": "^0.1.0", - "orchestra/testbench": "~3.7.0|~3.8.0", - "phpunit/phpunit": "^8.0" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Spatie\\Fractal\\FractalServiceProvider" - ], - "aliases": { - "Fractal": "Spatie\\Fractal\\FractalFacade" - } - } - }, - "autoload": { - "psr-4": { - "Spatie\\Fractal\\": "src" - }, - "files": [ - "src/helpers.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "An easy to use Fractal integration for Laravel applications", - "homepage": "https://github.com/spatie/laravel-fractal", - "keywords": [ - "api", - "fractal", - "laravel", - "laravel-fractal", - "lumen", - "spatie", - "transform" - ], - "time": "2019-03-13T14:18:31+00:00" - }, - { "name": "swiftmailer/swiftmailer", "version": "v6.2.1", "source": { From 8b6f8ab8ed9f01c9a26af10a93679a442d97a138 Mon Sep 17 00:00:00 2001 From: Damilola Olowookere Date: Fri, 18 Oct 2019 11:13:30 +0100 Subject: [PATCH 3/3] fix failing phpunit tests --- tests/Unit/Helpers/DateDifferenceTest.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/Unit/Helpers/DateDifferenceTest.php b/tests/Unit/Helpers/DateDifferenceTest.php index 3a9625e..28dd45c 100644 --- a/tests/Unit/Helpers/DateDifferenceTest.php +++ b/tests/Unit/Helpers/DateDifferenceTest.php @@ -32,13 +32,14 @@ class DateDifferenceTest extends TestCase /** @test */ public function date_difference_returns_proper_months_and_days_format() { - // TODO: Need to fix, this should returns 1 months 9 days - $this->assertEquals('1 month 12 days', date_difference('2018-03-01', '2018-04-10', '%m month %d days')); + //according to https://www.datecalculator.org/date-difference-between-dates + $this->assertEquals('1 month 9 days', date_difference('2018-03-01', '2018-04-10', '%m month %d days')); } /** @test */ public function date_difference_returns_proper_years_months_and_days_format() { - $this->assertEquals('1 year 1 month 12 days', date_difference('2017-03-01', '2018-04-10', '%y year %m month %d days')); + //according to https://www.datecalculator.org/date-difference-between-dates + $this->assertEquals('1 year 1 month 9 days', date_difference('2017-03-01', '2018-04-10', '%y year %m month %d days')); } }