Code Duplication    Length = 10-12 lines in 3 locations

tests/BlogCategoryTest.php 1 location

@@ 122-133 (lines=12) @@
119
        $this->assertTrue($category->canEdit($editor), 'Editor should be able to edit category.');
120
    }
121
122
    public function testCanCreate()
123
    {
124
        $this->useDraftSite();
125
126
        $admin = $this->objFromFixture(Member::class, 'Admin');
127
        $editor = $this->objFromFixture(Member::class, 'Editor');
128
129
        $category = singleton(BlogCategory::class);
130
131
        $this->assertTrue($category->canCreate($admin), 'Admin should be able to create category.');
132
        $this->assertTrue($category->canCreate($editor), 'Editor should be able to create category.');
133
    }
134
135
    public function testCanDelete()
136
    {

tests/BlogPostTest.php 1 location

@@ 105-114 (lines=10) @@
102
        $this->assertNotEmpty($fields->dataFieldByName('Authors'));
103
    }
104
105
    public function testCanViewFuturePost()
106
    {
107
        $blogPost = $this->objFromFixture(BlogPost::class, 'NullPublishDate');
108
109
        $editor = $this->objFromFixture(Member::class, 'BlogEditor');
110
        $this->assertTrue($blogPost->canView($editor));
111
112
        $visitor = $this->objFromFixture(Member::class, 'Visitor');
113
        $this->assertFalse($blogPost->canView($visitor));
114
    }
115
116
    /**
117
     * The purpose of getDate() is to act as a proxy for PublishDate in the default RSS

tests/BlogTagTest.php 1 location

@@ 119-130 (lines=12) @@
116
        $this->assertTrue($tag->canEdit($editor), 'Editor should be able to edit tag.');
117
    }
118
119
    public function testCanCreate()
120
    {
121
        $this->useDraftSite();
122
123
        $admin = $this->objFromFixture(Member::class, 'Admin');
124
        $editor = $this->objFromFixture(Member::class, 'Editor');
125
126
        $tag = singleton(BlogTag::class);
127
128
        $this->assertTrue($tag->canCreate($admin), 'Admin should be able to create tag.');
129
        $this->assertTrue($tag->canCreate($editor), 'Editor should be able to create tag.');
130
    }
131
132
    public function testCanDelete()
133
    {