diff --git a/composer.json b/composer.json
index 927deca..5237b24 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,7 @@
{
"name": "elementor/eunit",
"description": "WordPress PHPUnit Testing Library",
- "version": "0.0.4",
+ "version": "0.0.5",
"authors": [
{
"name": "ohad",
@@ -13,13 +13,5 @@
},
"autoload": {
"files": [ "src/eunit.php" ]
- },
- "require-dev": {
- "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
- "squizlabs/php_codesniffer": "^3.6",
- "phpcompatibility/php-compatibility": "^9.3",
- "wp-coding-standards/wpcs": "^2.3",
- "sirbrillig/phpcs-variable-analysis": "^2.8",
- "wp-phpunit/wp-phpunit": "^5.7.2"
}
}
diff --git a/src/traits/assets.php b/src/traits/assets.php
index 5fbf546..b065afb 100644
--- a/src/traits/assets.php
+++ b/src/traits/assets.php
@@ -32,7 +32,7 @@ public function assert_script_not_enqueued( string $handle ) : void {
public function assert_style_enqueued( string $handle ) : void {
// phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet
$style_link_tag = "assertContains( $style_link_tag, get_echo( 'wp_print_styles' ),
+ $this->assertStringContainsString( $style_link_tag, get_echo( 'wp_print_styles' ),
'Test ' . $handle . ' style is enqueued if needed'
);
}
@@ -44,7 +44,8 @@ public function assert_style_enqueued( string $handle ) : void {
public function assert_style_not_enqueued( string $handle ) : void {
// phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet
$style_link_tag = "assertNotContains( $style_link_tag, get_echo( 'wp_print_styles' ),
+ $actual = get_echo( 'wp_print_styles' );
+ $this->assertStringNotContainsString()( $style_link_tag, $actual,
'Test ' . $handle . ' style is not enqueued if not needed'
);
}
@@ -62,7 +63,7 @@ public function assert_style_not_enqueued( string $handle ) : void {
public function assert_localized_script( string $handle, string $variable, bool $return = true ) : array {
global $wp_scripts;
$data = $wp_scripts->get_data( $handle, 'data' );
- $this->assertContains( 'var ' . $variable, $data,
+ $this->assertStringContainsString( 'var ' . $variable, $data,
'Test that ' . $variable . ' var is enqueued'
);
if ( $return ) {