$98 GRAYBYTE WORDPRESS FILE MANAGER $74

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/php71/usr/share/pear/test/XML_Util/tests/

HOME
Current File : /opt/alt/php71/usr/share/pear/test/XML_Util/tests//IsValidNameTests.php
<?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());
    }
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
13 May 2025 12.01 AM
root / root
0755
AbstractUnitTests.php
0.414 KB
13 May 2025 12.01 AM
root / root
0644
ApiVersionTests.php
0.216 KB
13 May 2025 12.01 AM
root / root
0644
AttributesToStringTests.php
7.521 KB
13 May 2025 12.01 AM
root / root
0644
Bug18343Tests.php
1.701 KB
13 May 2025 12.01 AM
root / root
0644
Bug21177Tests.php
1.029 KB
13 May 2025 12.01 AM
root / root
0644
Bug21184Tests.php
0.439 KB
13 May 2025 12.01 AM
root / root
0644
Bug4950Tests.php
0.712 KB
13 May 2025 12.01 AM
root / root
0644
Bug5392Tests.php
0.749 KB
13 May 2025 12.01 AM
root / root
0644
CollapseEmptyTagsTests.php
4.251 KB
13 May 2025 12.01 AM
root / root
0644
CreateCDataSectionTests.php
0.354 KB
13 May 2025 12.01 AM
root / root
0644
CreateCommentTests.php
0.332 KB
13 May 2025 12.01 AM
root / root
0644
CreateEndElementTests.php
0.599 KB
13 May 2025 12.01 AM
root / root
0644
CreateStartElementTests.php
5.283 KB
13 May 2025 12.01 AM
root / root
0644
CreateTagFromArrayTests.php
13.176 KB
13 May 2025 12.01 AM
root / root
0644
CreateTagTests.php
7.791 KB
13 May 2025 12.01 AM
root / root
0644
GetDocTypeDeclarationTests.php
1.737 KB
13 May 2025 12.01 AM
root / root
0644
GetXmlDeclarationTests.php
1.137 KB
13 May 2025 12.01 AM
root / root
0644
IsValidNameTests.php
1.937 KB
13 May 2025 12.01 AM
root / root
0644
RaiseErrorTests.php
0.438 KB
13 May 2025 12.01 AM
root / root
0644
ReplaceEntitiesTests.php
4.22 KB
13 May 2025 12.01 AM
root / root
0644
ReverseEntitiesTests.php
4.209 KB
13 May 2025 12.01 AM
root / root
0644
SplitQualifiedNameTests.php
0.819 KB
13 May 2025 12.01 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF