Пример #1
0
 /**
  * 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);
 }
Пример #2
0
 /**
  * @test
  */
 public function createFromJsonTest()
 {
     $configurationObject = $this->fixture->createFromJsonForPath($this->getTestConfigurationJSONString(), 'ResourceName');
     $this->validateConfiguration($configurationObject);
 }
Пример #3
0
 public function setUp()
 {
     parent::setUp();
     $testConfiguration = $this->getTestConfigurationData();
     $this->fixture = new \Cundd\Rest\VirtualObject\Configuration(\Cundd\Rest\VirtualObject\ConfigurationFactory::preparePropertyMapping($testConfiguration['ResourceName']['mapping']));
 }
Пример #4
0
 /**
  * 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']));
 }