setFinal is available for both classes and methods, as shown in
example in my gist
(https://gist.github.com/1621839#file_final_test.php). This should be
enough for all possible mocks, as I discussed it with my friends.

It is also possible to remove final, create a mock class and then put
it back, if someone wants to keep it after mocks have been created.


Sorry about my CS, I'll be more careful next time. I wanted to make a
proof of concept quickly to try it in PHP.

Jan Dolecek
juzna...@gmail.com



On Tue, Jan 17, 2012 at 12:03 PM, jpauli <jpa...@php.net> wrote:
> Just one last word : The patch just adds setFinal() to ReflectionClass.
> What about ReflectionMethod ? Not very usefull for the mocking purpose, but
> that would be good for the Reflection API.
>
> Julien
>
> On Tue, Jan 17, 2012 at 12:00 PM, jpauli <jpa...@php.net> wrote:
>
>> +1, I like the idea as well.
>> How didn't we think about that earlier... ?
>>
>> Julien
>>
>>
>> On Tue, Jan 17, 2012 at 11:54 AM, Sebastian Bergmann 
>> <sebast...@php.net>wrote:
>>
>>> Am 17.01.2012 11:34, schrieb Pierre Joye:
>>> > Patch looks good, but coding standard.
>>>
>>>  If there are no objections, I can fix the CS issue and commit the patch
>>>  to trunk.
>>>
>>> --
>>> Sebastian Bergmann                    Co-Founder and Principal Consultant
>>> http://sebastian-bergmann.de/                           http://thePHP.cc/
>>>
>>> --
>>> PHP Internals - PHP Runtime Development Mailing List
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to