ConfigTest.php 975 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Backend\Test\Unit\Model\Translate\Inline;
  7. class ConfigTest extends \PHPUnit\Framework\TestCase
  8. {
  9. public function testIsActive()
  10. {
  11. $result = 'result';
  12. $backendConfig = $this->getMockForAbstractClass(\Magento\Backend\App\ConfigInterface::class);
  13. $backendConfig->expects(
  14. $this->once()
  15. )->method(
  16. 'isSetFlag'
  17. )->with(
  18. $this->equalTo('dev/translate_inline/active_admin')
  19. )->will(
  20. $this->returnValue($result)
  21. );
  22. $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
  23. $config = $objectManager->getObject(
  24. \Magento\Backend\Model\Translate\Inline\Config::class,
  25. ['config' => $backendConfig]
  26. );
  27. $this->assertEquals($result, $config->isActive('any'));
  28. }
  29. }