StatusTest.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Sales\Model\ResourceModel\Order;
  7. use Magento\TestFramework\Helper\Bootstrap;
  8. /**
  9. * Class StatusTest
  10. */
  11. class StatusTest extends \PHPUnit\Framework\TestCase
  12. {
  13. /**
  14. * @var \Magento\Sales\Model\ResourceModel\Order\Status
  15. */
  16. protected $resourceModel;
  17. /**
  18. * Test setUp
  19. */
  20. public function setUp()
  21. {
  22. $this->resourceModel = Bootstrap::getObjectManager()
  23. ->create(
  24. \Magento\Sales\Model\ResourceModel\Order\Status::class,
  25. [
  26. 'data' => ['status' => 'fake_status']
  27. ]
  28. );
  29. }
  30. /**
  31. * @magentoDataFixture Magento/Sales/_files/assign_status_to_state.php
  32. */
  33. public function testUnassignState()
  34. {
  35. $this->resourceModel->unassignState('fake_status_do_not_use_it', 'fake_state_do_not_use_it');
  36. $this->assertTrue(true);
  37. $this->assertFalse((bool)
  38. $this->resourceModel->getConnection()->fetchOne($this->resourceModel->getConnection()->select()
  39. ->from($this->resourceModel->getTable('sales_order_status_state'), [new \Zend_Db_Expr(1)])
  40. ->where('status = ?', 'fake_status_do_not_use_it')
  41. ->where('state = ?', 'fake_state_do_not_use_it')));
  42. }
  43. }