assertContains($symbol, $symbols, "Missing: $symbol"); } } public function testIgnoresSymbolsMarkedWithIgnoreComment() { $path = __DIR__ . '/fixtures/plugin-ignore-comment'; $symbols = PluginScanner::scan($path); $this->assertNotContains('add_option', $symbols, 'Should ignore symbol with @wp-since ignore'); $this->assertNotContains('should_be_ignored', $symbols, 'Should ignore symbolwith @wp-since ignore'); $this->assertNotContains('wp_is_block_theme', $symbols, 'Should ignore symbol with @wp-since ignore'); $this->assertNotContains('should_be_ignored_space', $symbols, 'Should ignore symbol with @wp-since ignore'); $this->assertContains('do_action', $symbols, 'Should detect function call without ignore comment'); $this->assertContains('my_custom_hook', $symbols, 'Should detect function call without ignore comment'); $this->assertContains('register_setting', $symbols, 'Should detect function call without ignore comment'); $this->assertContains('wp_detected_function', $symbols, 'Should detect function call without ignore comment'); $this->assertContains('need_detect', $symbols, 'Should detect function call without ignore comment'); } }