5
5
*/
6
6
declare (strict_types=1 );
7
7
8
- namespace Magento \GraphQl \CheckoutAgreements \ Api ;
8
+ namespace Magento \GraphQl \CheckoutAgreements ;
9
9
10
10
use Magento \CheckoutAgreements \Api \Data \AgreementInterface ;
11
11
use Magento \CheckoutAgreements \Model \Agreement as AgreementModel ;
20
20
use Magento \TestFramework \Helper \Bootstrap ;
21
21
use Magento \TestFramework \TestCase \GraphQlAbstract ;
22
22
23
- class CheckoutAgreementsListTest extends GraphQlAbstract
23
+ /**
24
+ * Get checkout agreements test
25
+ */
26
+ class GetCheckoutAgreementsTest extends GraphQlAbstract
24
27
{
28
+ /**
29
+ * @var string
30
+ */
25
31
private $ agreementsXmlConfigPath = 'checkout/options/enable_agreements ' ;
26
32
27
33
/**
@@ -55,14 +61,14 @@ public function testGetActiveAgreement()
55
61
56
62
$ response = $ this ->graphQlQuery ($ query );
57
63
58
- $ this -> assertArrayHasKey ('checkoutAgreements ' , $ response );
64
+ self :: assertArrayHasKey ('checkoutAgreements ' , $ response );
59
65
$ agreements = $ response ['checkoutAgreements ' ];
60
- $ this -> assertCount (1 , $ agreements );
61
- $ this -> assertEquals ('Checkout Agreement (active) ' , $ agreements [0 ]['name ' ]);
62
- $ this -> assertEquals ('Checkout agreement content: <b>HTML</b> ' , $ agreements [0 ]['content ' ]);
63
- $ this -> assertEquals ('200px ' , $ agreements [0 ]['content_height ' ]);
64
- $ this -> assertEquals ('Checkout agreement checkbox text. ' , $ agreements [0 ]['checkbox_text ' ]);
65
- $ this -> assertEquals (true , $ agreements [0 ]['is_html ' ]);
66
+ self :: assertCount (1 , $ agreements );
67
+ self :: assertEquals ('Checkout Agreement (active) ' , $ agreements [0 ]['name ' ]);
68
+ self :: assertEquals ('Checkout agreement content: <b>HTML</b> ' , $ agreements [0 ]['content ' ]);
69
+ self :: assertEquals ('200px ' , $ agreements [0 ]['content_height ' ]);
70
+ self :: assertEquals ('Checkout agreement checkbox text. ' , $ agreements [0 ]['checkbox_text ' ]);
71
+ self :: assertEquals (true , $ agreements [0 ]['is_html ' ]);
66
72
}
67
73
68
74
/**
@@ -81,14 +87,14 @@ public function testGetActiveAgreementOnSecondStore()
81
87
$ headerMap ['Store ' ] = $ secondStoreCode ;
82
88
$ response = $ this ->graphQlQuery ($ query , [], '' , $ headerMap );
83
89
84
- $ this -> assertArrayHasKey ('checkoutAgreements ' , $ response );
90
+ self :: assertArrayHasKey ('checkoutAgreements ' , $ response );
85
91
$ agreements = $ response ['checkoutAgreements ' ];
86
- $ this -> assertCount (1 , $ agreements );
87
- $ this -> assertEquals ($ agreementsName , $ agreements [0 ]['name ' ]);
88
- $ this -> assertEquals ('Checkout agreement content: <b>HTML</b> ' , $ agreements [0 ]['content ' ]);
89
- $ this -> assertEquals ('200px ' , $ agreements [0 ]['content_height ' ]);
90
- $ this -> assertEquals ('Checkout agreement checkbox text. ' , $ agreements [0 ]['checkbox_text ' ]);
91
- $ this -> assertEquals (true , $ agreements [0 ]['is_html ' ]);
92
+ self :: assertCount (1 , $ agreements );
93
+ self :: assertEquals ($ agreementsName , $ agreements [0 ]['name ' ]);
94
+ self :: assertEquals ('Checkout agreement content: <b>HTML</b> ' , $ agreements [0 ]['content ' ]);
95
+ self :: assertEquals ('200px ' , $ agreements [0 ]['content_height ' ]);
96
+ self :: assertEquals ('Checkout agreement checkbox text. ' , $ agreements [0 ]['checkbox_text ' ]);
97
+ self :: assertEquals (true , $ agreements [0 ]['is_html ' ]);
92
98
}
93
99
94
100
/**
@@ -106,9 +112,9 @@ public function testGetActiveAgreementFromSecondStoreOnDefaultStore()
106
112
107
113
$ response = $ this ->graphQlQuery ($ query );
108
114
109
- $ this -> assertArrayHasKey ('checkoutAgreements ' , $ response );
115
+ self :: assertArrayHasKey ('checkoutAgreements ' , $ response );
110
116
$ agreements = $ response ['checkoutAgreements ' ];
111
- $ this -> assertCount (0 , $ agreements );
117
+ self :: assertCount (0 , $ agreements );
112
118
}
113
119
114
120
public function testGetAgreementNotSet ()
@@ -117,9 +123,9 @@ public function testGetAgreementNotSet()
117
123
118
124
$ response = $ this ->graphQlQuery ($ query );
119
125
120
- $ this -> assertArrayHasKey ('checkoutAgreements ' , $ response );
126
+ self :: assertArrayHasKey ('checkoutAgreements ' , $ response );
121
127
$ agreements = $ response ['checkoutAgreements ' ];
122
- $ this -> assertCount (0 , $ agreements );
128
+ self :: assertCount (0 , $ agreements );
123
129
}
124
130
125
131
/**
@@ -133,9 +139,9 @@ public function testDisabledAgreements()
133
139
134
140
$ response = $ this ->graphQlQuery ($ query );
135
141
136
- $ this -> assertArrayHasKey ('checkoutAgreements ' , $ response );
142
+ self :: assertArrayHasKey ('checkoutAgreements ' , $ response );
137
143
$ agreements = $ response ['checkoutAgreements ' ];
138
- $ this -> assertCount (0 , $ agreements );
144
+ self :: assertCount (0 , $ agreements );
139
145
}
140
146
141
147
/**
0 commit comments