From f5c2537c03dfe4191715369b39f8dae8f79a1fa7 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 11 May 2017 12:29:44 +1200 Subject: [PATCH] MINOR: Add test to for blog tag urlsegment generation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This behaviour confused me so adding a test to clarify that it’s intentional. --- tests/BlogTagTest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/BlogTagTest.php b/tests/BlogTagTest.php index 2a6f35f..3ab1194 100755 --- a/tests/BlogTagTest.php +++ b/tests/BlogTagTest.php @@ -203,4 +203,17 @@ class BlogTagTest extends FunctionalTest $this->assertEquals(BlogTag::DUPLICATE_EXCEPTION, $messages[0]['messageType']); } } + + public function testBlogTagUrlSegmentsAreAutomaticallyUpdated() + { + $tag = new BlogTag; + $tag->Title = "a test"; + $tag->write(); + $this->assertEquals($tag->URLSegment, "a-test"); + + $tag->Title = "another test"; + $tag->write(); + $this->assertEquals($tag->URLSegment, "another-test"); + } + }