forked from roundcube/roundcubemail
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
125 changed files
with
2,857 additions
and
1,640 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,3 +123,7 @@ | |
{ | ||
margin-left: 0.5em; | ||
} | ||
|
||
ul.toolbarmenu li span.delete { | ||
background-position: 0 -1509px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
class Parser extends PHPUnit_Framework_TestCase | ||
{ | ||
|
||
function setUp() | ||
{ | ||
include_once dirname(__FILE__) . '/../lib/rcube_sieve_script.php'; | ||
} | ||
|
||
/** | ||
* Sieve script parsing | ||
* | ||
* @dataProvider data_parser | ||
*/ | ||
function test_parser($input, $output, $message) | ||
{ | ||
$script = new rcube_sieve_script($input); | ||
$result = $script->as_text(); | ||
|
||
$this->assertEquals(trim($result), trim($output), $message); | ||
} | ||
|
||
/** | ||
* Data provider for test_parser() | ||
*/ | ||
function data_parser() | ||
{ | ||
$dir_path = realpath(dirname(__FILE__) . '/src'); | ||
$dir = opendir($dir_path); | ||
$result = array(); | ||
|
||
while ($file = readdir($dir)) { | ||
if (preg_match('/^[a-z0-9_]+$/', $file)) { | ||
$input = file_get_contents($dir_path . '/' . $file); | ||
|
||
if (file_exists($dir_path . '/' . $file . '.out')) { | ||
$output = file_get_contents($dir_path . '/' . $file . '.out'); | ||
} | ||
else { | ||
$output = $input; | ||
} | ||
|
||
$result[] = array( | ||
'input' => $input, | ||
'output' => $output, | ||
'message' => "Error in parsing '$file' file", | ||
); | ||
} | ||
} | ||
|
||
return $result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
class Tokenizer extends PHPUnit_Framework_TestCase | ||
{ | ||
|
||
function setUp() | ||
{ | ||
include_once dirname(__FILE__) . '/../lib/rcube_sieve_script.php'; | ||
} | ||
|
||
function data_tokenizer() | ||
{ | ||
return array( | ||
array(1, "text: #test\nThis is test ; message;\nMulti line\n.\n;\n", '"This is test ; message;\nMulti line"'), | ||
array(0, '["test1","test2"]', '[["test1","test2"]]'), | ||
array(1, '["test"]', '["test"]'), | ||
array(1, '"te\\"st"', '"te\\"st"'), | ||
array(0, 'test #comment', '["test"]'), | ||
array(0, "text:\ntest\n.\ntext:\ntest\n.\n", '["test","test"]'), | ||
array(1, '"\\a\\\\\\"a"', '"a\\\\\\"a"'), | ||
); | ||
} | ||
|
||
/** | ||
* @dataProvider data_tokenizer | ||
*/ | ||
function test_tokenizer($num, $input, $output) | ||
{ | ||
$res = json_encode(rcube_sieve_script::tokenize($input, $num)); | ||
|
||
$this->assertEquals(trim($res), trim($output)); | ||
} | ||
} |
Oops, something went wrong.