35 require_once(
'bmlt_satellite_controller.class.php');
38 define(
'U_TEST_REMOTE_URI',
'https://bmlt.app/trunk/main_server');
41 define(
'U_TEST_LOCAL_URI',
'http://bmlt-server.localhost');
44 define(
'U_TEST_MEETING_ID', 734);
62 if ($local && preg_match(
'|localhost|', $_SERVER[
'SERVER_NAME'])) {
66 $override_uri = (isset($_GET[
'test_uri']) && $_GET[
'test_uri']) ? $_GET[
'test_uri'] :
null;
84 $ret =
'<h3>URI Test</h3>';
85 $ret .=
'<div class="test_container_div">';
86 $in_test_subject->set_m_root_uri($in_root_server_uri);
87 $in_root_server_uri = $in_test_subject->get_m_root_uri();
88 $ret .=
'The object has the following URI set: ';
89 $ret .= htmlspecialchars($in_test_subject->get_m_root_uri());
90 $server_version = $in_test_subject->get_server_version();
91 $error_message = $in_test_subject->get_m_error_message();
93 $ret .=
'<br />The object reported the following error: "' . htmlspecialchars($error_message) .
'"';
95 $ret .=
'<br />The server reports that its version is ' . htmlspecialchars($server_version) .
'<br />Test Passed!';
110 $ret =
'<h1 id="standard_query_test"># BEGIN STANDARD SERVER QUERY UNIT TESTS</h1>';
111 $ret .=
'<div class="test_container_div">';
112 $ret .=
'<h3>Standard Server Parameters Test</h3>';
113 $in_test_subject->set_m_root_uri($in_root_server_uri);
114 $ret .=
'<div class="test_container_div">';
116 $server_formats = $in_test_subject->get_server_formats();
117 $error_message = $in_test_subject->get_m_error_message();
118 if ($error_message) {
119 $ret .=
'<br />The object reported the following error: "' . htmlspecialchars($error_message) .
'"';
121 $server_langs_ret = $in_test_subject->get_server_langs();
124 foreach ($server_langs_ret as $lang) {
126 $server_langs .=
', ';
128 $server_langs .= $lang[
'name'];
130 if ($lang[
'default']) {
131 $server_langs .=
' (default language)';
132 if (isset($lang[
'key'])) {
133 $def_lang = $lang[
'key'];
137 $error_message = $in_test_subject->get_m_error_message();
138 if ($error_message) {
139 $ret .=
'<br />The object reported the following error: "' . htmlspecialchars($error_message) .
'"';
141 $server_service_bodies = $in_test_subject->get_server_service_bodies();
142 $error_message = $in_test_subject->get_m_error_message();
143 if ($error_message) {
144 $ret .=
'<br />The object reported the following error: "' . htmlspecialchars($error_message) .
'"';
146 $server_meeting_keyss = $in_test_subject->get_server_meeting_keys();
147 $error_message = $in_test_subject->get_m_error_message();
148 if ($error_message) {
149 $ret .=
'<br />The object reported the following error: "' . htmlspecialchars($error_message) .
'"';
151 $ret .=
'<h4>The server at ' . htmlspecialchars($in_root_server_uri) .
' supports the following languages:</h4><div class="test_container_div">' . htmlspecialchars($server_langs);
152 $ret .=
'</div><h4>The server at ' . htmlspecialchars($in_root_server_uri) .
' supports the following formats:</h4>';
153 foreach ($server_formats as $id => $format) {
154 $ret .=
'<div class="test_container_div"><strong>' . htmlspecialchars($id) .
' ' . htmlspecialchars($format[
'key_string']) .
'</strong> (' . htmlspecialchars($format[
'description_string']) .
')</div>';
156 $ret .=
'<h4>The server at ' . htmlspecialchars($in_root_server_uri) .
' has the following Service bodies:</h4><div class="test_container_div">';
157 foreach ($server_service_bodies as $sb) {
160 $ret .=
'</div><h4>The server at ' . htmlspecialchars($in_root_server_uri) .
' has the following Meeting Keys:</h4>';
161 foreach ($server_meeting_keyss as $key) {
162 $ret .=
'<div class="test_container_div">' . htmlspecialchars($key) .
'</div>';
170 $ret .=
'<h1># END STANDARD SERVER QUERY UNIT TESTS</h1>';
181 $ret =
'<div class="name_div"><strong>' . htmlspecialchars($in_service_body_array[
'name']) .
'</strong></div>';
182 $ret .=
'<div class="test_container_div">';
183 $ret .=
'<div class="type_div">' . htmlspecialchars($in_service_body_array[
'type']) .
'</div>';
184 $ret .=
'<div class="desc_div">' . htmlspecialchars($in_service_body_array[
'description']) .
'</div>';
185 $ret .=
'<div class="uri_div">' . htmlspecialchars($in_service_body_array[
'uri']) .
'</div>';
186 $ret .=
'<div class="kmluri_div">' . htmlspecialchars($in_service_body_array[
'kmluri']) .
'</div>';
187 if (isset($in_service_body_array[
'children']) && is_array($in_service_body_array[
'children']) && count($in_service_body_array[
'children'])) {
188 $ret .=
'<div class="test_container_div">';
189 foreach ($in_service_body_array[
'children'] as $child) {
209 $ret =
'<h1 id="root_uri_accessor_test"># BEGIN ROOT URI ACCESSOR UNIT TESTS</h1>';
210 $ret .=
'<div class="test_container_div">';
212 $ret .=
'<h2>Test With Good URI</h2>';
213 $ret .=
'<div class="test_container_div">';
215 $ret .=
'We are giving the object the following URI: ' . htmlspecialchars($test_uri) .
'<br />';
220 $ret .=
'<h2>Test With Good URI (With Slash at End)</h2>';
221 $ret .=
'<div class="test_container_div">';
222 $test_uri = $in_uri .
'/';
223 $ret .=
'We are giving the object the following URI: ' . htmlspecialchars($test_uri) .
'<br />';
228 $ret .=
'<h2>Test With Good URI (With No Protocol Preamble)</h2>';
229 $ret .=
'<div class="test_container_div">';
230 $test_uri = str_replace(
'http://',
'', $in_uri);
231 $ret .=
'We are giving the object the following URI: ' . htmlspecialchars($test_uri) .
'<br />';
236 $ret .=
'<h2>Test With Bad URI (Typical Typo Mistake -Will be Corrected)</h2>';
237 $ret .=
'<div class="test_container_div">';
238 $test_uri = str_replace(
'http://',
'ttp://', $in_uri);
239 $ret .=
'We are giving the object the following URI: ' . htmlspecialchars($test_uri) .
'<br />';
244 $ret .=
'<h2>Test With Bad URI (Invalid Protocol -Will be Corrected)</h2>';
245 $ret .=
'<div class="test_container_div">';
246 $test_uri = str_replace(
'http://',
'wcal://', $in_uri);
247 $ret .=
'We are giving the object the following URI: ' . htmlspecialchars($test_uri) .
'<br />';
252 $ret .=
'<h2>Test With Bad URI (Typical Typo Mistake -Will Not be Corrected)</h2>';
253 $ret .=
'<div class="test_container_div">';
254 $test_uri = preg_replace(
'|.$|',
'', $in_uri);
255 $ret .=
'We are giving the object the following URI: ' . htmlspecialchars($test_uri) .
'<br />';
260 $ret .=
'<h2>Test With Bad URI (Will Not be Corrected)</h2>';
261 $ret .=
'<div class="test_container_div">';
262 $test_uri = $in_uri .
'/monkee-business';
263 $ret .=
'We are giving the object the following URI: ' . htmlspecialchars($test_uri) .
'<br />';
267 $ret .=
'<h1># END ROOT URI ACCESSOR UNIT TESTS</h1>';
279 $ret =
'<h1 id="outgoing_parameter_test"># BEGIN OUTGOING PARAMETER STORAGE UNIT TESTS</h1>';
280 $ret .=
'<div class="test_container_div">';
281 $ret .=
'<h2>Place two Values By Two Keys, Then Retrieve Them</h2>';
282 $ret .=
'<div class="test_container_div">';
283 $test_key =
'SearchString';
284 $test_val =
'Test Value String 1';
285 $in_test_subject->set_m_outgoing_parameter($test_key, $test_val);
286 $error_message = $in_test_subject->get_m_error_message();
288 if ($error_message) {
289 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
291 $test_key2 =
'meeting_key_value';
292 $test_val2 =
'Test Value String 2';
293 $in_test_subject->set_m_outgoing_parameter($test_key2, $test_val2);
294 $error_message = $in_test_subject->get_m_error_message();
296 if ($error_message) {
297 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
299 $returned_val = $in_test_subject->get_m_outgoing_parameter($test_key);
300 $error_message = $in_test_subject->get_m_error_message();
302 if ($error_message) {
303 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
305 if (is_string($returned_val) && ( strcmp($returned_val, $test_val) === 0 )) {
306 $ret .=
'Test Passed! The object stored and returned the first string correctly.';
308 $ret .=
"Test Failed! '$returned_val', which was returned from the object, is not '$test_val', which was stored in the object! ($test_key)";
312 $returned_val2 = $in_test_subject->get_m_outgoing_parameter($test_key2);
316 $error_message = $in_test_subject->get_m_error_message();
318 if ($error_message) {
319 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
321 if (is_string($returned_val2) && ( strcmp($returned_val2, $test_val2) === 0 )) {
322 $ret .=
'Test Passed! The object stored and returned the second string correctly.';
324 $ret .=
"Test Failed! '$returned_val2', which was returned from the object, is not '$test_val2', which was stored in the object! ($test_key2)";
331 $ret .=
'<h2>Make Sure That The Errors Are Set for Bad Key Selection</h2>';
332 $ret .=
'<div class="test_container_div">';
335 $returned_val = $in_test_subject->get_m_outgoing_parameter(
'badz-maru');
336 $error_message = $in_test_subject->get_m_error_message();
338 if ($error_message) {
339 if ($returned_val ===
null) {
340 $ret .=
'The test passed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
342 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'", but the following value was returned: "' . htmlspecialchars($returned_val) .
'"';
347 $in_test_subject->clear_m_error_message();
349 if ($in_test_subject->get_m_error_message()) {
350 $ret .=
'<br />The error message was not cleared! Test fail!';
353 $ret .=
'The Test Failed! We were expecting an error!';
357 $in_test_subject->set_m_outgoing_parameter(
'spaz', $test_val);
358 $error_message = $in_test_subject->get_m_error_message();
360 if ($error_message) {
361 $ret .=
'The test passed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
362 $in_test_subject->clear_m_error_message();
364 $ret .=
'The Test Failed! We were expecting an error!';
368 $returned_val = $in_test_subject->get_m_outgoing_parameter(
null);
370 if ($returned_val !==
null) {
371 $ret .=
'<br />The Test Failed! We got data from a null request!';
376 $ret .=
'<h1># END OUTGOING PARAMETER STORAGE UNIT TESTS</h1>';
388 $ret =
'<h1 id="basic_search_test"># BEGIN BASIC SEARCH UNIT TEST</h1>';
389 $ret .=
'<div class="test_container_div">';
391 $start_time = microtime(
true);
394 $error_message = $test_subject->get_m_error_message();
395 if ($error_message) {
396 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
399 $test_subject->set_current_transaction_parameter(
'SearchString',
'Mineola, NY');
400 if ($error_message) {
401 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
403 $test_subject->set_current_transaction_parameter(
'StringSearchIsAnAddress',
true);
404 if ($error_message) {
405 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
407 $search_result = $test_subject->meeting_search();
408 $error_message = $test_subject->get_m_error_message();
409 if ($error_message) {
410 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
411 } elseif (isset($search_result) && is_array($search_result) && count($search_result)) {
412 $total_time = intval((microtime(
true) - $start_time) * 1000);
414 $ret .=
'<h2>Test Passed! (The complete setup and search took ';
415 if ($total_time > 1000) {
416 $total_time /= 1000.0;
417 $ret .= htmlspecialchars($total_time) .
' seconds';
419 $ret .= htmlspecialchars($total_time) .
' milliseconds';
421 $ret .=
' to run.) Here are the returned meetings:</h2><div class="test_container_div">';
422 foreach ($search_result[
'meetings'] as $meeting) {
427 $ret .=
'<h3>The query URI was: ' . htmlspecialchars($search_result[
'uri']) .
'<br />(Search for all meetings near Mineola, NY)</h3>';
429 $ret .=
'Test Failed! No Meetings Returned!';
436 $ret .=
'<h1># END BASIC SEARCH UNIT TEST</h1>';
448 &$serialized_transaction
450 $ret =
'<h1 id="complex_search_test"># BEGIN COMPLEX SEARCH UNIT TEST</h1>';
451 $ret .=
'<div class="test_container_div">';
453 $start_time = microtime(
true);
455 $error_message = $test_subject->get_m_error_message();
456 if ($error_message) {
457 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
460 $test_subject->set_current_transaction_parameter(
'SearchString',
'Bleeker Street at 14th Street, Manhattan, NY');
461 $error_message = $test_subject->get_m_error_message();
462 if ($error_message) {
463 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
465 $test_subject->set_current_transaction_parameter(
'StringSearchIsAnAddress',
true);
466 $error_message = $test_subject->get_m_error_message();
467 if ($error_message) {
468 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
470 $test_subject->set_current_transaction_parameter(
'weekdays', array ( 1, 2, 3, 4, 5 ));
471 $error_message = $test_subject->get_m_error_message();
472 if ($error_message) {
473 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
475 $test_subject->set_current_transaction_parameter(
'formats', array ( 17 ));
476 $error_message = $test_subject->get_m_error_message();
477 if ($error_message) {
478 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
480 $test_subject->set_current_transaction_parameter(
'langs', array (
'en' ));
481 if ($error_message) {
482 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
484 $search_result = $test_subject->meeting_search();
485 $error_message = $test_subject->get_m_error_message();
486 if ($error_message) {
487 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
488 } elseif (isset($search_result) && is_array($search_result) && count($search_result)) {
489 if (!isset($search_result[
'meetings']) || !is_array($search_result[
'meetings']) || !count($search_result[
'meetings'])) {
490 $ret .=
'<h2>Test Failed! No meetings were returned!</h2>';
492 $total_time = intval((microtime(
true) - $start_time) * 1000);
494 $ret .=
'<h2>Test Passed! (The complete setup and search took ';
495 if ($total_time > 1000) {
496 $total_time /= 1000.0;
497 $ret .= htmlspecialchars($total_time) .
' seconds';
499 $ret .= htmlspecialchars($total_time) .
' milliseconds';
501 $ret .=
' to run.) Here are the returned meetings:</h2><div class="test_container_div">';
502 foreach ($search_result[
'meetings'] as $meeting) {
509 $ret .=
'<h3>The query URI was: ' . htmlspecialchars($search_result[
'uri']) .
'<br />(Search for open, English-speaking, beginners\' meetings, on Sunday, Monday, Tuesday, Wednesday, or Thursday, near Bleeker Street and 14th Street, in Manhattan)</h3>';
510 $serialized_transaction = $search_result[
'serialized'];
512 $ret .=
'Test Failed! No Meetings Returned!';
522 $ret .=
'<h1># END COMPLEX SEARCH UNIT TEST</h1>';
534 $ret =
'<h1 id="partial_search_test"># BEGIN FILTERED SEARCH UNIT TEST</h1>';
535 $ret .=
'<div class="test_container_div">';
537 $start_time = microtime(
true);
539 $error_message = $test_subject->get_m_error_message();
540 if ($error_message) {
541 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
544 $test_subject->set_current_transaction_parameter(
'SearchString',
'Bleeker Street at 14th Street, Manhattan, NY');
545 $error_message = $test_subject->get_m_error_message();
546 if ($error_message) {
547 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
549 $test_subject->set_current_transaction_parameter(
'StringSearchIsAnAddress',
true);
550 $error_message = $test_subject->get_m_error_message();
551 if ($error_message) {
552 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
554 $test_subject->set_current_transaction_parameter(
'data_field_key',
'location_municipality,meeting_name');
555 $error_message = $test_subject->get_m_error_message();
556 if ($error_message) {
557 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
559 $search_result = $test_subject->meeting_search(
true);
560 $error_message = $test_subject->get_m_error_message();
561 if ($error_message) {
562 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
563 } elseif (isset($search_result) && is_array($search_result) && count($search_result)) {
564 if (!isset($search_result[
'meetings']) || !is_array($search_result[
'meetings']) || !count($search_result[
'meetings'])) {
565 $ret .=
'<h2>Test Failed! No meetings were returned!</h2>';
567 $total_time = intval((microtime(
true) - $start_time) * 1000);
570 foreach ($search_result[
'meetings'] as $meeting) {
571 foreach ($meeting as $key => $value) {
572 if (($key !=
'location_municipality') && ($key !=
'meeting_name' )) {
573 $ret .=
'The meeting should not have the ' . htmlspecialchars($key) .
' field!!';
581 $ret .=
'<h2>Test Passed! (The complete setup and search took ';
582 if ($total_time > 1000) {
583 $total_time /= 1000.0;
584 $ret .= htmlspecialchars($total_time) .
' seconds';
586 $ret .= htmlspecialchars($total_time) .
' milliseconds';
588 $ret .=
' to run.).';
590 $ret .=
'Test Failed! The meeting data had extra fields!';
594 $ret .=
'<h3>The query URI was: ' . htmlspecialchars($search_result[
'uri']) .
'</h3>';
596 $ret .=
'Test Failed! No Meetings Returned!';
604 $ret .=
'<h1># END FILTERED SEARCH UNIT TEST</h1>';
616 $serialized_transaction
618 $ret =
'<h1 id="serialized_search_test"># BEGIN SERIALIZED SEARCH UNIT TEST</h1>';
619 $ret .=
'<div class="test_container_div">';
621 $start_time = microtime(
true);
623 $in_test_subject->apply_serialized_transaction($serialized_transaction);
624 $error_message = $in_test_subject->get_m_error_message();
625 if ($error_message) {
626 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
628 $search_result = $in_test_subject->meeting_search();
629 $error_message = $in_test_subject->get_m_error_message();
630 if ($error_message) {
631 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
632 } elseif (isset($search_result) && is_array($search_result) && count($search_result)) {
633 if (!isset($search_result[
'meetings']) || !is_array($search_result[
'meetings']) || !count($search_result[
'meetings'])) {
634 $ret .=
'<h2>Test Failed! No meetings were returned!</h2>';
636 $total_time = intval((microtime(
true) - $start_time) * 1000);
638 $ret .=
'<h2>Test Passed! (The complete search took ';
639 if ($total_time > 1000) {
640 $total_time /= 1000.0;
641 $ret .= htmlspecialchars($total_time) .
' seconds';
643 $ret .= htmlspecialchars($total_time) .
' milliseconds';
645 $ret .=
' to run.) Here are the returned meetings:</h2><div class="test_container_div">';
646 foreach ($search_result[
'meetings'] as $meeting) {
653 $ret .=
'<h3>The query URI was: ' . htmlspecialchars($search_result[
'uri']);
655 $ret .=
'Test Failed! No Meetings Returned!';
660 $ret .=
'<h1># END SERIALIZED SEARCH UNIT TEST</h1>';
672 $ret =
'<div class="name_div"><h3>' . htmlspecialchars($in_meeting_array[
'meeting_name']) .
' (' . htmlspecialchars($in_meeting_array[
'id_bigint']) .
')</h3>';
673 foreach ($in_meeting_array as $key => $value) {
674 if ($key !=
'meeting_name' && $key !=
'id_bigint') {
675 $ret .=
'<div class="test_container_div"><strong>' . htmlspecialchars($key) .
':</strong> ' . htmlspecialchars($value) .
'</div>';
696 $ret =
'<h1 id="change_request_test"># BEGIN CHANGE REQUEST UNIT TEST</h1>';
697 $ret .=
'<div class="test_container_div">';
698 $ret .=
'<h2 id="change_request_test"># BEGIN GENERAL CHANGES TEST</h1>';
700 $start_time = microtime(
true);
702 $error_message = $test_subject->get_m_error_message();
703 if ($error_message) {
704 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
707 $start_date = time() - (7 * 24 * 60 * 60 * 7);
708 $end_date = time() - (7 * 24 * 60 * 60);
709 $change_array = $test_subject->get_meeting_changes($start_date, $end_date);
710 $error_message = $test_subject->get_m_error_message();
711 if ($error_message) {
712 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
713 } elseif (is_array($change_array) && count($change_array)) {
714 $total_time = intval((microtime(
true) - $start_time) * 1000);
716 $ret .=
'<h2>Test Passed! (The complete transaction took ';
717 if ($total_time > 1000) {
718 $total_time /= 1000.0;
719 $ret .= htmlspecialchars($total_time) .
' seconds';
721 $ret .= htmlspecialchars($total_time) .
' milliseconds';
723 $ret .=
' to run.) Here are the meeting changes from ' . htmlspecialchars(date(
'F j, Y', $start_date)) .
' to ' . htmlspecialchars(date(
'F j, Y', $end_date)) .
':</h2><div class="test_container_div">';
724 $ret .=
'<pre>' . htmlspecialchars(print_r($change_array,
true)) .
'</pre>';
727 $ret .=
'The test failed, because the object returned no meeting changes for the given period.';
730 $ret .=
'<h2># END GENERAL CHANGES TEST</h1>';
732 $ret .=
'<div class="test_container_div">';
733 $ret .=
'<h2 id="change_meeting_request_test"># BEGIN SPECIFIC MEETING CHANGES TEST</h1>';
734 $change_array = $test_subject->get_meeting_changes(
null,
null,
U_TEST_MEETING_ID);
735 $error_message = $test_subject->get_m_error_message();
736 if ($error_message) {
737 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
738 } elseif (is_array($change_array) && count($change_array)) {
739 $total_time = intval((microtime(
true) - $start_time) * 1000);
741 $ret .=
'<h2>Test Passed! (The complete transaction took ';
742 if ($total_time > 1000) {
743 $total_time /= 1000.0;
744 $ret .= htmlspecialchars($total_time) .
' seconds';
746 $ret .= htmlspecialchars($total_time) .
' milliseconds';
748 $ret .=
' to run.) Here are the meeting changes for this meeting:</h2><div class="test_container_div">';
749 $ret .=
'<pre>' . htmlspecialchars(print_r($change_array,
true)) .
'</pre>';
752 $ret .=
'The test failed, because the object returned no meeting changes for the given period.';
754 $ret .=
'<h2># END SPECIFIC MEETING CHANGES TEST</h1>';
756 $ret .=
'<h1># END CHANGE REQUEST UNIT TEST</h1>';
769 $ret =
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><title>bmlt_satellite_controller Class Unit Test (###-SERVER-URI-###)</title>';
770 $ret .=
'<style type="text/css">';
771 $ret .=
'*{margin:0;padding:0}';
772 $ret .=
'body{font-family:Courier;font-size:small}';
773 $ret .=
'.test_container_div{padding-left:20px}';
775 $ret .=
'</head><body>';
781 $ret = str_replace(
'###-SERVER-URI-###', htmlspecialchars($uri), $ret);
787 $ret .=
'<h1>BEGIN UNIT TEST</h1>';
788 $ret .=
'<div class="test_container_div">';
790 $ret .=
'<strong>USAGE:</strong> Override URI by "test_uri=<em>XXX</em>"<br />';
791 $ret .=
'<strong>USING:</strong> ' . htmlspecialchars($uri);
794 $ret .=
'<h1 id="constructor_unit_test"># BEGIN CONSTRUCTOR UNIT TEST</h1>';
795 $ret .=
'<div class="test_container_div">';
797 $start_time = microtime(
true);
799 $total_time = intval((microtime(
true) - $start_time) * 1000);
800 $error_message = $test_subject->get_m_error_message();
801 if ($error_message) {
802 $ret .=
'The test failed, because the object reported the following error: "' . htmlspecialchars($error_message) .
'"';
803 $ret .=
'</div><h1># END CONSTRUCTOR UNIT TEST</h1>';
805 $ret .=
'<h2>Auto-Setup Constructor Test</h2>';
806 $ret .=
'<div class="test_container_div">The initialization (setting up the object) took ';
807 if ($total_time > 1000) {
808 $total_time /= 1000.0;
809 $ret .= htmlspecialchars($total_time) .
' seconds';
811 $ret .= htmlspecialchars($total_time) .
' milliseconds';
814 $ret .=
' to run.<br />The object has the following URI set via the constructor: ';
815 $ret .= htmlspecialchars($test_subject->get_m_root_uri());
817 $server_version = $test_subject->get_server_version();
818 $server_langs = $test_subject->get_m_outgoing_parameter(
'langs');
819 $server_formats = $test_subject->get_m_outgoing_parameter(
'formats');
820 $server_services = $test_subject->get_m_outgoing_parameter(
'services');
821 $server_meeting_key = $test_subject->get_m_outgoing_parameter(
'meeting_key');
823 if ($server_version && is_array($server_langs) && is_array($server_formats) && is_array($server_services) && is_array($server_meeting_key)) {
824 $ret .=
'<br />The test passed, because all the data items were set up and cached.';
826 $ret .=
'<br />The test failed, because not all the data items were cached.';
831 $ret .=
'<h1># END CONSTRUCTOR UNIT TEST</h1>';
834 $test_subject =
null;
846 $serialized_transaction =
null;
851 $ret .=
'FAIL: Cannot instantiate bmlt_satellite_controller object!';
856 $ret .=
'<h1>END UNIT TEST</h1>';
862 $ret .=
'</body></html>';
Provides low-level communication to the BMLT Root Server.
u_test_complex_search( $in_root_server_uri, &$serialized_transaction)
Performs a more complex meeting search * *.
u_test_server_parameters_outgoing(&$in_test_subject)
Tests the outgoing parameter storage. * *.
u_test()
Runs the unit tests. * *.
u_test_draw_service_body($in_service_body_array)
Displays Service bodies in a hierarchical fashion. * *.
u_test_get_test_server_uri()
Returns the URI for the test server. The default is the public trunk test server * and you can specif...
u_test_server_root_uri(&$in_test_subject, $in_uri)
Tests the various ways the class deals with the root URI . This will also * exercise the cURL calling...
u_test_draw_meeting($in_meeting_array)
Displays one meeting in a hierarchical fashion. * *.
const U_TEST_MEETING_ID
This is an ID for a specific meeting (with some changes) for the meeting changes test.
const U_TEST_LOCAL_URI
If running on localhost, you can specify a local root URI. Comment this out to always use remote.
u_test_get_standard_server_parameters(&$in_test_subject, $in_root_server_uri)
Apply the URI, and see if the server is there (can also test for bad URI) * *.
u_test_serialized_search( $in_test_subject, $serialized_transaction)
Performs a more complex meeting search * *.
u_test_apply_root_uri(&$in_test_subject, $in_root_server_uri)
Apply the URI, and see if the server is there (can also test for bad URI) * *.
u_test_filtered_search($in_root_server_uri)
Performs a more complex meeting search, but only gets a couple of the fields. * *.
const U_TEST_REMOTE_URI
This is the URI to resolve a test root server (remote). Default is the public trunk test (not stable)...
u_test_changes($in_root_server_uri)
Queries the server for changes. *This function requires that the root server be version 1....
u_test_basic_search($in_root_server_uri)
Performs a basic meeting search * *.