/opt/alt/php74/usr/share/pear/test/XML_Util/tests
<?php class IsValidNameTests extends AbstractUnitTests { /** * @covers XML_Util::isValidName() */ public function testIsValidNameForTagNameThatIsValid() { $tagName = "alpha-x_y_z.123"; $result = XML_Util::isValidName($tagName); $this->assertTrue($result); } /** * @covers XML_Util::isValidName() */ public function testIsValidNameForTagNameWithInvalidCharacter() { $tagName = "invalidTag?"; $result = XML_Util::isValidName($tagName); $this->assertInstanceOf('PEAR_Error', $result); $expectedError = "XML names may only contain alphanumeric chars, period, hyphen, colon and underscores"; $this->assertEquals($expectedError, $result->getMessage()); } /** * @covers XML_Util::isValidName() */ public function testIsValidNameForTagNameWithInvalidStartingCharacter() { $tagName = "1234five"; $result = XML_Util::isValidName($tagName); $this->assertInstanceOf('PEAR_Error', $result); $expectedError = "XML names may only start with letter or underscore"; $this->assertEquals($expectedError, $result->getMessage()); } /** * @covers XML_Util::isValidName() */ public function testIsValidNameForInt() { $tagName = 1; $result = XML_Util::isValidName($tagName); $this->assertInstanceOf('PEAR_Error', $result); $expectedError = "XML names may only start with letter or underscore"; $this->assertEquals($expectedError, $result->getMessage()); } /** * @covers XML_Util::isValidName() */ public function testIsValidNameForEmptyString() { $tagName = ''; $result = XML_Util::isValidName($tagName); $this->assertInstanceOf('PEAR_Error', $result); $expectedError = "XML names may only start with letter or underscore"; $this->assertEquals($expectedError, $result->getMessage()); } }
.
Edit
..
Edit
AbstractUnitTests.php
Edit
ApiVersionTests.php
Edit
AttributesToStringTests.php
Edit
Bug18343Tests.php
Edit
Bug21177Tests.php
Edit
Bug21184Tests.php
Edit
Bug4950Tests.php
Edit
Bug5392Tests.php
Edit
CollapseEmptyTagsTests.php
Edit
CreateCDataSectionTests.php
Edit
CreateCommentTests.php
Edit
CreateEndElementTests.php
Edit
CreateStartElementTests.php
Edit
CreateTagFromArrayTests.php
Edit
CreateTagTests.php
Edit
GetDocTypeDeclarationTests.php
Edit
GetXmlDeclarationTests.php
Edit
IsValidNameTests.php
Edit
RaiseErrorTests.php
Edit
ReplaceEntitiesTests.php
Edit
ReverseEntitiesTests.php
Edit
SplitQualifiedNameTests.php
Edit