PHPUnit 6.0ã®ä¸»ãªå¤æ´ç¹
PHPUnit 6.0.0ã2017/02/03ã«ãªãªã¼ã¹ããã¾ããããã®å¾ç«ã¦ç¶ãã«ãã¼ã¸ã§ã³ããããã02/08ã«6.0.6ããªãªã¼ã¹ããã¦ãã¾ãã
主ãªå¤æ´ç¹
è¦ä»¶
PHP 7.0以ä¸ãå¿ è¦ã«ãªãã¾ããã
åå空é
PHPUnit_Framework_TestCase
ãPHPUnit\Framework\TestCase
ã«å¤æ´ããã¾ããã
ãããæ¢åã®ãã¹ãã³ã¼ããå¤æ´ã§ããªãå ´åã¯ãbootstrapã«ä»¥ä¸ã®ããã¯ã追å ãããã¨ã§å¯¾å¿ã§ãã¾ãã
if (! class_exists('PHPUnit_Framework_TestCase')) {
class_alias('PHPUnit\Framework\TestCase', 'PHPUnit_Framework_TestCase');
}
ããã©ã«ãè¨å®
ããã©ã«ãè¨å®ãå¤æ´ããã¾ããã
backupGlobals="true"
ã§ããããbackupGlobals="false"
ã«å¤æ´ããã¾ãã- å½¹ã«ç«ããªããã¹ããRiskyã«ãªãã¾ã
æ¢åã®ãã¹ãã³ã¼ãããã®ã¾ã¾åä½ããããå ´åã¯ãphpunit.xml
ã§backupGlobals="true"
ãè¨å®ãã¦ãã ããã
ãã ããbackupGlobals="false"
ã®æ¹ããã¹ãã®å®è¡ãéããªãã¾ãã®ã§ãfalse
ã§ãã¹ããéãããã«ããæ¹ã好ã¾ããã¨æãã¾ãã
ããã©ã«ãã¯false
ã«ãã¦ãå¿
è¦ãªãã¹ãã±ã¼ã¹ã ã@backupGlobals enabled
ã«ãããã¨ãå¯è½ã§ãã
å½¹ã«ç«ããªããã¹ãã¯ä¿®æ£ãããåé¤ãã¹ãã§ãããã
ãã°
- --log-junitãã©ã¼ãããå¤æ´
- --log-jsonå»æ¢
ãã¹ãã©ã³ãã¼
ãã¹ã¦ã®ãã¹ãããã¹ãããè¦åãããå ´åãexitã³ã¼ãã1ã«å¤æ´ããã¾ããã
å»æ¢
$this->getMock()
$this->setExpectedException()
ããã³$this->setExpectedExceptionRegExp()
$this->expectException()
,$this->expectExceptionCode()
,$this->expectExceptionMessage()
,$this->expectExceptionMessageRegExp()
ã使ãã¾ã
--tap
ãã®ä»
- PHP 5.3以ä¸ãè¦ä»¶ã®PHPUnit 4.8ã®ä¿å®ãçµäºãã¾ãã
- PHP 5.6以ä¸ãè¦ä»¶ã®PHPUnit 5.7ã¯2018/02/02ã¾ã§ä¿å®ããã¾ã
åè
Date: 2017/02/13