Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
NameValidationUtilTest.php
Go to the documentation of this file.
1 <?php
8 
12 
14 {
18  public function testCurlyBracesInTestName()
19  {
20  $this->validateBlacklistedTestName("{{curlyBraces}}");
21  }
22 
26  public function testQuotesInTestName()
27  {
28  $this->validateBlacklistedTestName("\"quotes\"");
29  }
30 
34  public function testSingleQuotesInTestName()
35  {
36  $this->validateBlacklistedTestName("'singleQuotes'");
37  }
38 
42  public function testParenthesesInTestName()
43  {
44  $this->validateBlacklistedTestName("(parenthesis)");
45  }
46 
50  public function testDollarSignInTestName()
51  {
52  $this->validateBlacklistedTestName("\$dollarSign\$");
53  }
54 
58  public function testSpacesInTestName()
59  {
60  $this->validateBlacklistedTestName("Test Name With Spaces");
61  }
62 
69  private function validateBlacklistedTestName($testName)
70  {
71  $this->expectException(XmlException::class);
72  NameValidationUtil::validateName($testName, "Test");
73  }
74 }