public function testcreate_export_query() { $user = new User(); //test with empty string params $expected = "SELECT id, user_name, first_name, last_name, description, date_entered, date_modified, modified_user_id, created_by, title, department, is_admin, phone_home, phone_mobile, phone_work, phone_other, phone_fax, address_street, address_city, address_state, address_postalcode, address_country, reports_to_id, portal_only, status, receive_notifications, employee_status, messenger_id, messenger_type, is_group FROM users WHERE users.deleted = 0 AND users.is_admin=0 ORDER BY users.user_name"; $actual = $user->create_export_query('', ''); $this->assertSame($expected, $actual); //test with valid string params $expected = "SELECT id, user_name, first_name, last_name, description, date_entered, date_modified, modified_user_id, created_by, title, department, is_admin, phone_home, phone_mobile, phone_work, phone_other, phone_fax, address_street, address_city, address_state, address_postalcode, address_country, reports_to_id, portal_only, status, receive_notifications, employee_status, messenger_id, messenger_type, is_group FROM users WHERE user_name=\"\" AND users.deleted = 0 AND users.is_admin=0 ORDER BY id"; $actual = $user->create_export_query('id', 'user_name=""'); $this->assertSame($expected, $actual); }