public function testDecodeUsesCorrectConverter() { $supportedMediaTypes = array('application/json' => 'BedRest\\TestFixtures\\Mocks\\Content\\Converter\\Dummy'); $this->negotiator->setSupportedMediaTypes($supportedMediaTypes); $result = $this->negotiator->decode('raw_data', 'application/json'); $this->assertEquals('decoded_data', $result); }
/** * Create service * * @param ServiceLocatorInterface $serviceLocator * @return mixed */ public function createService(ServiceLocatorInterface $serviceLocator) { $options = $serviceLocator->get('Config'); $options = $options['bedrest']; $negotiator = new Negotiator(); $negotiator->setSupportedMediaTypes($options['supported_content_types']); return $negotiator; }