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