ReflectionProperty('\Phalcon\Http\Cookie', 'restored') breaks on Phalcon 5.13+ (renamed to isRestored)
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- php
- Área
- testing-qa
Línea de trabajo
Start in src/Codeception/Lib/Connector/Phalcon5.php at doRequest(), especially the ReflectionProperty usage around line 145. Reproduce through the Phalcon5 _request() path with a non-empty cookies service on Phalcon 5.12 and 5.13+, then verify that cookie synchronization completes without a ReflectionException on both versions.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
Codeception\Lib\Connector\Phalcon5::doRequest() uses reflection to read a protected restored property off Phalcon\Http\Cookie instances when syncing cookies back onto the simulated response:
$restoredProperty = new ReflectionProperty('\Phalcon\Http\Cookie', 'restored');
Phalcon renamed this property from restored to isRestored starting with Phalcon 5.13 (still named isRestored as of 5.20.3):
https://github.com/phalcon/cphalcon/blob/v5.20.3/phalcon/Http/Cookie.zep#L50
Any functional/acceptance test that dispatches a request through an app where the cookies DI service ends up with at least one entry now fails with:
ReflectionException: Property Phalcon\Http\Cookie::$restored does not exist
Steps to reproduce
- Use
codeception/module-phalcon5v2.0.1against a Phalcon app running Phalcon core>= 5.13(e.g. viaphalcon-sharedor any recentext-phalconbuild). - Dispatch any request through the
Phalcon5module's_request()(or a Codeception action built on it) where the app'scookiesservice has a non-emptycookiesarray by the time the response is built (e.g. because the session service was started during dispatch). - Observe the
ReflectionException.
Expected behavior
The connector should read whichever property name is correct for the installed Phalcon version, or simply use the public API (Phalcon\Http\Cookie doesn't appear to expose isRestored() publicly today - only getValue() triggers restore() internally) rather than reflecting into a specific protected property name.
Environment
codeception/module-phalcon5: v2.0.1 (latest on Packagist)- Phalcon core: 5.20.3 (via
phalcon/phalcon-sharedcompiled extension) - PHP: 8.3
Workaround
We're carrying a local Composer patch (via cweagans/composer-patches) that renames the reflected property from restored to isRestored, which is obviously not version-safe across Phalcon 5.12 vs 5.13+. Happy to open a PR if a version-tolerant approach (e.g. checking which property exists, or avoiding the private-property reflection entirely) would be welcome.
- Lenguaje dominante
- PHP
- Estrellas
- 6
- Forks
- 3
- Métricas de merge de PR
- Sin PR fusionados en 30 d
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 Codeception/module-phalcon5
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
Codeception/module-phalcon5#11 · 2 comentarios ·
Todos los issues de Codeception/module-phalcon5
Issues similares
-
jira-created
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
nunomaduro/phpinsights#745 ·
-
status/awaiting_triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
WordPress/plugin-check#1486 ·
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
az-digital/az_quickstart#6019 ·