@@ -2055,6 +2055,17 @@ public function testAppendStringy()
20552055 static::assertSame('abczzz123öäüdef', $result->toString());
20562056 }
20572057
2058+ public function testAppendStringyConcatenatesEveryArgument()
2059+ {
2060+ $result = S::create('abc')->appendStringy(
2061+ S::create('123'),
2062+ S::create('öäü'),
2063+ S::create('def')
2064+ );
2065+
2066+ static::assertSame('abc123öäüdef', $result->toString());
2067+ }
2068+
20582069 /**
20592070 * @dataProvider atProvider()
20602071 *
@@ -3897,6 +3908,18 @@ public function testWords()
38973908 }
38983909 }
38993910
3911+ public function testWordsKeepsEmptyValuesByDefault()
3912+ {
3913+ $words = S::create('foo oo oöäü#s')->words();
3914+ $result = [];
3915+
3916+ foreach ($words as $word) {
3917+ $result[] = $word->toString();
3918+ }
3919+
3920+ static::assertSame(['', 'foo', ' ', 'oo', ' ', 'oöäü', '#', 's', ''], $result);
3921+ }
3922+
39003923 /**
39013924 * @dataProvider splitProvider()
39023925 *
@@ -5493,6 +5516,20 @@ public function testItPreservesEncodingChunk()
54935516 }
54945517 }
54955518
5519+ public function testChunkUsesSingleCharacterLengthByDefault()
5520+ {
5521+ $chunks = S::create('foo')->chunk();
5522+
5523+ static::assertSame(['f', 'o', 'o'], \array_map('strval', $chunks));
5524+ }
5525+
5526+ public function testChunkCollectionUsesSingleCharacterLengthByDefault()
5527+ {
5528+ $chunks = S::create('foo')->chunkCollection();
5529+
5530+ static::assertSame(['f', 'o', 'o'], \array_map('strval', $chunks->toArray()));
5531+ }
5532+
54965533 public function testItCanBeExploded()
54975534 {
54985535 $string = new \Stringy\Stringy('john pinkerton');
0 commit comments