File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
tests/unit/Payment_Gateway/External_Checkout/Google_Pay Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 55use Generator ;
66use Mockery ;
77use ReflectionException ;
8+ use SkyVerge \WooCommerce \PluginFramework \v5_15_3 \SV_WC_Payment_Gateway ;
89use SkyVerge \WooCommerce \PluginFramework \v5_15_3 \Payment_Gateway \External_Checkout \Google_Pay \Google_Pay ;
910use SkyVerge \WooCommerce \PluginFramework \v5_15_3 \Tests \TestCase ;
1011use WP_Mock ;
@@ -77,4 +78,38 @@ public function providerCanGetMerchantId() : Generator
7778 'expected ' => '' ,
7879 ];
7980 }
81+
82+ /**
83+ * @covers ::get_gateway_merchant_id()
84+ */
85+ public function testCanGetGatewayMerchantId () : void
86+ {
87+ $ this ->testObject ->expects ('get_processing_gateway ' )
88+ ->andReturn ($ gateway = new class {
89+ public string $ merchantId = 'TEST_MERCHANT_ID ' ;
90+
91+ public function get_merchant_id () : string
92+ {
93+ return $ this ->merchantId ;
94+ }
95+ });
96+
97+ $ this ->assertSame ($ gateway ->merchantId , $ this ->testObject ->get_gateway_merchant_id ());
98+ }
99+
100+ /**
101+ * @covers ::get_merchant_name()
102+ */
103+ public function testCanGetMerchantName () : void
104+ {
105+ WP_Mock::userFunction ('get_bloginfo ' )
106+ ->once ()
107+ ->with ('name ' )
108+ ->andReturn ($ merchantName = 'TEST_MERCHANT_NAME ' );
109+
110+ WP_Mock::onFilter ('sv_wc_google_pay_merchant_name ' )
111+ ->with ($ merchantName )->reply ($ merchantName );
112+
113+ $ this ->assertSame ($ merchantName , $ this ->testObject ->get_merchant_name ());
114+ }
80115}
You can’t perform that action at this time.
0 commit comments