GraphTest.php 1000 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Backend\Block\Dashboard;
  7. /**
  8. * @magentoAppArea adminhtml
  9. */
  10. class GraphTest extends \PHPUnit\Framework\TestCase
  11. {
  12. /**
  13. * @var \Magento\Backend\Block\Dashboard\Graph
  14. */
  15. protected $_block;
  16. protected function setUp()
  17. {
  18. parent::setUp();
  19. $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
  20. /** @var \Magento\Framework\View\LayoutInterface $layout */
  21. $layout = $objectManager->get(\Magento\Framework\View\LayoutInterface::class);
  22. $this->_block = $layout->createBlock(\Magento\Backend\Block\Dashboard\Graph::class);
  23. $this->_block->setDataHelper($objectManager->get(\Magento\Backend\Helper\Dashboard\Order::class));
  24. }
  25. public function testGetChartUrl()
  26. {
  27. $this->assertStringStartsWith('http://chart.apis.google.com/chart', $this->_block->getChartUrl());
  28. }
  29. }