Add tests for emails renderer api client and Yii2 wrapper component

This commit is contained in:
ErickSkrauch
2019-06-18 01:19:07 +03:00
parent 70d1999d55
commit d5cb0f304c
4 changed files with 113 additions and 4 deletions

View File

@@ -8,7 +8,6 @@ use common\emails\RendererInterface;
use Yii;
use yii\base\InvalidConfigException;
use yii\helpers\ArrayHelper;
use yii\helpers\FileHelper;
class Component extends \yii\base\Component implements RendererInterface {
@@ -63,7 +62,7 @@ class Component extends \yii\base\Component implements RendererInterface {
return $this->getApi()->getTemplate($request);
}
private function getApi(): Api {
protected function getApi(): Api {
if ($this->api === null) {
$this->api = new Api($this->serviceUrl);
}
@@ -72,7 +71,7 @@ class Component extends \yii\base\Component implements RendererInterface {
}
private function buildBasePath(): string {
return FileHelper::normalizePath($this->baseDomain . '/' . $this->basePath, '/');
return trim($this->baseDomain, '/') . '/' . trim($this->basePath, '/');
}
}