Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
4 votes
1 answer
125 views

Creating Dedicated Database for database test cases (Tests that I need to check the data are written or read sucessfully) in phpunit

I am making a base test class that bootstraps database Test cases ...
Dimitrios Desyllas's user avatar
2 votes
0 answers
49 views

Testing PHP CodeIgniter 3 controller with PHPUnit

I want to unit test my PHP website, which uses the outdated framework CodeIgniter 3. CodeIgniter 3 uses the MVC pattern, and each page on the website corresponds to a public method in a controller. I ...
RedDragonWebDesign's user avatar
1 vote
2 answers
195 views

PHP unit test to confirm that a validator is being called correctly

I have a Responder class whose prepare method takes an entity, checks it with a validator, and returns a response or errorResponse based on the results of validator....
EresDev's user avatar
  • 121
4 votes
1 answer
152 views

Bill settlement for multiple users

I want to improve the logic for bill settlement and calculation of amount due. I managed to write code with T.D.D., but I think those loops could be improved somehow. Do you have any ideas on that ...
Kalpa Perera's user avatar
3 votes
0 answers
635 views

PHPUnit testing my custom helper Facade classes in Laravel 5.5

I have been reading up on TDD and it's something I genuinely want to learn and be good at. This is something I haven't been doing as a developer and I thought it's about time I get into it. These are ...
Latheesan's user avatar
  • 303
0 votes
0 answers
432 views

Unit test for my image resizer class

I made a class that will be used to get an image properties like width, height, and MIME type. ...
Dwi Purnomo's user avatar
3 votes
2 answers
166 views

PHPUnit test for a PaymentMethodRuleManager

The following code snippet is about adding rules that filters Payment Methods listing to customer, for email we provide 4 different types of payment methods, but we do show them depending on some ...
Dahab's user avatar
  • 159
4 votes
1 answer
140 views

Testing a Pivotal API request client using lots of mocking

I have a class that is all about doing HTTP requests, and logging (in file system & database). It's only using 3 dependencies to do these things, so I'm fine with the code so far. Here it is for ...
Steve Chamaillard's user avatar
4 votes
1 answer
321 views

Simple Pizza Factory with tests

I implemented the Simple Factory Pattern with some unit tests, but I'm with a feeling that I did something wrong and that I can improve it. Tell me what you think about the code (source and tests). ...
yayuj's user avatar
  • 185
3 votes
0 answers
877 views

Laravel Testing: Is this testing too much of the inner workings?

So I'm using laravel for a project and have a InvoiceRepository and a InvoiceRepositoryTest and I have written the test first ...
toonevdb's user avatar
  • 131
2 votes
1 answer
7k views

Unit Testing of Curl based Rest Client Library

I ran into some issues with unit testing in that getting the response body etc from the curl handle was tricky. I didn't want to necessarily use a mock or abstract the curl functionality. A colleague ...
ajameswolf's user avatar
5 votes
1 answer
471 views

Mock user table class

I've just created my first tests using mock classes. So far my tests are running much faster and now I guess I'm solely focusing on a single class (in this case I'm testing UserTable and mocking the ...
Martyn's user avatar
  • 233