Skip to content

Instantly share code, notes, and snippets.

@b-durand
Created August 19, 2012 08:19
Show Gist options
  • Save b-durand/3393635 to your computer and use it in GitHub Desktop.
Save b-durand/3393635 to your computer and use it in GitHub Desktop.
CS: PSR-2 P4.6
class ControlSpacesFixerTest extends \PHPUnit_Framework_TestCase
{
/* ... */
/**
* @dataProvider testFixCallsProvider
*/
public function testFixCalls($call, $callFixed)
{
$fixer = new Fixer();
$this->assertEquals($callFixed, $fixer->fix($this->getFileMock(), $call));
$this->assertEquals($callFixed, $fixer->fix($this->getFileMock(), $callFixed));
}
public function testFixCallsProvider()
{
return array(
array('Foo::baz ($bar)', 'Foo::baz($bar)'),
array('Foo::baz( $bar )', 'Foo::baz($bar)'),
array('Foo::baz( $bar)', 'Foo::baz($bar)'),
array('Foo::baz($bar )', 'Foo::baz($bar)'),
array('bar($foo,$baz)', 'bar($foo, $baz)'),
array('bar($foo ,$baz)', 'bar($foo, $baz)'),
array('bar($foo , $baz)', 'bar($foo, $baz)'),
);
}
/* ... */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment