Exemple #1
0
 /**
  * @dataProvider providerTestGetListFilenameByLibName
  */
 public function testGetListFilenameByLibName($libName, $exceptionName = '')
 {
     if (!empty($exceptionName)) {
         $this->setExpectedException($exceptionName);
     }
     $opts = array('no-run' => true);
     $remainingArgs = array('Miao_Autoload_Test');
     $consoleObj = new Miao_PHPUnit_Console($opts, $remainingArgs);
     $expected = $consoleObj->getListFileListByLibName($libName);
     $condition = is_array($expected) && !empty($expected);
     $this->assertTrue($condition);
     $condition2 = true;
     foreach ($expected as $item) {
         if (false === strpos($item, 'class.Test.php')) {
             $condition2 = false;
             break;
         }
     }
     $this->assertTrue($condition2);
     //$this->assertEquals( count( $expected ), 36 );
 }
Exemple #2
0
if (isset($_SERVER['argc'])) {
    $opts = array();
    $remainingArgs = array();
    foreach ($_SERVER['argv'] as $key => $value) {
        if (0 == $key) {
            continue;
        }
        switch ($value) {
            case '-f':
                $opts['file'] = true;
                break;
            case '-d':
                $opts['dir'] = true;
                break;
            case '--no-run':
                $opts['no-run'] = true;
                break;
            case '-i':
                $opts['processIsolation'] = true;
                break;
            case '--help':
            case '-h':
                help();
                break;
            default:
                $remainingArgs[] = $value;
        }
    }
    $console = new Miao_PHPUnit_Console($opts, $remainingArgs);
    $console->run();
}