Skip to content

Commit ec4357b

Browse files
committed
Ensure stringification of ListValueInterface values
1 parent a5a457f commit ec4357b

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

tests/XMLSchema/Type/EntitiesValueTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ public function testToArray(): void
5151
}
5252

5353

54+
/**
55+
* Test stringification of the value
56+
*/
57+
#[DependsOnClass(EntitiesTest::class)]
58+
public function testStringification(): void
59+
{
60+
$entities = EntitiesValue::fromString("foo \nbar baz");
61+
$this->assertEquals('foo bar baz', strval($entities));
62+
}
63+
64+
5465
/**
5566
* @return array<string, array{0: true, 1: string}>
5667
*/

tests/XMLSchema/Type/IDRefsValueTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ public function testToArray(): void
5151
}
5252

5353

54+
/**
55+
* Test stringification of the value
56+
*/
57+
#[DependsOnClass(IDRefsTest::class)]
58+
public function testStringification(): void
59+
{
60+
$idrefs = IDRefsValue::fromString("foo \nbar baz");
61+
$this->assertEquals('foo bar baz', strval($idrefs));
62+
}
63+
64+
5465
/**
5566
* @return array<string, array{0: true, 1: string}>
5667
*/

tests/XMLSchema/Type/NMTokensValueTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ public function testToArray(): void
5151
}
5252

5353

54+
/**
55+
* Test stringification of the value
56+
*/
57+
#[DependsOnClass(NMTokensTest::class)]
58+
public function testStringification(): void
59+
{
60+
$nmtokens = NMTokensValue::fromString("foo \nbar baz");
61+
$this->assertEquals('foo bar baz', strval($nmtokens));
62+
}
63+
64+
5465
/**
5566
* @return array<string, array{0: true, 1: string}>
5667
*/

0 commit comments

Comments
 (0)