RE: [PHP-DEV] Class Posing
| From: | Jared Williams | Date: | Tue, 02 Oct 2007 21:50:11 +0000 |
| Subject: | RE: [PHP-DEV] Class Posing | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-32574@lists.php.net to get a copy of this message | ||
I think they end up using the dependency injection pattern.
http://www.picocontainer.org/ java implementation with a
PHP port.
http://sourceforge.net/projects/phemto/ is a
more lightweight PHP
implementation. Its README
http://phemto.cvs.sourceforge.net/phemto/phemto/README?revision=1.1.1.1&view
=markup .
Problem is the cost of setting up these, by registering implementations,
performing reflection and so on is expensive especially considering the
stateless nature of PHP.
J
> -----Original Message-----
> From: Stanislav Malyshev [mailto:stas@zend.com]
> Sent: 02 October 2007 21:21
> To: Sebastian Bergmann
> Cc: internals@lists.php.net
> Subject: Re: [PHP-DEV] Class Posing
>
> > Stubs / Mock Objects !== Unit Tests. Class Posing allows
> for better
> > stubs / mock objects which in turn are tools to write better unit
> > tests.
>
> OK, I see that. The question is - does any of the known unit
> test systems use mock objects? Does it do that in the
> language that doesn't allow "new Foo" to create object of
> entirely unrelated class? If so - how it is usually done?
> --
> Stanislav Malyshev, Zend Software Architect
> stas@zend.com http://www.zend.com/
> (408)253-8829 MSN: stas@zend.com
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>