Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertSelectSeveralExtensions.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Constraint\AbstractConstraint;
11 use Magento\Setup\Test\Fixture\Extension;
12 
16 class AssertSelectSeveralExtensions extends AbstractConstraint
17 {
25  public function processAssert(AbstractGrid $grid, array $extensions)
26  {
27  $extensions = $grid->selectSeveralExtensions($extensions);
28  \PHPUnit\Framework\Assert::assertEmpty(
29  $extensions,
30  'Next extensions are not found on the grid: ' . $this->getExtensionsNames($extensions)
31  );
32  }
33 
40  protected function getExtensionsNames(array $extensions)
41  {
42  $result = [];
43  foreach ($extensions as $extension) {
44  $result[] = $extension->getExtensionName();
45  }
46 
47  return implode(', ', $result);
48  }
49 
55  public function toString()
56  {
57  return "Extensions are found and selected on the grid.";
58  }
59 }