Commit c83b85ac authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

Issue #3161052 by Gábor Hojtsy, mglaman, Grimreaper, Eric_A: Annotation...

Issue #3161052 by Gábor Hojtsy, mglaman, Grimreaper, Eric_A: Annotation checking missing: context to context_definition and new config_export
parent dfb45209
<?php
namespace Drupal\upgrade_status_test_error;
use Drupal\Core\Config\Entity\ConfigEntityBase;
/**
* Defines the UpgradeStatusTestErrorEntity configuration entity.
*
* @ConfigEntityType(
* id = "upgrade_status_test_error",
* label = @Translation("Test configuration"),
* )
*/
final class UpgradeStatusTestErrorEntity extends ConfigEntityBase {
}
......@@ -35,8 +35,8 @@ class UpgradeStatusAnalyzeTest extends UpgradeStatusTestBase {
$report = $key_value->get('upgrade_status_test_error');
$this->assertNotEmpty($report);
$this->assertEquals(4, $report['data']['totals']['file_errors']);
$this->assertCount(4, $report['data']['files']);
$this->assertEquals(5, $report['data']['totals']['file_errors']);
$this->assertCount(5, $report['data']['files']);
$file = reset($report['data']['files']);
$message = $file['messages'][0];
$this->assertEquals('fatal.php', basename(key($report['data']['files'])));
......@@ -53,6 +53,11 @@ class UpgradeStatusAnalyzeTest extends UpgradeStatusTestBase {
$this->assertEquals("Class Drupal\upgrade_status_test_error\ExtendingClass extends deprecated class Drupal\upgrade_status_test_error\DeprecatedBaseClass. Deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Instead, use so and so. See https://www.drupal.org/project/upgrade_status.", $message['message']);
$this->assertEquals(10, $message['line']);
$file = next($report['data']['files']);
$this->assertEquals('UpgradeStatusTestErrorEntity.php', basename(key($report['data']['files'])));
$message = $file['messages'][0];
$this->assertEquals("Configuration entity must define a `config_export` key. See https://www.drupal.org/node/2481909", $message['message']);
$this->assertEquals(15, $message['line']);
$file = next($report['data']['files']);
$this->assertEquals('upgrade_status_test_error.info.yml', basename(key($report['data']['files'])));
$message = $file['messages'][0];
$this->assertEquals("Add core_version_requirement: ^8 || ^9 to designate that the module is compatible with Drupal 9. See https://drupal.org/node/3070687.", $message['message']);
......
......@@ -51,7 +51,7 @@ class UpgradeStatusUiTest extends UpgradeStatusTestBase {
$assert_session->buttonExists('Export selected as HTML');
// Error and no-error test module results should show.
$this->assertSame('4 problems', strip_tags($page->find('css', 'tr.project-upgrade_status_test_error td.scan-result')->getHtml()));
$this->assertSame('5 problems', strip_tags($page->find('css', 'tr.project-upgrade_status_test_error td.scan-result')->getHtml()));
$this->assertSame($this->getDrupalCoreMajorVersion() < 9 ? 'No problems found' : '1 problem', strip_tags($page->find('css', 'tr.project-upgrade_status_test_9_compatible td.scan-result')->getHtml()));
$this->assertSame('No problems found', strip_tags($page->find('css', 'tr.project-upgrade_status_test_10_compatible td.scan-result')->getHtml()));
......@@ -66,10 +66,10 @@ class UpgradeStatusUiTest extends UpgradeStatusTestBase {
$next_major = $this->getDrupalCoreMajorVersion() + 1;
$this->assertSession()->linkByHrefExists('https://drupal.org/project/issues/upgrade_status_test_contributed_9_compatible?text=Drupal+' . $next_major . '&status=All');
// Click the first '4 problems' link. Should be the custom project.
$this->clickLink('4 problems');
// Click the first '5 problems' link. Should be the custom project.
$this->clickLink('5 problems', 1);
$this->assertText('Upgrade status test error ' . \Drupal::VERSION);
$this->assertText('2 errors found. 2 warnings found.');
$this->assertText('2 errors found. 3 warnings found.');
$this->assertText('Syntax error, unexpected T_STRING on line 3');
// Go forward to the export page and assert that still contains the results
......@@ -79,17 +79,17 @@ class UpgradeStatusUiTest extends UpgradeStatusTestBase {
$this->assertText('Upgrade status test error ' . \Drupal::VERSION);
$this->assertText('Custom projects');
$this->assertNoText('Contributed projects');
$this->assertText('2 errors found. 2 warnings found.');
$this->assertText('2 errors found. 3 warnings found.');
$this->assertText('Syntax error, unexpected T_STRING on line 3');
// Go back to the listing page and click over to exporting in single ASCII.
$this->drupalGet(Url::fromRoute('upgrade_status.report'));
$this->clickLink('4 problems');
$this->clickLink('5 problems', 1);
$this->clickLink('Export as text');
$this->assertText('Upgrade status test error ' . \Drupal::VERSION);
$this->assertText('CUSTOM PROJECTS');
$this->assertNoText('CONTRIBUTED PROJECTS');
$this->assertText('2 errors found. 2 warnings found.');
$this->assertText('2 errors found. 3 warnings found.');
$this->assertText('Syntax error, unexpected T_STRING on line 3');
// Run partial export of multiple projects.
......@@ -111,7 +111,7 @@ class UpgradeStatusUiTest extends UpgradeStatusTestBase {
$this->assertText('Upgrade status test error ' . \Drupal::VERSION);
$this->assertNoText('Upgrade status test root module');
$this->assertNoText('Upgrade status test contrib 9 compatbile');
$this->assertText('2 errors found. 2 warnings found.');
$this->assertText('2 errors found. 3 warnings found.');
$this->assertText('Syntax error, unexpected T_STRING on line 3');
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment