Code Duplication    Length = 17-17 lines in 2 locations

tests/php/AssetAdminTest.php 2 locations

@@ 112-128 (lines=17) @@
109
        $this->assertEquals('testItCreatesFolder', $newFolder->Name);
110
    }
111
112
    public function testItRestrictsCreateFolderByCanCreate()
113
    {
114
        $folder = $this->objFromFixture(Folder::class, 'folder1');
115
116
        $response = Director::test(
117
            'admin/assets/api/createFolder',
118
            [
119
                'ParentID' => $folder->ID,
120
                'Name' => 'disallowCanCreate',
121
                'SecurityID' => SecurityToken::inst()->getValue(),
122
            ],
123
            $this->session,
124
            'POST'
125
        );
126
        $this->assertTrue($response->isError());
127
        $this->assertEquals(403, $response->getStatusCode());
128
    }
129
130
    public function testItRestrictsCreateFolderByCanAddChildren()
131
    {
@@ 130-146 (lines=17) @@
127
        $this->assertEquals(403, $response->getStatusCode());
128
    }
129
130
    public function testItRestrictsCreateFolderByCanAddChildren()
131
    {
132
        $folder = $this->objFromFixture(Folder::class, 'disallowCanAddChildren');
133
134
        $response = Director::test(
135
            'admin/assets/api/createFolder',
136
            [
137
                'ParentID' => $folder->ID,
138
                'Name' => 'testItRestrictsCreateFolderByCanAddChildren',
139
                'SecurityID' => SecurityToken::inst()->getValue(),
140
            ],
141
            $this->session,
142
            'POST'
143
        );
144
        $this->assertTrue($response->isError());
145
        $this->assertEquals(403, $response->getStatusCode());
146
    }
147
148
    public function testItCreatesFile()
149
    {