Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/env/__tests__/PhabricatorEnvTestCase.php
Show First 20 Lines • Show All 237 Lines • ▼ Show 20 Lines | $map = array( | ||||
'https://old.example.com/' => true, | 'https://old.example.com/' => true, | ||||
'https://old.example.com' => true, | 'https://old.example.com' => true, | ||||
'https://old.EXAMPLE.com' => true, | 'https://old.EXAMPLE.com' => true, | ||||
'http://old.example.com/' => true, | 'http://old.example.com/' => true, | ||||
'https://old.example.com/path/to/resource.png' => true, | 'https://old.example.com/path/to/resource.png' => true, | ||||
'https://other.example.com/' => false, | 'https://other.example.com/' => false, | ||||
'/' => true, | |||||
'/self' => true, | |||||
'#self' => true, | |||||
'/#self' => true, | |||||
'/self/#self' => true, | |||||
); | ); | ||||
foreach ($map as $input => $expect) { | foreach ($map as $input => $expect) { | ||||
$this->assertEqual( | $this->assertEqual( | ||||
$expect, | $expect, | ||||
PhabricatorEnv::isSelfURI($input), | PhabricatorEnv::isSelfURI($input), | ||||
pht('Is self URI? %s', $input)); | pht('Is self URI? %s', $input)); | ||||
} | } | ||||
} | } | ||||
} | } |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0