Code Duplication    Length = 20-20 lines in 2 locations

tests/php/AssetAdminTest.php 2 locations

@@ 83-102 (lines=20) @@
80
        $this->assertEquals('testItCreatesFolder', $newFolder->Name);
81
    }
82
83
    public function testItRestrictsCreateFolderByCanCreate()
84
    {
85
        $folder = $this->objFromFixture(
86
            'SilverStripe\AssetAdmin\Tests\AssetAdminTest_Folder',
87
            'disallowCanCreate'
88
        );
89
90
        $response = Director::test(
91
            'admin/assets/api/createFolder',
92
            [
93
                'ParentID' => $folder->ID,
94
                'Name' => 'testItRestrictsCreateFolderByCanCreate',
95
                'SecurityID' => SecurityToken::inst()->getValue(),
96
            ],
97
            $this->session,
98
            'POST'
99
        );
100
        $this->assertTrue($response->isError());
101
        $this->assertEquals(403, $response->getStatusCode());
102
    }
103
104
    public function testItRestrictsCreateFolderByCanAddChildren()
105
    {
@@ 104-123 (lines=20) @@
101
        $this->assertEquals(403, $response->getStatusCode());
102
    }
103
104
    public function testItRestrictsCreateFolderByCanAddChildren()
105
    {
106
        $folder = $this->objFromFixture(
107
            'SilverStripe\AssetAdmin\Tests\AssetAdminTest_Folder',
108
            'disallowCanAddChildren'
109
        );
110
111
        $response = Director::test(
112
            'admin/assets/api/createFolder',
113
            [
114
                'ParentID' => $folder->ID,
115
                'Name' => 'testItRestrictsCreateFolderByCanAddChildren',
116
                'SecurityID' => SecurityToken::inst()->getValue(),
117
            ],
118
            $this->session,
119
            'POST'
120
        );
121
        $this->assertTrue($response->isError());
122
        $this->assertEquals(403, $response->getStatusCode());
123
    }
124
125
    public function testItCreatesFile()
126
    {