/**
  * Интеграционный тест. Берется простой workflow. Запускается процесс. Проверяется что произошел переход в нужный шаг.
  * В качестве хранилища используется база данных.
  *
  * @return array
  */
 public function testIntegrationWorkflowDoctrineZF2()
 {
     /** @noinspection PhpIncludeInspection */
     $this->setApplicationConfig(include Paths::getPathToAppConfig());
     /** @var BasicWorkflow $wfManager */
     $wfManager = $this->getApplicationServiceLocator()->get('workflow.manager.testWorkflowManager');
     $entryId = $wfManager->initialize('test', 1);
     $currentSteps = $wfManager->getCurrentSteps($entryId);
     static::assertCount(1, $currentSteps);
     /** @var Step $step */
     $currentSteps->rewind();
     $step = $currentSteps->current();
     static::assertInstanceOf(Step::class, $step);
     static::assertEquals(2, $step->getStepId());
 }
<?php

use OldTown\Workflow\Doctrine\ZF2\PhpUnit\Test\Paths;
use OldTown\Workflow\Doctrine\ZF2\PhpUnit\Utils\InitTestAppListener;
return ['modules' => ['DoctrineModule', 'DoctrineORMModule', 'OldTown\\Workflow\\ZF2', 'OldTown\\Workflow\\Doctrine\\ZF2'], 'module_listener_options' => ['module_paths' => ['OldTown\\Workflow\\Doctrine\\ZF2' => Paths::getPathToModule()], 'config_glob_paths' => [__DIR__ . '/config/autoload/{{,*.}global,{,*.}local}.php']], 'service_manager' => ['invokables' => [InitTestAppListener::class => InitTestAppListener::class]], 'listeners' => [InitTestAppListener::class]];
Ejemplo n.º 3
0
 public function testLoadModule()
 {
     /** @noinspection PhpIncludeInspection */
     $this->setApplicationConfig(include Paths::getPathToAppConfig());
     $this->assertModulesLoaded(['OldTown\\Workflow\\Doctrine\\ZF2']);
 }
Ejemplo n.º 4
0
<?php

/**
 * @link https://github.com/old-town/workflow-doctrine-zf2
 * @author  Malofeykin Andrey  <*****@*****.**>
 */
use OldTown\Workflow\Basic\BasicWorkflow;
use OldTown\Workflow\Loader\ArrayWorkflowFactory;
use OldTown\Workflow\Loader\XmlWorkflowFactory;
use OldTown\Workflow\Util\DefaultVariableResolver;
use OldTown\Workflow\Spi\Doctrine\DoctrineWorkflowStory;
use OldTown\Workflow\Doctrine\ZF2\EntityManagerFactory;
use OldTown\Workflow\Doctrine\ZF2\PhpUnit\Test\Paths;
return ['doctrine' => ['entitymanager' => ['test' => ['configuration' => 'test', 'connection' => 'test']], 'connection' => ['test' => ['configuration' => 'test', 'eventmanager' => 'orm_default']], 'configuration' => ['test' => ['metadata_cache' => 'array', 'query_cache' => 'array', 'result_cache' => 'array', 'hydration_cache' => 'array', 'driver' => 'test', 'generate_proxies' => true, 'proxy_dir' => Paths::getPathToDoctrineProxyDir(), 'proxy_namespace' => 'DoctrineORMModule\\Proxy', 'filters' => [], 'datetime_functions' => [], 'string_functions' => [], 'numeric_functions' => [], 'second_level_cache' => []]], 'driver' => ['test' => ['class' => 'Doctrine\\ORM\\Mapping\\Driver\\DriverChain', 'drivers' => ['OldTown\\Workflow\\Spi\\Doctrine\\Entity' => 'WorkflowDoctrineEntity']]]], 'workflow_zf2' => ['configurations' => ['default' => ['persistence' => ['name' => DoctrineWorkflowStory::class, 'options' => [DoctrineWorkflowStory::ENTITY_MANAGER_FACTORY => [DoctrineWorkflowStory::ENTITY_MANAGER_FACTORY_NAME => EntityManagerFactory::class, DoctrineWorkflowStory::ENTITY_MANAGER_FACTORY_OPTIONS => [EntityManagerFactory::ENTITY_MANAGER_NAME => 'doctrine.entitymanager.test']]]], 'factory' => ['name' => ArrayWorkflowFactory::class, 'options' => ['reload' => true, 'workflows' => ['test' => ['location' => __DIR__ . '/test_workflow.xml']]]], 'resolver' => DefaultVariableResolver::class]], 'managers' => ['testWorkflowManager' => ['configuration' => 'default', 'name' => BasicWorkflow::class]]]];