Skip to content

3.0.x php unit testing fixes pre rfc - #38

Merged
tyrsson merged 19 commits into
3.0.xfrom
3.0.x-php-unit-testing-fixes-pre-rfc
Apr 14, 2025
Merged

3.0.x php unit testing fixes pre rfc#38
tyrsson merged 19 commits into
3.0.xfrom
3.0.x-php-unit-testing-fixes-pre-rfc

Conversation

@simon-mundy

Copy link
Copy Markdown
Member

Upgraded tests using rector -> PHPUnit 11
Fixed datasources to ensure they are static
Various refactoring to tests for compliance
Made E_NOTICE/E_ERROR silent for testing purposes
Commented out incomplete tests

For all intents and purposes this means the unit testing should work as-is. There are still numerous upgrades to perform - namely a lot of deprecated getMockForAbstractClass() calls in the tests - but they will need to wait until the satellite packages have been moved out as it's a lot of work.

Fixed datasources to ensure they are static
Various refactoring to tests for compliance
Made E_NOTICE/E_ERROR silent for testing purposes
Fixed datasources to ensure they are static
Various refactoring to tests for compliance
Made E_NOTICE/E_ERROR silent for testing purposes
Commented out incomplete tests
Fixed datasources to ensure they are static
Various refactoring to tests for compliance
Made E_NOTICE/E_ERROR silent for testing purposes
Commented out incomplete tests
@simon-mundy simon-mundy added the qa Improvements in quality assurance of the project label Mar 28, 2025
@simon-mundy simon-mundy added this to the 3.0.0 milestone Mar 28, 2025
@simon-mundy simon-mundy self-assigned this Mar 28, 2025
Fixed datasources to ensure they are static
Various refactoring to tests for compliance
Made E_NOTICE/E_ERROR silent for testing purposes
Commented out incomplete tests
Fixed datasources to ensure they are static
Various refactoring to tests for compliance
Made E_NOTICE/E_ERROR silent for testing purposes
Commented out incomplete tests

@tyrsson tyrsson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall looks very good. (I know you were just fixing what was already there)

For all of the test cases they need renamed to SomeTestCase and if test do not extend them they need to be marked as final.

All test methods that are not returning values need typed as :void. I'm requesting this change here since we are already touching all of these files and it will improve the psalm baseline a lot.

I would also like to get @settermjd thoughts on this review. It's a lot to review so maybe he can just provide some feedback on this one.

@simon-mundy Thank you for the huge amount of work in this PR.

Comment thread test/integration/Adapter/Driver/Pdo/AbstractAdapterTestCase.php Outdated
Comment thread test/integration/Adapter/Driver/Pdo/Mysql/AdapterTrait.php Outdated
Comment thread test/integration/Adapter/Driver/Pdo/Mysql/TableGatewayTest.php Outdated
Comment thread test/integration/Adapter/Driver/Pdo/Postgresql/AdapterTrait.php
Comment thread test/integration/Adapter/Platform/MysqlTest.php
Comment thread test/unit/Sql/Platform/Mysql/SelectDecoratorTest.php
Comment thread test/unit/Sql/SqlTest.php Outdated
Comment thread test/unit/Sql/TableIdentifierTest.php Outdated
Comment thread test/unit/Sql/TableIdentifierTest.php Outdated
Comment thread test/unit/TestAsset/ObjectToString.php
@github-project-automation github-project-automation Bot moved this from Todo to In Progress in @laminas-db Mar 29, 2025
Comment thread test/integration/Platform/MysqlFixtureLoader.php
Comment thread test/integration/Adapter/Driver/Pdo/Mysql/TableGatewayTest.php Outdated
Comment thread test/unit/Adapter/AdapterServiceFactoryTest.php
Comment thread test/unit/Adapter/AdapterTest.php
Comment thread test/unit/Adapter/Driver/IbmDb2/AbstractIntegrationTestCase.php
Comment thread test/unit/Adapter/Driver/IbmDb2/TestAsset/Db2Functions.php
Comment thread test/unit/Adapter/Driver/Mysqli/ConnectionTest.php
Comment thread test/unit/Adapter/Driver/Pdo/ConnectionIntegrationTest.php
Comment thread test/unit/Adapter/Driver/Pdo/ConnectionTest.php

@settermjd settermjd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just a few comments, mate Otherwise, thanks for the hard work.

Comment thread src/Sql/Delete.php
Fixed datasources to ensure they are static
Various refactoring to tests for compliance
Made E_NOTICE/E_ERROR silent for testing purposes
Commented out incomplete tests
Fixed datasources to ensure they are static
Various refactoring to tests for compliance
Made E_NOTICE/E_ERROR silent for testing purposes
Commented out incomplete tests
Fixed datasources to ensure they are static
Various refactoring to tests for compliance
Made E_NOTICE/E_ERROR silent for testing purposes
Commented out incomplete tests
Fixed datasources to ensure they are static
Various refactoring to tests for compliance
Made E_NOTICE/E_ERROR silent for testing purposes
Commented out incomplete tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

qa Improvements in quality assurance of the project

Projects

None yet

3 participants