Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F80769496
PhabricatorTypeaheadDatasourceTestCase.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Sep 2, 12:28
Size
873 B
Mime Type
text/x-php
Expires
Wed, Sep 4, 12:28 (2 d)
Engine
blob
Format
Raw Data
Handle
20442683
Attached To
rPH Phabricator
PhabricatorTypeaheadDatasourceTestCase.php
View Options
<?php
final
class
PhabricatorTypeaheadDatasourceTestCase
extends
PhabricatorTestCase
{
public
function
testTypeaheadTokenization
()
{
$this
->
assertTokenization
(
'The quick brown fox'
,
array
(
'the'
,
'quick'
,
'brown'
,
'fox'
));
$this
->
assertTokenization
(
'Quack quack QUACK'
,
array
(
'quack'
));
$this
->
assertTokenization
(
''
,
array
());
$this
->
assertTokenization
(
' [ - ] '
,
array
());
$this
->
assertTokenization
(
'jury-rigged'
,
array
(
'jury'
,
'rigged'
));
$this
->
assertTokenization
(
'[[ brackets ]] [-] ]-[ tie-fighters'
,
array
(
'brackets'
,
'tie'
,
'fighters'
));
}
private
function
assertTokenization
(
$input
,
$expect
)
{
$this
->
assertEqual
(
$expect
,
PhabricatorTypeaheadDatasource
::
tokenizeString
(
$input
),
pht
(
'Tokenization of "%s"'
,
$input
));
}
}
Event Timeline
Log In to Comment