PSR-3 Logger Mock

221 views
Skip to first unread message

Andrew Eddie

unread,
Mar 10, 2013, 9:13:56 PM3/10/13
to php...@googlegroups.com
Would there be any reason we couldn't add a PHPUnit style mock builder to the Log package? I'm writing a logger aware class but need a mock to test a few things.

If so, what would be the process for that change and how would that affect the version of the code?

Thanks in advance.

Regards,
Andrew Eddie

Marco Pivetta

unread,
Mar 10, 2013, 9:54:51 PM3/10/13
to php...@googlegroups.com
Heya!

What's the advantage over simply using a PHPUnit (or mockery, or whatever you prefer) mock of the interface?

--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/php-fig/-/yXRb_IU_BhoJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Andrew Eddie

unread,
Mar 10, 2013, 9:59:05 PM3/10/13
to php...@googlegroups.com
Saves everyone reinventing the same wheel. Actually, just ignore the question - we'd never be able to agree an approach to include the various flavours (PHPUnit, Mockery, et al) anyway.

Carry on.

Regards,
Andrew Eddie

--
You received this message because you are subscribed to a topic in the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/php-fig/Ub2EPRGfW4E/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to php-fig+u...@googlegroups.com.

To post to this group, send email to php...@googlegroups.com.

justin

unread,
Mar 11, 2013, 12:24:57 AM3/11/13
to php...@googlegroups.com
You could, however, make an andreweddy/psr3-logger-mock composer package in your favorite flavor, and anyone who wanted to use it could avoid reinventing the wheel for themselves :)

Andrew Eddie

unread,
Mar 11, 2013, 12:33:05 AM3/11/13
to php...@googlegroups.com
Yeah, maybe.  I ended up doing something like this:


Regards,
Andrew Eddie
http://learn.theartofjoomla.comfree tutorials and videos on Joomla development

Igor Wiedler

unread,
Mar 11, 2013, 10:30:00 PM3/11/13
to php...@googlegroups.com
Sounds like what you're really looking for is a mocking framework with a spy-like API, such as Phake: http://phake.digitalsandwich.com/
Reply all
Reply to author
Forward
0 new messages