@@ -286,6 +286,69 @@ jobs:
286286 sudo cp -f /tmp/wordpress-tests-lib/wp-tests-config.php /wordpress-tests-lib/ || echo "::warning::Failed to copy wp-tests-config.php"
287287 fi
288288
289+ # Create or copy required class-basic-object.php file if missing
290+ if [ ! -f "/tmp/wordpress-tests-lib/includes/class-basic-object.php" ]; then
291+ echo "Creating missing class-basic-object.php file in /tmp/wordpress-tests-lib..."
292+ cat > "/tmp/wordpress-tests-lib/includes/class-basic-object.php" << 'EOF'
293+ <?php
294+ /**
295+ * Basic object, which other objects in WordPress extend.
296+ *
297+ * This is a simplified version for tests to fix the missing class issue.
298+ */
299+ class Basic_Object {
300+ /**
301+ * Retrieve a value from an array with support for a default value.
302+ *
303+ * @param array $args Arguments.
304+ * @param string $key Key to retrieve.
305+ * @param mixed $default Default value.
306+ * @return mixed Value if set, default if not.
307+ */
308+ protected function get_from_array( $args, $key, $default = null ) {
309+ if ( isset( $args[ $key ] ) ) {
310+ return $args[ $key ];
311+ }
312+ return $default;
313+ }
314+ }
315+ EOF
316+ fi
317+
318+ # Copy to the alternate path as well
319+ if [ ! -f "/wordpress-tests-lib/includes/class-basic-object.php" ]; then
320+ sudo mkdir -p /wordpress-tests-lib/includes/
321+ if [ -f "/tmp/wordpress-tests-lib/includes/class-basic-object.php" ]; then
322+ sudo cp -f /tmp/wordpress-tests-lib/includes/class-basic-object.php /wordpress-tests-lib/includes/ || echo "::warning::Failed to copy class-basic-object.php"
323+ else
324+ echo "Creating missing class-basic-object.php file in /wordpress-tests-lib..."
325+ sudo bash -c 'cat > "/wordpress-tests-lib/includes/class-basic-object.php" << "EOF"
326+ <?php
327+ /**
328+ * Basic object, which other objects in WordPress extend.
329+ *
330+ * This is a simplified version for tests to fix the missing class issue.
331+ */
332+ class Basic_Object {
333+ /**
334+ * Retrieve a value from an array with support for a default value.
335+ *
336+ * @param array $args Arguments.
337+ * @param string $key Key to retrieve.
338+ * @param mixed $default Default value.
339+ * @return mixed Value if set, default if not.
340+ */
341+ protected function get_from_array( $args, $key, $default = null ) {
342+ if ( isset( $args[ $key ] ) ) {
343+ return $args[ $key ];
344+ }
345+ return $default;
346+ }
347+ }
348+ EOF'
349+ fi
350+ fi
351+
289352 # Check WordPress core installation and verify db.php was copied
290353 if [ ! -d "/tmp/wordpress" ]; then
291354 echo "::error::WordPress core directory not created."
@@ -379,7 +442,7 @@ jobs:
379442 fi
380443 else
381444 # Standard execution for PHP 7.4
382- echo "Running tests with PHP $PHP_VERSION standard mode"
445+ echo "Running tests with PHP $PHP_VERSION standard mode"
383446 vendor/bin/phpunit || {
384447 echo "::warning::Tests failed with standard execution, trying individual test files..."
385448 EXIT_CODE=0
0 commit comments