Fix return type for ViewAjaxControllerTest::setupValidMocks

Created on 27 September 2024, about 2 months ago

Problem/Motivation

The changes to remove unused variables in 📌 Use sniff DrupalPractice.CodeAnalysis.VariableAnalysis on */tests/* Needs work has shown that the return type hint on setupValidMocks is incorrect. The method returns a mock of the Views Executable where the hint is 'array'.

This was working because it used like this on HEAD
[$view, $executable] = $this->setupValidMocks();
but $view is not used so it should be removed.

Steps to reproduce

Proposed resolution

The returned value is a mock of the View Executable.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component

phpunit

Created by

🇳🇿New Zealand quietone

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @quietone
  • 🇳🇿New Zealand quietone

    I misunderstood something so this may not be needed. I need to look into this more over the next few days,

  • 🇦🇺Australia mstrelan

    I had a look at this. HEAD returns an array, and the method is correctly typed as such. The MR in 📌 Use sniff DrupalPractice.CodeAnalysis.VariableAnalysis on */tests/* Needs work changes the return value, and thus also changes the phpdoc return type, but does not change the return type in the method signature. There was probably a rebase involved in there too. Since the breakage only exists in the issue that is causing the breakage, that is where it should be fixed. Closing this "works as designed" but could possibly be "cannot reproduce".

  • 🇳🇿New Zealand quietone

    @mstrelan, thanks for having a look. I came to the same conclusion after I got some sleep. But I neglected to come back and close this.

Production build 0.71.5 2024