2

I am developing web application in PHP and I want to test signup functionality, only my php scripts not GUI because GUI is not yet developed properly. Recently I came through Selenium. After hitting my head against wall, I realized it is useful only for GUI testing. If want to test I should go through PHPUnit only. Am I correct ?? Or any suggestions ??

3 Answers 3

1

As a general rule you should have a mixture of unit tests integration tests and GUI tests in your application. People often refer to the automation testing triangle to guide them, this basically states that you should have a large number of unit tests, a smaller number of integration tests, an even smaller number of GUI tests and at the tip of the triangle, a small number of manual tests. All of these tests have a different purpose, your unit tests will test isolated “units” of functionality to prove that they work in isolation whereas your GUI tests will test your whole system.

Sign up to request clarification or add additional context in comments.

Comments

0

Yes, you are right. Selenium WebDriver will drive the browser and operate with the elements on the page( finding text, clicking buttons etc.) With PHPUnit, you will execute your tests.

Comments

0

If you like to test functionalities of your Web Application and not the graphical representation of your web application you see in your browser, you should use PHPUnit.

If you also use MVC frameworks like symfony or zend framework to build your web application, appliyng PHPUNit-Tests is straight forward. Identitfy your Unit, which contains your functionality and write a corresponding TestCase.

In your case the "sign-up" functionality might be an action within an MVC-Controller, so you have to write a MVC-Controller-Unit-Test like this one for example: http://www.phpriot.com/manual/zf/zend.test.phpunit.testing

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.