*/
class PropertyBagTest extends \PHPUnit\Framework\TestCase implements HeadlessInterface, TransactionalInterface {
+ /**
+ * @return \Civi\Test\CiviEnvBuilder
+ */
public function setUpHeadless() {
return \Civi\Test::headless()->apply();
}
- protected function setUp() {
- parent::setUp();
- // $this->useTransaction(TRUE);
- }
-
- public function tearDown() {
- parent::tearDown();
- }
-
/**
* Test we can set a contact ID.
*/
$this->assertEquals('a@b.com', $localPropertyBag->getEmail());
}
+ /**
+ * Test that null is valid for recurring contribution ID.
+ *
+ * See https://github.com/civicrm/civicrm-core/pull/17292
+ */
+ public function testRecurProcessorIDNull() {
+ $bag = new PropertyBag();
+ $bag->setRecurProcessorID(NULL);
+ $value = $bag->getRecurProcessorID();
+ $this->assertNull($value);
+ }
+
/**
*/
public function testMergeInputs() {
['paymentToken', [], $valid_strings, []],
['recurFrequencyInterval', ['frequency_interval'], $valid_ints, $invalid_ints],
['recurFrequencyUnit', [], [['month', 'month'], ['day', 'day'], ['year', 'year']], ['', NULL, 0]],
- ['recurProcessorID', [], [['foo', 'foo']], [str_repeat('x', 256), NULL, '', 0]],
+ ['recurProcessorID', [], [['foo', 'foo']], [str_repeat('x', 256)]],
['transactionID', ['transaction_id'], $valid_strings, []],
['trxnResultCode', [], $valid_strings, []],
];