7
7
8
8
namespace Magento \ReCaptchaWebapiGraphQl \Test \Api ;
9
9
10
+ use Exception ;
10
11
use Magento \Framework \Encryption \EncryptorInterface ;
11
12
use Magento \TestFramework \Fixture \Config ;
12
13
use Magento \Framework \App \ResourceConnection ;
@@ -29,6 +30,7 @@ class ReCaptchaV3ConfigTest extends GraphQlAbstract
29
30
language_code
30
31
failure_message
31
32
forms
33
+ theme
32
34
}
33
35
}
34
36
QUERY ;
@@ -49,6 +51,7 @@ public function setUp(): void
49
51
Config('recaptcha_frontend/type_recaptcha_v3/score_threshold ' , 0.75 ),
50
52
Config('recaptcha_frontend/type_recaptcha_v3/position ' , 'bottomright ' ),
51
53
Config('recaptcha_frontend/type_recaptcha_v3/lang ' , 'en ' ),
54
+ Config('recaptcha_frontend/type_recaptcha_v3/theme ' , 'light ' ),
52
55
Config('recaptcha_frontend/failure_messages/validation_failure_message ' , 'Test failure message ' ),
53
56
Config('recaptcha_frontend/type_for/customer_login ' , 'recaptcha_v3 ' )
54
57
]
@@ -65,7 +68,8 @@ public function testQueryRecaptchaNoPublicKeyConfigured(): void
65
68
'failure_message ' => 'Test failure message ' ,
66
69
'forms ' => [
67
70
'CUSTOMER_LOGIN '
68
- ]
71
+ ],
72
+ 'theme ' => 'light '
69
73
]
70
74
],
71
75
$ this ->graphQlQuery (self ::QUERY )
@@ -76,6 +80,7 @@ public function testQueryRecaptchaNoPublicKeyConfigured(): void
76
80
Config('recaptcha_frontend/type_recaptcha_v3/score_threshold ' , 0.75 ),
77
81
Config('recaptcha_frontend/type_recaptcha_v3/position ' , 'bottomright ' ),
78
82
Config('recaptcha_frontend/type_recaptcha_v3/lang ' , 'en ' ),
83
+ Config('recaptcha_frontend/type_recaptcha_v3/theme ' , 'light ' ),
79
84
Config('recaptcha_frontend/failure_messages/validation_failure_message ' , 'Test failure message ' )
80
85
]
81
86
public function testQueryRecaptchaNoFormsConfigured (): void
@@ -100,7 +105,8 @@ public function testQueryRecaptchaNoFormsConfigured(): void
100
105
'badge_position ' => 'bottomright ' ,
101
106
'language_code ' => 'en ' ,
102
107
'failure_message ' => 'Test failure message ' ,
103
- 'forms ' => []
108
+ 'forms ' => [],
109
+ 'theme ' => 'light '
104
110
]
105
111
],
106
112
$ this ->graphQlQuery (self ::QUERY )
@@ -111,6 +117,7 @@ public function testQueryRecaptchaNoFormsConfigured(): void
111
117
Config('recaptcha_frontend/type_recaptcha_v3/score_threshold ' , 0.75 ),
112
118
Config('recaptcha_frontend/type_recaptcha_v3/position ' , 'bottomright ' ),
113
119
Config('recaptcha_frontend/type_recaptcha_v3/lang ' , 'en ' ),
120
+ Config('recaptcha_frontend/type_recaptcha_v3/theme ' , 'dark ' ),
114
121
Config('recaptcha_frontend/failure_messages/validation_failure_message ' , 'Test failure message ' ),
115
122
Config('recaptcha_frontend/type_for/customer_login ' , 'recaptcha_v3 ' )
116
123
]
@@ -138,7 +145,8 @@ public function testQueryRecaptchaConfigured(): void
138
145
'failure_message ' => 'Test failure message ' ,
139
146
'forms ' => [
140
147
'CUSTOMER_LOGIN '
141
- ]
148
+ ],
149
+ 'theme ' => 'dark '
142
150
]
143
151
],
144
152
$ this ->graphQlQuery (self ::QUERY )
@@ -151,7 +159,7 @@ public function tearDown(): void
151
159
$ resource = Bootstrap::getObjectManager ()->get (ResourceConnection::class);
152
160
/** @var AdapterInterface $connection */
153
161
$ connection = $ resource ->getConnection (ResourceConnection::DEFAULT_CONNECTION );
154
-
162
+
155
163
$ connection ->delete (
156
164
$ resource ->getTableName ('core_config_data ' )
157
165
);
0 commit comments