Skip to content

Instantly share code, notes, and snippets.

@Shaked
Created June 19, 2014 11:16
Show Gist options
  • Save Shaked/d6fc1f5816b18bfb4ad9 to your computer and use it in GitHub Desktop.
Save Shaked/d6fc1f5816b18bfb4ad9 to your computer and use it in GitHub Desktop.
<?php
/* rest of the code here */
/**
* @dataProvider providerUseInString
*/
public function testUseInString($expected, $input)
{
$fixer = new UnusedUseStatementsFixer();
$file = new \SplFileInfo(__FILE__);
$this->assertEquals($expected, $fixer->fix($file, $input));
}
public function providerUseInString(){
$expected1 = <<<'EOF'
$x=<<<'EOA'
use a;
use b;
EOA;
EOF;
$input1 = <<<'EOF'
$x=<<<'EOA'
use a;
use b;
EOA;
EOF;
$expected2 = <<<'EOF'
$x='
use a;
use b;
';
EOF;
$input2 = <<<'EOF'
$x='
use a;
use b;
';
EOF;
$expected3 = <<<'EOF'
$x="
use a;
use b;
";
EOF;
$input3 = <<<'EOF'
$x="
use a;
use b;
";
EOF;
return array(
array($expected1, $input1),
array($expected2, $input2),
array($expected3, $input3),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment