Skip to content

Commit 9b3aea4

Browse files
committed
Merge remote-tracking branch 'origin/MC-39636' into 2.4-develop-sidecar-pr10
2 parents 23d7ba5 + b5bbc2b commit 9b3aea4

File tree

1 file changed

+22
-0
lines changed
  • dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Category/Save

1 file changed

+22
-0
lines changed

dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Category/Save/SaveCategoryTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
use Magento\Catalog\Api\Data\CategoryInterface;
1212
use Magento\Catalog\Model\Category;
1313
use Magento\Cms\Api\GetBlockByIdentifierInterface;
14+
use Magento\Framework\App\Request\Http as HttpRequest;
1415
use Magento\Framework\Exception\NoSuchEntityException;
16+
use Magento\Framework\Message\MessageInterface;
1517
use Magento\Store\Model\StoreManagerInterface;
1618

1719
/**
@@ -87,4 +89,24 @@ public function testCreateCategoryWithCmsBlock(): void
8789
$category = $this->categoryRepository->get($this->createdCategoryId);
8890
$this->assertEquals($blockId, $category->getLandingPage());
8991
}
92+
93+
/**
94+
* @return void
95+
*/
96+
public function testTryToCreateCategoryWithEmptyValues(): void
97+
{
98+
$this->getRequest()->setMethod(HttpRequest::METHOD_POST);
99+
$this->getRequest()->setPostValue([
100+
CategoryInterface::KEY_NAME => 'test',
101+
CategoryInterface::KEY_IS_ACTIVE => 1,
102+
'use_config' => [],
103+
'return_session_messages_only' => false,
104+
]);
105+
$this->dispatch('backend/catalog/category/save');
106+
$message = (string)__(
107+
'The "%1" attribute is required. Enter and try again.',
108+
'Available Product Listing Sort By'
109+
);
110+
$this->assertSessionMessages($this->containsEqual($message), MessageInterface::TYPE_ERROR);
111+
}
90112
}

0 commit comments

Comments
 (0)