Unexpected errors with `willReturn` called on `with`
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 45/100
Rechercherichtung
Reproduce the reported diagnostic using the shown PHPUnit mock chain and the listed PHPStan and PHPUnit versions. Inspect the PHPStan PHPUnit extension's handling of with() and willReturn(); done means the chain no longer reports InvocationStubber::with() as undefined while unrelated invalid calls remain detectable.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
After upgrading to PHPStan 2.2.0 the willReturn on the with seems not longer be detected correctly:
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class RegisterPreviewWebspaceClassPassTest extends TestCase
{
/** @var ContainerBuilder&MockObject */
private $containerBuilderMock;
public function testShouldNotOverrideWebspaceCacheClass(): void
{
$this->containerBuilderMock
->method('hasExtension')
->with('sulu_core')
->willReturn(false);
}
28 Call to an undefined method PHPUnit\Framework\MockObject\InvocationStubber::with().
🪪 method.notFound
Packages which are installed related to PHPUnit:
phpspec/prophecy-phpunit 2.5.0 Integrating the Prophecy mocking library in PHPUnit test cases
phpstan/phpstan-phpunit 2.0.16 PHPUnit extensions and rules for PHPStan
phpunit/php-code-coverage 14.1.9 Library that provides collection, processing, and rendering functionality for PHP code covera...
phpunit/php-file-iterator 7.0.0 FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-invoker 7.0.0 Invoke callables with a timeout
phpunit/php-text-template 6.0.0 Simple template engine.
phpunit/php-timer 9.0.0 Utility class for timing
phpunit/phpunit 13.1.13 The PHP Unit Testing framework.
symfony/phpunit-bridge 7.4.8 Provides utilities for PHPUnit, especially user deprecation notices management
- Vorherrschende Sprache
- PHP
- Sterne
- 544
- Forks
- 58
- Ø Merge
- 2 T. 1 Std.
- Gemergte PRs (30 T.)
- 5
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus phpstan/phpstan-phpunit
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 68/100
phpstan/phpstan-phpunit#332 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
phpstan/phpstan-phpunit#321 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
phpstan/phpstan-phpunit#309 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 52/100
phpstan/phpstan-phpunit#292 · 3 Kommentare ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 20/100
phpstan/phpstan-phpunit#291 ·
Alle Issues in phpstan/phpstan-phpunit
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
octobercms/october#6130 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
getgrav/grav-plugin-form#656 ·
-
customer-support needs-triage Platform(Default)
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
-
sync-en
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
-
sync-en
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100