⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.78
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
psa-pear
/
pear
/
tests
/
turba
/
Turba
/
Unit
/
Edit File: LdifTest.php
<?php /** * @author Jan Schneider <jan@horde.org> * @license http://www.horde.org/licenses/apache Apache-like * @category Horde * @package Turba * @subpackage UnitTests */ class Turba_Unit_LdifTest extends Turba_TestCase { /** * @dataProvider exportFiles */ public function testExport($contact, $ldif) { $data = new Turba_Data_Ldif(new Horde_Data_Storage_Mock()); $this->assertStringEqualsFile($ldif, $data->exportData($contact, false)); } /** * @dataProvider importFiles */ public function testImport($contact, $ldif) { $data = new Turba_Data_Ldif(new Horde_Data_Storage_Mock()); $this->assertEquals($contact, $data->importFile($ldif, false)); } public function exportFiles() { return array( array( array(array( 'firstname' => 'John', 'lastname' => 'Püblic', 'name' => 'John Püblic', 'email' => 'john@example.com' )), __DIR__ . '/../fixtures/bug_6518.ldif', ), array( array( array( 'firstname' => 'John', 'lastname' => 'Smith', 'name' => 'John Smith', 'email' => 'js23@school.edu'), array( 'firstname' => 'Charles', 'lastname' => 'Brown', 'name' => 'Charlie Brown', 'alias' => 'Chuck', 'birthday' => 'May 1', 'workPhone' => '+1 212 876 5432', 'homePhone' => '+1 203 234 5678', 'fax' => '+1 203 999 9999', 'cellPhone' => '+1 917 321 0987', 'homeStreet' => '12 west 57 street', 'homeCity' => 'New York', 'homeProvince' => 'New York', 'homePostalCode' => '10001', 'homeCountry' => 'USA', 'workStreet' => '12 west 55 street', 'workCity' => 'New York', 'workProvince' => 'New York', 'workPostalCode' => '10001', 'workCountry' => 'USA', 'title' => 'Senior Systems Programmer', 'department' => 'SUIT', 'company' => 'School University', 'website' => 'http://www.school.edu/', 'freebusyUrl' => 'http://www.school.edu/~chuck/fb.ics', 'notes' => 'hi mom ', 'email' => 'brown@school.edu' ), ), __DIR__ . '/../fixtures/export.ldif', ), ); } public function importFiles() { $result = array( array( 'givenName' => 'John', 'sn' => 'Smith', 'cn' => 'John Smith', 'mail' => 'js23@school.edu', ), array( 'givenName' => 'Charles', 'sn' => 'Brown', 'cn' => 'Charlie Brown', 'mozillaNickname' => 'Chuck', 'mail' => 'brown@school.edu', 'telephoneNumber' => '+1 212 876 5432', 'homePhone' => '+1 203 234 5678', 'fax' => '+1 203 999 9999', 'mobile' => '+1 917 321 0987', 'homeStreet' => '12 west 57 street', 'mozillaHomeStreet2' => 'Apt 2076', 'mozillaHomeLocalityName' => 'New York', 'mozillaHomeState' => 'New York', 'mozillaHomePostalCode' => '10001', 'mozillaHomeCountryName' => 'USA', 'street' => '12 West 55th Street', 'mozillaWorkStreet2' => 'Room 22', 'l' => 'New York', 'st' => 'New York', 'postalCode' => '10001', 'c' => 'USA', 'title' => 'Senior Systems Programmer', 'department' => 'CUIT', 'company' => 'School University', 'mozillaWorkUrl' => 'http://www.school.edu/', 'description' => 'hi mom ', ), ); return array( array( $result, __DIR__ . '/../fixtures/import.ldif', ), array( $result, __DIR__ . '/../fixtures/importCRLF.ldif', ), ); } }
Simpan