显示下拉菜单

Test of class_alias() 本页面仅提供英文版本。

Example #1 : test success
Example #2 : test success
Example #3 : test success
Example #1
$input = [
  
=> 'action',
  
=> 'baz',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'bool' => true,
    
'original_class' => [
      
'properties' => [
        
=> 'dependant_objects',
        
=> 'config',
        
=> 'objects',
      ],
      
'methods' => [
        
=> 'process',
        
=> 'run',
        
=> '__construct',
        
=> '__get',
        
=> 'create_dependant_objects',
        
=> 'create_non_object',
        
=> 'create_object',
        
=> 'get_class_name',
        
=> 'get_object',
        
=> 'get_object_name',
        
10 => 'get_property',
        
11 => 'load_class',
        
12 => 'register_object',
        
13 => 'set_alias_object',
        
14 => 'unregister_object',
      ],
    ],
    
'alias_class' => [
      
'properties' => [
        
=> 'dependant_objects',
        
=> 'config',
        
=> 'objects',
      ],
      
'methods' => [
        
=> 'process',
        
=> 'run',
        
=> '__construct',
        
=> '__get',
        
=> 'create_dependant_objects',
        
=> 'create_non_object',
        
=> 'create_object',
        
=> 'get_class_name',
        
=> 'get_object',
        
=> 'get_object_name',
        
10 => 'get_property',
        
11 => 'load_class',
        
12 => 'register_object',
        
13 => 'set_alias_object',
        
14 => 'unregister_object',
      ],
    ],
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #2
$input = [
  
=> 'Exception',
  
=> 'baz',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'bool' => false,
  ],
  
'errors' => [
    
=> [
      
'code' => 2,
      
'message' => 'First argument of class_alias() must be a name of user defined class',
    ],
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]
Example #3
$input = [
  
=> 'xyz',
  
=> 'baz',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'bool' => false,
  ],
  
'errors' => [
    
=> [
      
'code' => 2,
      
'message' => 'Class \'xyz\' not found',
    ],
  ],
  
'php_version' => '7.1.33 Linux x86_64',
]