@@ 27-39 (lines=13) @@ | ||
24 | { |
|
25 | use SlackMessageTrait; |
|
26 | ||
27 | public function testInlineMultilines() |
|
28 | { |
|
29 | $lines = []; |
|
30 | for ($i = rand(parent::ARRAY_MIN_ITEMS, parent::ARRAY_MAX_ITEMS); $i <= parent::ARRAY_MAX_ITEMS; ++$i) { |
|
31 | $randomString = $this->randomString(); |
|
32 | $lines[] = $randomString; |
|
33 | } |
|
34 | ||
35 | $expect = implode("\n", $lines); |
|
36 | $actual = $this->inlineMultilines($lines); |
|
37 | ||
38 | $this->assertEquals($expect, $actual); |
|
39 | } |
|
40 | ||
41 | public function testFormatBold() |
|
42 | { |
|
@@ 102-119 (lines=18) @@ | ||
99 | $this->assertEquals($expect, $actual); |
|
100 | } |
|
101 | ||
102 | public function testFormatCode() |
|
103 | { |
|
104 | $lines = []; |
|
105 | for ($i = rand(parent::ARRAY_MIN_ITEMS, parent::ARRAY_MAX_ITEMS); $i <= parent::ARRAY_MAX_ITEMS; ++$i) { |
|
106 | $randomString = $this->randomString(); |
|
107 | $lines[] = $randomString; |
|
108 | } |
|
109 | ||
110 | $expect = sprintf( |
|
111 | "%s%s%s", |
|
112 | "\n```", |
|
113 | $this->inlineMultilines($lines), |
|
114 | "```\n" |
|
115 | ); |
|
116 | $actual = $this->formatCode($lines); |
|
117 | ||
118 | $this->assertEquals($expect, $actual); |
|
119 | } |
|
120 | ||
121 | public function testNewLine() |
|
122 | { |