Skip to content

[4.x] Laravel 7 #1988

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 8 commits into from
Mar 10, 2020
Merged

[4.x] Laravel 7 #1988

merged 8 commits into from
Mar 10, 2020

Conversation

divine
Copy link
Contributor

@divine divine commented Mar 5, 2020

Added Laravel 7 compatibility.

divine added 5 commits March 6, 2020 00:01
Remove phpcov, it's not compatible and suggested to be installed with phar instead of composer, see sebastianbergmann/phpcov#96
Remove php 7.1 which is EOL.
Bump dependencies for laravel 7
Make functions and tests compatible with laravel 7

Date serialization changes
Laravel 7 uses a new date serialization format when using the toArray or toJson method on Eloquent models. To format dates for serialization, the framework now uses Carbon's toJSON method, which produces an ISO-8601
https://laravel.com/docs/7.x/upgrade#date-serialization
 laravel_7_comptability

$model->getOriginal() was moved to getRawOriginal method See https://laravel.com/docs/7.x/upgrade#factory-types
@divine
Copy link
Contributor Author

divine commented Mar 5, 2020

This tests are failing even changing $dateFormat = 'l jS \of F Y h:i:s A'; in User model didn't help.

// test custom date format for json output	
$json = $user->toArray();	
$this->assertEquals($user->birthday->format('l jS \of F Y h:i:s A'), $json['birthday']);	
$this->assertEquals($user->created_at->format('l jS \of F Y h:i:s A'), $json['created_at']);

Error:

Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'Tuesday 1st of January 1980 12:00:00 AM'
+'1980-01-01T00:00:00.000000Z'

However, added another tests which was taken from here

@divine divine requested a review from Smolevich March 5, 2020 22:04
@jenssegers
Copy link
Contributor

Codecov Report

Merging #1988 into develop will decrease coverage by 0.15%.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #1988      +/-   ##
=============================================
- Coverage      82.80%   82.65%   -0.16%     
  Complexity       531      531              
=============================================
  Files             27       27              
  Lines           1210     1211       +1     
=============================================
- Hits            1002     1001       -1     
- Misses           208      210       +2     
Impacted Files Coverage Δ Complexity Δ
src/Jenssegers/Mongodb/Eloquent/Model.php 80.53% <0.00%> (-1.22%) 80.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b379bd3...a73a667. Read the comment docs.

@codecov-io
Copy link

codecov-io commented Mar 5, 2020

Codecov Report

Merging #1988 into develop will decrease coverage by 0.15%.
The diff coverage is 90.9%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #1988      +/-   ##
=============================================
- Coverage       82.8%   82.65%   -0.16%     
  Complexity       531      531              
=============================================
  Files             27       27              
  Lines           1210     1211       +1     
=============================================
- Hits            1002     1001       -1     
- Misses           208      210       +2
Impacted Files Coverage Δ Complexity Δ
src/Jenssegers/Mongodb/Eloquent/Model.php 80.53% <90.9%> (-1.22%) 80 <10> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b379bd3...31b0fdf. Read the comment docs.

Drop test collections correctly
@@ -223,36 +223,37 @@ public function getCasts()
/**
* {@inheritdoc}
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest to remove this dock block and same in this file

@Smolevich Smolevich merged commit ec89233 into mongodb:develop Mar 10, 2020
@divine divine mentioned this pull request Mar 10, 2020
@divine divine deleted the laravel_7 branch March 10, 2020 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants