AdapterAbstractTest.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Translate\Test\Unit;
  7. class AdapterAbstractTest extends \PHPUnit\Framework\TestCase
  8. {
  9. /**
  10. * @var \Magento\Framework\Translate\AbstractAdapter
  11. */
  12. protected $_model = null;
  13. protected function setUp()
  14. {
  15. $this->_model = $this->getMockBuilder(\Magento\Framework\Translate\AbstractAdapter::class)
  16. ->getMockForAbstractClass();
  17. }
  18. /**
  19. * Magento translate adapter should always return false to be used correctly be Zend Validate
  20. */
  21. public function testIsTranslated()
  22. {
  23. $this->assertFalse($this->_model->isTranslated('string'));
  24. }
  25. /**
  26. * Test set locale do nothing
  27. */
  28. public function testSetLocale()
  29. {
  30. $this->assertInstanceOf(
  31. \Magento\Framework\Translate\AbstractAdapter::class,
  32. $this->_model->setLocale('en_US')
  33. );
  34. }
  35. /**
  36. * Check that abstract method is implemented
  37. */
  38. public function testToString()
  39. {
  40. $this->assertEquals(\Magento\Framework\Translate\Adapter::class, $this->_model->toString());
  41. }
  42. }