neubert
neubert

Reputation: 16792

How to find what version of phpunit introduced particular methods

I was running phpunit 3.7.28 (latest version my Ubuntu install could get via apt-get) but it didn't have the assertNotFalse() method. phpunit 4.4.0, however, does seem to have it.

On php.net if you look up a function you can see the version of PHP in which it was introduced. Can you do the same with phpunit?

Upvotes: 1

Views: 916

Answers (1)

unixmiah
unixmiah

Reputation: 3145

it depends on which php version you have, in your apt sources you need to specify the php version and do a php upgrade. then you'll need to remove and install phpunit again to get the latest php unit.

you can use ppa:ondrej/php5

It's now on 5.5 and also includes Apache 2.4 update.

sudo add-apt-repository ppa:ondrej/php5
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php5

If you don't have add-apt-repository binary do the following:

sudo apt-get install python-software-properties

you sure you update before you do any of this:

sudo apt-get update

Option 2: get rid of the old phpunit

you can install it with .phar

wget https://phar.phpunit.de/phpunit.phar

curl -s http://getcomposer.org/installer | php
chmod +x *.phar

then do a

phpunit --version

you should get

PHPUnit 4.4.0 by Sebastian Bergmann.

Upvotes: 2

Related Questions