Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Chi-teck committed Mar 10, 2024
1 parent f5a5bbe commit b8136b9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion scripts/sut-tests.sh
Expand Up @@ -63,7 +63,7 @@ function dcg_phpcs {
function dcg_phpunit {
SIMPLETEST_BASE_URL=http://$dcg_drupal_host:$dcg_drupal_port \
SIMPLETEST_DB=sqlite://localhost//$drupal_dir/sites/default/files/dcg_test.sqlite \
MINK_DRIVER_ARGS_WEBDRIVER='["chrome", {"chromeOptions": {"w3c": false, "args": ["--headless"]}}, "'$dcg_wd_url'"]' \
MINK_DRIVER_ARGS='["chrome", {"goog": {"w3c": false, "args": ["--headless"]}}, "'$dcg_wd_url'"]' \
$drupal_dir/vendor/bin/phpunit -c $drupal_dir/core "$@"
}

Expand Down
6 changes: 1 addition & 5 deletions src/Command/Navigation.php
Expand Up @@ -27,15 +27,11 @@ final class Navigation extends Command implements IOAwareInterface, LoggerAwareI

/**
* Menu tree.
*
* @var array
*/
private array $menuTree = [];

/**
* Menu labels.
*
* @var array
*/
private array $labels = [
'misc:d7' => 'Drupal 7',
Expand Down Expand Up @@ -173,7 +169,7 @@ private function selectGenerator(InputInterface $input, OutputInterface $output,
}

/**
* Sort multi-dimensional array by keys.
* Sort multidimensional array by keys.
*
* @param array $array
* An array being sorted.
Expand Down
Expand Up @@ -15,7 +15,6 @@
'revision_user',
'revision_log',
'status',
'uid',
'info',
'changed',
'reusable',
Expand Down
14 changes: 9 additions & 5 deletions tests/sut/qux/tests/src/FunctionalJavascript/FieldBaseTest.php
Expand Up @@ -24,7 +24,7 @@ abstract class FieldBaseTest extends WebDriverTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = ['qux', 'node', 'field_ui'];
protected static $modules = ['qux', 'node', 'field_ui', 'block'];

/**
* {@inheritdoc}
Expand All @@ -46,11 +46,15 @@ protected function setUp(): void {

// Create text field.
$this->drupalGet('admin/structure/types/manage/test/fields/add-field');
$page = $this->getSession()->getPage();
$page->selectFieldOption('new_storage_type', 'string');
$page->fillField('label', 'Wine');

$driver = $this->getSession()->getDriver();
$driver->click('//input[@name = "new_storage_type" and @value = "plain_text"]');
$driver->click('//input[@value = "Continue"]');
$driver->setValue('//input[@name = "label"]', 'Wine');
$driver->setValue('//input[@name = "group_field_options_wrapper"]', 'string');
$this->assertSession()->waitForElementVisible('css', '#edit-label-machine-name-suffix');
$page->pressButton('Save and continue');
$driver->click('//input[@value = "Continue"]');
$driver->click('//input[@value = "Save settings"]');
}

/**
Expand Down

0 comments on commit b8136b9

Please sign in to comment.