Differential D18533 Diff 44512 src/applications/search/ferret/__tests__/PhabricatorFerretEngineTestCase.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/ferret/__tests__/PhabricatorFerretEngineTestCase.php
- This file was moved from src/applications/search/ngrams/__tests__/PhabricatorNgramEngineTestCase.php.
| <?php | <?php | ||||
| final class PhabricatorNgramEngineTestCase | 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 PhabricatorNgramEngine(); | $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)); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||