Fix unit test error when repository name is not "rhymix"

This commit is contained in:
Kijin Sung 2023-11-02 12:44:03 +09:00
parent 99de7db35a
commit a128b6e3cb
2 changed files with 5 additions and 4 deletions

View file

@ -5,6 +5,7 @@ class TemplateTest extends \Codeception\Test\Unit
public function _before() public function _before()
{ {
Context::init(); Context::init();
$this->baseurl = '/' . basename(dirname(dirname(dirname(__DIR__)))) . '/';
} }
public function testIsRelativePath() public function testIsRelativePath()
@ -48,7 +49,7 @@ class TemplateTest extends \Codeception\Test\Unit
$this->assertEquals($target, $tmpl->convertPath($source)); $this->assertEquals($target, $tmpl->convertPath($source));
$source = '^/foo/bar.gif'; $source = '^/foo/bar.gif';
$target = '/rhymix/foo/bar.gif'; $target = $this->baseurl . 'foo/bar.gif';
$this->assertEquals($target, $tmpl->convertPath($source)); $this->assertEquals($target, $tmpl->convertPath($source));
} }

View file

@ -1145,9 +1145,9 @@ class TemplateParserV2Test extends \Codeception\Test\Unit
// Check that resource is loaded // Check that resource is loaded
$list = \Context::getJsFile('body'); $list = \Context::getJsFile('body');
$this->assertStringContainsString('/rhymix/common/js/plugins/ckeditor/', array_first($list)['file']); $this->assertStringContainsString('/common/js/plugins/ckeditor/', array_first($list)['file']);
$list = \Context::getCssFile(); $list = \Context::getCssFile();
$this->assertStringContainsString('/rhymix/tests/_data/template/css/style.scss', array_first($list)['file']); $this->assertStringContainsString('/tests/_data/template/css/style.scss', array_first($list)['file']);
} }
public function testCompileLang() public function testCompileLang()
@ -1240,7 +1240,7 @@ class TemplateParserV2Test extends \Codeception\Test\Unit
); );
$list = \Context::getJsFile(); $list = \Context::getJsFile();
$this->assertStringContainsString('/rhymix/tests/_data/template/js/test.js', array_last($list)['file']); $this->assertStringContainsString('/tests/_data/template/js/test.js', array_last($list)['file']);
} }
/** /**