This repository was archived by the owner on Jul 12, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,4 +47,38 @@ Feature: Optimize use
4747
4848 return $service;
4949 """
50+ Scenario : Organize use for file without namespace and other uses
51+ Given a PHP File named "src/Foo.php" with:
52+ """
53+ <?php
54+
55+ class Foo
56+ {
57+ public function operation()
58+ {
59+ return new \Bar\Qux\Adapter();
60+ }
61+ }
62+ """
63+ When I use refactoring "optimize-use" with:
64+ | arg | value |
65+ | file | src /Foo .php |
66+ Then the PHP File "src/Foo.php" should be refactored:
67+ """
68+ --- a/vfs://project/src/Foo.php
69+ +++ b/vfs://project/src/Foo.php
70+ @@ -1,4 +1,6 @@
71+ <?php
5072
73+ +use Bar\Qux\Adapter;
74+ +
75+ class Foo
76+ {
77+ @@ -5,5 +5,5 @@
78+ public function operation()
79+ {
80+ - return new \Bar\Qux\Adapter();
81+ + return new Adapter();
82+ }
83+ }
84+ """
You can’t perform that action at this time.
0 commit comments