PHPUnit is the de facto standard for writing unit tests for PHP code.

learn more… | top users | synonyms

0
votes
1answer
64 views

Repository code in Laravel

I am practicing to code in the right way and make it testable. Please review this code and tell me anything bad practices of it. Entity: ...
3
votes
3answers
90 views

XML parser using PHP

It is just one of the files. I have also tried to write some tests using PHPUnit. Please give me some suggestions to improve my coding-writing skills. The below is the test file for the above file: <...
2
votes
1answer
197 views

Car store implementation using abstract factory

I'm studying design patterns and I made this car store implementation. Although I'm confident that the idea is right, I'm not confident that the implementation is good. I would like you to check it ...
4
votes
1answer
133 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). ...
3
votes
0answers
477 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 ...
1
vote
1answer
2k 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 ...
5
votes
1answer
195 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 ...
2
votes
1answer
421 views

BDD tests in PHPUnit

No one in my team knows how to write BDD tests, so I started writing some and it's quite working well. I think the time has come to improve the code quality. This contains a lot of duplicated code ...