File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ protected function matchers() : Collection
115115 ->withChild (function (MethodDeclaration $ node ) {
116116 return $ this ->isPublic ($ node )
117117 && $ this ->isStatic ($ node )
118+ && property_exists ($ this ->currentContext (), 'data_providers ' )
118119 && ! $ this ->currentContext ()->data_providers ->contains ($ node ->getName ());
119120 }),
120121
Original file line number Diff line number Diff line change @@ -69,7 +69,26 @@ private function baz()
6969 ->lintSource ($ source )
7070 ->assertNoLintingResults ();
7171 }
72-
72+
73+ public function test_it_allows_enums () : void
74+ {
75+ $ source = <<<'END_SOURCE'
76+ enum Foo: string
77+ {
78+ case bar = 'bar';
79+
80+ public static function staticFoo()
81+ {
82+ return static::$static_foo;
83+ }
84+ }
85+ END_SOURCE;
86+
87+ $ this ->withLinter (OrderClassMembers::class)
88+ ->lintSource ($ source )
89+ ->assertNoLintingResults ();
90+ }
91+
7392 public function test_it_gives_special_consideration_to_setUp_and_tearDown_methods_in_tests () : void
7493 {
7594 $ source = <<<'END_SOURCE'
You can’t perform that action at this time.
0 commit comments