public function tearDown() { Miao_PHPUnit::rmdirr($this->_moduleRoot); }
public function testRunByFiles() { $sourceDir = Miao_PHPUnit::getSourceFolder(__METHOD__); $files = array('picture1' => array('name' => '1.jpg', 'type' => 'image/jpeg', 'tmp_name' => $sourceDir . '/1.jpg', 'error' => 0, 'size' => 1813815), 'picture2' => array('name' => '2.jpg', 'type' => 'image/jpeg', 'tmp_name' => $sourceDir . '/2.jpg', 'error' => 0, 'size' => 1923271)); $baseDir = Miao_PHPUnit::getSourceFolder(__CLASS__) . '/tmp'; $obj = new Miaox_File_Upload($baseDir); $expected = $obj->runByFiles($files); $actual = array('picture1' => $baseDir . '/06/44/b42029b988db920ed3f643d5c0151385.jpg', 'picture2' => $baseDir . '/22/46/b248310e95bf9930c1a5475abecced20.jpg'); $this->assertEquals($expected, $actual); Miao_PHPUnit::rmdirr($baseDir); }
public function tearDown() { Miao_PHPUnit::rmdirr($this->_tmpDir); }
protected function _deleteFolders(array $list) { foreach ($list as $className) { try { $path = Miao_Path::getDefaultInstance()->getModuleRoot($className); Miao_PHPUnit::rmdirr($path); } catch (Exception $ex) { } } }