Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3749615
D1542.id3933.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D1542.id3933.diff
View Options
diff --git a/app/Phabricator/PhabricatorStory.php b/app/Phabricator/PhabricatorStory.php
--- a/app/Phabricator/PhabricatorStory.php
+++ b/app/Phabricator/PhabricatorStory.php
@@ -317,6 +317,11 @@
if (starts_with($key, "story")) {
$key = substr($key, 5);
+
+ if (strlen($key) === 0) {
+ return "";
+ }
+
$key[0] = strtolower($key[0]); // lowercase
}
diff --git a/tests/Phabricator/PhabricatorStoryTest.php b/tests/Phabricator/PhabricatorStoryTest.php
--- a/tests/Phabricator/PhabricatorStoryTest.php
+++ b/tests/Phabricator/PhabricatorStoryTest.php
@@ -22,4 +22,22 @@
yield ["VOID", ['foo' => 'bar']];
yield ["TASK", ['objectPHID' => 'PHID-TASK-l34fw5wievp6n6rnvpuk']];
}
+
+ /**
+ * @dataProvider provideKeys
+ */
+ public function testMapPhabricatorFeedKey ($expected, $key) {
+ $this->assertEquals(
+ $expected,
+ PhabricatorStory::mapPhabricatorFeedKey($key)
+ );
+ }
+
+ public function provideKeys () : iterable {
+ yield ['id', 'storyID'];
+ yield ['id', 'storyId'];
+ yield ['task', 'storyTask'];
+ yield ['', 'story'];
+ yield ['', ''];
+ }
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 16:33 (21 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2249632
Default Alt Text
D1542.id3933.diff (1 KB)
Attached To
Mode
D1542: Test and fix PhabricatorStory::mapPhabricatorFeedKey
Attached
Detach File
Event Timeline
Log In to Comment