Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

The PHP Unit Testing framework.

License

NotificationsYou must be signed in to change notification settings

greenantdotcom/phpunit

 
 

Repository files navigation

PHPUnit is the de-facto standard for unit testing in PHP projects. It provides both a framework that makes the writing of tests easy as well as the functionality to easily run the tests and analyse their results.

Requirements

  • PHPUnit 3.6 requires PHP 5.2.7 (or later) but PHP 5.4.0 (or later) is highly recommended.
  • PHP_CodeCoverage, the library that is used by PHPUnit to collect and process code coverage information, depends onXdebug 2.0.5 (or later) but Xdebug 2.1.3 (or later) is highly recommended.

Installation

PHPUnit should be installed using the PEAR Installer, the backbone of thePHP Extension and Application Repository that provides a distribution system for PHP packages.

Depending on your OS distribution and/or your PHP environment, you may need to install PEAR or update your existing PEAR installation before you can proceed with the following instructions.sudo pear upgrade PEAR usually suffices to upgrade an existing PEAR installation. ThePEAR Manual explains how to perform a fresh installation of PEAR.

The following two commands (which you may have to run asroot) are all that is required to install PHPUnit using the PEAR Installer:

pear config-set auto_discover 1pear install pear.phpunit.de/PHPUnit

After the installation you can find the PHPUnit source files inside your local PEAR directory; the path is usually/usr/lib/php/PHPUnit.

Documentation

The documentation for PHPUnit is available in different formats:

IRC

The #phpunit channel on the Freenode IRC network is a place to chat about PHPUnit.

Using PHPUnit From a Git Checkout

The following commands can be used to perform the initial checkout of PHPUnit and its dependencies from Git:

mkdir phpunit && cd phpunitgit clone git://github.com/sebastianbergmann/phpunit.gitgit clone git://github.com/sebastianbergmann/dbunit.gitgit clone git://github.com/sebastianbergmann/php-file-iterator.gitgit clone git://github.com/sebastianbergmann/php-text-template.gitgit clone git://github.com/sebastianbergmann/php-code-coverage.gitgit clone git://github.com/sebastianbergmann/php-token-stream.gitgit clone git://github.com/sebastianbergmann/php-timer.gitgit clone git://github.com/sebastianbergmann/phpunit-mock-objects.gitgit clone git://github.com/sebastianbergmann/phpunit-selenium.gitgit clone git://github.com/sebastianbergmann/phpunit-story.gitgit clone git://github.com/sebastianbergmann/php-invoker.git

Thedbunit,php-code-coverage,php-file-iterator,php-text-template,php-timer,php-token-stream,phpunit,phpunit-mock-objects,phpunit-selenium,phpunit-story, andphp-invoker directories need to be added to theinclude_path.

In addition to the checkouts listed above, the YAML component that is provided by the Symfony project is required:

pear install pear.symfony-project.com/YAML

Thephpunit/phpunit.php script can be used to invoke the PHPUnit test runner.

The following commands can be used to check out the appropriate branches for PHPUnit 3.6:

cd phpunit && git checkout 3.6 && cd ..cd dbunit && git checkout 1.1 && cd ..cd php-code-coverage && git checkout 1.1 && cd ..cd phpunit-mock-objects && git checkout 1.1 && cd ..cd phpunit-selenium && git checkout 1.1 && cd ..

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp