public function testVirtualProcess() { $processAuthoringService = wfAuthoring_models_classes_ProcessService::singleton(); $processDefinitionClass = new core_kernel_classes_Class(CLASS_PROCESS); $processDefinition = $processDefinitionClass->createInstance('ProcessForUnitTest', 'Unit test'); $this->assertIsA($processDefinition, 'core_kernel_classes_Resource'); $authoringService = wfAuthoring_models_classes_ProcessService::singleton(); //define activities and connectors $activity1 = $authoringService->createActivity($processDefinition, 'activity1'); $this->assertNotNull($activity1); $authoringService->setFirstActivity($processDefinition, $activity1); //check first activity $this->assertTrue($this->service->isActivity($activity1)); $this->assertTrue($this->service->isInitial($activity1)); $connector1 = $authoringService->createConnector($activity1); $authoringService->setConnectorType($connector1, new core_kernel_classes_Resource(INSTANCE_TYPEOFCONNECTORS_SEQUENCE)); $activity2 = $authoringService->createSequenceActivity($connector1, null, 'activity2'); $this->assertNotNull($activity2); $this->assertTrue($this->service->isActivity($activity2)); $this->assertFalse($this->service->isFinal($activity1)); $this->assertFalse($this->service->isInitial($activity2)); $this->assertTrue($this->service->isFinal($activity2)); $activity1->delete(true); $connector1->delete(true); $activity2->delete(true); $processDefinition->delete(true); }