Skip to content
This repository has been archived by the owner on Sep 12, 2022. It is now read-only.

Commit

Permalink
#45 Add StripComment test
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Kleinhans committed Dec 14, 2016
1 parent 41fd3e1 commit 2b17a4c
Showing 1 changed file with 30 additions and 0 deletions.
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/*'],
];
}
}

0 comments on commit 2b17a4c

Please sign in to comment.