VarbaseMediaTests.php in Varbase Media 9.0.x
File
tests/src/FunctionalJavascript/VarbaseMediaTests.php
View source
<?php
namespace Drupal\Tests\varbase_media\FunctionalJavascript;
use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
use Drupal\Core\StringTranslation\StringTranslationTrait;
class VarbaseMediaTests extends WebDriverTestBase {
use StringTranslationTrait;
public static $modules = [
'metatag',
'metatag_views',
'better_exposed_filters',
'varbase_media',
'varbase_media_instagram',
'varbase_media_twitter',
];
protected $defaultTheme = 'vartheme_bs4';
protected $profile = 'standard';
protected function setUp() {
parent::setUp();
$this->container
->get('theme_installer')
->install([
'vartheme_claro',
]);
$this
->config('system.theme')
->set('admin', 'vartheme_claro')
->save();
}
public function testCheckVarbaseMediaTypesPage() {
$this
->drupalLogin($this->rootUser);
$this
->drupalGet('/admin/structure/media');
$this
->assertSession()
->pageTextContains($this
->t('Image'));
$this
->assertSession()
->pageTextContains($this
->t('Remote video'));
$this
->assertSession()
->pageTextContains($this
->t('Video'));
$this
->assertSession()
->pageTextContains($this
->t('Gallery'));
$this
->assertSession()
->pageTextContains($this
->t('Instagram'));
$this
->assertSession()
->pageTextContains($this
->t('Tweet'));
$this
->assertSession()
->pageTextContains($this
->t('Document'));
}
public function testCheckVarbaseMediaSettings() {
$this
->drupalLogin($this->rootUser);
$this
->drupalGet('/admin/people/permissions#module-varbase_media');
$this
->assertSession()
->pageTextContains($this
->t('Administer Varbase Media settings'));
}
public function testCheckVarbaseMediaSettingsPermissions() {
$this
->drupalLogin($this->rootUser);
$this
->drupalGet('/admin/people/permissions');
$this
->assertSession()
->pageTextContains($this
->t('Administer Varbase Media settings'));
}
}