Example #1
0
 public function testReformatSuccessful()
 {
     $content = file_get_contents('ScriptReorganizer/Tests/files/sample.php', true);
     $expected = '<?php' . (include 'ScriptReorganizer/Tests/files/expectedQuietedScript.php') . '?>';
     $strategy = new ScriptReorganizer_Strategy_Quiet();
     $this->assertTrue($expected === $strategy->reformat($content));
 }
Example #2
0
 public function testReformatSuccessful()
 {
     $os = PHP_EOL == "\r\n" ? '-win' : ( PHP_EOL == "\n" ? '-unix' : '-mac' );
     $content = file_get_contents( 'ScriptReorganizer/Tests/files/sample' . $os . '.php', true );
     $eol = $this->getEolStyle( $content );
     $expected = $eol . '<?php' . ( include 'ScriptReorganizer/Tests/files/expectedQuietedScript.php' ) . '?>' . $eol;
     $strategy = new ScriptReorganizer_Strategy_Quiet;
     
     $this->assertTrue( $expected === $strategy->reformat( $content, $eol ) );
 }
Example #3
0
 /**
  * Constructor
  */
 public function __construct()
 {
     self::$identifiers = array('multiLineComments' => '"[{};,' . PHP_EOL . ']([ \\t]*/\\*(.|[' . PHP_EOL . '])*?\\*/)"', 'singleLineComments' => '"[{};,' . PHP_EOL . ']([ \\t]*//[^' . PHP_EOL . ']*)"');
     $this->route = new ScriptReorganizer_Strategy_Route();
 }