0
votes
0answers
61 views

Testing WordPress with Mockery and a Facade

I've put together this gist with an idea about testing WordPress themes and plugins with Mockery and a WordPress facade object. I've love some feedback on the approach, please. WordPressFacade ...
1
vote
1answer
38 views

Thoughts on the testability of my use case interactor?

So here is a class that executes the CreateAPerson use case. It takes a request object (which is a simple data structure), validates the request, creates a new person, and then returns a response ...
3
votes
1answer
160 views

Tips for Making this Code Testable

So I'm writing an abstraction layer that wraps a telephony RESTful service for sending text messages and making phone calls. I should build this in such a way that the low-level provider, in this case ...
3
votes
1answer
488 views

Unit Testing Code that Calls RESTful API

So I'm writing a library which calls a RESTful API and then performs some work on the data. I've architected my code like this: I have a class, let's call it APIRequestor that initiates a call to the ...
1
vote
2answers
184 views

PHP class library

I am a PHP newbie, gone through a couple starter tutorials which went ok, so I thought I'd try creating a more complex project to get some experience. It is a NetBeans PHP project where I try to ...
2
votes
1answer
1k views

Is This the Best Approach for Unit Testing My Symfony2 Service?

The Service: <?php namespace TestApp\Services\Ext; class ExtFilterParser { private $parsedFilters = array(); private $filters = ''; private $requestParam = 'filter'; public ...
2
votes
1answer
213 views

Logger to syslog with error_log fallback

Below is an implementation of a typical Logger interface that uses syslog() as the default means to store messages and falls back to error_log() if that does not work. This is the first time I've ...
2
votes
1answer
197 views

Are my Unit Tests any good?

This is the first time I have written Unit Tests. I am testing code that I have already written and would like to move to TDD once I have managed to get units written for everything that is already in ...
4
votes
1answer
136 views

Reviewing my unit testing (in PHP)

This week-end, I finally found some time to learn unit testing (it's about time, I know). So I've tried to do this in PHP, with PHPUnit 3.6. I've wrote a small, simple and useless class wrapper for ...
9
votes
4answers
243 views

How to improve this to a readable Unittests that explain the Class better ?

for starters i though of going with a mostly code only example. This shows a testcase for an old caching library i use for a project. It features simple save/load/delete functions (saidly static ...