False positive missing call to parent when setUp never returns
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 52/100
Línea de trabajo
Start by reproducing the example with a PHPUnit TestCase whose setUp() returns never after markTestSkipped(). Find the PHPStan rule or test covering required parent::setUp() calls, add a regression case for the non-returning setup, and verify that the false-positive diagnostic is gone without changing other parent-call checks.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
When creating a test that has a setup method that never returns (e.g. because the whole test should be skipped), PHPStan will complain that the parent::setUp() should be called.
In this case, we have to choose between either setting up the parent before we skip the test (doing useless work in the process), setting up the parent after the skip, which will trigger an error about dead code, or baselining the original error. All of these solutions seem wrong to me and I think in this PHPStan just shouldn't tell you to call the parent.
Example:
final class MyTest extends TestCase
{
protected function setUp(): never
{
self::markTestSkipped('Currently broken due to XYZ');
}
}
- Lenguaje dominante
- PHP
- Estrellas
- 544
- Forks
- 58
- Merge medio
- 2 d 1 h
- PR fusionados (30 d)
- 5
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de phpstan/phpstan-phpunit
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
phpstan/phpstan-phpunit#332 · 2 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
phpstan/phpstan-phpunit#321 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
phpstan/phpstan-phpunit#309 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
phpstan/phpstan-phpunit#299 · 2 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
phpstan/phpstan-phpunit#291 ·
Todos los issues de phpstan/phpstan-phpunit
Issues similares
-
[Chore] Keep one viget-block-generator skill and replicate it, instead of four tracked copies Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
hector-jewell/food-delivery-system-for-restaurant-using-php#1311 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Sylius/SyliusGridBundle#501 ·