Esempio n. 1
0
 /**
  * @param bool $singleItemMode
  * @return MessageHandler
  */
 protected function getArticleExporterMessageHandler($singleItemMode = false)
 {
     $supportedProcessingType = $singleItemMode ? Article::prototype() : ArticleCollection::prototype();
     return MessageHandler::fromDefinition(MessageHandlerId::generate(), 'Article Exporter', NodeName::defaultName(), MessageHandler\HandlerType::connector(), MessageHandler\DataDirection::source(), MessageHandler\ProcessingTypes::support([$supportedProcessingType]), ProcessingMetadata::fromArray(['chunk_support' => true]), 'sqlconnector-pm-metadata', 'glyphicon-hdd', 'glyphicon');
 }
 /**
  * @test
  */
 function it_installs_a_message_handler()
 {
     $messageHandler = ProcessingNode::initializeAs(NodeName::defaultName())->installMessageHandler(MessageHandlerId::generate(), 'Article Exporter', HandlerType::connector(), DataDirection::source(), ProcessingTypes::support([ArticleCollection::prototype()]), ProcessingMetadata::noData(), 'sqlconnector-pm-metadata', 'glyphicon-hdd', 'glyphicon', ArticleCollection::prototype(), ProcessingId::fromString('sqlconnector:::example'));
     $this->assertInstanceOf(MessageHandler::class, $messageHandler);
 }
 /**
  * @test
  */
 function it_is_equal_to_another_source()
 {
     $direction1 = DataDirection::source();
     $direction2 = DataDirection::source();
     $this->assertTrue($direction1->equals($direction2));
 }