Loading modules/features_ui/tests/src/Functional/FeaturesBundleUiTest.php +26 −25 Original line number Diff line number Diff line Loading @@ -91,14 +91,14 @@ class FeaturesBundleUiTest extends BrowserTestBase { // Check initial form. $this->drupalGet('admin/config/development/features/bundle/_exclude/default'); $this->assertFieldChecked('edit-types-config-features-bundle', 'features_bundle is checked'); $this->assertNoFieldChecked('edit-types-config-system-simple', 'system_simple is not checked'); $this->assertNoFieldChecked('edit-types-config-user-role', 'user_role is not checked'); $this->assertFieldChecked('edit-curated', 'curated is checked'); $this->assertFieldChecked('edit-module-namespace', 'namespace is checked'); $this->assertSession()->checkboxChecked('edit-types-config-features-bundle'); $this->assertSession()->checkboxNotChecked('edit-types-config-system-simple'); $this->assertSession()->checkboxNotChecked('edit-types-config-user-role'); $this->assertSession()->checkboxChecked('edit-curated'); $this->assertSession()->checkboxChecked('edit-module-namespace'); // Configure the form. $this->drupalPostForm(NULL, [ $this->submitForm([ 'types[config][system_simple]' => TRUE, 'types[config][user_role]' => FALSE, 'curated' => TRUE, Loading @@ -107,11 +107,11 @@ class FeaturesBundleUiTest extends BrowserTestBase { // Check form results. $this->drupalGet('admin/config/development/features/bundle/_exclude/default'); $this->assertFieldChecked('edit-types-config-features-bundle', 'Saved, features_bundle is checked'); $this->assertFieldChecked('edit-types-config-system-simple', 'Saved, system_simple is checked'); $this->assertNoFieldChecked('edit-types-config-user-role', 'Saved, user_role is not checked'); $this->assertFieldChecked('edit-curated', 'Saved, curated is checked'); $this->assertNoFieldChecked('edit-module-namespace', 'Saved, namespace is not checked'); $this->assertSession()->checkboxChecked('edit-types-config-features-bundle'); $this->assertSession()->checkboxChecked('edit-types-config-system-simple'); $this->assertSession()->checkboxNotChecked('edit-types-config-user-role'); $this->assertSession()->checkboxChecked('edit-curated'); $this->assertSession()->checkboxNotChecked('edit-module-namespace'); // Check final values. $settings = $this->defaultBundle()->getAssignmentSettings('exclude'); Loading Loading @@ -143,19 +143,19 @@ class FeaturesBundleUiTest extends BrowserTestBase { // Can we visit the config page with no settings? $this->drupalGet('admin/config/development/features/bundle/_exclude/default'); $this->assertNoFieldChecked('edit-types-config-features-bundle', 'features_bundle is not checked'); $this->assertNoFieldChecked('edit-types-config-system-simple', 'system_simple is not checked'); $this->assertNoFieldChecked('edit-types-config-user-role', 'user_role is not checked'); $this->assertNoFieldChecked('edit-curated', 'curated is not checked'); $this->assertNoFieldChecked('edit-module-namespace', 'namespace is not checked'); $this->assertSession()->checkboxNotChecked('edit-types-config-features-bundle'); $this->assertSession()->checkboxNotChecked('edit-types-config-system-simple'); $this->assertSession()->checkboxNotChecked('edit-types-config-user-role'); $this->assertSession()->checkboxNotChecked('edit-curated'); $this->assertSession()->checkboxNotChecked('edit-module-namespace'); // Can we enable the method? $this->drupalGet('admin/config/development/features/bundle'); $this->assertNoFieldChecked('edit-enabled-exclude', 'Exclude disabled'); $this->drupalPostForm(NULL, [ $this->assertSession()->checkboxNotChecked('edit-enabled-exclude'); $this->submitForm([ 'enabled[exclude]' => TRUE, ], 'Save settings'); $this->assertFieldChecked('edit-enabled-exclude', 'Exclude enabled'); $this->assertSession()->checkboxChecked('edit-enabled-exclude'); // Check new settings. $settings = $this->defaultBundle()->getAssignmentSettings('exclude'); Loading @@ -168,9 +168,10 @@ class FeaturesBundleUiTest extends BrowserTestBase { // Can we run assignment with no settings? $this->drupalGet('admin/config/development/features'); $this->drupalGet('admin/config/development/features/bundle/_exclude/default'); // Can we configure the method? $this->drupalPostForm('admin/config/development/features/bundle/_exclude/default', [ $this->submitForm([ 'types[config][system_simple]' => TRUE, 'types[config][user_role]' => FALSE, 'curated' => TRUE, Loading @@ -179,11 +180,11 @@ class FeaturesBundleUiTest extends BrowserTestBase { // Check form results. $this->drupalGet('admin/config/development/features/bundle/_exclude/default'); $this->assertNoFieldChecked('edit-types-config-features-bundle', 'Saved, features_bundle is not checked'); $this->assertFieldChecked('edit-types-config-system-simple', 'Saved, system_simple is checked'); $this->assertNoFieldChecked('edit-types-config-user-role', 'Saved, user_role is not checked'); $this->assertFieldChecked('edit-curated', 'Saved, curated is checked'); $this->assertNoFieldChecked('edit-module-namespace', 'Saved, namespace is not checked'); $this->assertSession()->checkboxNotChecked('edit-types-config-features-bundle'); $this->assertSession()->checkboxChecked('edit-types-config-system-simple'); $this->assertSession()->checkboxNotChecked('edit-types-config-user-role'); $this->assertSession()->checkboxChecked('edit-curated'); $this->assertSession()->checkboxNotChecked('edit-module-namespace'); // Check final values. $settings = $this->defaultBundle()->getAssignmentSettings('exclude'); Loading modules/features_ui/tests/src/Functional/FeaturesCreateUiTest.php +16 −13 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ class FeaturesCreateUiTest extends BrowserTestBase { $this->drupalPlaceBlock('local_actions_block'); $this->drupalGet('admin/config/development/features'); $this->clickLink('Create new feature'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $edit = [ 'name' => 'Test feature', Loading @@ -55,10 +55,10 @@ class FeaturesCreateUiTest extends BrowserTestBase { 'system_simple[sources][selected][system.theme]' => TRUE, 'system_simple[sources][selected][user.settings]' => TRUE, ]; $this->drupalPostForm(NULL, $edit, 'Download Archive'); $this->submitForm($edit, 'Download Archive'); $this->assertResponse(200); $archive = $this->getRawContent(); $this->assertSession()->statusCodeEquals(200); $archive = $this->getSession()->getPage()->getContent(); $filename = tempnam($this->tempFilesDirectory, 'feature'); file_put_contents($filename, $archive); Loading Loading @@ -89,12 +89,12 @@ class FeaturesCreateUiTest extends BrowserTestBase { // Ensure that the features listing renders the right content. $this->drupalGet('admin/config/development/features'); $tds = $this->xpath('//table[contains(@class, "features-listing")]/tbody/tr[td[3] = "' . $feature_name . '"]/td'); $this->assertLink('Test feature'); $this->assertSession()->linkExists('Test feature'); $this->assertEquals($feature_name, $tds[2]->getText()); $description_column = $tds[3]->getText(); $this->assertTrue(strpos($description_column, 'system.theme') !== FALSE); $this->assertTrue(strpos($description_column, 'user.settings') !== FALSE); $this->assertRaw('Test description: <strong>giraffe</strong>'); $this->assertSession()->responseContains('Test description: <strong>giraffe</strong>'); $this->assertEquals('Uninstalled', $tds[5]->getText()); $this->assertEquals('', $tds[6]->getText()); Loading @@ -104,7 +104,7 @@ class FeaturesCreateUiTest extends BrowserTestBase { 'system_simple[included][system.theme]' => FALSE, 'user_role[sources][selected][authenticated]' => TRUE, ]; $this->drupalPostForm(NULL, $edit, 'Write'); $this->submitForm($edit, 'Write'); $info_filename = $module_path . '/' . $feature_name . '.info.yml'; $parsed_info = Yaml::decode(file_get_contents($info_filename)); Loading @@ -124,7 +124,8 @@ class FeaturesCreateUiTest extends BrowserTestBase { // Install new feature module. $edit = []; $edit['modules[' . $feature_name . '][enable]'] = TRUE; $this->drupalPostForm('admin/modules', $edit, 'Install'); $this->drupalGet('admin/modules'); $this->submitForm($edit, 'Install'); // Check that the feature is listed as installed. $this->drupalGet('admin/config/development/features'); Loading @@ -143,9 +144,10 @@ class FeaturesCreateUiTest extends BrowserTestBase { $tds = $this->xpath('//table[contains(@class, "features-listing")]/tbody/tr[td[3] = "' . $feature_name . '"]/td'); $this->assertTrue(strpos($tds[6]->getText(), 'Changed') !== FALSE); $this->drupalGet('admin/modules/uninstall'); // Uninstall the module. $this->drupalPostForm('admin/modules/uninstall', ['uninstall[' . $feature_name . ']' => $feature_name], 'Uninstall'); $this->submitForm(['uninstall[' . $feature_name . ']' => $feature_name], 'Uninstall'); $this->submitForm([], 'Uninstall'); $this->drupalGet('admin/config/development/features'); Loading @@ -155,12 +157,13 @@ class FeaturesCreateUiTest extends BrowserTestBase { $this->clickLink('Changed'); $this->drupalGet('admin/config/development/features/diff/' . $feature_name); $this->assertRaw('<td class="diff-context diff-deletedline">anonymous : <span class="diffchange">Giraffe</span></td>'); $this->assertRaw('<td class="diff-context diff-addedline">anonymous : <span class="diffchange">Anonymous</span></td>'); $this->assertSession()->responseContains('<td class="diff-context diff-deletedline">anonymous : <span class="diffchange">Giraffe</span></td>'); $this->assertSession()->responseContains('<td class="diff-context diff-addedline">anonymous : <span class="diffchange">Anonymous</span></td>'); $edit = []; $edit['modules[' . $feature_name . '][enable]'] = TRUE; $this->drupalPostForm('admin/modules', $edit, 'Install'); $this->drupalGet('admin/modules'); $this->submitForm($edit, 'Install'); $this->drupalGet('admin/config/development/features'); $tds = $this->xpath('//table[contains(@class, "features-listing")]/tbody/tr[td[3] = "' . $feature_name . '"]/td'); Loading @@ -180,7 +183,7 @@ class FeaturesCreateUiTest extends BrowserTestBase { $this->assertTrue(strpos($tds[6]->getText(), 'Changed') !== FALSE); $this->clickLink('Test feature'); $this->drupalPostForm(NULL, [], 'Write'); $this->submitForm([], 'Write'); $this->drupalGet('admin/config/development/features'); $tds = $this->xpath('//table[contains(@class, "features-listing")]/tbody/tr[td[3] = "' . $feature_name . '"]/td'); Loading tests/src/Kernel/FeaturesAssignTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ class FeaturesAssignTest extends KernelTestBase { /** * {@inheritdoc} */ protected function setUp() { protected function setUp(): void { parent::setUp(); $this->installConfig('features'); Loading tests/src/Kernel/FeaturesAssignerTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ class FeaturesAssignerTest extends KernelTestBase { /** * {@inheritdoc} */ protected function setUp() { protected function setUp(): void { parent::setUp(); // We need system.site in order to run $this->configImporter->import(). $this->installConfig('system'); Loading tests/src/Kernel/FeaturesGenerateTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ class FeaturesGenerateTest extends KernelTestBase { /** * {@inheritdoc} */ protected function setUp() { protected function setUp(): void { parent::setUp(); $this->installConfig('features'); Loading Loading
modules/features_ui/tests/src/Functional/FeaturesBundleUiTest.php +26 −25 Original line number Diff line number Diff line Loading @@ -91,14 +91,14 @@ class FeaturesBundleUiTest extends BrowserTestBase { // Check initial form. $this->drupalGet('admin/config/development/features/bundle/_exclude/default'); $this->assertFieldChecked('edit-types-config-features-bundle', 'features_bundle is checked'); $this->assertNoFieldChecked('edit-types-config-system-simple', 'system_simple is not checked'); $this->assertNoFieldChecked('edit-types-config-user-role', 'user_role is not checked'); $this->assertFieldChecked('edit-curated', 'curated is checked'); $this->assertFieldChecked('edit-module-namespace', 'namespace is checked'); $this->assertSession()->checkboxChecked('edit-types-config-features-bundle'); $this->assertSession()->checkboxNotChecked('edit-types-config-system-simple'); $this->assertSession()->checkboxNotChecked('edit-types-config-user-role'); $this->assertSession()->checkboxChecked('edit-curated'); $this->assertSession()->checkboxChecked('edit-module-namespace'); // Configure the form. $this->drupalPostForm(NULL, [ $this->submitForm([ 'types[config][system_simple]' => TRUE, 'types[config][user_role]' => FALSE, 'curated' => TRUE, Loading @@ -107,11 +107,11 @@ class FeaturesBundleUiTest extends BrowserTestBase { // Check form results. $this->drupalGet('admin/config/development/features/bundle/_exclude/default'); $this->assertFieldChecked('edit-types-config-features-bundle', 'Saved, features_bundle is checked'); $this->assertFieldChecked('edit-types-config-system-simple', 'Saved, system_simple is checked'); $this->assertNoFieldChecked('edit-types-config-user-role', 'Saved, user_role is not checked'); $this->assertFieldChecked('edit-curated', 'Saved, curated is checked'); $this->assertNoFieldChecked('edit-module-namespace', 'Saved, namespace is not checked'); $this->assertSession()->checkboxChecked('edit-types-config-features-bundle'); $this->assertSession()->checkboxChecked('edit-types-config-system-simple'); $this->assertSession()->checkboxNotChecked('edit-types-config-user-role'); $this->assertSession()->checkboxChecked('edit-curated'); $this->assertSession()->checkboxNotChecked('edit-module-namespace'); // Check final values. $settings = $this->defaultBundle()->getAssignmentSettings('exclude'); Loading Loading @@ -143,19 +143,19 @@ class FeaturesBundleUiTest extends BrowserTestBase { // Can we visit the config page with no settings? $this->drupalGet('admin/config/development/features/bundle/_exclude/default'); $this->assertNoFieldChecked('edit-types-config-features-bundle', 'features_bundle is not checked'); $this->assertNoFieldChecked('edit-types-config-system-simple', 'system_simple is not checked'); $this->assertNoFieldChecked('edit-types-config-user-role', 'user_role is not checked'); $this->assertNoFieldChecked('edit-curated', 'curated is not checked'); $this->assertNoFieldChecked('edit-module-namespace', 'namespace is not checked'); $this->assertSession()->checkboxNotChecked('edit-types-config-features-bundle'); $this->assertSession()->checkboxNotChecked('edit-types-config-system-simple'); $this->assertSession()->checkboxNotChecked('edit-types-config-user-role'); $this->assertSession()->checkboxNotChecked('edit-curated'); $this->assertSession()->checkboxNotChecked('edit-module-namespace'); // Can we enable the method? $this->drupalGet('admin/config/development/features/bundle'); $this->assertNoFieldChecked('edit-enabled-exclude', 'Exclude disabled'); $this->drupalPostForm(NULL, [ $this->assertSession()->checkboxNotChecked('edit-enabled-exclude'); $this->submitForm([ 'enabled[exclude]' => TRUE, ], 'Save settings'); $this->assertFieldChecked('edit-enabled-exclude', 'Exclude enabled'); $this->assertSession()->checkboxChecked('edit-enabled-exclude'); // Check new settings. $settings = $this->defaultBundle()->getAssignmentSettings('exclude'); Loading @@ -168,9 +168,10 @@ class FeaturesBundleUiTest extends BrowserTestBase { // Can we run assignment with no settings? $this->drupalGet('admin/config/development/features'); $this->drupalGet('admin/config/development/features/bundle/_exclude/default'); // Can we configure the method? $this->drupalPostForm('admin/config/development/features/bundle/_exclude/default', [ $this->submitForm([ 'types[config][system_simple]' => TRUE, 'types[config][user_role]' => FALSE, 'curated' => TRUE, Loading @@ -179,11 +180,11 @@ class FeaturesBundleUiTest extends BrowserTestBase { // Check form results. $this->drupalGet('admin/config/development/features/bundle/_exclude/default'); $this->assertNoFieldChecked('edit-types-config-features-bundle', 'Saved, features_bundle is not checked'); $this->assertFieldChecked('edit-types-config-system-simple', 'Saved, system_simple is checked'); $this->assertNoFieldChecked('edit-types-config-user-role', 'Saved, user_role is not checked'); $this->assertFieldChecked('edit-curated', 'Saved, curated is checked'); $this->assertNoFieldChecked('edit-module-namespace', 'Saved, namespace is not checked'); $this->assertSession()->checkboxNotChecked('edit-types-config-features-bundle'); $this->assertSession()->checkboxChecked('edit-types-config-system-simple'); $this->assertSession()->checkboxNotChecked('edit-types-config-user-role'); $this->assertSession()->checkboxChecked('edit-curated'); $this->assertSession()->checkboxNotChecked('edit-module-namespace'); // Check final values. $settings = $this->defaultBundle()->getAssignmentSettings('exclude'); Loading
modules/features_ui/tests/src/Functional/FeaturesCreateUiTest.php +16 −13 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ class FeaturesCreateUiTest extends BrowserTestBase { $this->drupalPlaceBlock('local_actions_block'); $this->drupalGet('admin/config/development/features'); $this->clickLink('Create new feature'); $this->assertResponse(200); $this->assertSession()->statusCodeEquals(200); $edit = [ 'name' => 'Test feature', Loading @@ -55,10 +55,10 @@ class FeaturesCreateUiTest extends BrowserTestBase { 'system_simple[sources][selected][system.theme]' => TRUE, 'system_simple[sources][selected][user.settings]' => TRUE, ]; $this->drupalPostForm(NULL, $edit, 'Download Archive'); $this->submitForm($edit, 'Download Archive'); $this->assertResponse(200); $archive = $this->getRawContent(); $this->assertSession()->statusCodeEquals(200); $archive = $this->getSession()->getPage()->getContent(); $filename = tempnam($this->tempFilesDirectory, 'feature'); file_put_contents($filename, $archive); Loading Loading @@ -89,12 +89,12 @@ class FeaturesCreateUiTest extends BrowserTestBase { // Ensure that the features listing renders the right content. $this->drupalGet('admin/config/development/features'); $tds = $this->xpath('//table[contains(@class, "features-listing")]/tbody/tr[td[3] = "' . $feature_name . '"]/td'); $this->assertLink('Test feature'); $this->assertSession()->linkExists('Test feature'); $this->assertEquals($feature_name, $tds[2]->getText()); $description_column = $tds[3]->getText(); $this->assertTrue(strpos($description_column, 'system.theme') !== FALSE); $this->assertTrue(strpos($description_column, 'user.settings') !== FALSE); $this->assertRaw('Test description: <strong>giraffe</strong>'); $this->assertSession()->responseContains('Test description: <strong>giraffe</strong>'); $this->assertEquals('Uninstalled', $tds[5]->getText()); $this->assertEquals('', $tds[6]->getText()); Loading @@ -104,7 +104,7 @@ class FeaturesCreateUiTest extends BrowserTestBase { 'system_simple[included][system.theme]' => FALSE, 'user_role[sources][selected][authenticated]' => TRUE, ]; $this->drupalPostForm(NULL, $edit, 'Write'); $this->submitForm($edit, 'Write'); $info_filename = $module_path . '/' . $feature_name . '.info.yml'; $parsed_info = Yaml::decode(file_get_contents($info_filename)); Loading @@ -124,7 +124,8 @@ class FeaturesCreateUiTest extends BrowserTestBase { // Install new feature module. $edit = []; $edit['modules[' . $feature_name . '][enable]'] = TRUE; $this->drupalPostForm('admin/modules', $edit, 'Install'); $this->drupalGet('admin/modules'); $this->submitForm($edit, 'Install'); // Check that the feature is listed as installed. $this->drupalGet('admin/config/development/features'); Loading @@ -143,9 +144,10 @@ class FeaturesCreateUiTest extends BrowserTestBase { $tds = $this->xpath('//table[contains(@class, "features-listing")]/tbody/tr[td[3] = "' . $feature_name . '"]/td'); $this->assertTrue(strpos($tds[6]->getText(), 'Changed') !== FALSE); $this->drupalGet('admin/modules/uninstall'); // Uninstall the module. $this->drupalPostForm('admin/modules/uninstall', ['uninstall[' . $feature_name . ']' => $feature_name], 'Uninstall'); $this->submitForm(['uninstall[' . $feature_name . ']' => $feature_name], 'Uninstall'); $this->submitForm([], 'Uninstall'); $this->drupalGet('admin/config/development/features'); Loading @@ -155,12 +157,13 @@ class FeaturesCreateUiTest extends BrowserTestBase { $this->clickLink('Changed'); $this->drupalGet('admin/config/development/features/diff/' . $feature_name); $this->assertRaw('<td class="diff-context diff-deletedline">anonymous : <span class="diffchange">Giraffe</span></td>'); $this->assertRaw('<td class="diff-context diff-addedline">anonymous : <span class="diffchange">Anonymous</span></td>'); $this->assertSession()->responseContains('<td class="diff-context diff-deletedline">anonymous : <span class="diffchange">Giraffe</span></td>'); $this->assertSession()->responseContains('<td class="diff-context diff-addedline">anonymous : <span class="diffchange">Anonymous</span></td>'); $edit = []; $edit['modules[' . $feature_name . '][enable]'] = TRUE; $this->drupalPostForm('admin/modules', $edit, 'Install'); $this->drupalGet('admin/modules'); $this->submitForm($edit, 'Install'); $this->drupalGet('admin/config/development/features'); $tds = $this->xpath('//table[contains(@class, "features-listing")]/tbody/tr[td[3] = "' . $feature_name . '"]/td'); Loading @@ -180,7 +183,7 @@ class FeaturesCreateUiTest extends BrowserTestBase { $this->assertTrue(strpos($tds[6]->getText(), 'Changed') !== FALSE); $this->clickLink('Test feature'); $this->drupalPostForm(NULL, [], 'Write'); $this->submitForm([], 'Write'); $this->drupalGet('admin/config/development/features'); $tds = $this->xpath('//table[contains(@class, "features-listing")]/tbody/tr[td[3] = "' . $feature_name . '"]/td'); Loading
tests/src/Kernel/FeaturesAssignTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ class FeaturesAssignTest extends KernelTestBase { /** * {@inheritdoc} */ protected function setUp() { protected function setUp(): void { parent::setUp(); $this->installConfig('features'); Loading
tests/src/Kernel/FeaturesAssignerTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ class FeaturesAssignerTest extends KernelTestBase { /** * {@inheritdoc} */ protected function setUp() { protected function setUp(): void { parent::setUp(); // We need system.site in order to run $this->configImporter->import(). $this->installConfig('system'); Loading
tests/src/Kernel/FeaturesGenerateTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ class FeaturesGenerateTest extends KernelTestBase { /** * {@inheritdoc} */ protected function setUp() { protected function setUp(): void { parent::setUp(); $this->installConfig('features'); Loading