Support

Forums

Contact Me

Posts Tagged 'phpunit'

PHPUnit

PHPUnit is a unit testing software framework for the programming language PHP. Created by Sebastian Bergmann, PHPUnit is one of the xUnit family of frameworks that originated with Kent Beck's SUnit. [http://en.wikipedia.org/wiki/PHPUnit]

XAMPP 1.8.0 Xdebug stop working and make segmentation fault

There's a new version of Xdebug released which fixes a major bug where inspecting static properties caused Xdebug to crash in XAMPP 1.8.0.

Unfortunately, you’ll need to update manually the version of Xdebug shipped with XAMPP to Xdebug 2.2.1 rather than 2.2.0:

Simply download the correct Xdebug binary (VC9 threadsafe PHP 5.4 VC9 TS (64 bit) (MD5: 81cacc87168c99c7f65ba202dc12c4b2)) and copy it in your XAMPP installation at xampp\php\ext\php_xdebug.dll

restart Apache and you can continue debugging!

Installing PHPUnit / Selenium in XAMPP

   phpunit-logo selenium-logo xampp.logo

A small how to install PHPUnit via PEAR in an XAMPP running on a windows box. A prerequisite for a continuous build strategy.

PHPUnit is a member of the xUnit family of testing frameworks and provides both a framework that makes the writing of tests easy as well as the functionality to easily run the tests and analyze their results.

Installing XAMPP

  • Download XAMPP from http://www.apachefriends.org/en/xampp.html
  • Unpack the zip, don't run any installer, just use the \xampp\xampp-control.exe to control the component (so the whole XAMPP directory can be moved to another drive without having absolute paths in all configurations files)

Installing PEAR

  • Execute  \xampp\php\go-pear.bat and follow the onscreen instructions. The installation will modify the include_path in your php.ini file.
  • Execute \xampp\php\PEAR_ENV.reg to add PEAR to the windows registry
Articles tagged

Read more: Installing PHPUnit / Selenium in XAMPP

phpUnderControl - Continuous Integration for PHP

phpUnderControl metrics screenshot
More screen shots here
phpUnderControl is an add-on application for the continuous integration
tool CruiseControl, which integrates some of the best PHP development tools.
This project aims to make your first steps with CruiseControl and PHP as easy
as possible. Therefore phpUnderControl comes with a command line tool that
performs all modifications to an existing CruiseControl installation.

My objective is to be able to set up this server and provide you all an access to the build result for my component.

Integrated tools
  • Testing and software metrics

    PHPUnit is the most popular xUnit implementation for PHP that provides a framework for automated
    software tests. Except the pure test automation PHPUnit contains a rich set of features like
    Code Coverage, Project Mess Detection and Software Metrics. To visualize the generated XML reports
    phpUnderControl comes with a set of XSL stylesheets that prepare the output for CruiseControl.

  • Documentation

    phpUnderControl uses the most common documentation tool for PHP projects, PhpDocumentor, to generate
    an up to date documentation of the software on every build cycle. Therefore the developers will always get
    the latest API documentation of their project. Additionally phpUnderControl extracts the documentation
    violations found by the PhpDocumentor and visualizes these as an additional quality report in the user
    interface and the project time line of documentation violations.

  • Coding Standards

    With the package PHP_CodeSniffer the PEAR project gave PHP developers a very useful tool to detect coding
    standard violations in a project. Since version 1.0.0RC3 it has native support for the Checkstyle XML format
    that can be visualized by CruiseControl. PHP_CodeSniffer comes with a variety of pre defined coding standards
    like PEAR and ZEND but due to its modular structure you can easily implement a custom rule set or extend one
    of the pre defined sets. This development tool assures that the whole project code will remain clean and
    consistent.
    From http://www.phpundercontrol.org/about.html

Record testcases with Selenium IDE

open.qa.logo Selenium is a test tool for web applications. Selenium tests run directly in a browser, just like real users do. It runs in Internet Explorer, Mozilla and Firefox on Windows, Linux, and Macintosh, Safari on the Mac.  They have plans to target Safari on the iPhone in some months. The tool is free and available under Apache 2.0.


  • Install the firefox plugin, note the latest version work only in Firefox 2.0 not in 3.0Beta!
  • Install also XPather another Firefox extension, very helpful to get the elements  XAPTH in pages.
  • Of course restart Firefox
  • Open either the sidebar (go to menu View, Sidebar, Selenium IDE) or the floating windows
    (go to menu Tools - Selenium IDE)
  • Go to the page where you wan to test something
  • Put the right Base URL (A) and press button (B) when ready
    doYourFirstSeleniumTest

Read more: Record testcases with Selenium IDE

Using PHPUnit to test-develop Joomla extensions in PhpStorm

Since I did not find any clear how to on the internet how to run test cases for 3rd party extensions that use Joomla CMS, here is my version of it.

Prerequisites

Having PHPUnit properly install, if you use XAMPP you may want to read this post.

Read more: Using PHPUnit to test-develop Joomla extensions in PhpStorm

Donations

Thank You for supporting my work