Files
wp-plugin-starter-template-…/tests/phpunit/test-core.php
marcusquinn eb388a846d Consolidate PHPUnit tests into tests/phpunit directory
Move test-admin.php and test-core.php from tests/ to tests/phpunit/
to match phpunit.xml configuration which only scans tests/phpunit/.

This fixes PHPUnit test discovery issues where tests were being
skipped because they were in the wrong directory.

All test files now in: tests/phpunit/
- test-admin.php
- test-core.php
- test-multisite.php
- bootstrap.php

🤖 Generated with [Qoder][https://qoder.com]
2025-11-16 05:00:50 +00:00

63 lines
1.1 KiB
PHP

<?php
/**
* Class CoreTest
*
* @package WPALLSTARS\PluginStarterTemplate
*/
use WPALLSTARS\PluginStarterTemplate\Core;
/**
* Core test case.
*/
class CoreTest extends \WP_Mock\Tools\TestCase {
/**
* Test instance
*
* @var Core
*/
private $core;
/**
* Set up the test environment.
*/
public function setUp(): void
{
parent::setUp();
// Set up mocks
WP_Mock::setUp();
// Create instance of Core class
$this->core = new Core();
}
/**
* Tear down the test environment.
*/
public function tearDown(): void
{
WP_Mock::tearDown();
parent::tearDown();
}
/**
* Test constructor
*/
public function test_constructor() {
// Verify that the constructor initializes hooks
$this->assertInstanceOf(Core::class, $this->core);
}
/**
* Test example method
*/
public function test_filter_content() {
$content = 'Test content';
// Test that filter_content returns the content
$this->assertEquals($content, $this->core->filter_content($content));
}
}