Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
nticaric committed Jul 3, 2016
1 parent 845d804 commit 05ca28d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/indexer/IndexerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,16 @@ public function testSetTokenizer()
$indexer->setTokenizer($someTokenizer);

$this->assertInstanceOf(TokenizerInterface::class, $indexer->tokenizer);

$res = $indexer->breakIntoTokens('Canon 70-200');
$this->assertContains("canon", $res);
$this->assertContains("70-200", $res);
}
}

class SomeTokenizer implements TokenizerInterface {

public function tokenize($text) {
return $text;
return preg_split("/[^\p{L}\p{N}-]+/u", strtolower($text), -1, PREG_SPLIT_NO_EMPTY);
}
}

0 comments on commit 05ca28d

Please sign in to comment.