0

I am trying to set up phpunit on my server. This is what I did so far...

  1. SSH into Apache server via PuTTY
  2. Ran command... cd /path/to
  3. Ran command... wget http://pear.phpunit.de/get/phpunit.phar
  4. Ran command... chmod +x phpunit.phar
  5. Ran command... /path/to/phpunit.phar

The error I received is...

PHP Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /path/to/phpunit.phar on line 6

The first 8 lines of the phpunit.phar file are...

#!/usr/bin/env php
<?php
define('__PHPUNIT_PHAR__', realpath($GLOBALS['_SERVER']['SCRIPT_NAME']));

spl_autoload_register(
  function ($class)
  {
      static $classes = NULL;

Any ideas what I'm doing wrong?

1
  • Bah, that must be it! Can't believe I forgot to check. The earliest phpunit.phar seems to only work with 5.3.3+, but the server I'm working on right now is at v5.2.17. Thanks! Commented Mar 15, 2013 at 13:48

1 Answer 1

1

You need at least PHP 5.3.3 to use PHPUnit's phar version:

Note: PHPUnit 3.7 requires PHP 5.3.3 (or later) but PHP 5.4.7 (or later) is highly recommended.

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

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.