Ejemplo n.º 1
0
bool TestExtOutput::RunTests(const std::string &which) {
  bool ret = true;

  DECLARE_TEST_FUNCTIONS("function mytolower($a) {"
                         " return strtolower($a);"
                         "}");

  RUN_TEST(test_ob_start);
  RUN_TEST(test_ob_clean);
  RUN_TEST(test_ob_flush);
  RUN_TEST(test_ob_end_clean);
  RUN_TEST(test_ob_end_flush);
  RUN_TEST(test_flush);
  RUN_TEST(test_ob_get_clean);
  RUN_TEST(test_ob_get_contents);
  RUN_TEST(test_ob_get_flush);
  RUN_TEST(test_ob_get_length);
  RUN_TEST(test_ob_get_level);
  RUN_TEST(test_ob_get_status);
  RUN_TEST(test_ob_gzhandler);
  RUN_TEST(test_ob_implicit_flush);
  RUN_TEST(test_ob_list_handlers);
  RUN_TEST(test_output_add_rewrite_var);
  RUN_TEST(test_output_reset_rewrite_vars);
  RUN_TEST(test_hphp_crash_log);
  RUN_TEST(test_hphp_stats);
  RUN_TEST(test_hphp_get_stats);
  RUN_TEST(test_hphp_get_timers);
  RUN_TEST(test_hphp_output_global_state);

  return ret;
}
Ejemplo n.º 2
0
bool TestExtMisc::RunTests(const std::string &which) {
  bool ret = true;

  DECLARE_TEST_FUNCTIONS("");

  RUN_TEST(test_connection_aborted);
  RUN_TEST(test_connection_status);
  RUN_TEST(test_connection_timeout);
  RUN_TEST(test_constant);
  RUN_TEST(test_define);
  RUN_TEST(test_defined);
  RUN_TEST(test_die);
  RUN_TEST(test_exit);
  RUN_TEST(test_eval);
  RUN_TEST(test_get_browser);
  RUN_TEST(test___halt_compiler);
  RUN_TEST(test_highlight_file);
  RUN_TEST(test_show_source);
  RUN_TEST(test_highlight_string);
  RUN_TEST(test_ignore_user_abort);
  RUN_TEST(test_pack);
  RUN_TEST(test_php_check_syntax);
  RUN_TEST(test_php_strip_whitespace);
  RUN_TEST(test_sleep);
  RUN_TEST(test_usleep);
  RUN_TEST(test_time_nanosleep);
  RUN_TEST(test_time_sleep_until);
  RUN_TEST(test_uniqid);
  RUN_TEST(test_unpack);
  RUN_TEST(test_sys_getloadavg);
  RUN_TEST(test_token_get_all);
  RUN_TEST(test_token_name);

  return ret;
}
Ejemplo n.º 3
0
bool TestExtFb::RunTests(const std::string &which) {
  bool ret = true;

  DECLARE_TEST_FUNCTIONS("function test($s1) {"
                         " return $s1;"
                         "}");

  RUN_TEST(test_fb_compact_serialize);
  RUN_TEST(test_fb_compact_unserialize);
  RUN_TEST(test_fb_thrift_serialize);
  RUN_TEST(test_fb_thrift_unserialize);
  RUN_TEST(test_fb_rename_function);
  RUN_TEST(test_fb_utf8ize);
  RUN_TEST(test_fb_utf8_strlen);
  RUN_TEST(test_fb_utf8_strlen_deprecated);
  RUN_TEST(test_fb_utf8_substr);
  RUN_TEST(test_fb_call_user_func_safe);
  RUN_TEST(test_fb_call_user_func_safe_return);
  RUN_TEST(test_fb_call_user_func_array_safe);
  RUN_TEST(test_fb_load_local_databases);
  RUN_TEST(test_fb_parallel_query);
  RUN_TEST(test_fb_crossall_query);

  return ret;
}
Ejemplo n.º 4
0
bool TestExtSession::RunTests(const std::string &which) {
  bool ret = true;

  DECLARE_TEST_FUNCTIONS("");

  RUN_TEST(test_session_set_cookie_params);
  RUN_TEST(test_session_get_cookie_params);
  RUN_TEST(test_session_name);
  RUN_TEST(test_session_module_name);
  RUN_TEST(test_session_set_save_handler);
  RUN_TEST(test_session_save_path);
  RUN_TEST(test_session_id);
  RUN_TEST(test_session_regenerate_id);
  RUN_TEST(test_session_cache_limiter);
  RUN_TEST(test_session_cache_expire);
  RUN_TEST(test_session_encode);
  RUN_TEST(test_session_decode);
  RUN_TEST(test_session_start);
  RUN_TEST(test_session_destroy);
  RUN_TEST(test_session_unset);
  RUN_TEST(test_session_commit);
  RUN_TEST(test_session_write_close);
  RUN_TEST(test_session_register);
  RUN_TEST(test_session_unregister);
  RUN_TEST(test_session_is_registered);

  return ret;
}
Ejemplo n.º 5
0
bool TestExtOptions::RunTests(const std::string &which) {
  bool ret = true;

  DECLARE_TEST_FUNCTIONS("");

  RUN_TEST(test_assert_options);
  RUN_TEST(test_assert);
  RUN_TEST(test_dl);
  RUN_TEST(test_extension_loaded);
  RUN_TEST(test_get_loaded_extensions);
  RUN_TEST(test_get_extension_funcs);
  RUN_TEST(test_get_cfg_var);
  RUN_TEST(test_get_current_user);
  RUN_TEST(test_get_defined_constants);
  RUN_TEST(test_get_include_path);
  RUN_TEST(test_restore_include_path);
  RUN_TEST(test_set_include_path);
  RUN_TEST(test_get_included_files);
  RUN_TEST(test_inclued_get_data);
  RUN_TEST(test_get_magic_quotes_gpc);
  RUN_TEST(test_get_magic_quotes_runtime);
  RUN_TEST(test_get_required_files);
  RUN_TEST(test_getenv);
  RUN_TEST(test_getlastmod);
  RUN_TEST(test_getmygid);
  RUN_TEST(test_getmyinode);
  RUN_TEST(test_getmypid);
  RUN_TEST(test_getmyuid);
  RUN_TEST(test_getopt);
  RUN_TEST(test_getrusage);
  RUN_TEST(test_clock_getres);
  RUN_TEST(test_clock_gettime);
  RUN_TEST(test_clock_settime);
  RUN_TEST(test_cpu_get_count);
  RUN_TEST(test_cpu_get_model);
  RUN_TEST(test_ini_alter);
  RUN_TEST(test_ini_get_all);
  RUN_TEST(test_ini_get);
  RUN_TEST(test_ini_restore);
  RUN_TEST(test_ini_set);
  RUN_TEST(test_memory_get_peak_usage);
  RUN_TEST(test_memory_get_usage);
  RUN_TEST(test_php_ini_scanned_files);
  RUN_TEST(test_php_logo_guid);
  RUN_TEST(test_php_sapi_name);
  RUN_TEST(test_php_uname);
  RUN_TEST(test_phpcredits);
  RUN_TEST(test_phpinfo);
  RUN_TEST(test_phpversion);
  RUN_TEST(test_putenv);
  RUN_TEST(test_set_magic_quotes_runtime);
  RUN_TEST(test_set_time_limit);
  RUN_TEST(test_sys_get_temp_dir);
  RUN_TEST(test_version_compare);
  RUN_TEST(test_zend_logo_guid);
  RUN_TEST(test_zend_thread_id);
  RUN_TEST(test_zend_version);

  return ret;
}
Ejemplo n.º 6
0
bool TestExtSoap::RunTests(const std::string &which) {
  bool ret = true;

  DECLARE_TEST_FUNCTIONS("function hello() {"
                         "  return 'Hello World';"
                         "}"
                         "function add($a, $b) {"
                         "  return (int)$a + (int)$b;"
                         "}"
                         "function sub($a, $b) {"
                         "  return (int)$a - (int)$b;"
                         "}"
                         "function sum($a) {"
                         "  $sum = 0;"
                         "  foreach ($a as $v) {"
                         "    $sum += (int)$v;"
                         "  }"
                         "  return $sum;"
                         "}"
                         "function fault() {"
                         " return new SoapFault('MyFault', 'My fault string');"
                         "}");

  RUN_TEST(test_SoapServerSanity);
  RUN_TEST(test_SoapServerFunctionAll);
  RUN_TEST(test_SoapServerFunctionParam);
  RUN_TEST(test_SoapServerArrayParam);
  RUN_TEST(test_SoapServerWSDL);
  RUN_TEST(test_SoapServerFault);

  m_server.reset();

  return ret;
}
Ejemplo n.º 7
0
bool TestExtPreg::RunTests(const std::string &which) {
  bool ret = true;

  DECLARE_TEST_FUNCTIONS("function test_preg_rep($a,$b,$c) {"
                         "  return strtoupper($c).$a;"
                         "}"
                         "function next_year($m) {"
                         "  return $m[1].((int)$m[2] + 1);"
                         "}"
                        );

  RUN_TEST(test_preg_grep);
  RUN_TEST(test_preg_match);
  RUN_TEST(test_preg_match_all);
  RUN_TEST(test_preg_replace);
  RUN_TEST(test_preg_replace_callback);
  RUN_TEST(test_preg_split);
  RUN_TEST(test_preg_quote);
  RUN_TEST(test_preg_last_error);
  RUN_TEST(test_ereg_replace);
  RUN_TEST(test_eregi_replace);
  RUN_TEST(test_ereg);
  RUN_TEST(test_eregi);
  RUN_TEST(test_split);
  RUN_TEST(test_spliti);
  RUN_TEST(test_sql_regcase);

  return ret;
}
Ejemplo n.º 8
0
bool TestExtFunction::RunTests(const std::string &which) {
  bool ret = true;

  DECLARE_TEST_FUNCTIONS("function test($s1) {"
                         " return $s1;"
                         "}");

  RUN_TEST(test_get_defined_functions);
  RUN_TEST(test_function_exists);
  RUN_TEST(test_is_callable);
  RUN_TEST(test_call_user_func_array);
  RUN_TEST(test_call_user_func);
  RUN_TEST(test_forward_static_call_array);
  RUN_TEST(test_forward_static_call);
  RUN_TEST(test_create_function);
  RUN_TEST(test_func_get_arg);
  RUN_TEST(test_func_get_args);
  RUN_TEST(test_func_num_args);
  RUN_TEST(test_register_postsend_function);
  RUN_TEST(test_register_shutdown_function);
  RUN_TEST(test_register_cleanup_function);
  RUN_TEST(test_register_tick_function);
  RUN_TEST(test_unregister_tick_function);

  return ret;
}
Ejemplo n.º 9
0
bool TestExtCurl::RunTests(const std::string &which) {
  bool ret = true;

  DECLARE_TEST_FUNCTIONS("function curl_write_func($s1, $s2) {"
                         " print 'curl_write_func called with ';"
                         " print $s2;"
                         " return strlen($s2);"
                         "}");

  ServerPtr server = std::move(runServer());

  RUN_TEST(test_curl_init);
  RUN_TEST(test_curl_copy_handle);
  RUN_TEST(test_curl_version);
  RUN_TEST(test_curl_setopt);
  RUN_TEST(test_curl_setopt_array);
  RUN_TEST(test_curl_exec);
  RUN_TEST(test_curl_getinfo);
  RUN_TEST(test_curl_errno);
  RUN_TEST(test_curl_error);
  RUN_TEST(test_curl_close);
  RUN_TEST(test_curl_multi_init);
  RUN_TEST(test_curl_multi_add_handle);
  RUN_TEST(test_curl_multi_remove_handle);
  RUN_TEST(test_curl_multi_exec);
  RUN_TEST(test_curl_multi_select);
  RUN_TEST(test_curl_multi_getcontent);
  RUN_TEST(test_curl_multi_info_read);
  RUN_TEST(test_curl_multi_close);

  server->stop();

  return ret;
}
Ejemplo n.º 10
0
bool TestExtServer::RunTests(const std::string &which) {
    bool ret = true;

    DECLARE_TEST_FUNCTIONS("");

    std::string root = std::string(f_getcwd().toString().c_str()) + "/test/";

    RuntimeOption::SourceRoot = root;
    RuntimeOption::PageletServerThreadCount = 10;
    PageletServer::Restart();

    RuntimeOption::XboxServerThreadCount = 10;
    RuntimeOption::XboxServerInfoReqInitDoc = root + "test_xbox_init.php";
    XboxServer::Restart();

    RUN_TEST(test_dangling_server_proxy_old_request);
    RUN_TEST(test_dangling_server_proxy_new_request);
    RUN_TEST(test_pagelet_server_task_start);
    RUN_TEST(test_pagelet_server_task_status);
    RUN_TEST(test_pagelet_server_task_result);
    RUN_TEST(test_xbox_send_message);
    RUN_TEST(test_xbox_post_message);
    RUN_TEST(test_xbox_task_start);
    RUN_TEST(test_xbox_task_status);
    RUN_TEST(test_xbox_task_result);

    return ret;
}
Ejemplo n.º 11
0
bool TestExtPdo::RunTests(const std::string &which) {
  bool ret = true;

  DECLARE_TEST_FUNCTIONS("");

  RUN_TEST(test_pdo_drivers);
  RUN_TEST(test_pdo_mysql);
  RUN_TEST(test_pdo_sqlite);

  return ret;
}
Ejemplo n.º 12
0
bool TestExtImagesprite::RunTests(const std::string &which) {
  bool ret = true;

  DECLARE_TEST_FUNCTIONS("");

  RUN_TEST(test_ImageSprite);
  RUN_TEST(test_addFile);
  RUN_TEST(test_addString);
  RUN_TEST(test_addUrl);
  RUN_TEST(test_clear);
  RUN_TEST(test_loadDims);
  RUN_TEST(test_loadImages);
  RUN_TEST(test_map);

  sprite.reset();

  return ret;
}
Ejemplo n.º 13
0
bool TestExtSqlite3::RunTests(const std::string &which) {
  bool ret = true;

  DECLARE_TEST_FUNCTIONS("function lower($a) {"
                         " return strtolower($a);"
                         "}"
                         "function sumlen_step($a,$b,$c) {"
                         " return (int)$a + strlen($c);"
                         "}"
                         "function sumlen_fini($a) {"
                         " return (int)$a;"
                         "}");

  RUN_TEST(test_sqlite3);
  RUN_TEST(test_sqlite3stmt);
  RUN_TEST(test_sqlite3result);

  return ret;
}
Ejemplo n.º 14
0
bool TestExtVariable::RunTests(const std::string &which) {
  bool ret = true;

  DECLARE_TEST_FUNCTIONS("");

  RUN_TEST(test_is_bool);
  RUN_TEST(test_is_int);
  RUN_TEST(test_is_integer);
  RUN_TEST(test_is_long);
  RUN_TEST(test_is_double);
  RUN_TEST(test_is_float);
  RUN_TEST(test_is_numeric);
  RUN_TEST(test_is_real);
  RUN_TEST(test_is_string);
  RUN_TEST(test_is_scalar);
  RUN_TEST(test_is_array);
  RUN_TEST(test_is_object);
  RUN_TEST(test_is_resource);
  RUN_TEST(test_is_null);
  RUN_TEST(test_gettype);
  RUN_TEST(test_get_resource_type);
  RUN_TEST(test_intval);
  RUN_TEST(test_doubleval);
  RUN_TEST(test_floatval);
  RUN_TEST(test_strval);
  RUN_TEST(test_settype);
  RUN_TEST(test_print_r);
  RUN_TEST(test_var_export);
  RUN_TEST(test_var_dump);
  RUN_TEST(test_debug_zval_dump);
  RUN_TEST(test_serialize);
  RUN_TEST(test_unserialize);
  RUN_TEST(test_get_defined_vars);
  RUN_TEST(test_import_request_variables);
  RUN_TEST(test_extract);

  return ret;
}
Ejemplo n.º 15
0
bool TestExtClass::RunTests(const std::string &which) {
  bool ret = true;

  DECLARE_TEST_FUNCTIONS("class test implements itestable {"
                         "  public $foo;"
                         "  protected $prop;"
                         "  private $bar;"
                         "  public function foo() {}"
                         "  protected function func() {}"
                         "  function bar() {}"
                         "  const const_foo = 'f';"
                         "}"
                         "interface itestable {"
                         "  function foo();"
                         "  function bar();"
                         "}"
                        );

  RUN_TEST(test_get_declared_classes);
  RUN_TEST(test_get_declared_interfaces);
  RUN_TEST(test_class_exists);
  RUN_TEST(test_interface_exists);
  RUN_TEST(test_get_class_methods);
  RUN_TEST(test_get_class_vars);
  RUN_TEST(test_get_class_constants);
  RUN_TEST(test_get_class);
  RUN_TEST(test_get_parent_class);
  RUN_TEST(test_is_a);
  RUN_TEST(test_is_subclass_of);
  RUN_TEST(test_method_exists);
  RUN_TEST(test_property_exists);
  RUN_TEST(test_get_object_vars);
  RUN_TEST(test_call_user_method_array);
  RUN_TEST(test_call_user_method);

  return ret;
}
Ejemplo n.º 16
0
bool TestExtMysql::RunTests(const std::string &which) {
  // XXX: Disabled until flakiness is resolved: t1135133
  return true;

  bool ret = true;
  mysqlExtension::ReadOnly = false;

  DECLARE_TEST_FUNCTIONS("");

  RUN_TEST(test_mysql_connect);
  RUN_TEST(test_mysql_pconnect);
  RUN_TEST(test_mysql_set_charset);
  RUN_TEST(test_mysql_ping);
  RUN_TEST(test_mysql_escape_string);
  RUN_TEST(test_mysql_real_escape_string);
  RUN_TEST(test_mysql_client_encoding);
  RUN_TEST(test_mysql_close);
  RUN_TEST(test_mysql_errno);
  RUN_TEST(test_mysql_error);
  RUN_TEST(test_mysql_warning_count);
  RUN_TEST(test_mysql_get_client_info);
  RUN_TEST(test_mysql_get_host_info);
  RUN_TEST(test_mysql_get_proto_info);
  RUN_TEST(test_mysql_get_server_info);
  RUN_TEST(test_mysql_info);
  RUN_TEST(test_mysql_insert_id);
  RUN_TEST(test_mysql_stat);
  RUN_TEST(test_mysql_thread_id);
  RUN_TEST(test_mysql_create_db);
  RUN_TEST(test_mysql_select_db);
  RUN_TEST(test_mysql_drop_db);
  RUN_TEST(test_mysql_affected_rows);
  RUN_TEST(test_mysql_set_timeout);
#ifdef MYSQL_MILLISECOND_TIMEOUT
  RUN_TEST(test_mysql_subsecond_timeout);
#endif
  RUN_TEST(test_mysql_query);
  RUN_TEST(test_mysql_unbuffered_query);
  RUN_TEST(test_mysql_db_query);
  RUN_TEST(test_mysql_list_dbs);
  RUN_TEST(test_mysql_list_tables);
  RUN_TEST(test_mysql_list_fields);
  RUN_TEST(test_mysql_list_processes);
  RUN_TEST(test_mysql_db_name);
  RUN_TEST(test_mysql_tablename);
  RUN_TEST(test_mysql_num_fields);
  RUN_TEST(test_mysql_num_rows);
  RUN_TEST(test_mysql_free_result);
  RUN_TEST(test_mysql_data_seek);
  RUN_TEST(test_mysql_fetch_row);
  RUN_TEST(test_mysql_fetch_assoc);
  RUN_TEST(test_mysql_fetch_array);
  RUN_TEST(test_mysql_fetch_lengths);
  RUN_TEST(test_mysql_fetch_object);
  RUN_TEST(test_mysql_result);
  RUN_TEST(test_mysql_fetch_field);
  RUN_TEST(test_mysql_field_seek);
  RUN_TEST(test_mysql_field_name);
  RUN_TEST(test_mysql_field_table);
  RUN_TEST(test_mysql_field_len);
  RUN_TEST(test_mysql_field_type);
  RUN_TEST(test_mysql_field_flags);

  return ret;
}
Ejemplo n.º 17
0
bool TestExtFile::RunTests(const std::string &which) {
  bool ret = true;

  DECLARE_TEST_FUNCTIONS("");

  RUN_TEST(test_fopen);
  RUN_TEST(test_fpassthru);
  RUN_TEST(test_fputcsv);
  RUN_TEST(test_fputs);
  RUN_TEST(test_fread);
  RUN_TEST(test_fscanf);
  RUN_TEST(test_fseek);
  RUN_TEST(test_fstat);
  RUN_TEST(test_ftell);
  RUN_TEST(test_ftruncate);
  RUN_TEST(test_fwrite);
  RUN_TEST(test_read_write);
  RUN_TEST(test_fprintf);
  RUN_TEST(test_vfprintf);
  RUN_TEST(test_fclose);
  RUN_TEST(test_feof);
  RUN_TEST(test_fflush);
  RUN_TEST(test_fgetc);
  RUN_TEST(test_fgetcsv);
  RUN_TEST(test_fgets);
  RUN_TEST(test_fgetss);
  RUN_TEST(test_flock);
  RUN_TEST(test_rewind);
  RUN_TEST(test_popen);
  RUN_TEST(test_pclose);
  RUN_TEST(test_file_exists);
  RUN_TEST(test_file_get_contents);
  RUN_TEST(test_file_put_contents);
  RUN_TEST(test_file);
  RUN_TEST(test_readfile);
  RUN_TEST(test_move_uploaded_file);
  RUN_TEST(test_parse_ini_file);
  RUN_TEST(test_parse_ini_string);
  RUN_TEST(test_parse_hdf_file);
  RUN_TEST(test_parse_hdf_string);
  RUN_TEST(test_write_hdf_file);
  RUN_TEST(test_write_hdf_string);
  RUN_TEST(test_md5_file);
  RUN_TEST(test_sha1_file);
  RUN_TEST(test_chmod);
  RUN_TEST(test_chown);
  RUN_TEST(test_touch);
  RUN_TEST(test_copy);
  RUN_TEST(test_rename);
  RUN_TEST(test_umask);
  RUN_TEST(test_unlink);
  RUN_TEST(test_chgrp);
  RUN_TEST(test_link);
  RUN_TEST(test_symlink);
  RUN_TEST(test_lchgrp);
  RUN_TEST(test_lchown);
  RUN_TEST(test_basename);
  RUN_TEST(test_fnmatch);
  RUN_TEST(test_glob);
  RUN_TEST(test_tempnam);
  RUN_TEST(test_tmpfile);
  RUN_TEST(test_clearstatcache);
  RUN_TEST(test_stat);
  RUN_TEST(test_lstat);
  RUN_TEST(test_is_dir);
  RUN_TEST(test_is_executable);
  RUN_TEST(test_is_file);
  RUN_TEST(test_is_link);
  RUN_TEST(test_is_readable);
  RUN_TEST(test_is_uploaded_file);
  RUN_TEST(test_is_writable);
  RUN_TEST(test_is_writeable);
  RUN_TEST(test_fileatime);
  RUN_TEST(test_filectime);
  RUN_TEST(test_filegroup);
  RUN_TEST(test_fileinode);
  RUN_TEST(test_filemtime);
  RUN_TEST(test_fileowner);
  RUN_TEST(test_fileperms);
  RUN_TEST(test_filesize);
  RUN_TEST(test_filetype);
  RUN_TEST(test_readlink);
  RUN_TEST(test_realpath);
  RUN_TEST(test_linkinfo);
  RUN_TEST(test_disk_free_space);
  RUN_TEST(test_diskfreespace);
  RUN_TEST(test_disk_total_space);
  RUN_TEST(test_pathinfo);
  RUN_TEST(test_mkdir);
  RUN_TEST(test_rmdir);
  RUN_TEST(test_dirname);
  RUN_TEST(test_chdir);
  RUN_TEST(test_chroot);
  RUN_TEST(test_dir);
  RUN_TEST(test_getcwd);
  RUN_TEST(test_opendir);
  RUN_TEST(test_readdir);
  RUN_TEST(test_rewinddir);
  RUN_TEST(test_scandir);
  RUN_TEST(test_closedir);

  LightProcess::Initialize(RuntimeOption::LightProcessFilePrefix,
                           RuntimeOption::LightProcessCount,
                           std::vector<int>());
  RUN_TEST(test_popen);
  RUN_TEST(test_pclose);
  LightProcess::Close();

  return ret;
}