You are here

public function UnitTests::isExecutable in Drupal 7 to 8/9 Module Upgrader 8

Returns if this conversion applies to the target module. If FALSE, the convert() method will not be called.

Parameters

TargetInterface $target: The target module.

Return value

bool

Overrides ConverterBase::isExecutable

File

src/Plugin/DMU/Converter/UnitTests.php, line 22

Class

UnitTests
Plugin annotation @Converter( id = "unit_tests", description = @Translation("Modifies unit test classes.") )

Namespace

Drupal\drupalmoduleupgrader\Plugin\DMU\Converter

Code

public function isExecutable(TargetInterface $target) {
  return $target
    ->getIndexer('class')
    ->getQuery()
    ->condition('parent', 'DrupalUnitTestCase')
    ->countQuery()
    ->execute();
}