Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15505476
D11450.id27525.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1017 B
Referenced Files
None
Subscribers
None
D11450.id27525.diff
View Options
diff --git a/src/lint/linter/__tests__/ArcanistLinterTestCase.php b/src/lint/linter/__tests__/ArcanistLinterTestCase.php
--- a/src/lint/linter/__tests__/ArcanistLinterTestCase.php
+++ b/src/lint/linter/__tests__/ArcanistLinterTestCase.php
@@ -11,20 +11,13 @@
* @return ArcanistLinter
*/
protected final function getLinter() {
- $matches = array();
-
- if (!preg_match('/^(\w+Linter)TestCase$/', get_class($this), $matches)) {
- throw new Exception(pht('Unable to infer linter class name.'));
- }
-
- $linter = id(new ReflectionClass($matches[1]))
- ->newInstanceWithoutConstructor();
-
- if (!$linter instanceof ArcanistLinter) {
+ $matches = null;
+ if (!preg_match('/^(\w+Linter)TestCase$/', get_class($this), $matches) ||
+ !is_subclass_of($matches[1], 'ArcanistLinter')) {
throw new Exception(pht('Unable to infer linter class name.'));
}
- return $linter;
+ return newv($matches[1], array());
}
public abstract function testLinter();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 16, 3:17 AM (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7719573
Default Alt Text
D11450.id27525.diff (1017 B)
Attached To
Mode
D11450: Don't use newInstanceWithoutConstructor in Arcanist unit test
Attached
Detach File
Event Timeline
Log In to Comment