public function LingotekProfileFormTest::testNoFilters in Lingotek Translation 3.3.x
Same name and namespace in other branches
- 8.2 tests/src/Functional/Form/LingotekProfileFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekProfileFormTest::testNoFilters()
- 4.0.x tests/src/Functional/Form/LingotekProfileFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekProfileFormTest::testNoFilters()
- 3.0.x tests/src/Functional/Form/LingotekProfileFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekProfileFormTest::testNoFilters()
- 3.1.x tests/src/Functional/Form/LingotekProfileFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekProfileFormTest::testNoFilters()
- 3.2.x tests/src/Functional/Form/LingotekProfileFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekProfileFormTest::testNoFilters()
- 3.4.x tests/src/Functional/Form/LingotekProfileFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekProfileFormTest::testNoFilters()
- 3.5.x tests/src/Functional/Form/LingotekProfileFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekProfileFormTest::testNoFilters()
- 3.6.x tests/src/Functional/Form/LingotekProfileFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekProfileFormTest::testNoFilters()
- 3.7.x tests/src/Functional/Form/LingotekProfileFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekProfileFormTest::testNoFilters()
- 3.8.x tests/src/Functional/Form/LingotekProfileFormTest.php \Drupal\Tests\lingotek\Functional\Form\LingotekProfileFormTest::testNoFilters()
Tests that only three filters are given when no resource filters are available.
File
- tests/
src/ Functional/ Form/ LingotekProfileFormTest.php, line 650
Class
- LingotekProfileFormTest
- Tests the Lingotek profile form.
Namespace
Drupal\Tests\lingotek\Functional\FormCode
public function testNoFilters() {
$assert_session = $this
->assertSession();
\Drupal::configFactory()
->getEditable('lingotek.settings')
->set('account.resources.filter', [])
->save();
$this
->drupalGet('admin/lingotek/settings');
$this
->clickLink(t('Add new Translation Profile'));
$this
->assertFieldByName('filter');
$option_field = $assert_session
->optionExists('edit-filter', 'drupal_default');
$this
->assertTrue($option_field
->hasAttribute('selected'));
$assert_session
->optionExists('edit-filter', 'default');
$assert_session
->optionExists('edit-filter', 'project_default');
$assert_session
->optionNotExists('edit-filter', 'test_filter');
$assert_session
->optionNotExists('edit-filter', 'test_filter2');
$this
->assertFieldByName('subfilter');
$option_field = $assert_session
->optionExists('edit-subfilter', 'drupal_default');
$this
->assertTrue($option_field
->hasAttribute('selected'));
$assert_session
->optionExists('edit-subfilter', 'default');
$assert_session
->optionExists('edit-subfilter', 'project_default');
$assert_session
->optionNotExists('edit-subfilter', 'test_filter');
$assert_session
->optionNotExists('edit-subfilter', 'test_filter2');
}