| | |
| | | |
| | | $vcf_text = trim(str_replace("\r\n", "\n", $vcf_text)); |
| | | $vcard = trim(str_replace("\r\n", "\n", $vcard)); |
| | | |
| | | $this->assertEquals($vcf_text, $vcard); |
| | | } |
| | | |
| | |
| | | $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); |
| | | } |
| | | } |