ConfigTest.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Test\Integrity\App\Language;
  7. class ConfigTest extends \Magento\TestFramework\Integrity\AbstractConfig
  8. {
  9. public function testSchemaUsingInvalidXml($expectedErrors = null)
  10. {
  11. $expectedErrors = [
  12. "Element 'code': [facet 'pattern'] The value 'e_GB' is not accepted by the pattern",
  13. "Element 'code': 'e_GB' is not a valid value of the atomic type 'codeType'",
  14. "Element 'vendor': [facet 'pattern'] The value 'Magento1' is not accepted by the pattern",
  15. "Element 'vendor': 'Magento1' is not a valid value of the atomic type",
  16. "Element 'sort_odrer': This element is not expected. Expected is",
  17. ];
  18. parent::testSchemaUsingInvalidXml($expectedErrors);
  19. }
  20. /**
  21. * Returns the name of the XSD file to be used to validate the XML
  22. *
  23. * @return string
  24. */
  25. protected function _getXsd()
  26. {
  27. $urnResolver = new \Magento\Framework\Config\Dom\UrnResolver();
  28. return $urnResolver->getRealPath('urn:magento:framework:App/Language/package.xsd');
  29. }
  30. /**
  31. * The location of a single valid complete xml file
  32. *
  33. * @return string
  34. */
  35. protected function _getKnownValidXml()
  36. {
  37. return __DIR__ . '/_files/known_valid.xml';
  38. }
  39. /**
  40. * The location of a single known invalid complete xml file
  41. *
  42. * @return string
  43. */
  44. protected function _getKnownInvalidXml()
  45. {
  46. return __DIR__ . '/_files/known_invalid.xml';
  47. }
  48. /**
  49. * {@inheritdoc}
  50. */
  51. protected function _getKnownValidPartialXml()
  52. {
  53. return;
  54. }
  55. /**
  56. * {@inheritdoc}
  57. */
  58. protected function _getFileXsd()
  59. {
  60. return;
  61. }
  62. /**
  63. * {@inheritdoc}
  64. */
  65. protected function _getKnownInvalidPartialXml()
  66. {
  67. return;
  68. }
  69. /**
  70. * {@inheritdoc}
  71. */
  72. protected function _getXmlName()
  73. {
  74. return;
  75. }
  76. }