-
Notifications
You must be signed in to change notification settings - Fork 170
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
[Laravel 6] Bring code to a state where unit tests pass #443
Conversation
- Require Laravel framework components ^6.0 - Require PHPUnit 8 to take advantage of longer support timeline - Require Assetic from October CMS' Assetic repo, to fix conflict with Symfony Process
Matches Laravel 6 signature.
Prevents test from failing to load as `choice` method must be present in a class extending the Translator contract.
!! Backwards incompatible change.
Exception docblock annotations were deprecated in PHPUnit 8 and will be removed in PHPUnit 9. This changes the @ExpectedException annotation to an `expectException()` call, and the @expectedExceptionMessage annotation to an `expectExceptionMessage()` call.
The `assertInternalType()` method is deprecated in PHPUnit 8 and will be removed in PHPUnit 9. We were using them to test if arrays were returned in certain test cases, so these calls have been changed to `assertIsArray()`.
`assertContain()` calls with a string haystack is deprecated in PHPUnit 8 and will be not be supported in PHPUnit 9. This changes these calls to `assertStringContainsString()`.
`assertArraySubset()` calls are deprecated in PHPUnit 8 and will be removed in PHPUnit 9. This change brings in the "dms/phpunit-arraysubset-asserts" package which retains this assertion for PHPUnit 8 and beyond.
Submitted a PR to meyfa/phpunit-assert-gd to make the library compatible with PHPUnit 8, so we don't have to rewrite the Resizer unit tests. This should resolve the unit test errors reported by Actions. |
@bennothommo I've sent an email to @meyfa asking if they're interested in merging that PR. If they aren't we'll just fork it over to @octoberrain and use that instead. |
@@ -1,13 +1,12 @@ | |||
<?php namespace October\Rain\Parse\Assetic; | |||
|
|||
use Event; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bennothommo @jaxwilko @christianWilling is there value in moving this filter to the Assetic core? I'm not 100% sure what it does differently from the already included Assetic filters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the looks of it the October one also add's in file version hashing functionality, could merge it in this filter or add in that functionality as an option for the Assetic project?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't spent enough time on this filter or the core Assetic filter to understand the difference between those two options @jaxwilko, are you able to explain it in a bit more detail for me?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jaxwilko ping
@@ -1,12 +1,11 @@ | |||
<?php namespace October\Rain\Parse\Assetic; | |||
|
|||
use Event; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bennothommo @jaxwilko @christianWilling is there value in moving this filter to the Assetic core? I'm not 100% sure what it does differently from the already included Assetic filters.
@bennothommo note that the assetic package is on packagist: https://packagist.org/packages/assetic/framework#dev-2.0/dev |
@LukeTowers sweet, will drop the repository definition in |
@LukeTowers FYI, I've released v2.0.0 of phpunit-assert-gd with the proposed changes. |
@meyfa awesome, thanks very much for that! @bennothommo do you need to update the constraint in composer? |
Thanks heaps @meyfa. Yep, will adjust |
@LukeTowers Input facade has been re-added. |
Newer versions deprecate, and drop, support for numeric keys in arrays, which prevents our plugin version files from working.
This PR brings the state of the Library code, running Laravel 6 as the foundation, so that the unit tests pass. Whilst it is definitely no guarantee that the code will work with Laravel 6, it's at least a good start. This work forms part of the work towards octobercms/october#4381.
Changes made:
composer.json
whilst the library is still unpublished on Packagist.October\Rain\Halcyon\MemoryRepository
to use seconds instead of minutes, as per changes made toIlluminate\Cache\Repository
. I didn't see this being used anywhere in the library, but I imagine this will likely result in needing changes done to October CMS core.Input
facade calls to comparableRequest
facade calls, as theInput
facade is no longer available in Laravel 6 (although we are making the facade available in October still).