MultipleValueOrTextNodeTest.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace Test\Unit;
  3. require_once dirname(__DIR__) . '/Setup.php';
  4. use Test\Setup;
  5. use Braintree;
  6. class MultipleValueOrTextNodeTest extends Setup
  7. {
  8. public function testIn()
  9. {
  10. $node = new Braintree\MultipleValueOrTextNode('field');
  11. $node->in(['firstValue', 'secondValue']);
  12. $this->assertEquals(['firstValue', 'secondValue'], $node->toParam());
  13. }
  14. public function testIs()
  15. {
  16. $node = new Braintree\MultipleValueOrTextNode('field');
  17. $node->is('value');
  18. $this->assertEquals(['is' => 'value'], $node->toParam());
  19. }
  20. public function testIsNot()
  21. {
  22. $node = new Braintree\MultipleValueOrTextNode('field');
  23. $node->isNot('value');
  24. $this->assertEquals(['is_not' => 'value'], $node->toParam());
  25. }
  26. public function testStartsWith()
  27. {
  28. $node = new Braintree\MultipleValueOrTextNode('field');
  29. $node->startsWith('beginning');
  30. $this->assertEquals(['starts_with' => 'beginning'], $node->toParam());
  31. }
  32. public function testEndsWith()
  33. {
  34. $node = new Braintree\MultipleValueOrTextNode('field');
  35. $node->endsWith('end');
  36. $this->assertEquals(['ends_with' => 'end'], $node->toParam());
  37. }
  38. public function testContains()
  39. {
  40. $node = new Braintree\MultipleValueOrTextNode('field');
  41. $node->contains('middle');
  42. $this->assertEquals(['contains' => 'middle'], $node->toParam());
  43. }
  44. }