ResultTest.php 932 B

123456789101112131415161718192021222324
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\CatalogSearch\Block;
  7. class ResultTest extends \PHPUnit\Framework\TestCase
  8. {
  9. public function testSetListOrders()
  10. {
  11. /** @var $layout \Magento\Framework\View\Layout */
  12. $layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
  13. \Magento\Framework\View\LayoutInterface::class
  14. );
  15. $layout->addBlock(\Magento\Framework\View\Element\Text::class, 'head');
  16. // The tested block is using head block
  17. /** @var $block \Magento\CatalogSearch\Block\Result */
  18. $block = $layout->addBlock(\Magento\CatalogSearch\Block\Result::class, 'block');
  19. $childBlock = $layout->addBlock(\Magento\Framework\View\Element\Text::class, 'search_result_list', 'block');
  20. $this->assertSame($childBlock, $block->getListBlock());
  21. }
  22. }