Skip to content

Commit 1d6f0bf

Browse files
committed
another test
1 parent 6eea24a commit 1d6f0bf

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

tests/TableFormatterTest.php

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,33 @@ public function test_length()
109109
$this->assertEquals($expect, trim($result));
110110
}
111111

112-
public function test_colorlength(){
112+
public function test_colorlength()
113+
{
113114
$color = new Colors();
114115

115-
$text = 'this is '.$color->wrap('green', Colors::C_GREEN);
116+
$text = 'this is ' . $color->wrap('green', Colors::C_GREEN);
116117
$expect = "$text |test";
117118

118119
$tf = new TableFormatter();
119120
$tf->setBorder('|');
120121
$result = $tf->format([20, '*'], [$text, 'test']);
121122

122123
$this->assertEquals($expect, trim($result));
123-
}
124+
}
125+
126+
public function test_onewrap()
127+
{
128+
$col1 = "test\nwrap";
129+
$col2 = "test";
130+
131+
$expect = "test |test \n" .
132+
"wrap | \n";
133+
134+
$tf = new TableFormatter();
135+
$tf->setMaxWidth(11);
136+
$tf->setBorder('|');
137+
138+
$result = $tf->format([5, '*'], [$col1, $col2]);
139+
$this->assertEquals($expect, $result);
140+
}
124141
}

0 commit comments

Comments
 (0)