![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/dev/tests/integration/testsuite/Magento/Wishlist/Controller/Index/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\Wishlist\Controller\Index; use Magento\Customer\Model\Session; use Magento\TestFramework\Helper\Xpath; use Magento\TestFramework\TestCase\AbstractController; /** * Test wish list on customer account page. * * @magentoDbIsolation disabled * @magentoAppArea frontend */ class IndexTest extends AbstractController { /** @var Session */ private $customerSession; /** * @inheritdoc */ protected function setUp(): void { parent::setUp(); $this->customerSession = $this->_objectManager->get(Session::class); } /** * @inheritdoc */ protected function tearDown(): void { $this->customerSession->setCustomerId(null); parent::tearDown(); } /** * Verify wishlist view action * * The following is verified: * - \Magento\Wishlist\Model\ResourceModel\Item\Collection * - \Magento\Wishlist\Block\Customer\Wishlist * - \Magento\Wishlist\Block\Customer\Wishlist\Items * - \Magento\Wishlist\Block\Customer\Wishlist\Item\Column * - \Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Cart * - \Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Comment * - \Magento\Wishlist\Block\Customer\Wishlist\Button * - that \Magento\Wishlist\Block\Customer\Wishlist\Item\Options doesn't throw a fatal error * * @magentoDataFixture Magento/Wishlist/_files/wishlist.php * * @return void */ public function testItemColumnBlock(): void { $this->customerSession->setCustomerId(1); $this->dispatch('wishlist/index/index'); $body = $this->getResponse()->getBody(); $this->assertEquals( 1, Xpath::getElementsCountForXpath( '//img[contains(@src, "small_image.jpg") and @alt = "Simple Product"]', $body ) ); $this->assertEquals( 1, Xpath::getElementsCountForXpath( '//textarea[contains(@name, "description")]', $body ) ); } }