示例#1
0
 /**
  * @dataProvider providerTestAdd
  */
 public function testAdd($className, $isModule = false, $expectedException = '')
 {
     if (!empty($expectedException)) {
         $this->setExpectedException($expectedException);
     }
     $console = new Miao_Console($className, 'TESTER');
     $console->add();
     $status = true;
     if (!$isModule) {
         $path = Miao_Path::getDefaultInstance()->getFilenameByClassName($className);
         if (!file_exists($path)) {
             $status = false;
         }
     } else {
         $path = Miao_Path::getDefaultInstance()->getModuleRoot($className);
         if (!is_dir($path) || !is_dir(sprintf('%s/data', $path)) || !is_dir(sprintf('%s/classes', $path)) || !is_dir(sprintf('%s/tests/classes', $path)) || !is_dir(sprintf('%s/tests/sources', $path))) {
             $status = false;
         }
     }
     $this->assertTrue($status);
 }