File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 55define ("DONT_RUN_SAMPLES " , "true " );
66define ("SAMPLE_CODE_NAME_HEADING " , "SampleCodeName " );
77require 'vendor/autoload.php ' ;
8+
9+ if ( $ _SERVER ['argc ' ] != 3 ) {
10+ die ('\n Usage: phpunit test-runner.php <SampleCodeDirectoryPath> ' );
11+ }
12+ $ dirPath = $ _SERVER ['argv ' ][2 ];
13+ if (substr ($ dirPath , -1 ) != "/ " )
14+ $ dirPath = $ dirPath ."/ " ;
15+
16+ $ prefix = getDirectoryPrefix ();
817$ directories = array (
918 'CustomerProfiles/ ' ,
1019 'RecurringBilling/ ' ,
1423 'ApplePayTransactions/ ' ,
1524 'VisaCheckout/ '
1625);
17- foreach ($ directories as $ directory ) {
26+ foreach ($ directories as $ dirPath . $ directory ) {
1827 foreach (glob ($ directory . "*.php " ) as $ sample ) {
1928 require_once $ sample ;
2029 //echo $sample;
2130 }
2231}
32+
2333error_reporting ($ errorlevel );
2434class TestRunner extends PHPUnit_Framework_TestCase
2535{
@@ -45,10 +55,7 @@ public static function getDay(){
4555 public function testAllSampleCodes (){
4656 $ runTests = 0 ;
4757
48- if ( $ _SERVER ['argc ' ] != 3 ) {
49- die ('\n Usage: phpunit test-runner.php <SampleCodeListFile> ' );
50- }
51- $ file = $ _SERVER ['argv ' ][2 ];
58+ $ file = $ dirPath ."SampleCodeList.txt " ;
5259 $ data = file ($ file ) or die ('\nCould not read SampleCodeList. ' );
5360 foreach ($ data as $ line )
5461 {
You can’t perform that action at this time.
0 commit comments