OptimizelySchemaTest.php in Optimizely 8.0
File
src/Tests/OptimizelySchemaTest.php
View source
<?php
namespace Drupal\optimizely\Tests;
use Drupal\simpletest\WebTestBase;
class OptimizelySchemaTest extends WebTestBase {
protected $privilegedUser;
public static $modules = array(
'optimizely',
);
public static function getInfo() {
return array(
'name' => 'Optimizely Schema Creation',
'description' => 'Ensure schema creation.',
'group' => 'Optimizely',
);
}
public function setUp() {
parent::setUp();
$this->privilegedUser = $this
->drupalCreateUser(array(
'administer optimizely',
));
}
public function testSchemaCreation() {
$this
->drupalLogin($this->privilegedUser);
$schema = \Drupal::moduleHandler()
->invoke('optimizely', 'schema');
$this
->assertNotNull($schema, t('<strong>Optimizely table was created.</strong>'), 'Optimizely');
}
}