0
votes
1answer
104 views

How do you detect lying Stubs/Mocks?

Consider this piece of code from the PHPUnit manual(I'm using PHP only as an example): class StubTest extends PHPUnit_Framework_TestCase { public function testStub() { // Create a ...
0
votes
0answers
31 views

How to unit-test for PHP implicit conversion errors?

Is there a way to find errors caused by crafted input in php, such as naming POST-fields like variable[] instead of variable, causing PHP to implicitly convert it into an array, by using some form of ...
0
votes
1answer
65 views

testing: which code layers should I aim to test?

Say I have this code: Design { public function load() { $this->loadProduct(); $this->loadService(); ... } public function loadProduct() { ...
0
votes
1answer
47 views

Testing the Consumers of Subclassed Data Structures

PHP's SplQueue does not include a clear() or reset() function to wipe data out of the data structure. My application requires that functionality. This leaves two options: A) Create a subclass of ...
0
votes
2answers
79 views

Area of testing

I'm trying to understand which part of my code I should to test. I have some code. Below is example of this code, just to understand the idea. Depends of some parametrs I put one or another currency ...
1
vote
1answer
871 views

How to create unit/integration tests for my web app?

I am currently developing an Ajax chat application that uses PHP on the back-end. Some of the features it has right now are different types of users (admin/mod/banned), public and private rooms, ...
1
vote
1answer
194 views

Unit testing methods which access an Internet API

Hi I'm developing a Wordpress plugin which accesses a couple of API's (Amazon Product API, Flickr, Freebase, Ebay). I've already started writing unit tests for it but I'm still wondering if its ...
5
votes
3answers
433 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
2answers
246 views

How do you test database abstraction in PHP?

I apologise in advance if this question is too subjective but I'm struggling to find a good answer, probably as there is not really a correct answer to give. I'm currently writing a database ...
1
vote
4answers
399 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 ...
1
vote
3answers
365 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 ...
3
votes
1answer
391 views

TDD and test automation in applications heavily dependent on databases and user input [closed]

Recently I have been reading online about eXtreme programming and agile practices. I wish to adapt them. However most of my code is all in PHP which is the normal CRUD type web applications. Moreover ...
1
vote
3answers
448 views

unit/integration testing web service proxy client

I'm rewriting a PHP client/proxy library that provides an interface to a SOAP-based .Net webservice, and in the process I want to add some unit and integration tests so future modifications are less ...
2
votes
1answer
301 views

Virtual Machines And Unit/Integration Testing Web Application

I am in the process of adding unit testing to a project I am working on at work and a suggestion came up that I should use VMs to populate the database with good data. This was suggested as an ...
8
votes
1answer
515 views

I've unit tested my class, now how do I get started with an integration test?

I've written a class that manages recipients on a MailChimp list, called MailChimpRecipient. It uses the MCAPI class, which is an third-party API wrapper. http://apidocs.mailchimp.com/api/1.3/ ...
6
votes
4answers
1k views

Why use phpunit when traditional manual testing can be used

When I make a web app I test my work on the browser to see if I receive any errors and fix them. I have made complex applications and testing this way has been easy and fast. I have watched many ...
9
votes
3answers
904 views

Automating Unit Test Creation

What are some strategies that could be used to automate the creation of unit test cases? What aspects would you need to look at in each class to be able to generate at least a decent test case ...
5
votes
3answers
442 views

Unit Testing For Different Environments

How does one do unit testing for multiple environments that behave differently? Here is my problem. I have a PHP class for which I'd like to create unit tests. The class provides shortcuts for ...
5
votes
2answers
385 views

how to fully unit test functions and their internal validation

I am just now getting into formal unit testing and have come across an issue in testing separate internal parts of functions. I have created a base class of data manipulation (i.e.- moving files, ...
10
votes
4answers
854 views

When should I use mock objects?

I've read a lot of things about TDD but I still have doubts. For example, I have these class diagrams: It's a simple example, just to learn about TDD and mock objects. Which test should I write ...
2
votes
3answers
2k views

Can I test effectively javascript functions with a PHP unit-testing framework?

If I want to unit-test some of my javascript functions, would it be more efficient (and doable) to use the already installed PHP unit-testing framework, or should I use a javascript unit-testing ...
5
votes
2answers
508 views

Good example of a properly unit tested PHP project? [closed]

In hopes of getting myself and my coworkers to adopt automated unit testing methods in future projects, I would like to see a proper example on how it's done. Simple introductionary lessons to unit ...