File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ [submodule "py "]
2+ path = py
3+ url = http://github.com/docopt/docopt.git
Original file line number Diff line number Diff line change 11<?php
2- $ basePath = __DIR__ ;
3- require $ basePath .'/../src/docopt.php ' ;
2+ $ basePath = __DIR__ .'/../ ' ;
3+ $ testPath = __DIR__ ;
4+ require $ basePath .'/src/docopt.php ' ;
45require_once 'PHPUnit/Autoload.php ' ;
56
6- require $ basePath .'/lib/PythonPortedTest.php ' ;
7- require $ basePath .'/lib/LanguageAgnosticTest.php ' ;
7+ require $ testPath .'/lib/PythonPortedTest.php ' ;
8+ require $ testPath .'/lib/LanguageAgnosticTest.php ' ;
89
910$ options = array (
10- 'py ' =>getenv ('DOCOPT_PYTHON_PATH ' ),
1111 'filter ' =>null ,
1212);
1313$ options = array_merge (
1414 $ options ,
15- getopt ('' , array ('py: ' , ' filter: ' ))
15+ getopt ('' , array ('filter: ' ))
1616);
1717
18- if (!$ options ['py ' ]) {
19- die (
20- "Please ensure the --py option or the DOCOPT_PYTHON_PATH environment \n" .
21- "variable point to the path of the python port "
22- );
18+ $ pyTestFile = $ basePath .'/py/testcases.docopt ' ;
19+ if (!file_exists ($ pyTestFile )) {
20+ die ("Please ensure you have loaded the git submodules \n" );
2321}
2422
2523$ suite = new PHPUnit_Framework_TestSuite ();
2624$ suite ->addTest (new PHPUnit_Framework_TestSuite ('Docopt\Test\PythonPortedTest ' ));
27- $ suite ->addTest (Docopt \Test \LanguageAgnosticTest::createSuite ($ options [ ' py ' ]. ' /testcases.docopt ' ));
25+ $ suite ->addTest (Docopt \Test \LanguageAgnosticTest::createSuite ($ pyTestFile ));
2826
2927$ runner = new PHPUnit_TextUI_TestRunner ();
3028$ runner ->doRun ($ suite , array (
You can’t perform that action at this time.
0 commit comments