-
Notifications
You must be signed in to change notification settings - Fork 73
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
Fix issue 414, add tests + add php8 to travis (but not composer) #415
Merged
prolic
merged 5 commits into
prooph:master
from
grymmare:feature/issue-414-support-php8
Aug 25, 2021
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
bd863b4
Add php8 to composer/travis + fix issue 414 that fails for php8 and a…
bae0621
Cleanup code + specifically ignore php deps, not all deps
e3e0e25
Fix CS errors. Limit psalm to <12 to avoid errors. Remove php8 from c…
7a3a0fc
Use latest php-cs-fixer-config with php8 support
be08b9d
Merge branch 'master' into feature/issue-414-support-php8
prolic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
/build | ||
.idea | ||
.php_cs.cache | ||
.phpunit.result.cache | ||
nbproject | ||
composer.lock | ||
docs/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of prooph/event-store. | ||
* (c) 2014-2020 Alexander Miertsch <[email protected]> | ||
* (c) 2015-2020 Sascha-Oliver Prolic <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace ProophTest\EventStore\Internal; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Prooph\EventStore\Internal\DateTimeStringBugWorkaround; | ||
|
||
class DateTimeStringBugWorkaroundTest extends TestCase | ||
grymmare marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
public function provider(): array | ||
{ | ||
return [ | ||
[ | ||
'2020-12-14T12:55:57Z', | ||
'2020-12-14T12:55:57.000000Z', | ||
], | ||
[ | ||
'2020-12-14T12:55:57.1234567Z', | ||
'2020-12-14T12:55:57.123456Z', | ||
], | ||
[ | ||
'2020-12-14T12:55:57.1234Z', | ||
'2020-12-14T12:55:57.123400Z', | ||
], | ||
]; | ||
} | ||
|
||
/** | ||
* @param string $date | ||
* @param string $expectedConvertedDate | ||
* @dataProvider provider | ||
*/ | ||
public function test_it_correctly_converts_datetime(string $date, string $expectedConvertedDate): void | ||
{ | ||
$actualConvertedDate = DateTimeStringBugWorkaround::fixDateTimeString($date); | ||
$this->assertEquals($expectedConvertedDate, $actualConvertedDate); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 don't think we should ignore these here. Better fix these issues properly. Not doing so makes this either not installable for normal users or it forces them to use this flag on their project too.
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.
Sure, makes sense, but without the flag, we cannot run the tests for php 8 until all dependencies supports php 8. What if we don't add php8 to composer.json, that way we don't officially support php8, but can still run tests.
The tests that fail (in addition to dependencies not supporting php8 yet) are related to the vimeo/psalm version.