@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add a bit of test coverage for bulky vs compact edge data representations

Summary: Depends on D18948. Ref T13051. The actual logic ended up so simple that this doesn't really feel terribly valuable, but maybe it'll catch something later on.

Test Plan: Ran test.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13051

Differential Revision: https://secure.phabricator.com/D18949

+160
+2
src/__phutil_library_map__.php
··· 2748 2748 'PhabricatorDraftInterface' => 'applications/transactions/draft/PhabricatorDraftInterface.php', 2749 2749 'PhabricatorDrydockApplication' => 'applications/drydock/application/PhabricatorDrydockApplication.php', 2750 2750 'PhabricatorEdgeChangeRecord' => 'infrastructure/edges/util/PhabricatorEdgeChangeRecord.php', 2751 + 'PhabricatorEdgeChangeRecordTestCase' => 'infrastructure/edges/__tests__/PhabricatorEdgeChangeRecordTestCase.php', 2751 2752 'PhabricatorEdgeConfig' => 'infrastructure/edges/constants/PhabricatorEdgeConfig.php', 2752 2753 'PhabricatorEdgeConstants' => 'infrastructure/edges/constants/PhabricatorEdgeConstants.php', 2753 2754 'PhabricatorEdgeCycleException' => 'infrastructure/edges/exception/PhabricatorEdgeCycleException.php', ··· 8173 8174 'PhabricatorDraftEngine' => 'Phobject', 8174 8175 'PhabricatorDrydockApplication' => 'PhabricatorApplication', 8175 8176 'PhabricatorEdgeChangeRecord' => 'Phobject', 8177 + 'PhabricatorEdgeChangeRecordTestCase' => 'PhabricatorTestCase', 8176 8178 'PhabricatorEdgeConfig' => 'PhabricatorEdgeConstants', 8177 8179 'PhabricatorEdgeConstants' => 'Phobject', 8178 8180 'PhabricatorEdgeCycleException' => 'Exception',
+158
src/infrastructure/edges/__tests__/PhabricatorEdgeChangeRecordTestCase.php
··· 1 + <?php 2 + 3 + final class PhabricatorEdgeChangeRecordTestCase extends PhabricatorTestCase { 4 + 5 + 6 + public function testEdgeStorageFormats() { 7 + $old_bulky = phutil_json_decode(<<<EOJSON 8 + { 9 + "PHID-PROJ-5r2ed5v27xrgltvou5or" : { 10 + "dataID" : null, 11 + "dateCreated" : "1449170683", 12 + "dst" : "PHID-PROJ-5r2ed5v27xrgltvou5or", 13 + "src" : "PHID-PSTE-5uj6oqv4kmhtr6ctwcq7", 14 + "type" : "41", 15 + "data" : [], 16 + "seq" : "0" 17 + }, 18 + "PHID-PROJ-wh32nih7q5scvc5lvipv" : { 19 + "dataID" : null, 20 + "seq" : "0", 21 + "type" : "41", 22 + "data" : [], 23 + "dst" : "PHID-PROJ-wh32nih7q5scvc5lvipv", 24 + "src" : "PHID-PSTE-5uj6oqv4kmhtr6ctwcq7", 25 + "dateCreated" : "1449170691" 26 + }, 27 + "PHID-PROJ-zfp44q7loir643b5i4v4" : { 28 + "dataID" : null, 29 + "type" : "41", 30 + "data" : [], 31 + "seq" : "0", 32 + "dateCreated" : "1449170668", 33 + "src" : "PHID-PSTE-5uj6oqv4kmhtr6ctwcq7", 34 + "dst" : "PHID-PROJ-zfp44q7loir643b5i4v4" 35 + }, 36 + "PHID-PROJ-amvkc5zw2gsy7tyvocug" : { 37 + "dataID" : null, 38 + "dst" : "PHID-PROJ-amvkc5zw2gsy7tyvocug", 39 + "src" : "PHID-PSTE-5uj6oqv4kmhtr6ctwcq7", 40 + "dateCreated" : "1448833330", 41 + "seq" : "0", 42 + "type" : "41", 43 + "data" : [] 44 + }, 45 + "PHID-PROJ-3cuwfuuh4pwqyuof2hhr" : { 46 + "dataID" : null, 47 + "seq" : "0", 48 + "type" : "41", 49 + "data" : [], 50 + "dst" : "PHID-PROJ-3cuwfuuh4pwqyuof2hhr", 51 + "src" : "PHID-PSTE-5uj6oqv4kmhtr6ctwcq7", 52 + "dateCreated" : "1448899367" 53 + }, 54 + "PHID-PROJ-okljqs7prifhajtvia3t" : { 55 + "dataID" : null, 56 + "seq" : "0", 57 + "data" : [], 58 + "type" : "41", 59 + "dst" : "PHID-PROJ-okljqs7prifhajtvia3t", 60 + "src" : "PHID-PSTE-5uj6oqv4kmhtr6ctwcq7", 61 + "dateCreated" : "1448902756" 62 + } 63 + } 64 + EOJSON 65 + ); 66 + 67 + $new_bulky = phutil_json_decode(<<<EOJSON 68 + { 69 + "PHID-PROJ-5r2ed5v27xrgltvou5or" : { 70 + "dataID" : null, 71 + "dateCreated" : "1449170683", 72 + "dst" : "PHID-PROJ-5r2ed5v27xrgltvou5or", 73 + "src" : "PHID-PSTE-5uj6oqv4kmhtr6ctwcq7", 74 + "type" : "41", 75 + "data" : [], 76 + "seq" : "0" 77 + }, 78 + "PHID-PROJ-wh32nih7q5scvc5lvipv" : { 79 + "dataID" : null, 80 + "seq" : "0", 81 + "type" : "41", 82 + "data" : [], 83 + "dst" : "PHID-PROJ-wh32nih7q5scvc5lvipv", 84 + "src" : "PHID-PSTE-5uj6oqv4kmhtr6ctwcq7", 85 + "dateCreated" : "1449170691" 86 + }, 87 + "PHID-PROJ-zfp44q7loir643b5i4v4" : { 88 + "dataID" : null, 89 + "type" : "41", 90 + "data" : [], 91 + "seq" : "0", 92 + "dateCreated" : "1449170668", 93 + "src" : "PHID-PSTE-5uj6oqv4kmhtr6ctwcq7", 94 + "dst" : "PHID-PROJ-zfp44q7loir643b5i4v4" 95 + }, 96 + "PHID-PROJ-amvkc5zw2gsy7tyvocug" : { 97 + "dataID" : null, 98 + "dst" : "PHID-PROJ-amvkc5zw2gsy7tyvocug", 99 + "src" : "PHID-PSTE-5uj6oqv4kmhtr6ctwcq7", 100 + "dateCreated" : "1448833330", 101 + "seq" : "0", 102 + "type" : "41", 103 + "data" : [] 104 + }, 105 + "PHID-PROJ-3cuwfuuh4pwqyuof2hhr" : { 106 + "dataID" : null, 107 + "seq" : "0", 108 + "type" : "41", 109 + "data" : [], 110 + "dst" : "PHID-PROJ-3cuwfuuh4pwqyuof2hhr", 111 + "src" : "PHID-PSTE-5uj6oqv4kmhtr6ctwcq7", 112 + "dateCreated" : "1448899367" 113 + }, 114 + "PHID-PROJ-zzzzqs7prifhajtvia3t" : { 115 + "dataID" : null, 116 + "seq" : "0", 117 + "data" : [], 118 + "type" : "41", 119 + "dst" : "PHID-PROJ-zzzzqs7prifhajtvia3t", 120 + "src" : "PHID-PSTE-5uj6oqv4kmhtr6ctwcq7", 121 + "dateCreated" : "1448902756" 122 + } 123 + } 124 + EOJSON 125 + ); 126 + 127 + $old_slim = array( 128 + 'PHID-PROJ-okljqs7prifhajtvia3t', 129 + ); 130 + 131 + $new_slim = array( 132 + 'PHID-PROJ-zzzzqs7prifhajtvia3t', 133 + ); 134 + 135 + $bulky_xaction = new ManiphestTransaction(); 136 + $bulky_xaction->setOldValue($old_bulky); 137 + $bulky_xaction->setNewValue($new_bulky); 138 + 139 + $slim_xaction = new ManiphestTransaction(); 140 + $slim_xaction->setOldValue($old_slim); 141 + $slim_xaction->setNewValue($new_slim); 142 + 143 + $bulky_record = PhabricatorEdgeChangeRecord::newFromTransaction( 144 + $bulky_xaction); 145 + 146 + $slim_record = PhabricatorEdgeChangeRecord::newFromTransaction( 147 + $slim_xaction); 148 + 149 + $this->assertEqual( 150 + $bulky_record->getAddedPHIDs(), 151 + $slim_record->getAddedPHIDs()); 152 + 153 + $this->assertEqual( 154 + $bulky_record->getRemovedPHIDs(), 155 + $slim_record->getRemovedPHIDs()); 156 + } 157 + 158 + }