public function testGetProjectStatus_HasSendReceiveAndSyncing_SyncingState() { $project = self::$environ->createProject(SF_TESTPROJECT, SF_TESTPROJECTCODE); $project->sendReceiveProjectIdentifier = 'sr_id'; $project->sendReceiveProject = new SendReceiveProjectModel('sr_name', '', 'manager'); $projectId = $project->write(); // Create test queue directories $tmpTestPath = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'pendingStateTest'; $lfMergePaths = SendReceiveCommands::getLFMergePaths(true, $tmpTestPath); $projectStatePath = $lfMergePaths->statePath . DIRECTORY_SEPARATOR . strtolower($project->projectCode) . '.state'; FileUtilities::createAllFolders($tmpTestPath); FileUtilities::createAllFolders($lfMergePaths->mergeQueuePath); FileUtilities::createAllFolders($lfMergePaths->receiveQueuePath); FileUtilities::createAllFolders($lfMergePaths->sendQueuePath); FileUtilities::createAllFolders($lfMergePaths->editQueuePath); FileUtilities::createAllFolders($lfMergePaths->syncQueuePath); FileUtilities::createAllFolders($lfMergePaths->statePath); $mockQueuePath = $lfMergePaths->syncQueuePath; SendReceiveCommands::queueProjectForSync($projectId, $mockQueuePath); file_put_contents($projectStatePath, '{"SRState": "SYNCING"}'); $status = SendReceiveCommands::getProjectStatus($projectId, $lfMergePaths->statePath); $this->assertEquals('SYNCING', $status['SRState']); FileUtilities::removeFolderAndAllContents($mockQueuePath); $mockQueuePath = $lfMergePaths->editQueuePath; SendReceiveCommands::queueProjectForEdit($projectId, $mockQueuePath); file_put_contents($projectStatePath, '{"SRState": "SYNCING"}'); $status = SendReceiveCommands::getProjectStatus($projectId, $lfMergePaths->statePath); $this->assertEquals('SYNCING', $status['SRState']); FileUtilities::removeFolderAndAllContents($mockQueuePath); FileUtilities::removeFolderAndAllContents($tmpTestPath); }