We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| @@ 209-225 (lines=17) @@ | ||
| 206 | * @uses PHP_Typography\Text_Parser |
|
| 207 | * @uses PHP_Typography\Text_Parser\Token |
|
| 208 | */ |
|
| 209 | public function test_set_classes_to_ignore() { |
|
| 210 | $s = $this->s; |
|
| 211 | ||
| 212 | $s->set_classes_to_ignore( 'foo bar' ); |
|
| 213 | ||
| 214 | $this->assertContains( 'foo', $s['ignoreClasses'] ); |
|
| 215 | $this->assertContains( 'bar', $s['ignoreClasses'] ); |
|
| 216 | ||
| 217 | $html = '<p><span class="foo">Ignore this "quote",</span><span class="other"> but not "this" one.</span></p> |
|
| 218 | <p class="bar">"This" should also be ignored. <span>And "this".</span></p> |
|
| 219 | <p><span>"But" not this.</span></p>'; |
|
| 220 | $expected = '<p><span class="foo">Ignore this "quote",</span><span class="other"> but not “this” one.</span></p> |
|
| 221 | <p class="bar">"This" should also be ignored. <span>And "this".</span></p> |
|
| 222 | <p><span>“But” not this.</span></p>'; |
|
| 223 | $s->set_smart_quotes( true ); |
|
| 224 | $this->assertSame( $expected, $this->clean_html( $this->typo->process( $html, $s ) ) ); |
|
| 225 | } |
|
| 226 | ||
| 227 | /** |
|
| 228 | * Test set_ids_to_ignore. |
|
| @@ 235-251 (lines=17) @@ | ||
| 232 | * @uses PHP_Typography\Text_Parser |
|
| 233 | * @uses PHP_Typography\Text_Parser\Token |
|
| 234 | */ |
|
| 235 | public function test_set_ids_to_ignore() { |
|
| 236 | $s = $this->s; |
|
| 237 | ||
| 238 | $s->set_ids_to_ignore( 'foobar barfoo' ); |
|
| 239 | ||
| 240 | $this->assertContains( 'foobar', $s['ignoreIDs'] ); |
|
| 241 | $this->assertContains( 'barfoo', $s['ignoreIDs'] ); |
|
| 242 | ||
| 243 | $html = '<p><span id="foobar">Ignore this "quote",</span><span class="other"> but not "this" one.</span></p> |
|
| 244 | <p id="barfoo">"This" should also be ignored. <span>And "this".</span></p> |
|
| 245 | <p><span>"But" not this.</span></p>'; |
|
| 246 | $expected = '<p><span id="foobar">Ignore this "quote",</span><span class="other"> but not “this” one.</span></p> |
|
| 247 | <p id="barfoo">"This" should also be ignored. <span>And "this".</span></p> |
|
| 248 | <p><span>“But” not this.</span></p>'; |
|
| 249 | $s->set_smart_quotes( true ); |
|
| 250 | $this->assertSame( $expected, $this->clean_html( $this->typo->process( $html, $s ) ) ); |
|
| 251 | } |
|
| 252 | ||
| 253 | /** |
|
| 254 | * Integrate all three "ignore" variants. |
|