|
@@ 191-205 (lines=15) @@
|
| 188 |
|
$this->assertNotContains('IFD0', $exif['SectionsFound']); |
| 189 |
|
} |
| 190 |
|
|
| 191 |
|
public function testAddFailureMaxUploadsPerUser() |
| 192 |
|
{ |
| 193 |
|
Configure::read('Saito.Settings.uploader')->setMaxNumberOfUploadsPerUser(1); |
| 194 |
|
$this->loginJwt(1); |
| 195 |
|
|
| 196 |
|
$Uploads = TableRegistry::get('ImageUploader.Uploads'); |
| 197 |
|
$count = $Uploads->find()->count(); |
| 198 |
|
|
| 199 |
|
$this->expectException(GenericApiException::class); |
| 200 |
|
$this->expectExceptionMessage('Error: Reached the maximal number of 1 uploads.'); |
| 201 |
|
|
| 202 |
|
$this->upload($this->file); |
| 203 |
|
|
| 204 |
|
$this->assertEquals($count, $Uploads->find()->count()); |
| 205 |
|
} |
| 206 |
|
|
| 207 |
|
public function testAddFailureMaxDocumentSize() |
| 208 |
|
{ |
|
@@ 207-224 (lines=18) @@
|
| 204 |
|
$this->assertEquals($count, $Uploads->find()->count()); |
| 205 |
|
} |
| 206 |
|
|
| 207 |
|
public function testAddFailureMaxDocumentSize() |
| 208 |
|
{ |
| 209 |
|
Configure::read('Saito.Settings.uploader') |
| 210 |
|
->setMaxNumberOfUploadsPerUser(10) |
| 211 |
|
->addType('image/png', 10); |
| 212 |
|
|
| 213 |
|
$this->loginJwt(1); |
| 214 |
|
|
| 215 |
|
$Uploads = TableRegistry::get('ImageUploader.Uploads'); |
| 216 |
|
$count = $Uploads->find()->count(); |
| 217 |
|
|
| 218 |
|
$this->expectException(GenericApiException::class); |
| 219 |
|
$this->expectExceptionMessage('Error: File size exceeds allowed limit of 10 Bytes.'); |
| 220 |
|
|
| 221 |
|
$this->upload($this->file); |
| 222 |
|
|
| 223 |
|
$this->assertEquals($count, $Uploads->find()->count()); |
| 224 |
|
} |
| 225 |
|
|
| 226 |
|
public function testIndexNoAuthorization() |
| 227 |
|
{ |