'Browsersync', 'description' => 'Tests for the Browsersync module.', 'group' => 'Browsersync', ); } /** * {@inheritdoc} */ public function setUp() { parent::setUp(array('browsersync')); // Create a dev user who can use Browsersync. $this->dev_user = $this->drupalCreateUser(array('use browsersync')); $this->drupalLogin($this->dev_user); // Enable Browsersync globally. $theme_settings = variable_get('theme_settings', array()); $theme_settings['browsersync_enabled'] = TRUE; variable_set('theme_settings', $theme_settings); } /** * Checks for the presence of the snippet in the markup. */ public function testSnippet() { $this->drupalGet(''); $elements = $this->xpath('//script[@id=:id]', array(':id' => '__bs_script__')); $this->assertTrue(!empty($elements), 'Page contains the Browsersync snippet.'); } }