Composerã§ã¤ã³ã¹ãã¼ã«ããPHPUnitãCakePHP2ã®ã³ã³ã½ã¼ã«ããå©ç¨ããæ¹æ³
ä»åã¯ãComposerã§ã¤ã³ã¹ãã¼ã«ããPHPUnitãCakePHP2ããå©ç¨ããæ¹æ³ã§ãã
Composerã®ã¤ã³ã¹ãã¼ã«æ¹æ³ã¯æ¨æ¥æ¸ãã¾ããã
「Composerを使ってPHPUnitをインストール」
ãã¦ãæ¹æ³ã¯ããããã¨ããã¨æãã¾ãããä»åã¯Cake2ãå ã æã£ã¦ããTestShellã¯ã©ã¹ãç¶æ¿ãã¦å¯¾å¿ãã¾ãã
ã¾ãã¯ãä¸è¨ã®å ´æã«ãã¡ã¤ã«ãä½æãã¾ãã
app/Console/Command/MyTestShell.php
<?php /** * Composerã¤ã³ã¹ãã¼ã«ããPHPUnitããã¼ã **/ require_once APP . DS . 'Vendor' . DS . 'PHPUnit' . DS . 'autoload.php'; /** * ãªãã·ã§ã³é ç® * Apacheå´ã§è¨å®ãã¦ããç°å¢å¤æ°ãshellã§å©ç¨ã§ããããã«ã»ãã **/ // $_SERVER['DB_CONFIG'] = 'hogehoge'; App::uses('TestShell', 'Console/Command'); class MyTestShell extends TestShell { }
ããã¦ãä¸è¨ã®ã³ãã³ãã§ä½æããã·ã§ã«ã¯ã©ã¹(my_test)ãå®è¡ã§ãã¾ã
cd /yourpath/app ./Console/cake my_test app
æ¯åæã§æã¤ã®ã¯é¢åãªã®ã§ãshellã«ã¨ã¤ãªã¢ã¹ãç»é²ãã¦ããã¨ä¾¿å©ã§ã
alias my_test="cd /yourpath/app && ./Console/cake my_test app"