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:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user