Cross-platform unit testing for PHP and JavaScript on Linux, Windows, and Mac OS
PHP JavaScript CSS
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
assets
docs
phpunit-portable
qunit
testlib
unitjs
README.md
readme.txt
test.php

README.md

About

Razor is a powerful unit test system that verifies PHP and JavaScript code works properly. Based on PHPUnit by Sebastian Bergmann and UnitJS by Nicolas Tallefourtane, Razor combines these libraries into a portable, highly reliable test platform, that runs on any OS.

alt text

It Just Works

Razor works on any modern desktop or server operating system, with zero user intervention. Our battle-hardened core runs reliably on even the most misconfigured of servers, automatically handling common problems. In the rare cases where Razor can't run, it provides useful debugging info.

Multi Platform

Razor runs on Linux, Windows, and Mac OS, letting you effortlessly move from your Windows desktop to your Mac notebook to your Linux production server, confident that your unit tests will run correctly. Razor's multi-platform support dramatically simplifies coordinating large development teams, because everyone on the team can use the same test platform and the same unit tests.

Zero Dependencies

Razor uses a specially modified fork of PHPUnit that don't need PEAR. This eliminates PHPUnit's legendary installation problems for Mac and Windows users. Zero dependencies also means you can check Razor into your team's version control system, confident that it will run on any machine.

WordPress Aware

Razor is WordPress aware. It automatically loads itself as a plugin when placed in the /wp-content/plugins/ folder, letting casual users run tests in the WordPress backend and view the results in their browser.

Razor lets developers script tests that were previously impossible to automate. Our test core can install and activate plugins, load the entire database from an image file, and even check the code coverage of testcases. And it can do all of this on a LIVE site, without damaging the WordPress install.

Razor's powerful command-line interface makes it easy to integrate with large automated test systems .Enterprise users can run tests in the terminal window, and can also use Razor as part of large-scale distributed test systems like Travis-CI.

Jump Points

Documentation

Razor has extensive documentation and sample implementations. See the docs folder.

Working Code

Razor is the unit-test system behind FoxFire, a large (250K LOC / 540 unit tests) object-relational mapping library. FoxFire uses Razor in a command-line capacity and integrates with Travis-CI. It's a good demonstration of enterprise-level automation.

Razor is also the unit test system behind Radient, (750K LOC / 230 unit tests) which is basically Flickr + YouTube for WordPress. Radient also uses command-line automation, but goes one step further and allows tests to be viewed on the WordPress back-end. Radient also uses advanced features like database loading, plugin activation, and test media files.