function MigrateUpgradeExecuteTestBase::assertLogError

Same name in other branches
  1. 10 core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php \Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeExecuteTestBase::assertLogError()

Asserts log errors.

2 calls to MigrateUpgradeExecuteTestBase::assertLogError()
Upgrade6Test::testUpgradeAndIncremental in core/modules/migrate_drupal_ui/tests/src/Functional/d6/Upgrade6Test.php
Executes all steps of migrations upgrade.
Upgrade7Test::testUpgradeAndIncremental in core/modules/migrate_drupal_ui/tests/src/Functional/d7/Upgrade7Test.php
Executes all steps of migrations upgrade.

File

core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php, line 148

Class

MigrateUpgradeExecuteTestBase
Provides a base class for testing a complete upgrade via the UI.

Namespace

Drupal\Tests\migrate_drupal_ui\Functional

Code

public function assertLogError() : void {
    $db = \Drupal::service('database');
    $num_errors = $db->select('watchdog', 'w')
        ->fields('w')
        ->condition('type', 'migrate_drupal_ui')
        ->condition('severity', RfcLogLevel::ERROR)
        ->countQuery()
        ->execute()
        ->fetchField();
    $this->assertSame($this->expectedLoggedErrors, (int) $num_errors);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.