Comments (9)
Hi @boesing, regarding the PHPUnit dependency upgrade: the assertions assertAttribute*
have been removed #(sebastianbergmann/phpunit#3338). This was primarily done because it makes it too easy to test implementation details.
This repository seems to use these assertions quite a lot, what's the recommended upgrade path for the tests which use these assertions?
from mezzio.
@jensdenies that really depends on the context in which those assertions are used.
Some can be addressed by comparing objects (assertEquals
not assertSame
, sure). However, there might be cases where the test method is just useless and needs to be removed or adjusted to use the public API.
Perhaps PHPUnit upgrade and dropping PHP 7.3 should be done in a separate PR, so that we can more easily contain the scope of changes?
from mezzio.
Hi @lcobucci, several of these assertions are used to read private properties, which are indeed implementation details. Those properties do not always have an associated getter, so IMO it would be best to remove those and only test the public API of those classes.
Regarding your last comment, that would certainly make thing easier because the assertions are still available in PHPUnit 8. I think it would make the upgrade path a lot easier.
from mezzio.
@lcobucci I've created a draft PR here: #55.
from mezzio.
@jensdenies Imho, the current tests can be rewritten with reflection. Feel free to create some trait within the tests
directory and share it with those tests which are using the removed assertAttribute*
methods.
I wont recommend rewriting the whole testsuite as this would take too much time.
We can still consider this for the next major but for now, just use a self-written method which uses reflection.
We've done so in many other components aswell.
from mezzio.
@boesing I will create a PR with a trait to polyfill those traits, like you proposed.
When looking at other Laminas repositories, I see that in some cases, tests which test implementation details are removed.
Is that something you'd like to see in the PR as well?
from mezzio.
@jensdenies Depends. The tests which were removed were tests to verify if backwards compatibility to servicemanager v2 works.
As we dropped support for the servicemanager v2 in laminas-cache
, the tests were removed accordingly along with the implementation.
from mezzio.
@boesing Okay, I will create a PR working on PHP 8.0 with a polyfill trait and let's see from there.
from mezzio.
from mezzio.
Related Issues (20)
- Create `Mezzio\ApplicationPipeline` implementation for better static code analysis HOT 1
- Missing good examples of configuration template paths for laminas-view in mezzio HOT 3
- Replace `RequestHandlerRunner` factory with `RequestHandlerRunnerInterface` factory HOT 3
- Page with the description of the installation is missing
- Dependency Dashboard
- [RFC]: Provide an ApplicationProgrammaticConfigDelegator that pairs with ApplicationConfigInjectionDelegator HOT 4
- Script MezzioInstaller\OptionalPackages::install handling the pre-install-cmd event terminated with an exception HOT 3
- Upgrading to PHP 8.2 breaks Dependency Injection HOT 9
- [RFC]: Remove Pimple from Mezzio documentation and from Mezzio skeleton HOT 3
- bin/mezzio-tooling is incompatible with mezzio/mezzio-tooling v2 HOT 7
- [RFC]: Deprecate `ApplicationConfigInjectionDelegator` and `Application#post`, etc.
- Provide `RouteCollectorInterface` and `MiddlewarePipeInterface` delegators to supersede `ApplicationConfigInjectionDelegator` HOT 1
- jsoumelidis/zend-sf-di-config[0.4.0, ..., 0.4.1] require php ^7.1 -> your php version 8.0.99 HOT 1
- PhpDebugBar documentation is outdated. HOT 1
- [RFC]: Mezzio v4 HOT 2
- Mezzio does not work without a router HOT 3
- Using ApplicationConfigInjectionDelegator more than once (in multiple modules simultaneously) results results in a DuplicateRouteException. HOT 1
- Move router integration tests to router packages
- PHP 8.1 Support HOT 12
- Support for laminas-httphandlerrunner 2.x versions HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mezzio.