hoaproject / Dispatcher

The Hoa\Dispatcher library.
https://hoa-project.net/
12 stars 8 forks source link

Implement `ObjectMethod` dispatcher. #27

Open shulard opened 8 years ago

shulard commented 8 years ago

Hello !

I've worked on the #16 issue about ObjectMethod dispatcher. I tried to use only the object logic inside the Basic dispatcher combined with the refactored ClassMethod.

For the moment it's a first step but there is a lot of duplicated code between the different dispatchers (parameters retrieving, ClassMethod vs ObjectMethod...). I think that we'll discuss about a refactoring when the dispatcher split will be done.

Hywan commented 8 years ago

Is it ready for a review?

shulard commented 8 years ago

I think it is ! Based on the current ClassMethod implementation it introduce the same behaviour but on a given object only...

shulard commented 7 years ago

Same here, I've rebased on master 😄.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.5%) to 95.302% when pulling a3b3fe89863b14d70c535ab64ceaa25218a90213 on shulard:feature/issue-16 into 2b1c3006ef2670378cc1a1b72e91ddb89b91b5ec on hoaproject:master.

shulard commented 7 years ago

Hello @Hywan,

I've rebased my code on master, for me the implementation is done. I've one question about custom object logic during tests. I've created specific classes in the ObjectMethod.php test file : ObjectMethod_MockObject, ObjectMethod_MockKit, ObjectMethod_MockRouter.

I know that I can mock Router and Kit relatively easily but the ObjectMethod_MockObject must exists during the test phase. It's a custom object used during dispatcher process and I can't add methods on a mock object.

Is there a cleaner way to handle that ?