Skip to content

Commit 096e81b

Browse files
committed
fix: restore full PHP test matrix [AI: OpenAI GPT-5.6 Sol via OpenCode]
1 parent e854445 commit 096e81b

7 files changed

Lines changed: 20 additions & 19 deletions

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"prefer-stable": true,
8181
"config": {
8282
"platform": {
83-
"php": "8.2.0"
83+
"php": "8.1.0"
8484
},
8585
"sort-packages": true
8686
}

composer.lock

Lines changed: 12 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

includes/class-static-site-importer-figma-import.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,8 @@ private static function website_artifact_from_figma_file( array $figma_file, arr
368368
'on_failure' => 'retain',
369369
'expires_at' => gmdate( 'c', time() + 604800 ),
370370
) : array( 'on_success' => 'purge_on_success' );
371-
$workspace = new Static_Site_Importer_Artifact_Run_Workspace( sys_get_temp_dir(), 'fig-' . bin2hex( random_bytes( 8 ) ), $retention );
371+
$temp_root = realpath( sys_get_temp_dir() );
372+
$workspace = new Static_Site_Importer_Artifact_Run_Workspace( false !== $temp_root ? $temp_root : sys_get_temp_dir(), 'fig-' . bin2hex( random_bytes( 8 ) ), $retention );
372373
$tmp = $workspace->publish_raw( 'input.fig', $content );
373374
if ( is_wp_error( $tmp ) ) {
374375
return new WP_Error( 'static_site_importer_figma_file_tempfile_failed', 'Uploaded .fig file could not be staged for transformation.', array( 'status' => 500 ) );

tests/form-materializer-topology.test.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ test( 'shared-row topology materializes through the PHP provider adapter', () =>
3434
assert.match( output, /PASS form-materializer-smoke\.php \(\d+ assertions\)/ );
3535
} );
3636

37-
test( 'Jetpack runtime preparation tolerates optional APIs missing from older versions', () => {
37+
test( 'Jetpack runtime preparation reports the missing canonical forms loader', () => {
3838
const code = String.raw`
3939
namespace Automattic\Jetpack {
4040
class Modules {
@@ -62,7 +62,7 @@ namespace {
6262
encoding: 'utf8',
6363
} );
6464

65-
assert.equal( output, 'static_site_importer_jetpack_forms_blocks_missing' );
65+
assert.equal( output, 'static_site_importer_jetpack_forms_loader_missing' );
6666
} );
6767

6868
test( 'provider-constrained topology emits nested fields and an editor-valid core submit', () => {

tests/smoke-entity-materializer-registry.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ function is_wp_error( mixed $value ): bool { return $value instanceof WP_Error;
4040
}
4141

4242
require_once dirname( __DIR__ ) . '/includes/class-static-site-importer-woo-product-seeder.php';
43+
require_once dirname( __DIR__ ) . '/includes/class-static-site-importer-form-seeder.php';
4344
require_once dirname( __DIR__ ) . '/includes/class-static-site-importer-entity-materializer-registry.php';
4445

4546
$failures = array();

tests/smoke-figma-workspace-lifecycle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ function blocks_engine_figma_transformer_transform_file( string $path, array $op
1313
$input = array( 'source' => array( 'figma_file' => array( 'name' => 'design.fig', 'content_base64' => base64_encode( 'fig' ) ) ) ); $success = Static_Site_Importer_Figma_Import::website_artifact_from_input( $input );
1414
if ( is_wp_error( $success ) || empty( $seen ) || array_diff( glob( sys_get_temp_dir() . '/.ssi-artifact-run-fig-*' ) ?: array(), $before ) ) { throw new RuntimeException( 'base64 Figma staging must clean its owned workspace after a successful transform' ); }
1515
$fail = true; $failed = Static_Site_Importer_Figma_Import::website_artifact_from_input( $input ); if ( ! is_wp_error( $failed ) || array_diff( glob( sys_get_temp_dir() . '/.ssi-artifact-run-fig-*' ) ?: array(), $before ) ) { throw new RuntimeException( 'base64 Figma staging must clean its owned workspace after a transform failure' ); }
16-
$fail = false; $retained = Static_Site_Importer_Figma_Import::website_artifact_from_input( $input + array( 'retain_workspace' => true ) ); $evidence = $retained['provenance']['artifact_workspace'] ?? array(); if ( is_wp_error( $retained ) || ! is_dir( $evidence['path'] ?? '' ) || empty( $evidence['expires_at'] ) || 'retained' !== ( $evidence['cleanup']['status'] ?? '' ) ) { throw new RuntimeException( 'retained Figma staging must expose expiry and cleanup evidence' ); } $workspace = new Static_Site_Importer_Artifact_Run_Workspace( sys_get_temp_dir(), substr( basename( $evidence['path'] ), strlen( '.ssi-artifact-run-' ) ) ); if ( 'purged' !== $workspace->purge()['status'] ) { throw new RuntimeException( 'retained Figma workspace must support explicit purge' ); }
16+
$fail = false; $retained = Static_Site_Importer_Figma_Import::website_artifact_from_input( $input + array( 'retain_workspace' => true ) ); $evidence = $retained['provenance']['artifact_workspace'] ?? array(); if ( is_wp_error( $retained ) || ! is_dir( $evidence['path'] ?? '' ) || empty( $evidence['expires_at'] ) || 'retained' !== ( $evidence['cleanup']['status'] ?? '' ) ) { throw new RuntimeException( 'retained Figma staging must expose expiry and cleanup evidence' ); } $workspace = new Static_Site_Importer_Artifact_Run_Workspace( (string) realpath( sys_get_temp_dir() ), substr( basename( $evidence['path'] ), strlen( '.ssi-artifact-run-' ) ) ); if ( 'purged' !== $workspace->purge()['status'] ) { throw new RuntimeException( 'retained Figma workspace must support explicit purge' ); }
1717
$studio = ABSPATH . '.studio-import'; wp_mkdir_p( $studio ); $staged = $studio . '/design.fig'; file_put_contents( $staged, 'fig' ); Static_Site_Importer_Figma_Import::website_artifact_from_input( array( 'source' => array( 'figma_file' => array( 'name' => 'design.fig', 'staged_path' => $staged ) ) ) ); if ( ! is_file( $staged ) ) { throw new RuntimeException( 'caller-owned Studio staged files must not be deleted' ); } unlink( $staged ); rmdir( $studio );
1818
echo "Figma workspace lifecycle smoke passed.\n";

tests/smoke-provider-presentation.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ function wp_add_inline_style( string $handle, string $css ): bool {
6565
require_once dirname( __DIR__ ) . '/includes/class-static-site-importer-provider-presentation.php';
6666
require_once dirname( __DIR__ ) . '/includes/class-static-site-importer-commerce-presentation.php';
6767
require_once dirname( __DIR__ ) . '/includes/class-static-site-importer-woo-product-seeder.php';
68+
require_once dirname( __DIR__ ) . '/includes/class-static-site-importer-form-seeder.php';
6869
require_once dirname( __DIR__ ) . '/includes/class-static-site-importer-entity-materializer-registry.php';
6970

7071
$failures = array();

0 commit comments

Comments
 (0)