コード例 #1
0
 public function testReformatSuccessful()
 {
     $content = file_get_contents('ScriptReorganizer/Tests/files/sample.php', true);
     $expected = '<?php' . (include 'ScriptReorganizer/Tests/files/expectedRoutedScript.php') . '?>';
     $strategy = new ScriptReorganizer_Strategy_Route();
     $this->assertTrue($expected === $strategy->reformat($content));
 }
コード例 #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/expectedRoutedScript.php' ) . '?>' . $eol;
     $strategy = new ScriptReorganizer_Strategy_Route;
     
     $this->assertTrue( $expected === $strategy->reformat( $content, $eol ) );
 }