ViewsDataExportTest.php in Views data export 8
File
tests/src/Functional/ViewsDataExportTest.php
View source
<?php
namespace Drupal\Tests\views_data_export\Functional;
use Drupal\Tests\views\Functional\ViewTestBase;
use Drupal\views\Tests\ViewTestData;
class ViewsDataExportTest extends ViewTestBase {
public static $modules = [
'entity_test',
'rest',
'views_data_export',
'views_data_export_test',
'csv_serialization',
'xls_serialization',
];
public static $testViews = [
'test_data_export',
];
protected function setUp($import_test_views = TRUE) {
parent::setUp($import_test_views);
ViewTestData::createTestViews(static::class, [
'views_data_export_test',
]);
$account = $this
->drupalCreateUser([
'access content',
]);
$this
->drupalLogin($account);
}
public function testHttpResponse() {
$this
->drupalGet('test/data_export/page');
$this
->assertSession()
->statusCodeEquals(200);
$this
->clickLink('Download JSON');
$this
->assertSession()
->statusCodeEquals(200);
}
}