sonata-project / cache

[Deprecated] Cache library
https://github.com/sonata-project/cache
MIT License
332 stars 29 forks source link

use the right method to get the object of the lifecycle event arguments #103

Closed dbu closed 6 years ago

dbu commented 6 years ago

I am targeting this branch, because its a bugfix.

Changelog

### Fixed
- PHPCR-ODM cache listener: use correct method to get object from event lifecycle arguments

Subject

In symfony-cmf we see an exception with this invalidator: https://github.com/symfony-cmf/cmf-sandbox/pull/398

I don't know why we did not see it before (likely we were not using this) and i think this listener never actually worked. There is no test for it unfortunately.

greg0ire commented 6 years ago

There is no test for it unfortunately.

Please test that method through preRemove, for instance

ElectricMaxxx commented 6 years ago

@dbu ping? shall we help for the testing?

dbu commented 6 years ago

i basically copied the orm test, and indeed found that we had a second occurence of getDocument in the listener! yay for tests :-D

greg0ire commented 6 years ago

That feeling when the tests prove useful right when they are written :D