public function test_workflows() { $config = array('types' => array(), 'workflows' => array('mock' => 'Midgard\\CreatePHP\\tests\\MockWorkflow')); $mapper = new MockMapper(); $loader = new ArrayLoader($config); $manager = $loader->getManager($mapper); $workflows = $manager->getRestHandler()->getWorkflows('test_id'); $expected = array(array('name' => "mockbutton", 'label' => 'Mock Label', 'action' => array('type' => "backbone_destroy"), 'type' => "button")); $this->assertEquals($expected, $workflows); }
public function __construct(array $config, RdfMapperInterface $mapper = null) { if (null === $mapper) { $this->_mapper = new dba2rdfMapper(); } else { $this->_mapper = $mapper; } $loader = new ArrayLoader($config); $this->_manager = $loader->getManager($this->_mapper); $this->_manager->registerWorkflow('delete', new delete()); }