mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
Merge pull request #438 from sminnee/drop-php55
FIX: updated test suite to cover supported versions
This commit is contained in:
commit
30cac31a78
15
.travis.yml
15
.travis.yml
@ -20,20 +20,11 @@ env:
|
|||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- php: 7.1
|
- php: 5.6
|
||||||
env: DB=MYSQL CORE_RELEASE=4 COVERAGE=1
|
env: DB=MYSQL CORE_RELEASE=4 COVERAGE=1
|
||||||
|
|
||||||
- php: 5.5
|
|
||||||
env: DB=MYSQL CORE_RELEASE=4
|
|
||||||
|
|
||||||
- php: 5.6
|
|
||||||
env: DB=MYSQL CORE_RELEASE=4
|
|
||||||
- php: 5.6
|
|
||||||
env: DB=PGSQL CORE_RELEASE=4
|
|
||||||
- php: 5.6
|
|
||||||
env: DB=SQLITE CORE_RELEASE=4
|
|
||||||
|
|
||||||
- php: 7.0
|
- php: 7.0
|
||||||
|
env: DB=PGSQL CORE_RELEASE=4
|
||||||
|
- php: 7.1.2
|
||||||
env: DB=MYSQL CORE_RELEASE=4
|
env: DB=MYSQL CORE_RELEASE=4
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
|
@ -54,12 +54,12 @@ class BlogCategoryTest extends FunctionalTest
|
|||||||
$member->logout();
|
$member->logout();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->objFromFixture(BlogPost::class, 'FirstBlogPost');
|
$this->objFromFixture('SiteTree', 'FirstBlogPost');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var BlogCategory $category
|
* @var BlogCategory $category
|
||||||
*/
|
*/
|
||||||
$category = $this->objFromFixture(BlogCategory::class, 'FirstCategory');
|
$category = $this->objFromFixture('BlogCategory', 'FirstCategory');
|
||||||
|
|
||||||
$this->assertEquals(5, $category->BlogPosts()->count(), 'Category blog post count');
|
$this->assertEquals(5, $category->BlogPosts()->count(), 'Category blog post count');
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ class BlogCategoryTest extends FunctionalTest
|
|||||||
*/
|
*/
|
||||||
public function testAllowMultibyteUrlSegment()
|
public function testAllowMultibyteUrlSegment()
|
||||||
{
|
{
|
||||||
$blog = $this->objFromFixture(Blog::class, 'FirstBlog');
|
$blog = $this->objFromFixture('SiteTree', 'FirstBlog');
|
||||||
$cat = new BlogCategory();
|
$cat = new BlogCategory();
|
||||||
$cat->BlogID = $blog->ID;
|
$cat->BlogID = $blog->ID;
|
||||||
$cat->Title = 'تست';
|
$cat->Title = 'تست';
|
||||||
@ -84,10 +84,10 @@ class BlogCategoryTest extends FunctionalTest
|
|||||||
{
|
{
|
||||||
$this->useDraftSite();
|
$this->useDraftSite();
|
||||||
|
|
||||||
$this->objFromFixture(Member::class, 'Admin');
|
$this->objFromFixture('Member', 'Admin');
|
||||||
|
|
||||||
$editor = $this->objFromFixture(Member::class, 'Editor');
|
$editor = $this->objFromFixture('Member', 'Editor');
|
||||||
$category = $this->objFromFixture(BlogCategory::class, 'SecondCategory');
|
$category = $this->objFromFixture('BlogCategory', 'SecondCategory');
|
||||||
|
|
||||||
$this->assertFalse($category->canView($editor), 'Editor should not be able to view category.');
|
$this->assertFalse($category->canView($editor), 'Editor should not be able to view category.');
|
||||||
}
|
}
|
||||||
@ -99,20 +99,20 @@ class BlogCategoryTest extends FunctionalTest
|
|||||||
{
|
{
|
||||||
$this->useDraftSite();
|
$this->useDraftSite();
|
||||||
|
|
||||||
$admin = $this->objFromFixture(Member::class, 'Admin');
|
$admin = $this->objFromFixture('Member', 'Admin');
|
||||||
$editor = $this->objFromFixture(Member::class, 'Editor');
|
$editor = $this->objFromFixture('Member', 'Editor');
|
||||||
|
|
||||||
$category = $this->objFromFixture(BlogCategory::class, 'FirstCategory');
|
$category = $this->objFromFixture('BlogCategory', 'FirstCategory');
|
||||||
|
|
||||||
$this->assertTrue($category->canEdit($admin), 'Admin should be able to edit category.');
|
$this->assertTrue($category->canEdit($admin), 'Admin should be able to edit category.');
|
||||||
$this->assertTrue($category->canEdit($editor), 'Editor should be able to edit category.');
|
$this->assertTrue($category->canEdit($editor), 'Editor should be able to edit category.');
|
||||||
|
|
||||||
$category = $this->objFromFixture(BlogCategory::class, 'SecondCategory');
|
$category = $this->objFromFixture('BlogCategory', 'SecondCategory');
|
||||||
|
|
||||||
$this->assertTrue($category->canEdit($admin), 'Admin should be able to edit category.');
|
$this->assertTrue($category->canEdit($admin), 'Admin should be able to edit category.');
|
||||||
$this->assertFalse($category->canEdit($editor), 'Editor should not be able to edit category.');
|
$this->assertFalse($category->canEdit($editor), 'Editor should not be able to edit category.');
|
||||||
|
|
||||||
$category = $this->objFromFixture(BlogCategory::class, 'ThirdCategory');
|
$category = $this->objFromFixture('BlogCategory', 'ThirdCategory');
|
||||||
|
|
||||||
$this->assertTrue($category->canEdit($admin), 'Admin should always be able to edit category.');
|
$this->assertTrue($category->canEdit($admin), 'Admin should always be able to edit category.');
|
||||||
$this->assertTrue($category->canEdit($editor), 'Editor should be able to edit category.');
|
$this->assertTrue($category->canEdit($editor), 'Editor should be able to edit category.');
|
||||||
@ -122,8 +122,8 @@ class BlogCategoryTest extends FunctionalTest
|
|||||||
{
|
{
|
||||||
$this->useDraftSite();
|
$this->useDraftSite();
|
||||||
|
|
||||||
$admin = $this->objFromFixture(Member::class, 'Admin');
|
$admin = $this->objFromFixture('Member', 'Admin');
|
||||||
$editor = $this->objFromFixture(Member::class, 'Editor');
|
$editor = $this->objFromFixture('Member', 'Editor');
|
||||||
|
|
||||||
$category = singleton(BlogCategory::class);
|
$category = singleton(BlogCategory::class);
|
||||||
|
|
||||||
@ -135,19 +135,19 @@ class BlogCategoryTest extends FunctionalTest
|
|||||||
{
|
{
|
||||||
$this->useDraftSite();
|
$this->useDraftSite();
|
||||||
|
|
||||||
$admin = $this->objFromFixture(Member::class, 'Admin');
|
$admin = $this->objFromFixture('Member', 'Admin');
|
||||||
$editor = $this->objFromFixture(Member::class, 'Editor');
|
$editor = $this->objFromFixture('Member', 'Editor');
|
||||||
|
|
||||||
$category = $this->objFromFixture(BlogCategory::class, 'FirstCategory');
|
$category = $this->objFromFixture('BlogCategory', 'FirstCategory');
|
||||||
|
|
||||||
$this->assertTrue($category->canDelete($admin), 'Admin should be able to delete category.');
|
$this->assertTrue($category->canDelete($admin), 'Admin should be able to delete category.');
|
||||||
$this->assertTrue($category->canDelete($editor), 'Editor should be able to category category.');
|
$this->assertTrue($category->canDelete($editor), 'Editor should be able to category category.');
|
||||||
|
|
||||||
$category = $this->objFromFixture(BlogCategory::class, 'SecondCategory');
|
$category = $this->objFromFixture('BlogCategory', 'SecondCategory');
|
||||||
$this->assertTrue($category->canDelete($admin), 'Admin should be able to delete category.');
|
$this->assertTrue($category->canDelete($admin), 'Admin should be able to delete category.');
|
||||||
$this->assertFalse($category->canDelete($editor), 'Editor should not be able to delete category.');
|
$this->assertFalse($category->canDelete($editor), 'Editor should not be able to delete category.');
|
||||||
|
|
||||||
$category = $this->objFromFixture(BlogCategory::class, 'ThirdCategory');
|
$category = $this->objFromFixture('BlogCategory', 'ThirdCategory');
|
||||||
$this->assertTrue($category->canDelete($admin), 'Admin should always be able to delete category.');
|
$this->assertTrue($category->canDelete($admin), 'Admin should always be able to delete category.');
|
||||||
$this->assertTrue($category->canDelete($editor), 'Editor should be able to delete category.');
|
$this->assertTrue($category->canDelete($editor), 'Editor should be able to delete category.');
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ class BlogPostFilterTest extends SapphireTest
|
|||||||
/**
|
/**
|
||||||
* @var Blog $blog
|
* @var Blog $blog
|
||||||
*/
|
*/
|
||||||
$blog = $this->objFromFixture(Blog::class, 'FirstBlog');
|
$blog = $this->objFromFixture('SiteTree', 'FirstBlog');
|
||||||
|
|
||||||
$this->assertEquals(3, $blog->AllChildren()->Count(), 'Filtered blog posts');
|
$this->assertEquals(3, $blog->AllChildren()->Count(), 'Filtered blog posts');
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ class BlogPostNotificationsTest extends SapphireTest
|
|||||||
$this->markTestSkipped('Comments Notification module is not installed');
|
$this->markTestSkipped('Comments Notification module is not installed');
|
||||||
}
|
}
|
||||||
|
|
||||||
$blogPost = $this->objFromFixture(BlogPost::class, 'PostC');
|
$blogPost = $this->objFromFixture('SiteTree', 'PostC');
|
||||||
$comment = new \SilverStripe\Comments\Model\Comment();
|
$comment = new \SilverStripe\Comments\Model\Comment();
|
||||||
$comment->Comment = 'This is a comment';
|
$comment->Comment = 'This is a comment';
|
||||||
$comment->write();
|
$comment->write();
|
||||||
@ -44,7 +44,7 @@ class BlogPostNotificationsTest extends SapphireTest
|
|||||||
if (!class_exists('CommentNotifier')) {
|
if (!class_exists('CommentNotifier')) {
|
||||||
$this->markTestSkipped('Comments Notification module is not installed');
|
$this->markTestSkipped('Comments Notification module is not installed');
|
||||||
}
|
}
|
||||||
$blogPost = $this->objFromFixture(BlogPost::class, 'PostC');
|
$blogPost = $this->objFromFixture('SiteTree', 'PostC');
|
||||||
$comment = new SilverStripe\Comments\Model\Comment();
|
$comment = new SilverStripe\Comments\Model\Comment();
|
||||||
$comment->Comment = 'This is a comment';
|
$comment->Comment = 'This is a comment';
|
||||||
$comment->write();
|
$comment->write();
|
||||||
|
@ -30,8 +30,8 @@ class BlogPostTest extends SapphireTest
|
|||||||
*/
|
*/
|
||||||
public function testCanView($date, $user, $page, $canView)
|
public function testCanView($date, $user, $page, $canView)
|
||||||
{
|
{
|
||||||
$userRecord = $this->objFromFixture(Member::class, $user);
|
$userRecord = $this->objFromFixture('Member', $user);
|
||||||
$pageRecord = $this->objFromFixture(BlogPost::class, $page);
|
$pageRecord = $this->objFromFixture('SiteTree', $page);
|
||||||
DBDatetime::set_mock_now($date);
|
DBDatetime::set_mock_now($date);
|
||||||
$this->assertEquals($canView, $pageRecord->canView($userRecord));
|
$this->assertEquals($canView, $pageRecord->canView($userRecord));
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ class BlogPostTest extends SapphireTest
|
|||||||
|
|
||||||
public function testCandidateAuthors()
|
public function testCandidateAuthors()
|
||||||
{
|
{
|
||||||
$blogpost = $this->objFromFixture(BlogPost::class, 'PostC');
|
$blogpost = $this->objFromFixture('SiteTree', 'PostC');
|
||||||
|
|
||||||
$this->assertEquals(7, $blogpost->getCandidateAuthors()->count());
|
$this->assertEquals(7, $blogpost->getCandidateAuthors()->count());
|
||||||
|
|
||||||
@ -90,12 +90,12 @@ class BlogPostTest extends SapphireTest
|
|||||||
|
|
||||||
public function testCanViewFuturePost()
|
public function testCanViewFuturePost()
|
||||||
{
|
{
|
||||||
$blogPost = $this->objFromFixture(BlogPost::class, 'NullPublishDate');
|
$blogPost = $this->objFromFixture('SiteTree', 'NullPublishDate');
|
||||||
|
|
||||||
$editor = $this->objFromFixture(Member::class, 'BlogEditor');
|
$editor = $this->objFromFixture('Member', 'BlogEditor');
|
||||||
$this->assertTrue($blogPost->canView($editor));
|
$this->assertTrue($blogPost->canView($editor));
|
||||||
|
|
||||||
$visitor = $this->objFromFixture(Member::class, 'Visitor');
|
$visitor = $this->objFromFixture('Member', 'Visitor');
|
||||||
$this->assertFalse($blogPost->canView($visitor));
|
$this->assertFalse($blogPost->canView($visitor));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,10 +105,10 @@ class BlogPostTest extends SapphireTest
|
|||||||
*/
|
*/
|
||||||
public function testGetDate()
|
public function testGetDate()
|
||||||
{
|
{
|
||||||
$blogPost = $this->objFromFixture(BlogPost::class, 'NullPublishDate');
|
$blogPost = $this->objFromFixture('SiteTree', 'NullPublishDate');
|
||||||
$this->assertNull($blogPost->getDate());
|
$this->assertNull($blogPost->getDate());
|
||||||
|
|
||||||
$blogPost = $this->objFromFixture(BlogPost::class, 'PostA');
|
$blogPost = $this->objFromFixture('SiteTree', 'PostA');
|
||||||
$this->assertEquals('2012-01-09 15:00:00', $blogPost->getDate());
|
$this->assertEquals('2012-01-09 15:00:00', $blogPost->getDate());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,12 +54,12 @@ class BlogTagTest extends FunctionalTest
|
|||||||
$member->logout();
|
$member->logout();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->objFromFixture(BlogPost::class, 'FirstBlogPost');
|
$this->objFromFixture('SiteTree', 'FirstBlogPost');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var BlogTag $tag
|
* @var BlogTag $tag
|
||||||
*/
|
*/
|
||||||
$tag = $this->objFromFixture(BlogTag::class, 'FirstTag');
|
$tag = $this->objFromFixture('BlogTag', 'FirstTag');
|
||||||
|
|
||||||
$this->assertEquals(1, $tag->BlogPosts()->count(), 'Tag blog post count');
|
$this->assertEquals(1, $tag->BlogPosts()->count(), 'Tag blog post count');
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ class BlogTagTest extends FunctionalTest
|
|||||||
*/
|
*/
|
||||||
public function testAllowMultibyteUrlSegment()
|
public function testAllowMultibyteUrlSegment()
|
||||||
{
|
{
|
||||||
$blog = $this->objFromFixture(Blog::class, 'FirstBlog');
|
$blog = $this->objFromFixture('SiteTree', 'FirstBlog');
|
||||||
$tag = new BlogTag();
|
$tag = new BlogTag();
|
||||||
$tag->BlogID = $blog->ID;
|
$tag->BlogID = $blog->ID;
|
||||||
$tag->Title = 'تست';
|
$tag->Title = 'تست';
|
||||||
@ -87,15 +87,15 @@ class BlogTagTest extends FunctionalTest
|
|||||||
{
|
{
|
||||||
$this->useDraftSite();
|
$this->useDraftSite();
|
||||||
|
|
||||||
$admin = $this->objFromFixture(Member::class, 'Admin');
|
$admin = $this->objFromFixture('Member', 'Admin');
|
||||||
$editor = $this->objFromFixture(Member::class, 'Editor');
|
$editor = $this->objFromFixture('Member', 'Editor');
|
||||||
|
|
||||||
$tag = $this->objFromFixture(BlogTag::class, 'FirstTag');
|
$tag = $this->objFromFixture('BlogTag', 'FirstTag');
|
||||||
|
|
||||||
$this->assertTrue($tag->canView($admin), 'Admin should be able to view tag.');
|
$this->assertTrue($tag->canView($admin), 'Admin should be able to view tag.');
|
||||||
$this->assertTrue($tag->canView($editor), 'Editor should be able to view tag.');
|
$this->assertTrue($tag->canView($editor), 'Editor should be able to view tag.');
|
||||||
|
|
||||||
$tag = $this->objFromFixture(BlogTag::class, 'SecondTag');
|
$tag = $this->objFromFixture('BlogTag', 'SecondTag');
|
||||||
|
|
||||||
$this->assertTrue($tag->canView($admin), 'Admin should be able to view tag.');
|
$this->assertTrue($tag->canView($admin), 'Admin should be able to view tag.');
|
||||||
$this->assertFalse($tag->canView($editor), 'Editor should not be able to view tag.');
|
$this->assertFalse($tag->canView($editor), 'Editor should not be able to view tag.');
|
||||||
@ -105,20 +105,20 @@ class BlogTagTest extends FunctionalTest
|
|||||||
{
|
{
|
||||||
$this->useDraftSite();
|
$this->useDraftSite();
|
||||||
|
|
||||||
$admin = $this->objFromFixture(Member::class, 'Admin');
|
$admin = $this->objFromFixture('Member', 'Admin');
|
||||||
$editor = $this->objFromFixture(Member::class, 'Editor');
|
$editor = $this->objFromFixture('Member', 'Editor');
|
||||||
|
|
||||||
$tag = $this->objFromFixture(BlogTag::class, 'FirstTag');
|
$tag = $this->objFromFixture('BlogTag', 'FirstTag');
|
||||||
|
|
||||||
$this->assertTrue($tag->canEdit($admin), 'Admin should be able to edit tag.');
|
$this->assertTrue($tag->canEdit($admin), 'Admin should be able to edit tag.');
|
||||||
$this->assertTrue($tag->canEdit($editor), 'Editor should be able to edit tag.');
|
$this->assertTrue($tag->canEdit($editor), 'Editor should be able to edit tag.');
|
||||||
|
|
||||||
$tag = $this->objFromFixture(BlogTag::class, 'SecondTag');
|
$tag = $this->objFromFixture('BlogTag', 'SecondTag');
|
||||||
|
|
||||||
$this->assertTrue($tag->canEdit($admin), 'Admin should be able to edit tag.');
|
$this->assertTrue($tag->canEdit($admin), 'Admin should be able to edit tag.');
|
||||||
$this->assertFalse($tag->canEdit($editor), 'Editor should not be able to edit tag.');
|
$this->assertFalse($tag->canEdit($editor), 'Editor should not be able to edit tag.');
|
||||||
|
|
||||||
$tag = $this->objFromFixture(BlogTag::class, 'ThirdTag');
|
$tag = $this->objFromFixture('BlogTag', 'ThirdTag');
|
||||||
|
|
||||||
$this->assertTrue($tag->canEdit($admin), 'Admin should always be able to edit tags.');
|
$this->assertTrue($tag->canEdit($admin), 'Admin should always be able to edit tags.');
|
||||||
$this->assertTrue($tag->canEdit($editor), 'Editor should be able to edit tag.');
|
$this->assertTrue($tag->canEdit($editor), 'Editor should be able to edit tag.');
|
||||||
@ -128,8 +128,8 @@ class BlogTagTest extends FunctionalTest
|
|||||||
{
|
{
|
||||||
$this->useDraftSite();
|
$this->useDraftSite();
|
||||||
|
|
||||||
$admin = $this->objFromFixture(Member::class, 'Admin');
|
$admin = $this->objFromFixture('Member', 'Admin');
|
||||||
$editor = $this->objFromFixture(Member::class, 'Editor');
|
$editor = $this->objFromFixture('Member', 'Editor');
|
||||||
|
|
||||||
$tag = singleton(BlogTag::class);
|
$tag = singleton(BlogTag::class);
|
||||||
|
|
||||||
@ -141,20 +141,20 @@ class BlogTagTest extends FunctionalTest
|
|||||||
{
|
{
|
||||||
$this->useDraftSite();
|
$this->useDraftSite();
|
||||||
|
|
||||||
$admin = $this->objFromFixture(Member::class, 'Admin');
|
$admin = $this->objFromFixture('Member', 'Admin');
|
||||||
$editor = $this->objFromFixture(Member::class, 'Editor');
|
$editor = $this->objFromFixture('Member', 'Editor');
|
||||||
|
|
||||||
$tag = $this->objFromFixture(BlogTag::class, 'FirstTag');
|
$tag = $this->objFromFixture('BlogTag', 'FirstTag');
|
||||||
|
|
||||||
$this->assertTrue($tag->canDelete($admin), 'Admin should be able to delete tag.');
|
$this->assertTrue($tag->canDelete($admin), 'Admin should be able to delete tag.');
|
||||||
$this->assertTrue($tag->canDelete($editor), 'Editor should be able to delete tag.');
|
$this->assertTrue($tag->canDelete($editor), 'Editor should be able to delete tag.');
|
||||||
|
|
||||||
$tag = $this->objFromFixture(BlogTag::class, 'SecondTag');
|
$tag = $this->objFromFixture('BlogTag', 'SecondTag');
|
||||||
|
|
||||||
$this->assertTrue($tag->canDelete($admin), 'Admin should be able to delete tag.');
|
$this->assertTrue($tag->canDelete($admin), 'Admin should be able to delete tag.');
|
||||||
$this->assertFalse($tag->canDelete($editor), 'Editor should not be able to delete tag.');
|
$this->assertFalse($tag->canDelete($editor), 'Editor should not be able to delete tag.');
|
||||||
|
|
||||||
$tag = $this->objFromFixture(BlogTag::class, 'ThirdTag');
|
$tag = $this->objFromFixture('BlogTag', 'ThirdTag');
|
||||||
|
|
||||||
$this->assertTrue($tag->canDelete($admin), 'Admin should always be able to delete tags.');
|
$this->assertTrue($tag->canDelete($admin), 'Admin should always be able to delete tags.');
|
||||||
$this->assertTrue($tag->canDelete($editor), 'Editor should be able to delete tag.');
|
$this->assertTrue($tag->canDelete($editor), 'Editor should be able to delete tag.');
|
||||||
@ -203,4 +203,17 @@ class BlogTagTest extends FunctionalTest
|
|||||||
$this->assertEquals(BlogTag::DUPLICATE_EXCEPTION, $messages[0]['messageType']);
|
$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");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ class BlogTagsCloudWidgetTest extends SapphireTest
|
|||||||
$this->markTestSkipped('Widgets module not installed');
|
$this->markTestSkipped('Widgets module not installed');
|
||||||
}
|
}
|
||||||
$widget = new BlogTagsCloudWidget();
|
$widget = new BlogTagsCloudWidget();
|
||||||
$blog = $this->objFromFixture(Blog::class, 'FourthBlog');
|
$blog = $this->objFromFixture('SiteTree', 'FourthBlog');
|
||||||
$widget->BlogID = $blog->ID;
|
$widget->BlogID = $blog->ID;
|
||||||
$widget->write();
|
$widget->write();
|
||||||
$tags = $widget->getTags()->toArray();
|
$tags = $widget->getTags()->toArray();
|
||||||
|
@ -39,7 +39,7 @@ class BlogTest extends SapphireTest
|
|||||||
/**
|
/**
|
||||||
* @var Blog $blog
|
* @var Blog $blog
|
||||||
*/
|
*/
|
||||||
$blog = $this->objFromFixture(Blog::class, 'FirstBlog');
|
$blog = $this->objFromFixture('SiteTree', 'FirstBlog');
|
||||||
|
|
||||||
$blog->publish('Stage', 'Live');
|
$blog->publish('Stage', 'Live');
|
||||||
}
|
}
|
||||||
@ -66,7 +66,7 @@ class BlogTest extends SapphireTest
|
|||||||
/**
|
/**
|
||||||
* @var Blog $blog
|
* @var Blog $blog
|
||||||
*/
|
*/
|
||||||
$blog = $this->objFromFixture(Blog::class, 'FirstBlog');
|
$blog = $this->objFromFixture('SiteTree', 'FirstBlog');
|
||||||
|
|
||||||
Config::inst()->update(BlogPost::class, 'show_in_sitetree', true);
|
Config::inst()->update(BlogPost::class, 'show_in_sitetree', true);
|
||||||
$classes = $blog->getExcludedSiteTreeClassNames();
|
$classes = $blog->getExcludedSiteTreeClassNames();
|
||||||
@ -90,7 +90,7 @@ class BlogTest extends SapphireTest
|
|||||||
/**
|
/**
|
||||||
* @var Blog $blog
|
* @var Blog $blog
|
||||||
*/
|
*/
|
||||||
$blog = $this->objFromFixture(Blog::class, 'FirstBlog');
|
$blog = $this->objFromFixture('SiteTree', 'FirstBlog');
|
||||||
|
|
||||||
$archive = $blog->getArchivedBlogPosts(2013);
|
$archive = $blog->getArchivedBlogPosts(2013);
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ class BlogTest extends SapphireTest
|
|||||||
/**
|
/**
|
||||||
* @var Blog $blog
|
* @var Blog $blog
|
||||||
*/
|
*/
|
||||||
$blog = $this->objFromFixture(Blog::class, 'FirstBlog');
|
$blog = $this->objFromFixture('SiteTree', 'FirstBlog');
|
||||||
|
|
||||||
$link = Controller::join_links($blog->Link('archive'), '2013', '10', '01');
|
$link = Controller::join_links($blog->Link('archive'), '2013', '10', '01');
|
||||||
|
|
||||||
@ -151,7 +151,7 @@ class BlogTest extends SapphireTest
|
|||||||
*/
|
*/
|
||||||
public function testArchiveYear()
|
public function testArchiveYear()
|
||||||
{
|
{
|
||||||
$blog = $this->objFromFixture(Blog::class, 'FirstBlog');
|
$blog = $this->objFromFixture('SiteTree', 'FirstBlog');
|
||||||
$controller = new BlogController($blog);
|
$controller = new BlogController($blog);
|
||||||
$this->requestURL($controller, 'first-post/archive/');
|
$this->requestURL($controller, 'first-post/archive/');
|
||||||
$this->assertEquals(2013, $controller->getArchiveYear(), 'getArchiveYear should return 2013');
|
$this->assertEquals(2013, $controller->getArchiveYear(), 'getArchiveYear should return 2013');
|
||||||
@ -172,47 +172,47 @@ class BlogTest extends SapphireTest
|
|||||||
/**
|
/**
|
||||||
* @var Blog $firstBlog
|
* @var Blog $firstBlog
|
||||||
*/
|
*/
|
||||||
$firstBlog = $this->objFromFixture(Blog::class, 'FirstBlog');
|
$firstBlog = $this->objFromFixture('SiteTree', 'FirstBlog');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Blog $fourthBlog
|
* @var Blog $fourthBlog
|
||||||
*/
|
*/
|
||||||
$fourthBlog = $this->objFromFixture(Blog::class, 'FourthBlog');
|
$fourthBlog = $this->objFromFixture('SiteTree', 'FourthBlog');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var BlogPost $postA
|
* @var BlogPost $postA
|
||||||
*/
|
*/
|
||||||
$postA = $this->objFromFixture(BlogPost::class, 'PostA');
|
$postA = $this->objFromFixture('SiteTree', 'PostA');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var BlogPost $postB
|
* @var BlogPost $postB
|
||||||
*/
|
*/
|
||||||
$postB = $this->objFromFixture(BlogPost::class, 'PostB');
|
$postB = $this->objFromFixture('SiteTree', 'PostB');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var BlogPost $postC
|
* @var BlogPost $postC
|
||||||
*/
|
*/
|
||||||
$postC = $this->objFromFixture(BlogPost::class, 'PostC');
|
$postC = $this->objFromFixture('SiteTree', 'PostC');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Member $editor
|
* @var Member $editor
|
||||||
*/
|
*/
|
||||||
$editor = $this->objFromFixture(Member::class, 'BlogEditor');
|
$editor = $this->objFromFixture('Member', 'BlogEditor');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Member $writer
|
* @var Member $writer
|
||||||
*/
|
*/
|
||||||
$writer = $this->objFromFixture(Member::class, 'Writer');
|
$writer = $this->objFromFixture('Member', 'Writer');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Member $contributor
|
* @var Member $contributor
|
||||||
*/
|
*/
|
||||||
$contributor = $this->objFromFixture(Member::class, 'Contributor');
|
$contributor = $this->objFromFixture('Member', 'Contributor');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Member $visitor
|
* @var Member $visitor
|
||||||
*/
|
*/
|
||||||
$visitor = $this->objFromFixture(Member::class, 'Visitor');
|
$visitor = $this->objFromFixture('Member', 'Visitor');
|
||||||
|
|
||||||
$this->assertEquals('Editor', $fourthBlog->RoleOf($editor));
|
$this->assertEquals('Editor', $fourthBlog->RoleOf($editor));
|
||||||
$this->assertEquals('Contributor', $fourthBlog->RoleOf($contributor));
|
$this->assertEquals('Contributor', $fourthBlog->RoleOf($contributor));
|
||||||
@ -290,7 +290,7 @@ class BlogTest extends SapphireTest
|
|||||||
|
|
||||||
public function testFilteredCategories()
|
public function testFilteredCategories()
|
||||||
{
|
{
|
||||||
$blog = $this->objFromFixture(Blog::class, 'FirstBlog');
|
$blog = $this->objFromFixture('SiteTree', 'FirstBlog');
|
||||||
$controller = new BlogController($blog);
|
$controller = new BlogController($blog);
|
||||||
|
|
||||||
// Root url
|
// Root url
|
||||||
@ -309,10 +309,10 @@ class BlogTest extends SapphireTest
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Posts
|
// Posts
|
||||||
$firstPostID = $this->idFromFixture(BlogPost::class, 'FirstBlogPost');
|
$firstPostID = $this->idFromFixture('SiteTree', 'FirstBlogPost');
|
||||||
$secondPostID = $this->idFromFixture(BlogPost::class, 'SecondBlogPost');
|
$secondPostID = $this->idFromFixture('SiteTree', 'SecondBlogPost');
|
||||||
$firstFuturePostID = $this->idFromFixture(BlogPost::class, 'FirstFutureBlogPost');
|
$firstFuturePostID = $this->idFromFixture('SiteTree', 'FirstFutureBlogPost');
|
||||||
$secondFuturePostID = $this->idFromFixture(BlogPost::class, 'SecondFutureBlogPost');
|
$secondFuturePostID = $this->idFromFixture('SiteTree', 'SecondFutureBlogPost');
|
||||||
|
|
||||||
// Request first tag
|
// Request first tag
|
||||||
$this->requestURL($controller, 'first-post/tag/first-tag');
|
$this->requestURL($controller, 'first-post/tag/first-tag');
|
||||||
|
407
tests/blog.yml
407
tests/blog.yml
@ -1,6 +1,7 @@
|
|||||||
# Mock date is set to 2013-10-01 20:00:00
|
# Mock date is set to 2013-10-01 20:00:00
|
||||||
|
# Write to tables rather than dataobjects for performance
|
||||||
|
|
||||||
SilverStripe\Security\Group:
|
Group:
|
||||||
Administrators:
|
Administrators:
|
||||||
Title: Administrators
|
Title: Administrators
|
||||||
Editors:
|
Editors:
|
||||||
@ -9,193 +10,371 @@ SilverStripe\Security\Group:
|
|||||||
Title: Blog Users
|
Title: Blog Users
|
||||||
Code: blogusers
|
Code: blogusers
|
||||||
|
|
||||||
SilverStripe\Security\Permission:
|
Permission:
|
||||||
Administrators:
|
Administrators:
|
||||||
Code: ADMIN
|
Code: ADMIN
|
||||||
Group: =>SilverStripe\Security\Group.Administrators
|
GroupID: =>Group.Administrators
|
||||||
Editors:
|
Editors:
|
||||||
Code: CMS_ACCESS_CMSMain
|
Code: CMS_ACCESS_CMSMain
|
||||||
Group: =>SilverStripe\Security\Group.Editors
|
GroupID: =>Group.Editors
|
||||||
BlogUsers:
|
BlogUsers:
|
||||||
Code: CMS_ACCESS_CMSMain
|
Code: CMS_ACCESS_CMSMain
|
||||||
Group: =>SilverStripe\Security\Group.BlogUsers
|
GroupID: =>Group.BlogUsers
|
||||||
|
|
||||||
SilverStripe\SiteConfig\SiteConfig:
|
SiteConfig:
|
||||||
Default:
|
Default:
|
||||||
CanEditType: 'OnlyTheseUsers'
|
CanEditType: 'OnlyTheseUsers'
|
||||||
CanCreateTopLevelType: 'OnlyTheseUsers'
|
CanCreateTopLevelType: 'OnlyTheseUsers'
|
||||||
EditorGroups: =>SilverStripe\Security\Group.Administrators,=>SilverStripe\Security\Group.Editors
|
|
||||||
CreateTopLevelGroups: =>SilverStripe\Security\Group.Administrators,=>SilverStripe\Security\Group.Editors
|
|
||||||
|
|
||||||
SilverStripe\Security\Member:
|
SiteConfig_EditorGroups:
|
||||||
|
A:
|
||||||
|
SiteConfigID: =>SiteConfig.Default
|
||||||
|
GroupID: =>Group.Administrators
|
||||||
|
B:
|
||||||
|
SiteConfigID: =>SiteConfig.Default
|
||||||
|
GroupID: =>Group.Editors
|
||||||
|
SiteConfig_CreateTopLevelGroups:
|
||||||
|
A:
|
||||||
|
SiteConfigID: =>SiteConfig.Default
|
||||||
|
GroupID: =>Group.Administrators
|
||||||
|
B:
|
||||||
|
SiteConfigID: =>SiteConfig.Default
|
||||||
|
GroupID: =>Group.Editors
|
||||||
|
|
||||||
|
Member:
|
||||||
Admin:
|
Admin:
|
||||||
FirstName: Test
|
FirstName: Test
|
||||||
Surname: Administrator
|
Surname: Administrator
|
||||||
Groups: =>SilverStripe\Security\Group.Administrators
|
|
||||||
Editor:
|
Editor:
|
||||||
FirstName: Test
|
FirstName: Test
|
||||||
Surname: Editor
|
Surname: Editor
|
||||||
Groups: =>SilverStripe\Security\Group.Editors
|
|
||||||
BlogEditor:
|
BlogEditor:
|
||||||
FirstName: Blog
|
FirstName: Blog
|
||||||
Surname: Editor
|
Surname: Editor
|
||||||
Groups: =>SilverStripe\Security\Group.BlogUsers
|
|
||||||
Writer:
|
Writer:
|
||||||
FirstName: Blog
|
FirstName: Blog
|
||||||
Surname: Writer
|
Surname: Writer
|
||||||
Groups: =>SilverStripe\Security\Group.BlogUsers
|
|
||||||
Contributor:
|
Contributor:
|
||||||
FirstName: Blog
|
FirstName: Blog
|
||||||
Surname: Contributor
|
Surname: Contributor
|
||||||
Groups: =>SilverStripe\Security\Group.BlogUsers
|
|
||||||
Visitor:
|
Visitor:
|
||||||
FirstName: Blog
|
FirstName: Blog
|
||||||
Surname: Visitor
|
Surname: Visitor
|
||||||
|
|
||||||
SilverStripe\Blog\Model\Blog:
|
Group_Members:
|
||||||
|
Admin:
|
||||||
|
MemberID: =>Member.Admin
|
||||||
|
GroupID: =>Group.Administrators
|
||||||
|
Editor:
|
||||||
|
MemberID: =>Member.Editor
|
||||||
|
GroupID: =>Group.Editors
|
||||||
|
BlogEditor:
|
||||||
|
MemberID: =>Member.BlogEditor
|
||||||
|
GroupID: =>Group.BlogUsers
|
||||||
|
Writer:
|
||||||
|
MemberID: =>Member.Writer
|
||||||
|
GroupID: =>Group.BlogUsers
|
||||||
|
Contributor:
|
||||||
|
MemberID: =>Member.Contributor
|
||||||
|
GroupID: =>Group.BlogUsers
|
||||||
|
|
||||||
|
SiteTree:
|
||||||
FirstBlog:
|
FirstBlog:
|
||||||
|
ClassName: SilverStripe\Blog\Model\Blog
|
||||||
Title: 'First Blog'
|
Title: 'First Blog'
|
||||||
|
URLSegment: 'first-blog'
|
||||||
SecondBlog:
|
SecondBlog:
|
||||||
|
ClassName: SilverStripe\Blog\Model\Blog
|
||||||
Title: 'Second Blog'
|
Title: 'Second Blog'
|
||||||
CanViewType: 'OnlyTheseUsers'
|
CanViewType: 'OnlyTheseUsers'
|
||||||
CanEditType: 'OnlyTheseUsers'
|
CanEditType: 'OnlyTheseUsers'
|
||||||
ViewerGroups: =>SilverStripe\Security\Group.Administrators
|
URLSegment: 'second-blog'
|
||||||
EditorGroups: =>SilverStripe\Security\Group.Administrators
|
|
||||||
ThirdBlog:
|
ThirdBlog:
|
||||||
|
ClassName: SilverStripe\Blog\Model\Blog
|
||||||
Title: 'Third Blog'
|
Title: 'Third Blog'
|
||||||
CanEditType: 'OnlyTheseUsers'
|
CanEditType: 'OnlyTheseUsers'
|
||||||
EditorGroups: =>SilverStripe\Security\Group.Editors
|
URLSegment: 'third-blog'
|
||||||
FourthBlog:
|
FourthBlog:
|
||||||
|
ClassName: SilverStripe\Blog\Model\Blog
|
||||||
Title: 'Fourth Blog'
|
Title: 'Fourth Blog'
|
||||||
Editors: =>SilverStripe\Security\Member.BlogEditor
|
URLSegment: 'fourth-blog'
|
||||||
Writers: =>SilverStripe\Security\Member.Writer
|
|
||||||
Contributors: =>SilverStripe\Security\Member.Contributor
|
|
||||||
|
|
||||||
SilverStripe\Blog\Model\BlogTag:
|
FirstBlogPost:
|
||||||
|
ClassName: SilverStripe\Blog\Model\BlogPost
|
||||||
|
Title: 'First Post'
|
||||||
|
URLSegment: first-post
|
||||||
|
ParentID: =>SiteTree.FirstBlog
|
||||||
|
SecondBlogPost:
|
||||||
|
ClassName: SilverStripe\Blog\Model\BlogPost
|
||||||
|
Title: 'Second Post'
|
||||||
|
URLSegment: second-post
|
||||||
|
ParentID: =>SiteTree.FirstBlog
|
||||||
|
ThirdBlogPost:
|
||||||
|
ClassName: SilverStripe\Blog\Model\BlogPost
|
||||||
|
Title: 'Old Post'
|
||||||
|
URLSegment: old-post
|
||||||
|
ParentID: =>SiteTree.FirstBlog
|
||||||
|
FirstFutureBlogPost:
|
||||||
|
ClassName: SilverStripe\Blog\Model\BlogPost
|
||||||
|
Title: 'Future Post'
|
||||||
|
URLSegment: future-post
|
||||||
|
ParentID: =>SiteTree.FirstBlog
|
||||||
|
SecondFutureBlogPost:
|
||||||
|
ClassName: SilverStripe\Blog\Model\BlogPost
|
||||||
|
Title: 'Future Post 2'
|
||||||
|
URLSegment: future-post-2
|
||||||
|
ParentID: =>SiteTree.FirstBlog
|
||||||
|
PostA:
|
||||||
|
ClassName: SilverStripe\Blog\Model\BlogPost
|
||||||
|
Title: 'One Post'
|
||||||
|
ParentID: =>SiteTree.FourthBlog
|
||||||
|
PostB:
|
||||||
|
ClassName: SilverStripe\Blog\Model\BlogPost
|
||||||
|
Title: 'Second Post'
|
||||||
|
ParentID: =>SiteTree.FourthBlog
|
||||||
|
PostC:
|
||||||
|
ClassName: SilverStripe\Blog\Model\BlogPost
|
||||||
|
Title: 'Third Post'
|
||||||
|
ParentID: =>SiteTree.FourthBlog
|
||||||
|
NullPublishDate:
|
||||||
|
ClassName: SilverStripe\Blog\Model\BlogPost
|
||||||
|
Title: 'No publish date'
|
||||||
|
ParentID: =>SiteTree.FourthBlog
|
||||||
|
|
||||||
|
#Posts for the tag cloud widget test
|
||||||
|
TaggedPost1:
|
||||||
|
ClassName: SilverStripe\Blog\Model\BlogPost
|
||||||
|
Title: 'Tagged Post 1'
|
||||||
|
URLSegment: tagged-post-1
|
||||||
|
ParentID: =>SiteTree.FourthBlog
|
||||||
|
TaggedPost2:
|
||||||
|
ClassName: SilverStripe\Blog\Model\BlogPost
|
||||||
|
Title: 'Tagged Post 2'
|
||||||
|
URLSegment: tagged-post-2
|
||||||
|
ParentID: =>SiteTree.FourthBlog
|
||||||
|
TaggedPost3:
|
||||||
|
ClassName: SilverStripe\Blog\Model\BlogPost
|
||||||
|
Title: 'Tagged Post 3'
|
||||||
|
URLSegment: tagged-post-3
|
||||||
|
ParentID: =>SiteTree.FourthBlog
|
||||||
|
TaggedPost4:
|
||||||
|
ClassName: SilverStripe\Blog\Model\BlogPost
|
||||||
|
Title: 'Tagged Post 4'
|
||||||
|
URLSegment: tagged-post-4
|
||||||
|
ParentID: =>SiteTree.FourthBlog
|
||||||
|
|
||||||
|
BlogPost:
|
||||||
|
FirstBlogPost:
|
||||||
|
ID: =>SiteTree.FirstBlogPost
|
||||||
|
PublishDate: '2013-10-01 15:00:00'
|
||||||
|
SecondBlogPost:
|
||||||
|
ID: =>SiteTree.SecondBlogPost
|
||||||
|
PublishDate: '2013-09-01 15:00:00'
|
||||||
|
ThirdBlogPost:
|
||||||
|
ID: =>SiteTree.ThirdBlogPost
|
||||||
|
PublishDate: '2012-01-09 15:00:00'
|
||||||
|
FirstFutureBlogPost:
|
||||||
|
ID: =>SiteTree.FirstFutureBlogPost
|
||||||
|
PublishDate: '2015-01-01 00:00:00'
|
||||||
|
SecondFutureBlogPost:
|
||||||
|
ID: =>SiteTree.SecondFutureBlogPost
|
||||||
|
PublishDate: '2013-11-01 00:00:00'
|
||||||
|
PostA:
|
||||||
|
ID: =>SiteTree.PostA
|
||||||
|
PublishDate: '2012-01-09 15:00:00'
|
||||||
|
PostB:
|
||||||
|
ID: =>SiteTree.PostB
|
||||||
|
PublishDate: '2012-01-09 15:00:00'
|
||||||
|
PostC:
|
||||||
|
ID: =>SiteTree.PostC
|
||||||
|
PublishDate: '2012-01-09 15:00:00'
|
||||||
|
NullPublishDate:
|
||||||
|
ID: =>SiteTree.NullPublishDate
|
||||||
|
PublishDate: null
|
||||||
|
|
||||||
|
#Posts for the tag cloud widget test
|
||||||
|
TaggedPost1:
|
||||||
|
ID: =>SiteTree.TaggedPost1
|
||||||
|
PublishDate: '2012-01-09 15:00:00'
|
||||||
|
TaggedPost2:
|
||||||
|
ID: =>SiteTree.TaggedPost2
|
||||||
|
PublishDate: '2012-01-09 15:00:00'
|
||||||
|
TaggedPost3:
|
||||||
|
ID: =>SiteTree.TaggedPost3
|
||||||
|
PublishDate: '2012-01-09 17:20:00'
|
||||||
|
TaggedPost4:
|
||||||
|
ID: =>SiteTree.TaggedPost4
|
||||||
|
PublishDate: '2012-04-09 15:00:00'
|
||||||
|
|
||||||
|
Blog_Editors:
|
||||||
|
FourthBlog:
|
||||||
|
BlogID: =>SiteTree.FourthBlog
|
||||||
|
MemberID: =>Member.BlogEditor
|
||||||
|
|
||||||
|
Blog_Writers:
|
||||||
|
FourthBlog:
|
||||||
|
BlogID: =>SiteTree.FourthBlog
|
||||||
|
MemberID: =>Member.Writer
|
||||||
|
|
||||||
|
Blog_Contributors:
|
||||||
|
FourthBlog:
|
||||||
|
BlogID: =>SiteTree.FourthBlog
|
||||||
|
MemberID: =>Member.Contributor
|
||||||
|
|
||||||
|
SiteTree_ViewerGroups:
|
||||||
|
SecondBlog:
|
||||||
|
SiteTreeID: =>SiteTree.SecondBlog
|
||||||
|
GroupID: =>Group.Administrators
|
||||||
|
|
||||||
|
SiteTree_EditorGroups:
|
||||||
|
SecondBlog:
|
||||||
|
SiteTreeID: =>SiteTree.SecondBlog
|
||||||
|
GroupID: =>Group.Administrators
|
||||||
|
ThirdBlog:
|
||||||
|
SiteTreeID: =>SiteTree.ThirdBlog
|
||||||
|
GroupID: =>Group.Editors
|
||||||
|
|
||||||
|
BlogTag:
|
||||||
FirstTag:
|
FirstTag:
|
||||||
Title: 'First Tag'
|
Title: 'First Tag'
|
||||||
URLSegment: 'first-tag'
|
URLSegment: 'first-tag'
|
||||||
Blog: =>SilverStripe\Blog\Model\Blog.FirstBlog
|
BlogID: =>SiteTree.FirstBlog
|
||||||
SecondTag:
|
SecondTag:
|
||||||
Title: 'Second Tag'
|
Title: 'Second Tag'
|
||||||
URLSegment: 'second-tag'
|
URLSegment: 'second-tag'
|
||||||
Blog: =>SilverStripe\Blog\Model\Blog.SecondBlog
|
BlogID: =>SiteTree.SecondBlog
|
||||||
ThirdTag:
|
ThirdTag:
|
||||||
Title: 'Third Tag'
|
Title: 'Third Tag'
|
||||||
URLSegment: 'third-tag'
|
URLSegment: 'third-tag'
|
||||||
Blog: =>SilverStripe\Blog\Model\Blog.ThirdBlog
|
BlogID: =>SiteTree.ThirdBlog
|
||||||
|
|
||||||
#Tags for Tag Cloud widget
|
#Tags for Tag Cloud widget
|
||||||
PopularTag:
|
PopularTag:
|
||||||
Title: 'Popular'
|
Title: 'Popular'
|
||||||
URLSegment: 'popular-tag'
|
URLSegment: 'popular'
|
||||||
Blog: =>SilverStripe\Blog\Model\Blog.FourthBlog
|
BlogID: =>SiteTree.FourthBlog
|
||||||
CoolTag:
|
CoolTag:
|
||||||
Title: 'Cool'
|
Title: 'Cool'
|
||||||
URLSegment: 'cool-tag'
|
URLSegment: 'cool'
|
||||||
Blog: =>SilverStripe\Blog\Model\Blog.FourthBlog
|
BlogID: =>SiteTree.FourthBlog
|
||||||
CatTag:
|
CatTag:
|
||||||
Title: 'Cat'
|
Title: 'Cat'
|
||||||
URLSegment: 'cat-tag'
|
URLSegment: 'cat'
|
||||||
Blog: =>SilverStripe\Blog\Model\Blog.FourthBlog
|
BlogID: =>SiteTree.FourthBlog
|
||||||
KiwiTag:
|
KiwiTag:
|
||||||
Title: 'Kiwi'
|
Title: 'Kiwi'
|
||||||
URLSegment: 'kiwi-tag'
|
URLSegment: 'kiwi'
|
||||||
Blog: =>SilverStripe\Blog\Model\Blog.FourthBlog
|
BlogID: =>SiteTree.FourthBlog
|
||||||
|
|
||||||
SilverStripe\Blog\Model\BlogCategory:
|
BlogCategory:
|
||||||
FirstCategory:
|
FirstCategory:
|
||||||
Title: 'First Category'
|
Title: 'First Category'
|
||||||
URLSegment: 'first-category'
|
URLSegment: 'first-category'
|
||||||
Blog: =>SilverStripe\Blog\Model\Blog.FirstBlog
|
BlogID: =>SiteTree.FirstBlog
|
||||||
SecondCategory:
|
SecondCategory:
|
||||||
Title: 'Second Category'
|
Title: 'Second Category'
|
||||||
URLSegment: 'second-category'
|
URLSegment: 'second-category'
|
||||||
Blog: =>SilverStripe\Blog\Model\Blog.SecondBlog
|
BlogID: =>SiteTree.SecondBlog
|
||||||
ThirdCategory:
|
ThirdCategory:
|
||||||
Title: 'Third Category'
|
Title: 'Third Category'
|
||||||
URLSegment: 'third-category'
|
URLSegment: 'third-category'
|
||||||
Blog: =>SilverStripe\Blog\Model\Blog.ThirdBlog
|
BlogID: =>SiteTree.ThirdBlog
|
||||||
|
|
||||||
SilverStripe\Blog\Model\BlogPost:
|
BlogPost_Tags:
|
||||||
FirstBlogPost:
|
FirstBlogPost:
|
||||||
Title: 'First Post'
|
BlogPostID: =>SiteTree.FirstBlogPost
|
||||||
URLSegment: first-post
|
BlogTagID: =>BlogTag.FirstTag
|
||||||
PublishDate: '2013-10-01 15:00:00'
|
|
||||||
Parent: =>SilverStripe\Blog\Model\Blog.FirstBlog
|
|
||||||
Tags: =>SilverStripe\Blog\Model\BlogTag.FirstTag
|
|
||||||
Categories: =>SilverStripe\Blog\Model\BlogCategory.FirstCategory
|
|
||||||
SecondBlogPost:
|
|
||||||
Title: 'Second Post'
|
|
||||||
URLSegment: second-post
|
|
||||||
PublishDate: '2013-09-01 15:00:00'
|
|
||||||
Parent: =>SilverStripe\Blog\Model\Blog.FirstBlog
|
|
||||||
ThirdBlogPost:
|
|
||||||
Title: 'Old Post'
|
|
||||||
URLSegment: old-post
|
|
||||||
PublishDate: '2012-01-09 15:00:00'
|
|
||||||
Parent: =>SilverStripe\Blog\Model\Blog.FirstBlog
|
|
||||||
FirstFutureBlogPost:
|
FirstFutureBlogPost:
|
||||||
Title: 'Future Post'
|
BlogPostID: =>SiteTree.FirstFutureBlogPost
|
||||||
URLSegment: future-post
|
BlogTagID: =>BlogTag.FirstTag
|
||||||
PublishDate: '2015-01-01 00:00:00'
|
|
||||||
Tags: =>SilverStripe\Blog\Model\BlogTag.FirstTag
|
|
||||||
Categories: =>SilverStripe\Blog\Model\BlogCategory.FirstCategory
|
|
||||||
Parent: =>SilverStripe\Blog\Model\Blog.FirstBlog
|
|
||||||
SecondFutureBlogPost:
|
SecondFutureBlogPost:
|
||||||
Title: 'Future Post 2'
|
BlogPostID: =>SiteTree.SecondFutureBlogPost
|
||||||
URLSegment: future-post-2
|
BlogTagID: =>BlogTag.FirstTag
|
||||||
PublishDate: '2013-11-01 00:00:00'
|
|
||||||
Tags: =>SilverStripe\Blog\Model\BlogTag.FirstTag
|
|
||||||
Categories: =>SilverStripe\Blog\Model\BlogCategory.FirstCategory
|
TaggedPost1A:
|
||||||
Parent: =>SilverStripe\Blog\Model\Blog.FirstBlog
|
BlogPostID: =>SiteTree.TaggedPost1
|
||||||
PostA:
|
BlogTagID: =>BlogTag.PopularTag
|
||||||
Title: 'One Post'
|
TaggedPost1B:
|
||||||
PublishDate: '2012-01-09 15:00:00'
|
BlogPostID: =>SiteTree.TaggedPost1
|
||||||
Parent: =>SilverStripe\Blog\Model\Blog.FourthBlog
|
BlogTagID: =>BlogTag.CoolTag
|
||||||
Authors: =>SilverStripe\Security\Member.Writer,=>SilverStripe\Security\Member.Contributor
|
|
||||||
PostB:
|
TaggedPost2A:
|
||||||
Title: 'Second Post'
|
BlogPostID: =>SiteTree.TaggedPost2
|
||||||
PublishDate: '2012-01-09 15:00:00'
|
BlogTagID: =>BlogTag.PopularTag
|
||||||
Parent: =>SilverStripe\Blog\Model\Blog.FourthBlog
|
TaggedPost2B:
|
||||||
Authors: =>SilverStripe\Security\Member.BlogEditor
|
BlogPostID: =>SiteTree.TaggedPost2
|
||||||
PostC:
|
BlogTagID: =>BlogTag.CoolTag
|
||||||
Title: 'Third Post'
|
TaggedPost2C:
|
||||||
PublishDate: '2012-01-09 15:00:00'
|
BlogPostID: =>SiteTree.TaggedPost2
|
||||||
Parent: =>SilverStripe\Blog\Model\Blog.FourthBlog
|
BlogTagID: =>BlogTag.CatTag
|
||||||
Authors: =>SilverStripe\Security\Member.BlogEditor,=>SilverStripe\Security\Member.Writer,=>SilverStripe\Security\Member.Contributor
|
|
||||||
NullPublishDate:
|
TaggedPost3A:
|
||||||
Title: 'No publish date'
|
BlogPostID: =>SiteTree.TaggedPost3
|
||||||
PublishDate: ''
|
BlogTagID: =>BlogTag.PopularTag
|
||||||
Parent: =>SilverStripe\Blog\Model\Blog.FourthBlog
|
TaggedPost3B:
|
||||||
Authors: =>SilverStripe\Security\Member.BlogEditor,=>SilverStripe\Security\Member.Writer,=>SilverStripe\Security\Member.Contributor
|
BlogPostID: =>SiteTree.TaggedPost3
|
||||||
|
BlogTagID: =>BlogTag.CoolTag
|
||||||
|
TaggedPost3C:
|
||||||
|
BlogPostID: =>SiteTree.TaggedPost3
|
||||||
|
BlogTagID: =>BlogTag.CatTag
|
||||||
|
TaggedPost3D:
|
||||||
|
BlogPostID: =>SiteTree.TaggedPost3
|
||||||
|
BlogTagID: =>BlogTag.KiwiTag
|
||||||
|
|
||||||
#Posts for the tag cloud widget test
|
|
||||||
TaggedPost1:
|
|
||||||
Title: 'Tagged Post 1'
|
|
||||||
URLSegment: tagged-post-1
|
|
||||||
PublishDate: '2012-01-09 15:00:00'
|
|
||||||
Tags: =>SilverStripe\Blog\Model\BlogTag.PopularTag,=>SilverStripe\Blog\Model\BlogTag.CoolTag
|
|
||||||
Categories: =>SilverStripe\Blog\Model\BlogCategory.FirstCategory
|
|
||||||
Parent: =>SilverStripe\Blog\Model\Blog.FourthBlog
|
|
||||||
TaggedPost2:
|
|
||||||
Title: 'Tagged Post 2'
|
|
||||||
URLSegment: tagged-post-2
|
|
||||||
PublishDate: '2012-01-09 15:00:00'
|
|
||||||
Tags: =>SilverStripe\Blog\Model\BlogTag.PopularTag,=>SilverStripe\Blog\Model\BlogTag.CoolTag,=>SilverStripe\Blog\Model\BlogTag.CatTag
|
|
||||||
Categories: =>SilverStripe\Blog\Model\BlogCategory.FirstCategory
|
|
||||||
Parent: =>SilverStripe\Blog\Model\Blog.FourthBlog
|
|
||||||
TaggedPost3:
|
|
||||||
Title: 'Tagged Post 3'
|
|
||||||
URLSegment: tagged-post-3
|
|
||||||
PublishDate: '2012-01-09 17:20:00'
|
|
||||||
Tags: =>SilverStripe\Blog\Model\BlogTag.PopularTag,=>SilverStripe\Blog\Model\BlogTag.CoolTag,=>SilverStripe\Blog\Model\BlogTag.CatTag,=>SilverStripe\Blog\Model\BlogTag.KiwiTag
|
|
||||||
Categories: =>SilverStripe\Blog\Model\BlogCategory.FirstCategory
|
|
||||||
Parent: =>SilverStripe\Blog\Model\Blog.FourthBlog
|
|
||||||
TaggedPost4:
|
TaggedPost4:
|
||||||
Title: 'Tagged Post 4'
|
BlogPostID: =>SiteTree.TaggedPost4
|
||||||
URLSegment: tagged-post-4
|
BlogTagID: =>BlogTag.PopularTag
|
||||||
PublishDate: '2012-04-09 15:00:00'
|
|
||||||
Tags: =>SilverStripe\Blog\Model\BlogTag.PopularTag
|
BlogPost_Categories:
|
||||||
Categories: =>SilverStripe\Blog\Model\BlogCategory.FirstCategory
|
FirstBlogPost:
|
||||||
Parent: =>SilverStripe\Blog\Model\Blog.FourthBlog
|
BlogPostID: =>SiteTree.FirstBlogPost
|
||||||
|
BlogCategoryID: =>BlogCategory.FirstCategory
|
||||||
|
FirstFutureBlogPost:
|
||||||
|
BlogPostID: =>SiteTree.FirstFutureBlogPost
|
||||||
|
BlogCategoryID: =>BlogCategory.FirstCategory
|
||||||
|
SecondFutureBlogPost:
|
||||||
|
BlogPostID: =>SiteTree.SecondFutureBlogPost
|
||||||
|
BlogCategoryID: =>BlogCategory.FirstCategory
|
||||||
|
TaggedPost1:
|
||||||
|
BlogPostID: =>SiteTree.TaggedPost1
|
||||||
|
BlogCategoryID: =>BlogCategory.FirstCategory
|
||||||
|
TaggedPost2:
|
||||||
|
BlogPostID: =>SiteTree.TaggedPost2
|
||||||
|
BlogCategoryID: =>BlogCategory.FirstCategory
|
||||||
|
TaggedPost3:
|
||||||
|
BlogPostID: =>SiteTree.TaggedPost3
|
||||||
|
BlogCategoryID: =>BlogCategory.FirstCategory
|
||||||
|
TaggedPost4:
|
||||||
|
BlogPostID: =>SiteTree.TaggedPost4
|
||||||
|
BlogCategoryID: =>BlogCategory.FirstCategory
|
||||||
|
|
||||||
|
BlogPost_Authors:
|
||||||
|
PostAA:
|
||||||
|
BlogPostID: =>SiteTree.PostA
|
||||||
|
MemberID: =>Member.Writer
|
||||||
|
PostAB:
|
||||||
|
BlogPostID: =>SiteTree.PostA
|
||||||
|
MemberID: =>Member.Contributor
|
||||||
|
PostB:
|
||||||
|
BlogPostID: =>SiteTree.PostB
|
||||||
|
MemberID: =>Member.BlogEditor
|
||||||
|
PostCA:
|
||||||
|
BlogPostID: =>SiteTree.PostC
|
||||||
|
MemberID: =>Member.BlogEditor
|
||||||
|
PostCB:
|
||||||
|
BlogPostID: =>SiteTree.PostC
|
||||||
|
MemberID: =>Member.Writer
|
||||||
|
PostCC:
|
||||||
|
BlogPostID: =>SiteTree.PostC
|
||||||
|
MemberID: =>Member.Contributor
|
||||||
|
NullPublishDateA:
|
||||||
|
BlogPostID: =>SiteTree.NullPublishDate
|
||||||
|
MemberID: =>Member.BlogEditor
|
||||||
|
NullPublishDateB:
|
||||||
|
BlogPostID: =>SiteTree.NullPublishDate
|
||||||
|
MemberID: =>Member.Writer
|
||||||
|
NullPublishDateC:
|
||||||
|
BlogPostID: =>SiteTree.NullPublishDate
|
||||||
|
MemberID: =>Member.Contributor
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user