diff --git a/src/OfficialAccount/TemplateMessage/TemplateMessage.php b/src/OfficialAccount/TemplateMessage/TemplateMessage.php index 9edbeb6d1..46dbf7abd 100644 --- a/src/OfficialAccount/TemplateMessage/TemplateMessage.php +++ b/src/OfficialAccount/TemplateMessage/TemplateMessage.php @@ -82,6 +82,20 @@ public function __construct(AccessToken $accessToken) $this->messageBackup = $this->message; } + /** + * Set default color. + * + * @param string $color example: #0f0f0f + * + * @return $this + */ + public function defaultColor($color) + { + $this->defaultColor = $color; + + return $this; + } + /** * Set industry. * diff --git a/src/Support/Log.php b/src/Support/Log.php index fc52a17ec..e77de07c3 100644 --- a/src/Support/Log.php +++ b/src/Support/Log.php @@ -113,7 +113,7 @@ private static function createDefaultLogger() { $log = new Logger('EasyWeChat'); - if (defined('PHPUNIT_RUNNING')) { + if (defined('PHPUNIT_RUNNING') || php_sapi_name() === 'cli') { $log->pushHandler(new NullHandler()); } else { $log->pushHandler(new ErrorLogHandler());