You are here

public function PaymentReferenceBaseTest::testDisableChildren in Payment 8.2

@covers ::disableChildren

File

tests/src/Unit/Element/PaymentReferenceBaseTest.php, line 518

Class

PaymentReferenceBaseTest
@coversDefaultClass \Drupal\payment\Element\PaymentReferenceBase

Namespace

Drupal\Tests\payment\Unit\Element

Code

public function testDisableChildren() {
  $element = array(
    'foo' => array(
      '#foo' => $this
        ->randomMachineName(),
      'bar' => array(
        '#bar' => $this
          ->randomMachineName(),
      ),
    ),
  );
  $expected_element = $element;
  $expected_element['foo']['#disabled'] = TRUE;
  $expected_element['foo']['bar']['#disabled'] = TRUE;
  $method = new \ReflectionMethod($this->sut, 'disableChildren');
  $method
    ->setAccessible(TRUE);
  $method
    ->invokeArgs($this->sut, array(
    &$element,
  ));
  $this
    ->assertSame($expected_element, $element);
}