-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #127 from VincentLanglet/addTests
🚨 Add tests
- Loading branch information
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
TwigCS/tests/Ruleset/Generic/PunctuationSpacing/PunctuationSpacingTest.fixed.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{{ 1..10 }} | ||
{{ foo.bar }} | ||
{{ (foo) }} | ||
{{ {'a': 'b', 'c': 'd'} }} | ||
{% set a = [1, 2, 4] %} | ||
{{ a|trans }} |
36 changes: 36 additions & 0 deletions
36
TwigCS/tests/Ruleset/Generic/PunctuationSpacing/PunctuationSpacingTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace TwigCS\Tests\Ruleset\Generic\PunctuationSpacing; | ||
|
||
use TwigCS\Ruleset\Generic\PunctuationSpacingSniff; | ||
use TwigCS\Tests\Ruleset\AbstractSniffTest; | ||
|
||
/** | ||
* Class PunctuationSpacingTest | ||
*/ | ||
class PunctuationSpacingTest extends AbstractSniffTest | ||
{ | ||
/** | ||
* @return void | ||
*/ | ||
public function testSniff(): void | ||
{ | ||
$this->checkSniff(new PunctuationSpacingSniff(), [ | ||
[3 => 4], | ||
[3 => 10], | ||
[4 => 4], | ||
[4 => 10], | ||
[4 => 16], | ||
[4 => 22], | ||
[4 => 28], | ||
[5 => 12], | ||
[5 => 16], | ||
[5 => 20], | ||
[5 => 24], | ||
[6 => 6], | ||
[6 => 6], | ||
]); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
TwigCS/tests/Ruleset/Generic/PunctuationSpacing/PunctuationSpacingTest.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{{ 1..10 }} | ||
{{ foo.bar }} | ||
{{ ( foo ) }} | ||
{{ { 'a' : 'b' , 'c' : 'd' } }} | ||
{% set a = [ 1 , 2 , 4 ] %} | ||
{{ a | trans }} |