RuleTest.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\SalesRule\Test\Unit\Model\Plugin;
  7. class RuleTest extends \PHPUnit\Framework\TestCase
  8. {
  9. /**
  10. * @var \Magento\SalesRule\Model\Plugin\Rule
  11. */
  12. protected $plugin;
  13. /**}
  14. * @var \Magento\SalesRule\Model\Rule|\PHPUnit_Framework_MockObject_MockObject
  15. */
  16. protected $subject;
  17. /**
  18. * @var \Closure
  19. */
  20. protected $genericClosure;
  21. protected function setUp()
  22. {
  23. $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
  24. $this->subject = $this->getMockBuilder(\Magento\SalesRule\Model\Rule::class)
  25. ->disableOriginalConstructor()
  26. ->getMock();
  27. $this->genericClosure = function () {
  28. return;
  29. };
  30. $this->plugin = $objectManager->getObject(\Magento\SalesRule\Model\Plugin\Rule::class);
  31. }
  32. public function testLoadRelations()
  33. {
  34. $this->assertEquals(
  35. $this->subject,
  36. $this->plugin->aroundLoadRelations($this->subject, $this->genericClosure)
  37. );
  38. }
  39. }