DataTest.php 916 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Url\Helper;
  7. class DataTest extends \PHPUnit\Framework\TestCase
  8. {
  9. /**
  10. * @var \Magento\Framework\Url\Helper\Data
  11. */
  12. protected $_helper = null;
  13. protected function setUp()
  14. {
  15. $this->_helper = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
  16. \Magento\Framework\Url\Helper\Data::class
  17. );
  18. }
  19. public function testGetCurrentBase64Url()
  20. {
  21. $this->assertEquals('aHR0cDovL2xvY2FsaG9zdDo4MS8,', $this->_helper->getCurrentBase64Url());
  22. }
  23. public function testGetEncodedUrl()
  24. {
  25. $this->assertEquals('aHR0cDovL2xvY2FsaG9zdDo4MS8,', $this->_helper->getEncodedUrl());
  26. $this->assertEquals('aHR0cDovL2V4YW1wbGUuY29tLw,,', $this->_helper->getEncodedUrl('http://example.com/'));
  27. }
  28. }