| @@ 66-77 (lines=12) @@ | ||
| 63 | /** |
|
| 64 | * @see https://github.com/silverstripe/silverstripe-blog/issues/376 |
|
| 65 | */ |
|
| 66 | public function testAllowMultibyteUrlSegment() |
|
| 67 | { |
|
| 68 | $blog = $this->objFromFixture('Blog', 'FirstBlog'); |
|
| 69 | $cat = new BlogCategory(); |
|
| 70 | $cat->BlogID = $blog->ID; |
|
| 71 | $cat->Title = 'تست'; |
|
| 72 | $cat->write(); |
|
| 73 | // urlencoded |
|
| 74 | $this->assertEquals('%D8%AA%D8%B3%D8%AA', $cat->URLSegment); |
|
| 75 | $link = Controller::join_links($cat->Blog()->Link(), 'category', '%D8%AA%D8%B3%D8%AA'); |
|
| 76 | $this->assertEquals($link, $cat->getLink()); |
|
| 77 | } |
|
| 78 | ||
| 79 | public function testCanView() |
|
| 80 | { |
|
| @@ 66-77 (lines=12) @@ | ||
| 63 | /** |
|
| 64 | * @see https://github.com/silverstripe/silverstripe-blog/issues/376 |
|
| 65 | */ |
|
| 66 | public function testAllowMultibyteUrlSegment() |
|
| 67 | { |
|
| 68 | $blog = $this->objFromFixture('Blog', 'FirstBlog'); |
|
| 69 | $tag = new BlogTag(); |
|
| 70 | $tag->BlogID = $blog->ID; |
|
| 71 | $tag->Title = 'تست'; |
|
| 72 | $tag->write(); |
|
| 73 | // urlencoded |
|
| 74 | $this->assertEquals('%D8%AA%D8%B3%D8%AA', $tag->URLSegment); |
|
| 75 | $link = Controller::join_links($tag->Blog()->Link(), 'tag', '%D8%AA%D8%B3%D8%AA'); |
|
| 76 | $this->assertEquals($link, $tag->getLink()); |
|
| 77 | } |
|
| 78 | ||
| 79 | /** |
|
| 80 | * The first blog can be viewed by anybody. |
|