File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
dev/tests/integration/testsuite/Magento/CatalogWidget/Model/Rule/Condition Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 77namespace Magento \CatalogWidget \Model \Rule \Condition ;
88
99use Magento \Catalog \Api \Data \ProductInterface ;
10+ use Magento \Catalog \Model \ResourceModel \Product as ProductResource ;
1011
1112class ProductTest extends \PHPUnit \Framework \TestCase
1213{
@@ -50,6 +51,30 @@ public function testLoadAttributeOptions()
5051 }
5152 }
5253
54+ /**
55+ * @return void
56+ */
57+ public function testLoadAttributeOptionsContainsTextAttributes ()
58+ {
59+ $ this ->conditionProduct ->loadAttributeOptions ();
60+ $ options = $ this ->conditionProduct ->getAttributeOption ();
61+
62+ /** @var ProductResource $productResource */
63+ $ productResource = $ this ->objectManager ->create (ProductResource::class);
64+ $ attributes = $ productResource ->loadAllAttributes ()->getAttributesByCode ();
65+ foreach ($ attributes as $ key => $ attribute ) {
66+ if (!$ attribute ->getFrontendLabel () || $ attribute ->getFrontendInput () !== 'text ' ) {
67+ unset($ attributes [$ key ]);
68+ }
69+ }
70+
71+ $ textAttributeCodes = array_keys ($ attributes );
72+ foreach ($ textAttributeCodes as $ textAttributeCode ) {
73+ $ this ->assertArrayHasKey ($ textAttributeCode , $ options );
74+ $ this ->assertNotEmpty ($ options [$ textAttributeCode ]);
75+ }
76+ }
77+
5378 /**
5479 * @return void
5580 */
You can’t perform that action at this time.
0 commit comments