/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
phpunit/class-test-plugin-version-meta-test.php
26 строк
976 B
Shail Mehta
Docs: Use `gutenberg` instead of `Gutenberg` in package name (#71790)
30 сен 2025, 03:47
Не верифицирован
30 сен 2025, 03:47
4932e0c
Код
Авторство
О чём код?
<?php /** * Unit tests covering the version checks in the plugin file. * * @package gutenberg */ class Test_PluginMetaData_Test extends WP_UnitTestCase { /** * Test the minimum WordPress version check. * * Ensures the constant defined as the minimum required version of WordPress * matches the minimum version defined in the plugin header. */ public function test_minimum_required_wordpress_version() { $file_meta = get_file_data( __DIR__ . '/../gutenberg.php', array( 'RequiresWP' => 'Requires at least' ) ); /* * Gutenberg.php isn't loaded in the test environment. * * Read the file directly and use regex to extract the constant. */ preg_match( '/GUTENBERG_MINIMUM_WP_VERSION\', \'(.*?)\'/', file_get_contents( __DIR__ . '/../gutenberg.php' ), $matches ); $version_in_file = $matches[1]; $this->assertSame( $file_meta['RequiresWP'], $version_in_file, 'The minimum required WordPress version does not match the plugin header.' ); } }