Problem/Motivation

If that's no longer needed, we can think of removing StubPDO.

Proposed resolution

Figure it out, and if confirmed deprecate the fixture class in 11.x, and remove in main.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3585476

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mondrake created an issue. See original summary.

mondrake’s picture

Status: Active » Needs review
dcam’s picture

Status: Needs review » Needs work
Issue tags: +Needs change record

I can tell you based on my recent experience with stub objects that the StubPDO class looks entirely superfluous. Maybe there was a point to having it once, but not anymore. I looked over all of the changes and tried to figure out if there are any "gotchas" that might not be obvious. But the fact that they're all stubs inserted directly into constructors makes this pretty simple. It looks clear to me that we aren't doing anything important with these objects.

I grepped the code base and didn't find any more uses or mentions of StubPDO. So there's no concern there. Unfortunately, there are uses in contrib. See https://search.tresbien.tech/search?q=StubPDO. I hate to say it, but the class may need to be deprecated. I do feel we need to create a change record to document the change for anyone using the class, just to be friendly.

mondrake’s picture

No big deal if we need to deprecate instead of straight remove.

Maybe let’s extend scope here to mark @internal all of the StubConnection classes, so we can be a little more free in the future?

What do you think?

mondrake’s picture

Status: Needs work » Needs review

Done #5

mondrake’s picture

Title: Remove StubPDO » Deprecate StubPDO
mondrake’s picture

Issue summary: View changes
dcam’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs change record

I'm sorry that I didn't come back to this sooner.

Maybe let’s extend scope here to mark @internal all of the StubConnection classes, so we can be a little more free in the future?

Yes, I think that's a good idea too. These new changes look good to me.

  • catch committed 53093aef on main
    task: #3585476 Deprecate StubPDO
    
    By: mondrake
    By: dcam
    

catch’s picture

Version: main » 11.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed/pushed to main, thanks!

Doesn't cherry-pick cleanly to 11.x so will need a backport MR.

mondrake’s picture

Status: Patch (to be ported) » Needs review
dcam’s picture

Status: Needs review » Reviewed & tested by the community

The 11.x MR is mostly identical to the one for main. The few additions in the 11.x MR are in line with the other changes to remove the use of StubPDO. The Settings Tray failure is reproducible on the 11.x branch. The test discovery failures are caused by the problem described by #3612498: PhpUnitApiFindAllClassFilesTest not finding namespace errors. Therefore, the failures are not related to this MR. The backport looks good to me.

  • catch committed e1a5b9a5 on 11.x
    task: #3585476 Deprecate StubPDO
    
    By: mondrake
    By: dcam
    By: catch
    
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.