Incorrect resolution of assertInstanceOf with __NAMESPACE__ + string

Aperta
#27 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
php
Ambito
testing

Direzione di ricerca

Start with the Doctrine\Tests\DBAL\Functional\DataAccessTest case and reproduce the legacy assertInstanceOf(NAMESPACE.'\MyFetchClass', ...) example described in the issue. Trace how the PHPStan PHPUnit rule resolves the string and verify that the resulting class is Doctrine\Tests\DBAL\Functional\MyFetchClass rather than Doctrine\MyFetchClass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Doctrine is using the following legacy format on some places:

self::assertInstanceOf(__NAMESPACE__.'\\MyFetchClass', $results[0]);

in a test located inside the Doctrine\Tests\DBAL\Functional\DataAccessTest test case.

The above incorrectly resolves as Doctrine\MyFetchClass instead of Doctrine\Tests\DBAL\Functional\MyFetchClass. Replacing with MyFetchClass::class is a workaround.

Lingua principale
PHP
Stelle
544
Fork
58
Merge medio
2g 1h
PR unite (30g)
5

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di phpstan/phpstan-phpunit

Tutte le issue di phpstan/phpstan-phpunit

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.