3 namespace Drupal\Tests\aggregator\Functional\Update;
5 use Drupal\FunctionalTests\Update\UpdatePathTestBase;
8 * Tests that node settings are properly updated during database updates.
12 class AggregatorUpdateTest extends UpdatePathTestBase {
17 protected function setDatabaseDumpFiles() {
18 $this->databaseDumpFiles = [
19 __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.filled.standard.php.gz',
24 * Tests that the 'Source feed' field is required.
26 * @see aggregator_update_8200()
28 public function testSourceFeedRequired() {
29 // Check that the 'fid' field is not required prior to the update.
30 $field_definition = \Drupal::entityDefinitionUpdateManager()->getFieldStorageDefinition('fid', 'aggregator_item');
31 $this->assertFalse($field_definition->isRequired());
36 // Check that the 'fid' field is now required.
37 $field_definition = \Drupal::entityDefinitionUpdateManager()->getFieldStorageDefinition('fid', 'aggregator_item');
38 $this->assertTrue($field_definition->isRequired());
42 * Tests that the 'Update interval' field has a default value.
44 public function testUpdateIntervalDefaultValue() {
45 // Check that the 'refresh' field does not have a default value prior to the
47 $field_definition = \Drupal::entityDefinitionUpdateManager()->getFieldStorageDefinition('refresh', 'aggregator_feed');
48 $this->assertSame([], $field_definition->getDefaultValueLiteral());
53 // Check that the 'refresh' has a default value now.
54 $field_definition = \Drupal::entityDefinitionUpdateManager()->getFieldStorageDefinition('refresh', 'aggregator_feed');
55 $this->assertSame([['value' => 3600]], $field_definition->getDefaultValueLiteral());