File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Category/Save Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 11
11
use Magento \Catalog \Api \Data \CategoryInterface ;
12
12
use Magento \Catalog \Model \Category ;
13
13
use Magento \Cms \Api \GetBlockByIdentifierInterface ;
14
+ use Magento \Framework \App \Request \Http as HttpRequest ;
14
15
use Magento \Framework \Exception \NoSuchEntityException ;
16
+ use Magento \Framework \Message \MessageInterface ;
15
17
use Magento \Store \Model \StoreManagerInterface ;
16
18
17
19
/**
@@ -87,4 +89,21 @@ public function testCreateCategoryWithCmsBlock(): void
87
89
$ category = $ this ->categoryRepository ->get ($ this ->createdCategoryId );
88
90
$ this ->assertEquals ($ blockId , $ category ->getLandingPage ());
89
91
}
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 = 'The "Available Product Listing Sort By" attribute is required. Enter and try again. ' ;
107
+ $ this ->assertSessionMessages ($ this ->equalTo ([(string )__ ($ message )]), MessageInterface::TYPE_ERROR );
108
+ }
90
109
}
You can’t perform that action at this time.
0 commit comments