Code Duplication    Length = 24-28 lines in 2 locations

tests/CommentsExtensionTest.php 1 location

@@ 32-59 (lines=28) @@
29
        CommentableItemDisabled::class
30
    );
31
32
    public function setUp()
33
    {
34
        parent::setUp();
35
        Config::nest();
36
37
        // Set good default values
38
        Config::inst()->update(CommentsExtension::class, 'comments', array(
39
            'enabled' => true,
40
            'enabled_cms' => false,
41
            'require_login' => false,
42
            'require_login_cms' => false,
43
            'required_permission' => false,
44
            'require_moderation_nonmembers' => false,
45
            'require_moderation' => false,
46
            'require_moderation_cms' => false,
47
            'frontend_moderation' => false,
48
            'Member' => false,
49
        ));
50
51
        $this->requiredExtensions = array(
52
            'CommentableItem' => CommentsExtension::class
53
        );
54
55
        // Configure this dataobject
56
        Config::inst()->update(CommentableItem::class, 'comments', array(
57
            'enabled_cms' => true
58
        ));
59
    }
60
61
    public function tearDown()
62
    {

tests/CommentsTest.php 1 location

@@ 35-58 (lines=24) @@
32
        CommentableItemDisabled::class
33
    );
34
35
    public function setUp()
36
    {
37
        parent::setUp();
38
        Config::nest();
39
40
        // Set good default values
41
        Config::inst()->update(CommentsExtension::class, 'comments', array(
42
            'enabled' => true,
43
            'enabled_cms' => false,
44
            'require_login' => false,
45
            'require_login_cms' => false,
46
            'required_permission' => false,
47
            'require_moderation_nonmembers' => false,
48
            'require_moderation' => false,
49
            'require_moderation_cms' => false,
50
            'frontend_moderation' => false,
51
            'frontend_spam' => false,
52
        ));
53
54
        // Configure this dataobject
55
        Config::inst()->update(CommentableItem::class, 'comments', array(
56
            'enabled_cms' => true
57
        ));
58
    }
59
60
    public function tearDown()
61
    {