/** * @covers ::getResumeContextResponse * * @depends testGetPayment */ public function testGetResumeContextResponse() { $response = $this->getMock(ResponseInterface::class); $payment = $this->getMock(PaymentInterface::class); $this->sut->setPayment($payment); $this->sut->expects($this->atLeastOnce())->method('doGetResumeContextResponse')->willReturn($response); $this->eventDispatcher->expects($this->once())->method('preResumeContext')->with($payment); $this->assertSame($response, $this->sut->getResumeContextResponse()); }
/** * Constructs a new instance. * * @param mixed[] $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin_id for the plugin instance. * @param mixed[] $plugin_definition * The plugin implementation definition. * @param \Drupal\payment\EventDispatcherInterface $event_dispatcher * The event dispatcher. * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation * The string translator. */ public function __construct(array $configuration, $plugin_id, array $plugin_definition, EventDispatcherInterface $event_dispatcher, TranslationInterface $string_translation) { parent::__construct($configuration, $plugin_id, $plugin_definition, $event_dispatcher); $this->stringTranslation = $string_translation; }
/** * {@inheritdoc} */ public function defaultConfiguration() { return array('bundle' => NULL, 'entity_type_id' => NULL, 'field_name' => NULL) + parent::defaultConfiguration(); }
/** * {@inheritdoc} */ public function defaultConfiguration() { return ['bundle' => NULL, 'destination_url' => NULL, 'entity_type_id' => NULL, 'field_name' => NULL] + parent::defaultConfiguration(); }