Skip to content

Commit 2155a18

Browse files
committed
Fix printing of a non-prefix QNameValue
1 parent da34115 commit 2155a18

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/XMLSchema/Type/QNameValue.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ protected function validateValue(string $value): void
9797
*/
9898
public function getValue(): string
9999
{
100-
return $this->getNamespacePrefix() . ':' . $this->getLocalName();
100+
$prefix = $this->getNamespacePrefix();
101+
return ($prefix ? $prefix . ':' : '') . $this->getLocalName();
101102
}
102103

103104

tests/XML/Assert/AnyURITest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public static function provideValidURI(): array
4949
'spaces' => [true, 'this is silly'],
5050
'empty' => [true, ''],
5151
'azure-common' => [true, 'https://sts.windows.net/{tenantid}/'],
52+
'one' => [true, '1'],
5253
];
5354
}
5455
}

0 commit comments

Comments
 (0)