Skip to content
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 integration tests #2201

Merged
merged 3 commits into from
Apr 16, 2023
Merged

fix integration tests #2201

merged 3 commits into from
Apr 16, 2023

Conversation

Grotax
Copy link
Member

@Grotax Grotax commented Apr 15, 2023

  • Resolves: Tests Failing

Summary

fix ?? operator, I'm not sure what ??= does but apparently not what we wanted. ?? is evaluating if the expression to the left is null and assigns the default value on the right.
"null coalescing" operator
https://www.php.net/manual/en/language.operators.comparison.php#language.operators.comparison.coalesce

Checklist

@Grotax Grotax added the Skip-Changelog No changelog update is required, minor change label Apr 15, 2023
@SMillerDev
Copy link
Contributor

https://wiki.php.net/rfc/null_coalesce_equal_operator is what it should be

@anoymouserver
Copy link
Contributor

The null coalescing assignment operator does essentially this:
$httpLastModified = $httpLastModified ?? (new DateTime("-1 year"))->format(DateTime::RSS);

https://www.php.net/manual/en/migration74.new-features.php#migration74.new-features.core.null-coalescing-assignment-operator - However I also couldn't find it in the docs itself.

Your current code does something different, since it nerver assigns the value.

@Grotax
Copy link
Member Author

Grotax commented Apr 15, 2023

hmm I see but why does the test fail without this change? I will try
$httpLastModified = $httpLastModified ?? (new DateTime("-1 year"))->format(DateTime::RSS);

@Grotax
Copy link
Member Author

Grotax commented Apr 15, 2023

with
$httpLastModified = $httpLastModified ?? (new DateTime("-1 year"))->format(DateTime::RSS);

it also fails, I'm clueless. That seems to mean that when we pass the date to feed-io it will handle the call somehow in a different way and not throw the exception

@Grotax Grotax changed the title fix ?? operator fix integration tests Apr 15, 2023
@Grotax
Copy link
Member Author

Grotax commented Apr 15, 2023

Okay after your input I thought again what else could cause this and I followed the feed-io code.

Feed-Io adds a filter based on the date we give it.

The feed we test with just happens to have dates about 1 year ago. So with every day less items where considered as valid in that feed until even the last item was out.
The feed returned by feed-io is empty. It does still notice the error and we have it in the DB but since there is no Item that is valid or to be considered for further actions everything returns ok :D

As temporary fix I updated the dates to 2023 and it works again.

@Grotax
Copy link
Member Author

Grotax commented Apr 15, 2023

Okay 2099 should be fine for a while, the next maintainer can adjust the date again if needed.

Grotax added 2 commits April 15, 2023 18:48
Signed-off-by: Benjamin Brahmer <[email protected]>
@Grotax Grotax merged commit 934b307 into master Apr 16, 2023
@delete-merged-branch delete-merged-branch bot deleted the fix/operator branch April 16, 2023 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip-Changelog No changelog update is required, minor change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants