diff options
author | ArthurHoaro <arthur@hoa.ro> | 2021-02-04 10:57:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-04 10:57:12 +0100 |
commit | 11edc143b42a7be09c0c9dc02730c83e8cbb73c2 (patch) | |
tree | 55d6d35896c600066981f4cf3f49d6563ffda7d0 /tests/formatter/BookmarkDefaultFormatterTest.php | |
parent | 83b4eb17958c0c03bea637db7e394f6d622aeb00 (diff) | |
parent | a1cd7a3b2ff32bf6a0f6083007f59104a85eb4bf (diff) | |
download | Shaarli-11edc143b42a7be09c0c9dc02730c83e8cbb73c2.tar.gz Shaarli-11edc143b42a7be09c0c9dc02730c83e8cbb73c2.tar.zst Shaarli-11edc143b42a7be09c0c9dc02730c83e8cbb73c2.zip |
Merge pull request #1696 from ArthurHoaro/fix/search-highlight-url
Diffstat (limited to 'tests/formatter/BookmarkDefaultFormatterTest.php')
-rw-r--r-- | tests/formatter/BookmarkDefaultFormatterTest.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/formatter/BookmarkDefaultFormatterTest.php b/tests/formatter/BookmarkDefaultFormatterTest.php index 4fcc5dd1..983960b6 100644 --- a/tests/formatter/BookmarkDefaultFormatterTest.php +++ b/tests/formatter/BookmarkDefaultFormatterTest.php | |||
@@ -211,13 +211,17 @@ class BookmarkDefaultFormatterTest extends TestCase | |||
211 | $this->formatter = new BookmarkDefaultFormatter($this->conf, false); | 211 | $this->formatter = new BookmarkDefaultFormatter($this->conf, false); |
212 | 212 | ||
213 | $bookmark = new Bookmark(); | 213 | $bookmark = new Bookmark(); |
214 | $bookmark->setDescription('This guide extends and expands on PSR-1, the basic coding standard.'); | 214 | $bookmark->setDescription( |
215 | 'This guide extends and expands on PSR-1, the basic coding standard.' . PHP_EOL . | ||
216 | 'https://www.php-fig.org/psr/psr-1/' | ||
217 | ); | ||
215 | $bookmark->addAdditionalContentEntry( | 218 | $bookmark->addAdditionalContentEntry( |
216 | 'search_highlight', | 219 | 'search_highlight', |
217 | ['description' => [ | 220 | ['description' => [ |
218 | ['start' => 0, 'end' => 10], // "This guide" | 221 | ['start' => 0, 'end' => 10], // "This guide" |
219 | ['start' => 45, 'end' => 50], // basic | 222 | ['start' => 45, 'end' => 50], // basic |
220 | ['start' => 58, 'end' => 67], // standard. | 223 | ['start' => 58, 'end' => 67], // standard. |
224 | ['start' => 84, 'end' => 87], // fig | ||
221 | ]] | 225 | ]] |
222 | ); | 226 | ); |
223 | 227 | ||
@@ -226,7 +230,10 @@ class BookmarkDefaultFormatterTest extends TestCase | |||
226 | $this->assertSame( | 230 | $this->assertSame( |
227 | '<span class="search-highlight">This guide</span> extends and expands on PSR-1, the ' . | 231 | '<span class="search-highlight">This guide</span> extends and expands on PSR-1, the ' . |
228 | '<span class="search-highlight">basic</span> coding ' . | 232 | '<span class="search-highlight">basic</span> coding ' . |
229 | '<span class="search-highlight">standard.</span>', | 233 | '<span class="search-highlight">standard.</span><br />' . PHP_EOL . |
234 | '<a href="https://www.php-fig.org/psr/psr-1/">' . | ||
235 | 'https://www.php-<span class="search-highlight">fig</span>.org/psr/psr-1/' . | ||
236 | '</a>', | ||
230 | $link['description'] | 237 | $link['description'] |
231 | ); | 238 | ); |
232 | } | 239 | } |