public function testLiftImportMerge_ZipFileNoLift_Exception() { $zipFilePath = $this->environ->copyTestUploadFile(TestPath . 'common/TestLexNoProject.zip'); $project = $this->environ->createProject(SF_TESTPROJECT, SF_TESTPROJECTCODE); $this->environ->inhibitErrorDisplay(); $this->expectException(new \Exception("Uploaded file does not contain any LIFT data")); $importer = LiftImport::get()->importZip($zipFilePath, $project); // nothing runs in the current test function after an exception. IJH 2014-11 }
public function testDeleteImageFile_UnsupportedMediaType_Exception() { $project = $this->environ->createProject(SF_TESTPROJECT, SF_TESTPROJECTCODE); $projectId = $project->id->asString(); $this->environ->inhibitErrorDisplay(); $this->expectException(); LexUploadCommands::deleteMediaFile($projectId, 'bogusMediaType', ''); // nothing runs in the current test function after an exception. IJH 2014-11 }
/** * @expectedException Exception */ public function testUpdateCommentStatus_InvalidStatus_Exception() { $environ = new LexiconMongoTestEnvironment(); $environ->clean(); $project = $environ->createProject(SF_TESTPROJECT, SF_TESTPROJECTCODE); $userId = $environ->createUser('joe', 'joe', 'joe'); $regarding = array('field' => 'lexeme', 'fieldValue' => 'Word 1', 'inputSystem' => 'th', 'word' => '', 'meaning' => ''); $data = array('id' => '', 'content' => 'hi there!', 'regarding' => $regarding); $commentId = LexCommentCommands::updateComment($project->id->asString(), $userId, $environ->website, $data); $comment = new LexCommentModel($project, $commentId); $this->assertEquals(LexCommentModel::STATUS_OPEN, $comment->status); // save data for rest of this test self::$save['environ'] = $environ; self::$save['commentId'] = $commentId; self::$save['comment'] = $comment; $environ->inhibitErrorDisplay(); LexCommentCommands::updateCommentStatus($project->id->asString(), $commentId, 'malicious code; rm -rf'); // nothing runs in the current test function after an exception. IJH 2014-11 }