Update unit tests for latest codeception

This commit is contained in:
Kijin Sung 2021-01-28 21:53:44 +09:00
parent 0db02281c9
commit f46b41f437
12 changed files with 331 additions and 295 deletions

View file

@ -4,17 +4,25 @@ class ValidatorTest extends \Codeception\TestCase\Test
{
public function _before()
{
$ob_level = ob_get_level();
//$oContext = Context::getInstance();
//$oContext->init();
$ob_level = ob_get_level();
Context::init();
while (ob_get_level() > $ob_level)
{
ob_end_clean();
}
}
public function _after()
{
Rhymix\Framework\Storage::deleteDirectory(__DIR__ . '/validator/ruleset', true);
}
public function _failed()
{
Rhymix\Framework\Storage::deleteDirectory(__DIR__ . '/validator/ruleset', true);
}
public function testRequired()
{
$vd = new Validator();
@ -187,20 +195,5 @@ class ValidatorTest extends \Codeception\TestCase\Test
$js = $vd->getJsPath();
$this->assertEquals(trim(file_get_contents(__DIR__ . '/validator/condition.en.js')), trim(file_get_contents($js)));
}
protected function tearDown()
{
// remove cache directory
$cache_dir = __DIR__ . '/validator/ruleset';
if(is_dir($cache_dir))
{
$files = (array)glob($cache_dir.'/*');
foreach($files as $file)
{
unlink($file);
}
rmdir($cache_dir);
}
}
}