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/BlogTagTest.php 1 location

@@ 128-139 (lines=12) @@
125
        $this->assertTrue($tag->canEdit($editor), 'Editor should be able to edit tag.');
126
    }
127
128
    public function testCanCreate()
129
    {
130
        $this->useDraftSite();
131
132
        $admin = $this->objFromFixture(Member::class, 'Admin');
133
        $editor = $this->objFromFixture(Member::class, 'Editor');
134
135
        $tag = singleton(BlogTag::class);
136
137
        $this->assertTrue($tag->canCreate($admin), 'Admin should be able to create tag.');
138
        $this->assertTrue($tag->canCreate($editor), 'Editor should be able to create tag.');
139
    }
140
141
    public function testCanDelete()
142
    {

tests/BlogPostTest.php 1 location

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