Skip to content

Commit

Permalink
Add test for inconsistent charsets in AND + OR searches
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Apr 29, 2015
1 parent bcd1cd2 commit 094ecdd
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions framework/Imap_Client/test/Horde/Imap/Client/SearchTest.php
Expand Up @@ -634,6 +634,34 @@ public function testBug13971()
);
}

/**
* @dataProvider inconsistentCharsetsInAndOrSearchesProvider
* @expectedException InvalidArgumentException
*/
public function testInconsistentCharsetsInAndOrSearches($query)
{
$query->build(null);
}

public function inconsistentCharsetsInAndOrSearchesProvider()
{
$ob = new Horde_Imap_Client_Search_Query();
$ob->text('foo');
$ob->charset('UTF-8', false);

$ob2 = new Horde_Imap_Client_Search_Query();
$ob2->text('foo2');
$ob2->charset('ISO-8859-1', false);
$ob2->andSearch($ob);

$ob3 = new Horde_Imap_Client_Search_Query();
$ob3->text('foo2');
$ob3->charset('ISO-8859-1', false);
$ob3->orSearch($ob);

return array(array($ob2), array($ob3));
}

private function _fuzzy($ob, array $exts = array())
{
$capability = new Horde_Imap_Client_Data_Capability_Imap();
Expand Down

0 comments on commit 094ecdd

Please sign in to comment.