Esempio n. 1
0
 /**
  * @test
  */
 public function buildCustomWiredAction()
 {
     $pipeline = new Pipeline("wizbii_profile");
     $pipelineFactory = new PipelineFactory();
     $pipelineFactory->buildAction($pipeline, "profile_network_updated", ["triggered_by_events" => ["profile_new_connection", "profile_new_school"]]);
     // check the number of created actions
     $this->assertThat(count($pipeline->getActions()), $this->equalTo(1));
     // check the action
     $profileAnniversaryAction = $pipeline->getAction("profile_network_updated");
     $this->assertThat($profileAnniversaryAction, $this->isInstanceOf(Action::class));
     // check the action creator
     $profileAnniversaryActionCreator = $pipeline->getActionCreatorFor("profile_network_updated");
     $this->assertThat($profileAnniversaryActionCreator, $this->isInstanceOf(ActionCreator::class));
     $this->assertThat(count($profileAnniversaryActionCreator->getTriggeredByEvents()), $this->equalTo(2));
     $this->assertThat($profileAnniversaryActionCreator->getTriggeredByEvents()[0]->getName(), $this->equalTo("profile_new_connection"));
     $this->assertThat($profileAnniversaryActionCreator->getTriggeredByEvents()[1]->getName(), $this->equalTo("profile_new_school"));
 }