Chris@13: setPass(new UseStatementPass()); Chris@13: } Chris@13: Chris@13: /** Chris@13: * @dataProvider useStatements Chris@13: */ Chris@13: public function testProcess($from, $to) Chris@13: { Chris@13: $this->assertProcessesAs($from, $to); Chris@13: } Chris@13: Chris@13: public function useStatements() Chris@13: { Chris@13: return [ Chris@13: [ Chris@13: "use StdClass as NotSoStd;\n\$std = new NotSoStd();", Chris@13: '$std = new \\StdClass();', Chris@13: ], Chris@13: [ Chris@13: "namespace Foo;\n\nuse StdClass as S;\n\$std = new S();", Chris@13: "namespace Foo;\n\n\$std = new \\StdClass();", Chris@13: ], Chris@13: [ Chris@13: "namespace Foo;\n\nuse \\StdClass as S;\n\$std = new S();", Chris@13: "namespace Foo;\n\n\$std = new \\StdClass();", Chris@13: ], Chris@13: [ Chris@13: "use Foo\\Bar as fb;\n\$baz = new fb\\Baz();", Chris@13: '$baz = new \\Foo\\Bar\\Baz();', Chris@13: ], Chris@13: [ Chris@13: "use Foo\\Bar;\n\$baz = new Bar\\Baz();", Chris@13: '$baz = new \\Foo\\Bar\\Baz();', Chris@13: ], Chris@13: [ Chris@13: "namespace Foo;\nuse Bar;\n\$baz = new Bar\\Baz();", Chris@13: "namespace Foo;\n\n\$baz = new \\Bar\\Baz();", Chris@13: ], Chris@13: ]; Chris@13: } Chris@13: }