Пример #1
0
 /**
  * Test output WSDL when registering a web service function with no output parameters.
  */
 public function test_register_without_output()
 {
     $this->resetAfterTest();
     $serviceclass = 'testserviceclass';
     $namespace = 'testnamespace';
     $wsdl = new wsdl($serviceclass, $namespace);
     $functionname = 'testfunction';
     $documentation = 'This is a test function';
     $in = array('return' => array('type' => 'teststruct2'));
     $wsdl->register($functionname, $in, null, $documentation);
     $definitions = new \SimpleXMLElement($wsdl->to_xml());
     // Test portType operation node.
     $porttypeoperation = $definitions->portType->operation;
     $this->assertEquals($documentation, $porttypeoperation->documentation);
     $this->assertTrue(isset($porttypeoperation->input));
     $this->assertFalse(isset($porttypeoperation->output));
     // Test binding operation nodes.
     $bindingoperation = $definitions->binding->operation;
     // Confirm that there is no input node.
     $this->assertTrue(isset($bindingoperation->input));
     $this->assertFalse(isset($bindingoperation->output));
     // Test messages.
     // Assert there's only the output message node.
     $this->assertEquals(1, count($definitions->message));
     $messagein = $definitions->message[0];
     $this->assertEquals($functionname . wsdl::IN, $messagein->attributes()->name);
 }