| Total Complexity | 2 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class UserFormFileExtensionTest extends SapphireTest |
||
| 11 | { |
||
| 12 | protected $usesDatabase = true; |
||
| 13 | |||
| 14 | public function testUpdateIsUserFormUploadFalse() |
||
| 15 | { |
||
| 16 | $file = File::create(); |
||
| 17 | $file->write(); |
||
| 18 | $this->assertNull($file->UserFormUpload); |
||
| 19 | |||
| 20 | $value = true; |
||
| 21 | $file->invokeWithExtensions('updateTrackedFormUpload', $value); |
||
| 22 | $this->assertFalse($value); |
||
| 23 | |||
| 24 | // refresh DataObject to get latest DB changes |
||
| 25 | $file = File::get()->byID($file->ID); |
||
| 26 | |||
| 27 | $this->assertEquals(UserFormFileExtension::USER_FORM_UPLOAD_FALSE, $file->UserFormUpload); |
||
| 28 | } |
||
| 29 | |||
| 30 | public function testUpdateIsUserFormUploadTrue() |
||
| 48 | } |
||
| 49 | } |
||
| 50 |