Example #1
0
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     // Create a field of type float.
     FieldStorageConfig::create(['field_name' => 'float', 'entity_type' => 'node', 'type' => 'float'])->save();
     // Create an instance of the float field on the "page" content type.
     FieldConfig::create(['field_name' => 'float', 'entity_type' => 'node', 'bundle' => 'page', 'label' => 'Float Field Label'])->save();
     // Log in, so we can test all the things.
     $this->drupalLogin($this->adminUser);
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     $this->drupalLogin($this->adminUser);
     // Index the content.
     \Drupal::service('plugin.manager.search')->createInstance('node_search')->updateIndex();
     search_update_totals();
     // Make absolutely sure the ::$blocks variable doesn't pass information
     // along between tests.
     $this->blocks = [];
 }