StringTest.php 960 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Translation\Model;
  7. class StringTest extends \PHPUnit\Framework\TestCase
  8. {
  9. /**
  10. * @var \Magento\Translation\Model\StringUtils
  11. */
  12. protected $_model;
  13. protected function setUp()
  14. {
  15. $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
  16. \Magento\Translation\Model\StringUtils::class
  17. );
  18. }
  19. public function testConstructor()
  20. {
  21. $this->assertInstanceOf(
  22. \Magento\Translation\Model\ResourceModel\StringUtils::class,
  23. $this->_model->getResource()
  24. );
  25. }
  26. public function testSetGetString()
  27. {
  28. $expectedString = __METHOD__;
  29. $this->_model->setString($expectedString);
  30. $actualString = $this->_model->getString();
  31. $this->assertEquals($expectedString, $actualString);
  32. }
  33. }