phpunit 3.8…3.7
http://phpunit.de/manual/3.8/ja/installation.html
wget https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
mv phpunit.phar /usr/local/bin/phpunit
とりあえず。これだけ。
早速テストファイル作成
Log/PrefixText.php
require_once( '.../lib/base/autoloader.ini');
class LogPrefix extends PHPUnit_Framework_TestCase{
public function testPrefix(){
Log_Quadrangular::data();
}
}
実行すると
$ phpunit Log_PrefixTest
PHPUnit 3.7.28 by Sebastian Bergmann.
E
Time: 90 ms, Memory: 2.50Mb
There was 1 error:
1) LogPrefix::testPrefix
Missing argument 1 for Log_Quadrangular::data(), called in .../dev/lib/Test/Log/PrefixTest.php on line 6 and defined
.../dev/lib/Log/Quadrangular.php:29
.../dev/lib/Test/Log/PrefixTest.php:6
FAILURES!
Tests: 1, Assertions: 0, Errors: 1.
こんな感じでちゃんとエラーになりました。と。3.7ですね・・・
とりあえず内部操作modelなどをphpunitでテストします。
外部はseleniumで。