Пример #1
0
 function Test_get_this_object_methods()
 {
     if (AK_PHP5) {
         $expected_methods = array('AkTestingObjectInspectionChild', 'child_function', 'child_method');
     } else {
         $expected_methods = array('aktestingobjectinspectionchild', 'child_function', 'child_method');
     }
     $resulting_methods = Ak::get_this_object_methods($this->AkTestingObjectInspectionChildInstance);
     $this->assertEqual($expected_methods, $resulting_methods);
 }
Пример #2
0
 /**
  * Gets information about given object
  *
  * @access public
  * @static
  * @uses Ak::get_this_object_methods
  * @uses Ak::get_this_object_attributes
  * @param    object    &$object    Object to get info from
  * @param    boolean    $include_inherited_info    By setting this to true, parent Object properties
  * and methods will be included.
  * @return string html output with Object info
  */
 function get_object_info($object, $include_inherited_info = false)
 {
     $object_name = get_class($object);
     $methods = $include_inherited_info ? get_class_methods($object) : Ak::get_this_object_methods($object);
     $vars = $include_inherited_info ? get_class_vars($object_name) : Ak::get_this_object_attributes($object);
     $var_desc = '';
     if (is_array($vars)) {
         $var_desc = '<ul>';
         foreach ($vars as $varname => $var_value) {
             $var_desc .= "<li>{$varname} = {$var_value} (" . gettype($var_value) . ")</li>\n";
         }
         $var_desc .= "</ul>";
     }
     return Ak::t('Object <b>%object_name</b> information:<hr> <b>object Vars:</b><br>%var_desc <hr> <b>object Methods:</b><br><ul><li>%methods</li></ul>', array('%object_name' => $object_name, '%var_desc' => $var_desc, '%methods' => join("();</li>\n<li>", $methods) . '();'));
 }
Пример #3
0
 public function Test_get_this_object_methods()
 {
     $expected_methods = array('AkTestingObjectInspectionChild', 'child_function', 'child_method');
     $resulting_methods = Ak::get_this_object_methods($this->AkTestingObjectInspectionChildInstance);
     $this->assertEqual($expected_methods, $resulting_methods);
 }