Back to index

php5  5.3.10
Public Member Functions | Public Attributes
SOAP_Test Class Reference

List of all members.

Public Member Functions

 SOAP_Test ($methodname, $params, $expect=NULL, $cmp_func=NULL)
 setResult ($ok, $result, $wire, $error= '', $fault=NULL)
 showTestResult ($debug=0, $html=0)
 showMethodResult print simple output about a methods result

Public Attributes

 $type = 'php'
 $test_name = NULL
 $method_name = NULL
 $method_params = NULL
 $cmp_func = NULL
 $expect = NULL
 $expect_fault = FALSE
 $headers = NULL
 $headers_expect = NULL
 $result = array()
 $show = 1
 $debug = 0
 $encoding = 'UTF-8'

Detailed Description

Definition at line 24 of file client_round2_params.php.


Member Function Documentation

SOAP_Test::setResult ( ok,
result,
wire,
error = '',
fault = NULL 
)

Definition at line 67 of file client_round2_params.php.

    {
        $this->result['success'] = $ok;
        $this->result['result'] = $result;
        $this->result['error'] = $error;
        $this->result['wire'] = $wire;
        $this->result['fault'] = $fault;
    }
SOAP_Test::showTestResult ( debug = 0,
html = 0 
)

showMethodResult print simple output about a methods result

Parameters:
arrayendpoint_info
stringmethod public

Definition at line 84 of file client_round2_params.php.

                                                   {
        // debug output
        if ($debug) $this->show = 1;
        if ($debug) {
            echo str_repeat("-",50).$html?"<br>\n":"\n";
        }

        echo "testing $this->test_name : ";

        if ($debug) {
            print "method params: ";
            print_r($this->params);
            print "\n";
        }

        $ok = $this->result['success'];
        if ($ok) {
            if ($html) {
                print "<font color=\"#00cc00\">SUCCESS</font>\n";
            } else {
                print "SUCCESS\n";
            }
        } else {
            $fault = $this->result['fault'];
            if ($fault) {
                     $res = $fault->faultcode;
                $pos = strpos($res,':');
                if ($pos !== false) {
                     $res = substr($res,$pos+1);                      
                }
                if ($html) {
                    print "<font color=\"#ff0000\">FAILED: [$res] {$fault->faultstring}</font>\n";
                } else {
                    print "FAILED: [$res] {$fault->faultstring}\n";
                }
            } else {
                if ($html) {
                    print "<font color=\"#ff0000\">FAILED: ".$this->result['result']."</font>\n";
                } else {
                    print "FAILED: ".$this->result['result']."\n";
                }
            }
        }
        if ($debug) {
            if ($html) {
                echo "<pre>\n".htmlentities($this->result['wire'])."</pre>\n";
            } else {
                echo "\n".htmlentities($this->result['wire'])."\n";
            }
        }
    }
SOAP_Test::SOAP_Test ( methodname,
params,
expect = NULL,
cmp_func = NULL 
)

Definition at line 39 of file client_round2_params.php.

                                                                               {
        # XXX we have to do this to make php-soap happy with NULL params
        if (!$params) $params = array();

        if (strchr($methodname,'(')) {
            preg_match('/(.*)\((.*)\)/',$methodname,$matches);
            $this->test_name = $methodname;
            $this->method_name = $matches[1];
        } else {
            $this->test_name = $this->method_name = $methodname;
        }
        $this->method_params = $params;
        if ($expect !== NULL) {
          $this->expect = $expect;
        }
        if ($cmp_func !== NULL) {
          $this->cmp_func = $cmp_func;
        }

        // determine test type
        if ($params) {
        $v = array_values($params);
        if (gettype($v[0]) == 'object' &&
            (get_class($v[0]) == 'SoapVar' || get_class($v[0]) == 'SoapParam'))
            $this->type = 'soapval';
        }
    }

Here is the call graph for this function:


Member Data Documentation

Definition at line 29 of file client_round2_params.php.

Definition at line 36 of file client_round2_params.php.

Definition at line 37 of file client_round2_params.php.

Definition at line 30 of file client_round2_params.php.

Definition at line 31 of file client_round2_params.php.

Definition at line 32 of file client_round2_params.php.

Definition at line 33 of file client_round2_params.php.

Definition at line 27 of file client_round2_params.php.

Definition at line 28 of file client_round2_params.php.

SOAP_Test::$result = array()

Definition at line 34 of file client_round2_params.php.

Definition at line 35 of file client_round2_params.php.

Definition at line 26 of file client_round2_params.php.

Definition at line 25 of file client_round2_params.php.


The documentation for this class was generated from the following file: