![]() 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/Catalog/_files/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ $category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Catalog\Model\Category::class); $category->isObjectNew(true); $category->setId( '444' )->setName( 'Category 2' )->setAttributeSetId( '3' )->setParentId( 2 )->setPath( '1/2/444' )->setLevel( '2' )->setDefaultSortBy( 'name' )->setIsActive( true )->save(); $productModel = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( \Magento\Catalog\Model\Product::class ); $productModel->setTypeId( \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE )->setId( 1 )->setAttributeSetId( 4 )->setName( 'New Product' )->setSku( 'simple3' )->setPrice( 10 )->setTierPrice( [0 => ['website_id' => 0, 'cust_group' => 0, 'price_qty' => 3, 'price' => 8]] )->setVisibility( \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH )->setStatus( \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED )->setWebsiteIds( [1] )->setCategoryIds( [] )->setStockData( ['qty' => 100, 'is_in_stock' => 1, 'manage_stock' => 1] )->setCategoryIds( [444] )->save();