From 3e3681db5a3c414fadfd3ba738b4fcbc092001f3 Mon Sep 17 00:00:00 2001 From: Herbert Maschke Date: Tue, 11 Aug 2020 09:31:11 +0200 Subject: [PATCH] add testBlockProductCopy --- tests/functional/Product/ProductCopyCest.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/functional/Product/ProductCopyCest.php b/tests/functional/Product/ProductCopyCest.php index fc7638a83..392746f73 100644 --- a/tests/functional/Product/ProductCopyCest.php +++ b/tests/functional/Product/ProductCopyCest.php @@ -12,10 +12,13 @@ use Webkul\Product\Models\ProductAttributeValue; class ProductCopyCest { - public function testSkipAttributes(FunctionalTester $I) + public function _before(FunctionalTester $I) { $I->loginAsAdmin(); + } + public function testSkipAttributes(FunctionalTester $I) + { config(['products.skipAttributesOnCopy' => ['name', 'inventories']]); $original = $I->haveProduct(Laravel5Helper::SIMPLE_PRODUCT, [ @@ -42,10 +45,17 @@ class ProductCopyCest ]); } + public function testBlockProductCopy(FunctionalTester $I) + { + $original = $I->haveProduct(Laravel5Helper::BOOKING_EVENT_PRODUCT, []); + + $I->amOnAdminRoute('admin.catalog.products.copy', ['id' => $original->id], false); + + $I->seeInSource('Products of type booking can not be copied'); + } + public function testProductCopy(FunctionalTester $I) { - $I->loginAsAdmin(); - // set this config value to true to make it testable. It defaults to false. config(['products.linkProductsOnCopy' => true]);