Page MenuHomePhorge

D25323.1734668908.diff
No OneTemporary

D25323.1734668908.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -488,6 +488,7 @@
'DifferentialChangesetRenderer' => 'applications/differential/render/DifferentialChangesetRenderer.php',
'DifferentialChangesetSearchConduitAPIMethod' => 'applications/differential/conduit/DifferentialChangesetSearchConduitAPIMethod.php',
'DifferentialChangesetSearchEngine' => 'applications/differential/query/DifferentialChangesetSearchEngine.php',
+ 'DifferentialChangesetTestCase' => 'applications/differential/storage/__tests__/DifferentialChangesetTestCase.php',
'DifferentialChangesetTestRenderer' => 'applications/differential/render/DifferentialChangesetTestRenderer.php',
'DifferentialChangesetTwoUpRenderer' => 'applications/differential/render/DifferentialChangesetTwoUpRenderer.php',
'DifferentialChangesetTwoUpTestRenderer' => 'applications/differential/render/DifferentialChangesetTwoUpTestRenderer.php',
@@ -6501,6 +6502,7 @@
'DifferentialChangesetRenderer' => 'Phobject',
'DifferentialChangesetSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod',
'DifferentialChangesetSearchEngine' => 'PhabricatorApplicationSearchEngine',
+ 'DifferentialChangesetTestCase' => 'PhabricatorTestCase',
'DifferentialChangesetTestRenderer' => 'DifferentialChangesetRenderer',
'DifferentialChangesetTwoUpRenderer' => 'DifferentialChangesetHTMLRenderer',
'DifferentialChangesetTwoUpTestRenderer' => 'DifferentialChangesetTestRenderer',
diff --git a/src/applications/differential/storage/DifferentialChangeset.php b/src/applications/differential/storage/DifferentialChangeset.php
--- a/src/applications/differential/storage/DifferentialChangeset.php
+++ b/src/applications/differential/storage/DifferentialChangeset.php
@@ -325,14 +325,16 @@
public function getOldStatePathVector() {
$path = $this->getOldFile();
- if (!strlen($path)) {
+ if (!phutil_nonempty_string($path)) {
$path = $this->getFilename();
}
- $path = trim($path, '/');
- $path = explode('/', $path);
+ if (!phutil_nonempty_string($path)) {
+ return null;
+ }
- return $path;
+ $path = trim($path, '/');
+ return explode('/', $path);
}
public function getNewStatePathVector() {
diff --git a/src/applications/differential/storage/__tests__/DifferentialChangesetTestCase.php b/src/applications/differential/storage/__tests__/DifferentialChangesetTestCase.php
new file mode 100644
--- /dev/null
+++ b/src/applications/differential/storage/__tests__/DifferentialChangesetTestCase.php
@@ -0,0 +1,16 @@
+<?php
+
+final class DifferentialChangesetTestCase extends PhabricatorTestCase {
+
+ public function testPhp81() {
+ $diff_change_set = new DifferentialChangeset();
+ try {
+ $old_state_vector = $diff_change_set->getOldStatePathVector();
+ $this->assertTrue(true, 'getOldStatePathVector did not throw an error');
+ } catch (Throwable $ex) {
+ $this->assertTrue(false,
+ 'getOldStatePathVector threw an exception:'.$ex->getMessage());
+ }
+ }
+
+}

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 04:28 (17 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1016528
Default Alt Text
D25323.1734668908.diff (3 KB)

Event Timeline