comparison core/modules/config/tests/src/Functional/ConfigDependencyWebTest.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
56 ], 56 ],
57 ] 57 ]
58 ); 58 );
59 $entity2->save(); 59 $entity2->save();
60 60
61 $this->drupalGet($entity2->urlInfo('delete-form')); 61 $this->drupalGet($entity2->toUrl('delete-form'));
62 $this->assertNoText(t('Configuration updates'), 'No configuration updates found.'); 62 $this->assertNoText(t('Configuration updates'), 'No configuration updates found.');
63 $this->assertNoText(t('Configuration deletions'), 'No configuration deletes found.'); 63 $this->assertNoText(t('Configuration deletions'), 'No configuration deletes found.');
64 $this->drupalGet($entity1->urlInfo('delete-form')); 64 $this->drupalGet($entity1->toUrl('delete-form'));
65 $this->assertNoText(t('Configuration updates'), 'No configuration updates found.'); 65 $this->assertNoText(t('Configuration updates'), 'No configuration updates found.');
66 $this->assertText(t('Configuration deletions'), 'Configuration deletions found.'); 66 $this->assertText(t('Configuration deletions'), 'Configuration deletions found.');
67 $this->assertText($entity2->id(), 'Entity2 id found'); 67 $this->assertText($entity2->id(), 'Entity2 id found');
68 $this->drupalPostForm($entity1->urlInfo('delete-form'), [], 'Delete'); 68 $this->drupalPostForm($entity1->toUrl('delete-form'), [], 'Delete');
69 $storage->resetCache(); 69 $storage->resetCache();
70 $this->assertFalse($storage->loadMultiple([$entity1->id(), $entity2->id()]), 'Test entities deleted'); 70 $this->assertFalse($storage->loadMultiple([$entity1->id(), $entity2->id()]), 'Test entities deleted');
71 71
72 // Set a more complicated test where dependencies will be fixed. 72 // Set a more complicated test where dependencies will be fixed.
73 // Entity1 will be deleted by the test. 73 // Entity1 will be deleted by the test.
107 ], 107 ],
108 ] 108 ]
109 ); 109 );
110 $entity3->save(); 110 $entity3->save();
111 111
112 $this->drupalGet($entity1->urlInfo('delete-form')); 112 $this->drupalGet($entity1->toUrl('delete-form'));
113 $this->assertText(t('Configuration updates'), 'Configuration updates found.'); 113 $this->assertText(t('Configuration updates'), 'Configuration updates found.');
114 $this->assertNoText(t('Configuration deletions'), 'No configuration deletions found.'); 114 $this->assertNoText(t('Configuration deletions'), 'No configuration deletions found.');
115 $this->assertNoText($entity2->id(), 'Entity2 id not found'); 115 $this->assertNoText($entity2->id(), 'Entity2 id not found');
116 $this->assertText($entity2->label(), 'Entity2 label not found'); 116 $this->assertText($entity2->label(), 'Entity2 label not found');
117 $this->assertNoText($entity3->id(), 'Entity3 id not found'); 117 $this->assertNoText($entity3->id(), 'Entity3 id not found');
118 $this->drupalPostForm($entity1->urlInfo('delete-form'), [], 'Delete'); 118 $this->drupalPostForm($entity1->toUrl('delete-form'), [], 'Delete');
119 $storage->resetCache(); 119 $storage->resetCache();
120 $this->assertFalse($storage->load('entity1'), 'Test entity 1 deleted'); 120 $this->assertFalse($storage->load('entity1'), 'Test entity 1 deleted');
121 $entity2 = $storage->load('entity2'); 121 $entity2 = $storage->load('entity2');
122 $this->assertTrue($entity2, 'Entity 2 not deleted'); 122 $this->assertTrue($entity2, 'Entity 2 not deleted');
123 $this->assertEqual($entity2->calculateDependencies()->getDependencies()['config'], [], 'Entity 2 dependencies updated to remove dependency on Entity1.'); 123 $this->assertEqual($entity2->calculateDependencies()->getDependencies()['config'], [], 'Entity 2 dependencies updated to remove dependency on Entity1.');