public function testMetadataConversion() { $tabOpenable = $this->doublesManager->createTabOpenable('/url/des/tabs', 'label des Tabs'); $request = $this->doublesManager->createHTTPRequest('POST', '/entities/persons'); $response = new ServiceResponse(Service::OK, (object) array('ok' => 'true'), 'json'); $response->setMetadata(MetadataGenerator::create()->openTab($tabOpenable)); $httpResponse = $this->converter->fromService($response, $request); $this->assertInstanceof('Psc\\Net\\HTTP\\Response', $httpResponse); $this->assertTrue($httpResponse->hasHeaderField('X-Psc-Cms-Meta')); }
public function testEntityResponseMetaAddsRevisionInItemMeta() { $meta = MetadataGenerator::create()->revision($revision = 'some-saved-revision-17')->toArray(); $this->assertEquals($revision, @$meta['revision'], 'revision has to be defined in meta' . "\n" . print_r($meta, true)); }