Redirect subclass tests #23
Open
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.
This is an attempt to resolve Danack/pdo_shenanigans#6, turned out to be really cumbersome, at least for my skillset :)
I modified the factory in pdo_test.inc so it could also create a subclass when required to. So we can use test redirection to run the same testsuite with the old
PDOas well as withPDO::connect.I had to modify run-tests.php to allow skipping double redirects instead of borking, otherwise I could not redirect to a suite that contains another redirect (and the
pdo_pgsqlsuite already has a redirect to basepdosuite).I've included two redirects at the moment:
pdo_pgsqltests using an instance created byPDO::connect(subclass specific tests are excluded as they are running without the redirect already)pdotests using an instance created byPDO::connect(eight tests are excluded because they either invokePDOdirectly without the factory or expect the exact classnamePDOin the output)We can potentially add similar redirects to all the other drivers, but you should decide whether this direction is anything we'd like to take at all.
I understand that the initial request was to only share a couple of tests, but all my attempts at moving them to a subdirectory or even a sibling directory failed, because the tests strongly rely on directory structure — they need the test files and redirects to have similar sibling files and the same path depth.