You are here

public function Util_XMLTest::testAssertValidKeysInvalidKeys in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/tests/Util/XMLTest.php \Util_XMLTest::testAssertValidKeysInvalidKeys()

File

vendor/phpunit/phpunit/tests/Util/XMLTest.php, line 70

Class

Util_XMLTest
@since Class available since Release 3.3.0 @covers PHPUnit_Util_XML

Code

public function testAssertValidKeysInvalidKeys() {
  $options = array(
    'testA' => 1,
    'testD' => 2,
    'testE' => 3,
  );
  $valid = array(
    'testA',
    'testB',
    'testC',
  );
  try {
    $validated = PHPUnit_Util_XML::assertValidKeys($options, $valid);
    $this
      ->fail();
  } catch (PHPUnit_Framework_Exception $e) {
    $this
      ->assertEquals('Unknown key(s): testD, testE', $e
      ->getMessage());
  }
}