You are here

public function ConstraintTest::testToArray in Drupal 8

@covers ::toArray @group legacy @expectedDeprecation Drupal\Component\Version\Constraint::toArray() only exists to provide a backwards compatibility layer. See https://www.drupal.org/node/2756875

File

core/tests/Drupal/Tests/Component/Version/ConstraintTest.php, line 157

Class

ConstraintTest
@coversDefaultClass \Drupal\Component\Version\Constraint @group Version

Namespace

Drupal\Tests\Component\Version

Code

public function testToArray() {
  $constraint = new Constraint('<8.x-4.x,>8.x-1.x', '8.x');
  $this
    ->assertSame([
    [
      'op' => '<',
      'version' => '4.x',
    ],
    [
      'op' => '>',
      'version' => '2.x',
    ],
  ], $constraint
    ->toArray());
}