Code Duplication    Length = 13-13 lines in 4 locations

tests/FormBlockTest.php 2 locations

@@ 42-54 (lines=13) @@
39
    /**
40
     *
41
     */
42
    public function testCanView()
43
    {
44
        $object = $this->objFromFixture('FormBlock', 'one');
45
        $admin = $this->objFromFixture('Member', 'admin');
46
        $member = $this->objFromFixture('Member', 'default');
47
        if (class_exists('UserDefinedForm')) {
48
            $this->assertTrue($object->canView($admin));
49
            $this->assertTrue($object->canView($member));
50
        } else {
51
            $this->assertFalse($object->canView($admin));
52
            $this->assertFalse($object->canView($member));
53
        }
54
    }
55
56
    /**
57
     *
@@ 59-71 (lines=13) @@
56
    /**
57
     *
58
     */
59
    public function testCanCreate()
60
    {
61
        $object = $this->objFromFixture('FormBlock', 'one');
62
        $admin = $this->objFromFixture('Member', 'admin');
63
        $member = $this->objFromFixture('Member', 'default');
64
        if (class_exists('UserDefinedForm')) {
65
            $this->assertTrue($object->canCreate($admin));
66
            $this->assertTrue($object->canCreate($member));
67
        } else {
68
            $this->assertFalse($object->canCreate($admin));
69
            $this->assertFalse($object->canCreate($member));
70
        }
71
    }
72
}

tests/RecentBlogPostsBlockTest.php 2 locations

@@ 28-40 (lines=13) @@
25
    /**
26
     *
27
     */
28
    public function testCanView()
29
    {
30
        $object = $this->objFromFixture('RecentBlogPostsBlock', 'one');
31
        $admin = $this->objFromFixture('Member', 'admin');
32
        $member = $this->objFromFixture('Member', 'default');
33
        if (class_exists('Blog')) {
34
            $this->assertTrue($object->canView($admin));
35
            $this->assertTrue($object->canView($member));
36
        } else {
37
            $this->assertFalse($object->canView($admin));
38
            $this->assertFalse($object->canView($member));
39
        }
40
    }
41
42
    /**
43
     *
@@ 45-57 (lines=13) @@
42
    /**
43
     *
44
     */
45
    public function testCanCreate()
46
    {
47
        $object = $this->objFromFixture('RecentBlogPostsBlock', 'one');
48
        $admin = $this->objFromFixture('Member', 'admin');
49
        $member = $this->objFromFixture('Member', 'default');
50
        if (class_exists('Blog')) {
51
            $this->assertTrue($object->canCreate($admin));
52
            $this->assertTrue($object->canCreate($member));
53
        } else {
54
            $this->assertFalse($object->canCreate($admin));
55
            $this->assertFalse($object->canCreate($member));
56
        }
57
    }
58
}