diff options
author | Thomas Bruederli <thomas@roundcube.net> | 2014-01-30 09:12:57 +0100 |
---|---|---|
committer | Thomas Bruederli <thomas@roundcube.net> | 2014-01-30 09:12:57 +0100 |
commit | 8c893b79d230cc844226bdf3b1de95cd5a99ecb2 (patch) | |
tree | f8e6e1df519c9b85bd16bdc31f1ae6a3b16ce6e7 /tests/Framework/Csv2vcard.php | |
parent | 1978ae97a5e0feb8d205c5fcbaa2cc16ce3ffc28 (diff) |
Branching off for release 1.0
Diffstat (limited to 'tests/Framework/Csv2vcard.php')
-rw-r--r-- | tests/Framework/Csv2vcard.php | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/tests/Framework/Csv2vcard.php b/tests/Framework/Csv2vcard.php deleted file mode 100644 index 5d52efc58..000000000 --- a/tests/Framework/Csv2vcard.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -/** - * Test class to test rcube_csv2vcard class - * - * @package Tests - */ -class Framework_Csv2vcard extends PHPUnit_Framework_TestCase -{ - - function test_import_generic() - { - $csv = new rcube_csv2vcard; - - // empty input - $csv->import(''); - $this->assertSame(array(), $csv->export()); - } - - function test_import_tb_plain() - { - $csv_text = file_get_contents(TESTS_DIR . '/src/Csv2vcard/tb_plain.csv'); - $vcf_text = file_get_contents(TESTS_DIR . '/src/Csv2vcard/tb_plain.vcf'); - - $csv = new rcube_csv2vcard; - $csv->import($csv_text); - $result = $csv->export(); - $vcard = $result[0]->export(false); - - $this->assertCount(1, $result); - - $vcf_text = trim(str_replace("\r\n", "\n", $vcf_text)); - $vcard = trim(str_replace("\r\n", "\n", $vcard)); - - $this->assertEquals($vcf_text, $vcard); - } - - function test_import_email() - { - $csv_text = file_get_contents(TESTS_DIR . '/src/Csv2vcard/email.csv'); - $vcf_text = file_get_contents(TESTS_DIR . '/src/Csv2vcard/email.vcf'); - - $csv = new rcube_csv2vcard; - $csv->import($csv_text); - $result = $csv->export(); - - $this->assertCount(4, $result); - - $vcard = ''; - foreach ($result as $vcf) { - $vcard .= $vcf->export(false) . "\n"; - } - - $vcf_text = trim(str_replace("\r\n", "\n", $vcf_text)); - $vcard = trim(str_replace("\r\n", "\n", $vcard)); - $this->assertEquals($vcf_text, $vcard); - } -} |