This repository has been archived by the owner on Sep 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Julian Kleinhans
committed
Dec 14, 2016
1 parent
41fd3e1
commit 2b17a4c
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
tests/StackFormation/PreProcessor/Stage/String/StripCommentsTest.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,30 @@ | ||
<?php | ||
|
||
namespace StackFormation\Tests\PreProcessor\Stage\String; | ||
|
||
class StripCommentsTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @test | ||
* @dataProvider stripCommentsDataProvider | ||
*/ | ||
public function stripComments($string, $expected) | ||
{ | ||
$stringPreProcessor = $this->getMock('\StackFormation\PreProcessor\StringPreProcessor', [], [], '', false); | ||
$transformer = new \StackFormation\PreProcessor\Stage\String\StripComments($stringPreProcessor); | ||
$output = $transformer->invoke($string); | ||
$this->assertEquals($expected, $output); | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function stripCommentsDataProvider() | ||
{ | ||
return [ | ||
['This is a string /** comment blabla */', 'This is a string '], | ||
['This is a string /** comment blabla */ with a comment between', 'This is a string with a comment between'], | ||
['arn:aws:s3:::my-bucket/*', 'arn:aws:s3:::my-bucket/*'], | ||
]; | ||
} | ||
} |