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 7
7
namespace Magento \CatalogWidget \Model \Rule \Condition ;
8
8
9
9
use Magento \Catalog \Api \Data \ProductInterface ;
10
+ use Magento \Catalog \Model \ResourceModel \Product as ProductResource ;
10
11
11
12
class ProductTest extends \PHPUnit \Framework \TestCase
12
13
{
@@ -50,6 +51,30 @@ public function testLoadAttributeOptions()
50
51
}
51
52
}
52
53
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
+
53
78
/**
54
79
* @return void
55
80
*/
You can’t perform that action at this time.
0 commit comments