Differential D18534 Diff 44513 src/applications/search/ferret/__tests__/PhabricatorFerretEngineTestCase.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/ferret/__tests__/PhabricatorFerretEngineTestCase.php
| <?php | <?php | ||||
| final class PhabricatorFerretEngineTestCase | final class PhabricatorFerretEngineTestCase | ||||
| extends PhabricatorTestCase { | extends PhabricatorTestCase { | ||||
| public function testTermsCorpus() { | public function testTermsCorpus() { | ||||
| $map = array( | $map = array( | ||||
| 'Hear ye, hear ye!' => 'Hear ye hear ye', | 'Hear ye, hear ye!' => ' Hear ye hear ye ', | ||||
| "Thou whom'st've art worthy." => "Thou whom'st've art worthy", | "Thou whom'st've art worthy." => " Thou whom'st've art worthy ", | ||||
| 'Guaranteed to contain "food".' => 'Guaranteed to contain food', | 'Guaranteed to contain "food".' => ' Guaranteed to contain food ', | ||||
| 'http://example.org/path/to/file.jpg' => | 'http://example.org/path/to/file.jpg' => | ||||
| 'http example org path to file jpg', | ' http example org path to file jpg ', | ||||
| ); | ); | ||||
| $engine = new ManiphestTaskFerretEngine(); | $engine = new ManiphestTaskFerretEngine(); | ||||
| foreach ($map as $input => $expect) { | foreach ($map as $input => $expect) { | ||||
| $actual = $engine->newTermsCorpus($input); | $actual = $engine->newTermsCorpus($input); | ||||
| $this->assertEqual( | $this->assertEqual( | ||||
| $expect, | $expect, | ||||
| $actual, | $actual, | ||||
| pht('Terms corpus for: %s', $input)); | pht('Terms corpus for: %s', $input)); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||