PaymentQueuePaymentIdsAlterTest.php in Payment 8.2
File
tests/src/Unit/Event/PaymentQueuePaymentIdsAlterTest.php
View source
<?php
namespace Drupal\Tests\payment\Unit\Event;
use Drupal\payment\Event\PaymentQueuePaymentIdsAlter;
use Drupal\Tests\UnitTestCase;
class PaymentQueuePaymentIdsAlterTest extends UnitTestCase {
protected $categoryId;
protected $ownerId;
protected $paymentIds;
protected $queueId;
protected $sut;
public function setUp() : void {
$this->categoryId = $this
->randomMachineName();
$this->ownerId = $this
->randomMachineName();
$this->paymentIds = array(
$this
->randomMachineName(),
);
$this->sut = new PaymentQueuePaymentIdsAlter($this->queueId, $this->categoryId, $this->ownerId, $this->paymentIds);
}
public function testGetQueueId() {
$this
->assertSame($this->queueId, $this->sut
->getQueueId());
}
public function testGetCategoryId() {
$this
->assertSame($this->categoryId, $this->sut
->getCategoryId());
}
public function testGetOwnerId() {
$this
->assertSame($this->ownerId, $this->sut
->getOwnerId());
}
public function testGetPaymentIds() {
$this
->assertSame($this->paymentIds, $this->sut
->getPaymentIds());
$payment_ids = array(
$this
->randomMachineName(),
);
$this
->assertSame($this->sut, $this->sut
->setPaymentIds($payment_ids));
$this
->assertSame($payment_ids, $this->sut
->getPaymentIds());
}
}