From 590fa54cb5d49525043c8258ace40aa94c29a734 Mon Sep 17 00:00:00 2001 From: George Nicolaou Date: Sun, 21 Jun 2026 14:51:20 +0300 Subject: [PATCH] Add trademark for-use regression test --- .../load.php | 16 ++++++++++++++++ .../Checker/Checks/Trademarks_Check_Tests.php | 13 +++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 tests/phpunit/testdata/plugins/test-trademarks-plugin-header-for-woocommerce-middle/load.php diff --git a/tests/phpunit/testdata/plugins/test-trademarks-plugin-header-for-woocommerce-middle/load.php b/tests/phpunit/testdata/plugins/test-trademarks-plugin-header-for-woocommerce-middle/load.php new file mode 100644 index 000000000..d6da0b9f9 --- /dev/null +++ b/tests/phpunit/testdata/plugins/test-trademarks-plugin-header-for-woocommerce-middle/load.php @@ -0,0 +1,16 @@ +assertSame( 0, $check_result->get_warning_count() ); } + public function test_trademarks_with_for_woocommerce_exception_in_middle_of_name() { + $check_context = new Check_Context( UNIT_TESTS_PLUGIN_DIR . 'test-trademarks-plugin-header-for-woocommerce-middle/load.php' ); + $check_result = new Check_Result( $check_context ); + + $check = new Trademarks_Check( Trademarks_Check::TYPE_NAME ); + $check->run( $check_result ); + + $warnings = $check_result->get_warnings(); + + $this->assertEmpty( $warnings ); + $this->assertSame( 0, $check_result->get_warning_count() ); + } + public function test_single_file_plugin_without_error_for_trademarks() { $trademarks_check = new Trademarks_Check(); $check_context = new Check_Context( WP_PLUGIN_DIR . '/single-file-plugin.php' );