예제 #1
0
 /**
  * @covers ::delete
  * @dataProvider overrideDataProvider
  */
 public function testDelete($data, $module_data)
 {
     $this->cacheTagsInvalidator->expects($this->once())->method('invalidateTags')->with(['config:config.test']);
     // Set initial data.
     foreach ($data as $key => $value) {
         $this->config->set($key, $value);
     }
     // Set overrides.
     $this->config->setModuleOverride($module_data);
     // Save.
     $this->config->save();
     // Check that original data is still correct.
     $this->assertOriginalConfigDataEquals($data, FALSE);
     // Check overrides have been set.
     $this->assertConfigDataEquals($module_data);
     $this->assertOriginalConfigDataEquals($module_data, TRUE);
     // Check that config is new.
     $this->assertFalse($this->config->isNew());
     // Delete.
     $this->config->delete();
     // Check object properties have been reset.
     $this->assertTrue($this->config->isNew());
     foreach ($data as $key => $value) {
         $this->assertEmpty($this->config->getOriginal($key, FALSE));
     }
     // Check that overrides have persisted.
     foreach ($module_data as $key => $value) {
         $this->assertConfigDataEquals($module_data);
         $this->assertOriginalConfigDataEquals($module_data, TRUE);
     }
 }