1
0
mirror of https://github.com/Intervention/image.git synced 2025-09-09 05:30:40 +02:00

Implement text wrapping

This commit is contained in:
Oliver Vogel
2024-02-03 14:51:17 +01:00
parent ac7389fa96
commit 684f5e6eb6
9 changed files with 161 additions and 9 deletions

View File

@@ -18,8 +18,8 @@ class LineTest extends TestCase
public function testToString(): void
{
$line = new Line('foo');
$this->assertEquals('foo', (string) $line);
$line = new Line('foo bar');
$this->assertEquals('foo bar', (string) $line);
}
public function testSetGetPosition(): void
@@ -35,10 +35,27 @@ class LineTest extends TestCase
public function testCount(): void
{
$line = new Line();
$this->assertEquals(0, $line->count());
$line = new Line("foo");
$this->assertEquals(1, $line->count());
$line = new Line("foo bar");
$this->assertEquals(2, $line->count());
}
public function testAdd(): void
{
$line = new Line();
$this->assertEquals(0, $line->count());
$result = $line->add('foo');
$this->assertEquals(1, $line->count());
$this->assertEquals(1, $result->count());
$result = $line->add('bar');
$this->assertEquals(2, $line->count());
$this->assertEquals(2, $result->count());
}
}