function ConstraintTest::testToArray

@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());
}

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