function testUploadAudio_WavFile_uploadDisallowed() { $environ = new MongoTestEnvironment(); $environ->clean(); $project = $environ->createProject(SF_TESTPROJECT, SF_TESTPROJECTCODE); $projectId = $project->write(); $text = new TextModel($project); $textId = $text->write(); $tmpFilePath = $environ->uploadTextAudioFile(TestPath . 'common/TestAudio.wav', 'TestAudio.mp3', $textId); $response = SfchecksUploadCommands::uploadFile($projectId, 'audio', $tmpFilePath); $this->assertFalse($response->result, 'Import should fail'); $this->assertEqual('UserMessage', $response->data->errorType, 'Error response should be a user message'); $this->assertPattern('/Ensure the file is a .mp3/', $response->data->errorMessage, 'Error message should match the error'); $tmpFilePath = $environ->uploadTextAudioFile(TestPath . 'common/TestAudio.mp3', 'TestAudio.wav', $textId); $response = SfchecksUploadCommands::uploadFile($projectId, 'audio', $tmpFilePath); $this->assertFalse($response->result, 'Import should fail'); $this->assertEqual('UserMessage', $response->data->errorType, 'Error response should be a user message'); $this->assertPattern('/Ensure the file is a .mp3/', $response->data->errorMessage, 'Error message should match the error'); $environ->cleanupTestFiles($project->getAssetsFolderPath()); }