mirror of
https://bitbucket.org/jsuto/piler.git
synced 2025-06-13 12:07:03 +02:00
gui: added unit tests for Piler_Mime_Decoder class
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
32
tests/EmailTest.php
Normal file
32
tests/EmailTest.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
include_once("webui/system/model.php");
|
||||
include_once("webui/model/search/search.php");
|
||||
|
||||
|
||||
final class SearchSearchTest extends TestCase {
|
||||
|
||||
public function providerTestFixEmailAddressForSphinx() {
|
||||
return [
|
||||
['aaa@aaa.fu', 'aaaXaaaXfu'],
|
||||
['list-507327664@mail.aaa.fu', 'listX507327664XmailXaaaXfu'],
|
||||
['aaa+bbb@aaa.fu', 'aaaXbbbXaaaXfu'],
|
||||
['ahahah_aiai@aaa.fu', 'ahahahXaiaiXaaaXfu'],
|
||||
['aaa|@bbb@ccc.fu', 'aaa|bbbXcccXfu']
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @dataProvider providerTestFixEmailAddressForSphinx
|
||||
*/
|
||||
|
||||
public function test_get_boundary($input, $expected_result) {
|
||||
$result = ModelSearchSearch::fix_email_address_for_sphinx($input);
|
||||
$this->assertEquals($result, $expected_result);
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user