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

DB2 constants are missing when setting up db factory #83

Closed
wants to merge 2 commits into from

Conversation

glensc
Copy link
Contributor

@glensc glensc commented Mar 15, 2021

In a lot of cases with PHP8 Type and ValueErrors are thrown instead of
warnings emitted. The error handling in tests needed to be modified
accordingly.

Changes for this discussion:

} catch (Throwable $e) {
if (stristr($e->getMessage(), 'undefined constant')) {
$this->markTestSkipped();
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Example:

But I'm thinking maybe this approach is wrong, better emulate in code the same behavior as older php versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This class can't be even loaded:

The exception is thrown on class construction:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the only solution here is to assign $_execute_mode default value on the constructor. but no idea about is that backward compatible change or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@glensc glensc mentioned this pull request Mar 16, 2021
32 tasks
In a lot of cases with PHP8 Type and ValueErrors are thrown instead of
warnings emitted. The error handling in tests needed to be modified
accordingly.

Signed-off-by: Elan Ruusamäe <glen@pld-linux.org>
Signed-off-by: Alexander Wozniak <wozniak@oktopos.com>
With php 8.0, the class can't be constructed if constant is missing
so the runtime check of extension can never be reached.
@falkenhawk
Copy link
Member

In my opinion this will not be necessary as running Zend\Db\AllTests.php (either directly, by passing this file to phpunit command, or just letting phpunit run all tests with default configuration) also omitted other disabled adapters - effectively avoiding a fatal error with missing DB2 constant.

I am going to close this, thank you for your investigation.

@falkenhawk falkenhawk closed this Sep 25, 2021
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.

2 participants