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