Commit f5acb246 authored by Matt's avatar Matt

Add unit test for length exceeded in expander

parent 5b66e9a0
Pipeline #49692686 passed with stages
in 5 minutes and 4 seconds
......@@ -41,15 +41,15 @@ class Container implements \JsonSerializable
public function toArray(): array
{
return [
'emmet' => $this->emmet,
'theme' => $this->theme,
'description' => $this->description,
'keywords' => $this->keywords,
'ga' => $this->ga,
'favicon' => $this->favicon,
'title' => $this->title,
'css' => $this->css,
'scripts' => $this->scripts,
'emmet' => $this->getEmmetRecord(),
'theme' => $this->getTheme(),
'description' => $this->getDescription(),
'keywords' => $this->getKeywords(),
'ga' => $this->getGoogleAnalyticsCode(),
'favicon' => $this->getFaviconLink(),
'title' => $this->getTitle(),
'css' => $this->getCssLinks(),
'scripts' => $this->getScriptLinks(),
];
}
......
......@@ -32,4 +32,14 @@ class ExpanderTest extends \PHPUnit\Framework\TestCase
$this->expander->expand(':;');
}
/**
* @test
*/
public function expand_should_throw_an_exception_when_length_is_exceeded()
{
$this->expectException(Emmet\Exception\LengthExceeded::class);
$this->expander->expand(str_repeat('a', Emmet\Expander::ABBR_LENGTH_MAX + 1));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment