private function moveAttachmentToFinalPlace(Tracker_FileInfo $attachment, $method, $src_path) { if ($method($src_path, $attachment->getPath())) { $attachment->postUploadActions(); return true; } else { $attachment->delete(); return false; } }
public function itCreatesThumbnailForJpeg() { copy($this->fixture_data_dir . '/logo.jpg', $this->working_directory . '/421'); $file_info_1 = new Tracker_FileInfo(421, $this->field, 0, '', '', '', 'image/jpg'); $this->assertFalse(file_exists($file_info_1->getThumbnailPath())); $file_info_1->postUploadActions(); $this->assertTrue(file_exists($file_info_1->getThumbnailPath())); $this->assertEqual(getimagesize($file_info_1->getThumbnailPath()), array(150, 55, IMAGETYPE_JPEG, 'width="150" height="55"', 'bits' => 8, 'channels' => 3, 'mime' => 'image/jpeg')); }