/** * Returns the Configuration for the given path * * @param string $path * @throws \Cundd\Rest\VirtualObject\Exception\MissingConfigurationException * @return ConfigurationInterface */ public function getConfigurationForPath($path) { $path = substr($path, strpos($path, '-') + 1); // Strip the "VirtualObject-" from the path if (!$path) { throw new MissingConfigurationException('Could not get configuration for empty path', 1395932408); } return $this->configurationFactory->createFromTypoScriptForPath($path); }
/** * @test */ public function createFromJsonTest() { $configurationObject = $this->fixture->createFromJsonForPath($this->getTestConfigurationJSONString(), 'ResourceName'); $this->validateConfiguration($configurationObject); }
public function setUp() { parent::setUp(); $testConfiguration = $this->getTestConfigurationData(); $this->fixture = new \Cundd\Rest\VirtualObject\Configuration(\Cundd\Rest\VirtualObject\ConfigurationFactory::preparePropertyMapping($testConfiguration['ResourceName']['mapping'])); }
/** * Returns the test configuration object * @return Configuration */ protected function getTestConfiguration() { $testConfiguration = $this->getTestConfigurationData(); return new \Cundd\Rest\VirtualObject\Configuration(\Cundd\Rest\VirtualObject\ConfigurationFactory::preparePropertyMapping($testConfiguration['ResourceName']['mapping'])); }