Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertVersionOnGrid.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 AssertVersionOnGrid extends AbstractConstraint
17 {
21  const TYPE_INSTALL = 1;
22  const TYPE_UPDATE = 2;
23  /*#@-*/
24 
33  public function processAssert(Grid $grid, Extension $extension, $type)
34  {
35  switch ($type) {
36  case self::TYPE_INSTALL:
37  $version = $extension->getVersion();
38  break;
39 
40  case self::TYPE_UPDATE:
41  $version = $extension->getVersionToUpdate();
42  break;
43 
44  default:
45  $version = '';
46  }
47 
48  \PHPUnit\Framework\Assert::assertTrue(
49  $grid->getVersion($extension) === $version,
50  'Version of extension is not correct.'
51  );
52  }
53 
59  public function toString()
60  {
61  return "Version of extension is correct.";
62  }
63 }
$type
Definition: item.phtml:13
getVersion(Extension $extension)
Definition: Grid.php:125
processAssert(Grid $grid, Extension $extension, $type)