protected function getConfigData() { $uuid = new Php(); // Mock data using minimal data to use ConfigDependencyManger. $this->configData = array('system.site' => array('title' => 'Drupal', 'uuid' => $uuid->generate()), 'field.instance.node.article.body' => array('id' => 'node.article.body', 'uuid' => $uuid->generate(), 'dependencies' => array('entity' => array('field.storage.node.body'))), 'field.storage.node.body' => array('id' => 'node.body', 'uuid' => $uuid->generate(), 'dependencies' => array('module' => array('text'))), 'views.view.test_view' => array('id' => 'test_view', 'uuid' => $uuid->generate(), 'dependencies' => array('module' => array('node'))), 'system.performance' => array('stale_file_threshold' => 2592000)); return $this->configData; }
/** * Tests configuration renaming validation for simple configuration. */ public function testRenameSimpleConfigValidation() { $uuid = new Php(); // Create a simple configuration with a UUID. $config = $this->config('config_test.new'); $uuid_value = $uuid->generate(); $config->set('uuid', $uuid_value)->save(); $active = $this->container->get('config.storage'); $sync = $this->container->get('config.storage.sync'); $this->copyConfig($active, $sync); $config->delete(); // Create another simple configuration with the same UUID. $config = $this->config('config_test.old'); $config->set('uuid', $uuid_value)->save(); // Confirm that the staged configuration is detected as a rename since the // UUIDs match. $this->configImporter->reset(); $expected = array('config_test.old::config_test.new'); $renames = $this->configImporter->getUnprocessedConfiguration('rename'); $this->assertIdentical($expected, $renames); // Try to import the configuration. We expect an exception to be thrown // because the rename is for simple configuration. try { $this->configImporter->import(); $this->fail('Expected ConfigImporterException thrown when simple configuration is renamed.'); } catch (ConfigImporterException $e) { $this->pass('Expected ConfigImporterException thrown when simple configuration is renamed.'); $expected = array(SafeMarkup::format('Rename operation for simple configuration. Existing configuration @old_name and staged configuration @new_name.', array('@old_name' => 'config_test.old', '@new_name' => 'config_test.new'))); $this->assertEqual($expected, $this->configImporter->getErrors()); } }
/** * Returns a random URI ID for the collection. * * @return string * A string URI */ public function getRandomUri() { $php = new Php(); return 'http://example.com/' . $php->generate(); }
/** * Generate the id of the entity. * * @return string * The new id for the entity. */ protected function generateId() { $uuid = new Php(); // @todo Fetch a bundle specific template. return 'http://placeHolder/' . $uuid->generate(); }