LineItemTest.php 645 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace CMText\RichContent\Common;
  3. use PHPUnit\Framework\TestCase;
  4. class LineItemTest extends TestCase
  5. {
  6. public function test__construct()
  7. {
  8. $lineitem = new \CMText\RichContent\Common\LineItem(
  9. 'product-name',
  10. 'final-or-pending',
  11. 1
  12. );
  13. $json = json_decode(json_encode($lineitem));
  14. $this->assertObjectHasAttribute(
  15. 'label',
  16. $json
  17. );
  18. $this->assertObjectHasAttribute(
  19. 'type',
  20. $json
  21. );
  22. $this->assertObjectHasAttribute(
  23. 'amount',
  24. $json
  25. );
  26. }
  27. }