|
| 1 | +<?php |
| 2 | +declare(strict_types=1); |
| 3 | + |
| 4 | +namespace Soap\Encoding\Test\PhpCompatibility\Implied; |
| 5 | + |
| 6 | +use PHPUnit\Framework\Attributes\CoversClass; |
| 7 | +use Soap\Encoding\Decoder; |
| 8 | +use Soap\Encoding\Driver; |
| 9 | +use Soap\Encoding\Encoder; |
| 10 | +use Soap\Encoding\Test\PhpCompatibility\AbstractCompatibilityTests; |
| 11 | + |
| 12 | +#[CoversClass(Driver::class)] |
| 13 | +#[CoversClass(Encoder::class)] |
| 14 | +#[CoversClass(Decoder::class)] |
| 15 | +final class ImpliedSchema002Test extends AbstractCompatibilityTests |
| 16 | +{ |
| 17 | + protected string $schema = <<<EOXML |
| 18 | + <element name="testType"> |
| 19 | + <complexType> |
| 20 | + <sequence> |
| 21 | + <element name="customerId" type="xsd:string" /> |
| 22 | + <element name="countryCode" type="xsd:string" nillable="true" /> |
| 23 | + </sequence> |
| 24 | + </complexType> |
| 25 | + </element> |
| 26 | + EOXML; |
| 27 | + protected string $type = 'type="tns:testType"'; |
| 28 | + |
| 29 | + protected function calculateParam(): mixed |
| 30 | + { |
| 31 | + return (object)[ |
| 32 | + 'customerId' => '123', |
| 33 | + 'countryCode' => 'BE', |
| 34 | + ]; |
| 35 | + } |
| 36 | + |
| 37 | + protected function expectXml(): string |
| 38 | + { |
| 39 | + return <<<XML |
| 40 | + <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="http://test-uri/" |
| 41 | + xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 42 | + xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"> |
| 43 | + <SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> |
| 44 | + <tns:test> |
| 45 | + <testParam xsi:type="tns:testType"> |
| 46 | + <customerId xsi:type="xsd:string">123</customerId> |
| 47 | + <countryCode xsi:type="xsd:string">BE</countryCode> |
| 48 | + </testParam> |
| 49 | + </tns:test> |
| 50 | + </SOAP-ENV:Body> |
| 51 | + </SOAP-ENV:Envelope> |
| 52 | + XML; |
| 53 | + } |
| 54 | +} |
0 commit comments