PHPUnit is a unit testing framework that is written in php. It is based on the JUnit for Java framework
0
votes
0answers
4 views
Could not send form data in PHPUnit? [migrated]
I am new to PHPUnit with Symfony 2.
I have a problem sending form data to client. I have login details needed to log in the page. so i send it as array. Every time i run test i got Error Message as:
...
2
votes
0answers
162 views
Unit testing Eloquent outside of Laravel
How can I unit test my Eloquent models when I'm using the ORM outside of Laravel? What I'm hoping to do it run tests on each model but somehow mock the database connection/query/builder(?) object.
...
4
votes
1answer
251 views
How well am I writing my tests?
I've been coding as a career for about 2 years now but am just now writing my first "real" tests for a non-trivial application. I've been trying to follow best practices I've picked up from the ...
5
votes
4answers
1k views
Is it a bad practice to separate the unit tests for a class? [closed]
My Classes normally have about 5-20 methods maximum, that implies that the class that has the unit tests has about the double of methods (counting dataProviders, setUp, ...)
I have thought to ...
1
vote
1answer
223 views
PHPUnit > Best approach to mock container objects? (e.g. $item->id)
I'm using PHPUnit test doubles to mock models, libraries etc. But when I want to return an array perhaps of container objects, how best to do so. Here is what I'm currently doing:
/**
* This is just ...
0
votes
1answer
84 views
Test logic with external data [duplicate]
I have a site programmed in PHP where I make more call to external server that return me big xml of data.
For each record of the xml I have to make other external call to get other data.
So my ...
0
votes
2answers
360 views
When running PHPUnit tests - is it common to use a separate database for testing?
I'm running tests from the same database as I use in development. I recall using Rails and I used a separate database for testing (mainly coz the tutorial I was going by said so). Made sense though. I ...
0
votes
1answer
88 views
Just jumped into database testing in PHPUnit - not really sure what the purpose of it is
I've been reading about database testing in PHPUnit. I'm not exactly sure what it's purpose is. Should I use this to test schema? E.g. if I have a UNIQUE email column then ensure that I'm not allow ...
2
votes
1answer
369 views
When NOT to unit test? [duplicate]
I am hitting a stumbling block with TDD flow. We are using PHPUnit+FuelPHP and I am stuck on how to write a unit test for our image upload/cropping feature.
FuelPHP is notoriously hard to unit test ...
1
vote
4answers
581 views
Unit Test code generation
We have a project that was written over a period of 2 years, but has a poorly designed architecture and not unit tests.
The software works well, but we're at the point where we want to refactor some ...
5
votes
3answers
497 views
Time consuming Unit test for support for 100,000 records: Am I doing it right?
I am working on adding test coverage for an application that previously didn't have any. One additional requirement that emerged is that one of the background processes should be able to process ...
1
vote
3answers
647 views
Unit-testing functions without business logic (only checks) [duplicate]
My team is trying to find out the best way to test one of our components; the main scope is to check if the user/actor has the right to complete the operation requested. The component is formed by ...
2
votes
1answer
306 views
Specifying Query in Unit Test
When writing unit tests, should I specify the query that will be performed for interacting with the database?
I can see both sides of this. On one hand, I want to make sure that the query that I ...