Skip to content

Commit

Permalink
test invalid filter name
Browse files Browse the repository at this point in the history
  • Loading branch information
vidy committed Jun 10, 2022
1 parent 02e3959 commit 17e3a94
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions tests/BladeFilterParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,22 @@ public function test_filter_with_missing_arguments()
{
$this->expectException(SyntaxException::class);

$input = '"css/carousel.css" | theme_asset_url:';
$input = '"css/carousel.css" | theme_asset_url:';

$parser = new BladeFilterParser();

$filter = $parser->parse($input);
$parser = new BladeFilterParser();

$this->assertEquals($filter['prefiltered'], '"css/carousel.css"');
$this->assertTrue(count($filter['filters']) == 1);
$parser->parse($input);
}

/** @test */
public function test_invalid_filter_argument_name()
{
$this->expectException(SyntaxException::class);

$input = '"css/carousel.css" | "t"';

$parser = new BladeFilterParser();

$parser->parse($input);
}
}

0 comments on commit 17e3a94

Please sign in to comment.