|
@@ 138-157 (lines=20) @@
|
| 135 |
|
$this->checkEdmxSerialiseDeserialiseRoundTrip($ds, $edmx, $msg); |
| 136 |
|
} |
| 137 |
|
|
| 138 |
|
public function testKnownGoodV3DocumentDeserialiseToOk() |
| 139 |
|
{ |
| 140 |
|
$this->markTestSkipped('Skipped until service-document models get implemented'); |
| 141 |
|
$ds = DIRECTORY_SEPARATOR; |
| 142 |
|
$msg = null; |
| 143 |
|
|
| 144 |
|
$docLocation = dirname(__DIR__) . $ds . "tests" . $ds . "exampleV3ServiceDocument.xml"; |
| 145 |
|
$document = file_get_contents($docLocation); |
| 146 |
|
$type = 'AlgoWeb\ODataMetadata\MetadataV3\edmx\TDataServicesType'; |
| 147 |
|
$ymlDir = dirname(__DIR__) . $ds . "src" . $ds . "MetadataV3" . $ds . "JMSmetadata"; |
| 148 |
|
|
| 149 |
|
$serializer = |
| 150 |
|
\JMS\Serializer\SerializerBuilder::create() |
| 151 |
|
->addMetadataDir($ymlDir) |
| 152 |
|
->build(); |
| 153 |
|
|
| 154 |
|
$d = $serializer->deserialize($document, $type, 'xml'); |
| 155 |
|
$this->assertTrue($d instanceof TDataServicesType, get_class($this)); |
| 156 |
|
$this->assertTrue($d->isOK($msg), $msg); |
| 157 |
|
} |
| 158 |
|
|
| 159 |
|
public function testKnownGoodV3MetadataDeserialiseToOk() |
| 160 |
|
{ |
|
@@ 159-177 (lines=19) @@
|
| 156 |
|
$this->assertTrue($d->isOK($msg), $msg); |
| 157 |
|
} |
| 158 |
|
|
| 159 |
|
public function testKnownGoodV3MetadataDeserialiseToOk() |
| 160 |
|
{ |
| 161 |
|
$ds = DIRECTORY_SEPARATOR; |
| 162 |
|
$msg = null; |
| 163 |
|
|
| 164 |
|
$docLocation = dirname(__DIR__) . $ds . "tests" . $ds . "exampleV3ServiceMetadata.xml"; |
| 165 |
|
$document = file_get_contents($docLocation); |
| 166 |
|
$type = 'AlgoWeb\ODataMetadata\MetadataV3\edmx\Edmx'; |
| 167 |
|
$ymlDir = dirname(__DIR__) . $ds . "src" . $ds . "MetadataV3" . $ds . "JMSmetadata"; |
| 168 |
|
|
| 169 |
|
$serializer = |
| 170 |
|
\JMS\Serializer\SerializerBuilder::create() |
| 171 |
|
->addMetadataDir($ymlDir) |
| 172 |
|
->build(); |
| 173 |
|
|
| 174 |
|
$d = $serializer->deserialize($document, $type, 'xml'); |
| 175 |
|
$this->assertTrue($d instanceof TEdmxType, get_class($d)); |
| 176 |
|
$this->assertTrue($d->isOK($msg), $msg); |
| 177 |
|
} |
| 178 |
|
|
| 179 |
|
public function testKnownGoodV3MetadataDeserialiseToOkSerializeDeserializeRoundTrip() |
| 180 |
|
{ |