From a3644638aaf0418598196a870204e0b632a4c8ad Mon Sep 17 00:00:00 2001 From: Thomas Bruederli <thomas@roundcube.net> Date: Fri, 17 Apr 2015 06:28:40 -0400 Subject: [PATCH] Allow preference sections to define CSS class names --- tests/Framework/Csv2vcard.php | 38 +++++++++++++++++++++++++++++++++++++- 1 files changed, 37 insertions(+), 1 deletions(-) diff --git a/tests/Framework/Csv2vcard.php b/tests/Framework/Csv2vcard.php index f460c42..34faf7d 100644 --- a/tests/Framework/Csv2vcard.php +++ b/tests/Framework/Csv2vcard.php @@ -31,7 +31,7 @@ $vcf_text = trim(str_replace("\r\n", "\n", $vcf_text)); $vcard = trim(str_replace("\r\n", "\n", $vcard)); -echo $vcard; + $this->assertEquals($vcf_text, $vcard); } @@ -55,4 +55,40 @@ $vcard = trim(str_replace("\r\n", "\n", $vcard)); $this->assertEquals($vcf_text, $vcard); } + + function test_import_gmail() + { + $csv_text = file_get_contents(TESTS_DIR . '/src/Csv2vcard/gmail.csv'); + $vcf_text = file_get_contents(TESTS_DIR . '/src/Csv2vcard/gmail.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_outlook() + { + $csv_text = file_get_contents(TESTS_DIR . '/src/Csv2vcard/outlook.csv'); + $vcf_text = file_get_contents(TESTS_DIR . '/src/Csv2vcard/outlook.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); + } } -- Gitblit v1.9.1