Skip to content
Snippets Groups Projects
Commit 24d02caa authored by Florent Torregrosa's avatar Florent Torregrosa
Browse files

Issue #3485886 by grimreaper, pdureau: Test components

parent f3c55dc3
No related branches found
No related tags found
1 merge request!220Resolve #3485886 "Test components"
Pipeline #336152 passed with warnings
...@@ -7,3 +7,6 @@ include: ...@@ -7,3 +7,6 @@ include:
- '/includes/include.drupalci.main.yml' - '/includes/include.drupalci.main.yml'
- '/includes/include.drupalci.variables.yml' - '/includes/include.drupalci.variables.yml'
- '/includes/include.drupalci.workflows.yml' - '/includes/include.drupalci.workflows.yml'
.phpunit-base:
allow_failure: true
<?php
declare(strict_types=1);
namespace Drupal\Tests\ui_suite_bootstrap\Kernel;
use Drupal\Tests\Core\Theme\Component\ComponentKernelTestBase;
use Drupal\ui_patterns_devel\Controller\ComponentValidatorOverview;
/**
* Validate components.
*
* @group ui_suite_bootstrap
*/
class ComponentValidatorTest extends ComponentKernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'system',
'ui_patterns',
'ui_patterns_devel',
'ui_patterns_library',
'ui_styles',
'ui_styles_entity_status',
'ui_styles_page',
'layout_options',
];
/**
* {@inheritdoc}
*/
protected static $themes = [
'ui_suite_bootstrap',
];
/**
* {@inheritdoc}
*/
protected function setUp(): void {
parent::setUp();
$this->installConfig('system');
}
/**
* Validate components.
*/
public function testComponents(): void {
$validatorController = new ComponentValidatorOverview(
$this->container->get('ui_patterns_devel.validator'),
$this->container->get('plugin.manager.sdc'),
$this->container->get('plugin.manager.component_story'),
$this->container->get('renderer')
);
$overview = $validatorController->overview();
if (isset($overview['table']['#rows']) && !empty($overview['table']['#rows'])) {
$messages = [];
foreach ($overview['table']['#rows'] as $row) {
$message = [
$row['data'][0]->getText(),
$row['data'][1],
$row['data'][2],
$row['data'][3],
'Line ' . $row['data'][4],
];
$messages[] = \implode(' | ', $message);
}
$this->fail(\implode(\PHP_EOL, $messages));
}
else {
$this->assertTrue(TRUE, 'No errors found');
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment