diff --git a/.psalm/stubs.php b/.psalm/stubs.php
index 6d897c723..8b9348b1b 100644
--- a/.psalm/stubs.php
+++ b/.psalm/stubs.php
@@ -55,3 +55,13 @@ function as_unschedule_action($hook, $args = array(), $group = '') {}
* @return int The action ID.
*/
function as_schedule_single_action( $timestamp, $hook, $args = array(), $group = '', $unique = false ) {}
+
+/**
+ * HTML API: WP_HTML_Tag_Processor class
+ */
+class WP_HTML_Tag_Processor {
+ public function __construct( $html ) {}
+ public function next_tag( $query = null ) {}
+ public function set_attribute( $name, $value ) {}
+ public function get_updated_html() {}
+}
diff --git a/modules/ppcp-paylater-block/src/PayLaterBlockRenderer.php b/modules/ppcp-paylater-block/src/PayLaterBlockRenderer.php
index 4fb111c35..75fa9cf25 100644
--- a/modules/ppcp-paylater-block/src/PayLaterBlockRenderer.php
+++ b/modules/ppcp-paylater-block/src/PayLaterBlockRenderer.php
@@ -30,11 +30,6 @@ class PayLaterBlockRenderer {
$html = '
';
- /**
- * Class exist in WordPress.
- *
- * @psalm-suppress UndefinedClass
- */
$processor = new \WP_HTML_Tag_Processor( $html );
if ( $processor->next_tag( 'div' ) ) {
@@ -57,7 +52,7 @@ class PayLaterBlockRenderer {
}
}
- $updated_html = (string) $processor;
+ $updated_html = $processor->get_updated_html();
return sprintf(
'%2$s
',
diff --git a/package.json b/package.json
index beed09ccb..5c1182f0b 100644
--- a/package.json
+++ b/package.json
@@ -87,6 +87,7 @@
"dependencies": {
"dotenv": "^16.0.3",
"npm-run-all": "^4.1.5",
+ "playwright": "^1.43.0",
"run-s": "^0.0.0"
}
}
diff --git a/yarn.lock b/yarn.lock
index b9ab4e05f..722df19c5 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -131,6 +131,11 @@ escape-string-regexp@^1.0.5:
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==
+fsevents@2.3.2:
+ version "2.3.2"
+ resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
+ integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
+
function-bind@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
@@ -427,6 +432,20 @@ pify@^3.0.0:
resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176"
integrity sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==
+playwright-core@1.43.0:
+ version "1.43.0"
+ resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.43.0.tgz#d8079acb653abebb0b63062e432479647a4e1271"
+ integrity sha512-iWFjyBUH97+pUFiyTqSLd8cDMMOS0r2ZYz2qEsPjH8/bX++sbIJT35MSwKnp1r/OQBAqC5XO99xFbJ9XClhf4w==
+
+playwright@^1.43.0:
+ version "1.43.0"
+ resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.43.0.tgz#2c2efd4ee2a25defd8c24c98ccb342bdd9d435f5"
+ integrity sha512-SiOKHbVjTSf6wHuGCbqrEyzlm6qvXcv7mENP+OZon1I07brfZLGdfWV0l/efAzVx7TF3Z45ov1gPEkku9q25YQ==
+ dependencies:
+ playwright-core "1.43.0"
+ optionalDependencies:
+ fsevents "2.3.2"
+
read-pkg@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389"