Skip to content

Commit

Permalink
Added windows units
Browse files Browse the repository at this point in the history
  • Loading branch information
dpanta94 committed Jun 14, 2024
1 parent 5d35632 commit eda1309
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion tests/wpunit/AssetsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,28 @@ public function constantProvider() {
'WP_PLUGIN_URL' => null,
],
],
[
// Windows
'**windows-simple**',
[
'ABSPATH' => 'C:\\xampp\\htdocs\\wordpress',
'WP_CONTENT_DIR' => 'C:\\xampp\\htdocs\\wordpress\\wp-content',
'WP_CONTENT_URL' => 'http://wordpress.test/wp-content',
'WP_PLUGIN_DIR' => 'C:\\xampp\\htdocs\\wordpress\\wp-content\\plugins',
'WP_PLUGIN_URL' => 'http://wordpress.test/wp-content/plugins',
],
],
[
// Windows
'**windows-complex**',
[
'ABSPATH' => 'C:\\xampp\\htdocs\\wordpress',
'WP_CONTENT_DIR' => 'C:\\xampp\\htdocs\\content',
'WP_CONTENT_URL' => 'http://wordpress.test/content',
'WP_PLUGIN_DIR' => 'C:\\xampp\\htdocs\\addons',
'WP_PLUGIN_URL' => 'http://wordpress.test/wp-content/addons',
],
],
];

foreach ( $data as $d ) {
Expand Down Expand Up @@ -529,7 +551,7 @@ protected function assert_minified_found( $slug_prefix, $is_js = true, $has_min

$plugins_path = str_replace( constant( 'WP_CONTENT_DIR' ), '', constant( 'WP_PLUGIN_DIR' ) );

if ( constant( 'WP_PLUGIN_DIR' ) !== constant( 'WP_CONTENT_DIR' ) . $plugins_path ) {
if ( constant( 'WP_PLUGIN_DIR' ) !== constant( 'WP_CONTENT_DIR' ) . $plugins_path || strpos( constant( 'ABSPATH' ), 'C:') === 0 ) {
// If we are testing outside of the actual plugin directory, the file_exists will always fail.
// In installations where this set up is the actual, the file should exist.
// In this case it will always fail to locate mins.
Expand Down

0 comments on commit eda1309

Please sign in to comment.