You've already forked wp-prometheus
189 tests across 8 test classes covering all core plugin classes: CustomMetricBuilder, StorageFactory, Authentication, DashboardProvider, RuntimeCollector, Installer, Collector, and MetricsEndpoint. Added test job to Gitea release workflow that gates build-release. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
33 lines
709 B
PHP
33 lines
709 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Magdev\WpPrometheus\Tests\Unit;
|
|
|
|
use Magdev\WpPrometheus\Tests\Helpers\GlobalFunctionState;
|
|
use phpmock\phpunit\PHPMock;
|
|
use PHPUnit\Framework\TestCase as PHPUnitTestCase;
|
|
|
|
/**
|
|
* Base test case for WP Prometheus unit tests.
|
|
*
|
|
* Provides the PHPMock trait for mocking WordPress functions
|
|
* called from namespaced code, and resets global state between tests.
|
|
*/
|
|
abstract class TestCase extends PHPUnitTestCase
|
|
{
|
|
use PHPMock;
|
|
|
|
protected function setUp(): void
|
|
{
|
|
parent::setUp();
|
|
GlobalFunctionState::reset();
|
|
}
|
|
|
|
protected function tearDown(): void
|
|
{
|
|
GlobalFunctionState::reset();
|
|
parent::tearDown();
|
|
}
|
|
}
|