feat: establish CHRNX block theme foundation

This commit is contained in:
chrnx committed 2026-08-11 14:12:57 -05:00
1 parent d32ac67fba
commit b727d4148c
21 files changed
+2394 -13

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
<?php
/**
* Tests for theme setup.
*
* @package CHRNX
*/
/**
* Verify the theme's WordPress setup contract.
*/
class ThemeSetupTest extends WP_UnitTestCase {
/**
* Ensure the required theme supports are registered.
*/
public function test_required_theme_supports_are_registered() {
$this->assertTrue( current_theme_supports( 'title-tag' ) );
$this->assertTrue( current_theme_supports( 'post-thumbnails' ) );
$this->assertTrue( current_theme_supports( 'responsive-embeds' ) );
$this->assertTrue( current_theme_supports( 'editor-styles' ) );
}
/**
* Ensure the card crop is available to future card components.
*/
public function test_card_image_size_is_registered() {
$this->assertTrue( has_image_size( 'chrnx-card' ) );
}
}
+28
View File
@@ -0,0 +1,28 @@
<?php
/**
* PHPUnit bootstrap for the CHRNX theme.
*
* @package CHRNX
*/
$chrnx_tests_dir = getenv( 'WP_TESTS_DIR' );
if ( ! $chrnx_tests_dir ) {
$chrnx_tests_dir = '/wordpress-phpunit';
}
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound
define( 'WP_TESTS_PHPUNIT_POLYFILLS_PATH', dirname( __DIR__, 2 ) . '/vendor/yoast/phpunit-polyfills' );
require_once $chrnx_tests_dir . '/includes/functions.php';
/**
* Activate the mapped theme before WordPress finishes bootstrapping.
*/
function chrnx_tests_load_theme() {
switch_theme( 'chrnx' );
}
tests_add_filter( 'muplugins_loaded', 'chrnx_tests_load_theme' );
require $chrnx_tests_dir . '/includes/bootstrap.php';