Skip to content
Snippets Groups Projects
Commit cbb47727 authored by Oleksandr Kuzava's avatar Oleksandr Kuzava
Browse files

Issue #3229471: Rename test classes, code cleaning.

parent b2be70af
No related branches found
No related tags found
1 merge request!5setup simple test
action.configuration.content_bulk_export:
type: action_configuration_default
label: 'Export content'
single_content_sync.settings:
type: config_object
label: 'Single Content Sync settings'
mapping:
allowed_entity_types:
type: sequence
sequence:
type: string
label: 'Allowed entity types to export'
......@@ -3,17 +3,21 @@
namespace Drupal\Tests\single_content_sync\Functional;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\single_content_sync\SingleContentSyncImportContentTrait\Functional;
/**
* Test description.
* Browser test base class for Single content sync functional tests.
*
* @group single_content_sync
*/
abstract class SingleContentSyncTestBase extends BrowserTestBase {
abstract class SingleContentSyncBrowserTestBase extends BrowserTestBase {
use SingleContentSyncImportContentTrait;
/**
* {@inheritdoc}
*/
protected $profile = 'minimal';
/**
* {@inheritdoc}
*/
......@@ -31,15 +35,6 @@ abstract class SingleContentSyncTestBase extends BrowserTestBase {
*/
protected $adminUser;
/**
* Disabling as the require yaml_editor module has a missing schema.
*
* @see \Drupal\Core\Config\Development\ConfigSchemaChecker
*
* @var bool
*/
protected $strictConfigSchema = FALSE;
/**
* {@inheritdoc}
*/
......@@ -69,6 +64,7 @@ abstract class SingleContentSyncTestBase extends BrowserTestBase {
'access content overview',
'import single content',
'export single content',
'export node content',
]);
$this->drupalLogin($this->adminUser);
......
......@@ -2,6 +2,9 @@
namespace Drupal\Tests\single_content_sync\Functional;
/**
* Define a trait with useful methods to use in tests.
*/
trait SingleContentSyncImportContentTrait {
/**
......@@ -9,11 +12,10 @@ trait SingleContentSyncImportContentTrait {
*
* @param string $file_name
* The name of the file in the assets folder.
*
* @return void
*/
protected function importFile($file_name) {
$file_path = \Drupal::service('extension.list.module')->getPath('single_content_sync') . '/tests/assets/' . $file_name . '.yml';
\Drupal::service('single_content_sync.importer')->importFromFile($file_path);
}
}
......@@ -7,7 +7,7 @@ namespace Drupal\Tests\single_content_sync\Functional;
*
* @group single_content_sync
*/
class SingleContentSyncImport extends SingleContentSyncTestBase {
class SingleContentSyncImportTest extends SingleContentSyncBrowserTestBase {
/**
* Test import of a very simple basic page.
......
......@@ -7,12 +7,12 @@ namespace Drupal\Tests\single_content_sync\Functional;
*
* @group single_content_sync
*/
class SingleContentSyncImportUI extends SingleContentSyncTestBase {
class SingleContentSyncImportUITest extends SingleContentSyncBrowserTestBase {
/**
* Test import of a versy simple basic page through the UI.
* Test import of a very simple basic page through the UI.
*/
public function testSingleImportUI() {
public function testSingleImportUi() {
// First check if there's no content.
$this->drupalGet('admin/content');
$this->assertSession()->pageTextContains('There are no content items yet.');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment