Can someone provide a simple documentation how to use PHPUnit in Komodo?
My folder:
/ (root path)
-Money.php
-tests
--MoneyTest.php
Money.php
<?php
class Money {
public $money = 0;
public function __construct($money) {
$this->money = $money;
}
public function getAmount() {
return $this->money;
}
}
tests/MoneyTest.php
<?php
class MoneyTest extends PHPUnit_Framework_TestCase {
public function testAmount() {
$t = new Test(1);
$this->assertEquals(1, $t->getAmount());
}
}
I created a test plan #1 and when I run it - I get this errors:
PHP Warning: require_once(PHPUnit/Runner/Version.php): failed to open stream: No such file or directory in /home/defman/Komodo-IDE-9/lib/mozilla/python/komodo/harnesses/php/Base/HarnessSelector.php on line 10
PHP Fatal error: require_once(): Failed opening required 'PHPUnit/Runner/Version.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/defman/Komodo-IDE-9/lib/mozilla/python/komodo/harnesses/php/Base/HarnessSelector.php on line 10
The problem solved by installing PHPUnit via apt-get and adding /usr/share/php to the include_path in file /etc/php5/cli/php.ini (include_path=".:${USER}/pear/share/pear:/usr/share/php")