feat(wpmc S3): Helpers scaffold + reset_cache wiring
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace WPMultiCity;
|
||||||
|
|
||||||
|
final class Helpers
|
||||||
|
{
|
||||||
|
private static ?string $current_town_memo = null;
|
||||||
|
private static bool $current_town_resolved = false;
|
||||||
|
private static array $term_cache = [];
|
||||||
|
|
||||||
|
public static function reset_cache(): void
|
||||||
|
{
|
||||||
|
self::$current_town_memo = null;
|
||||||
|
self::$current_town_resolved = false;
|
||||||
|
self::$term_cache = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ namespace WPMultiCity\Tests;
|
|||||||
|
|
||||||
use Brain\Monkey;
|
use Brain\Monkey;
|
||||||
use PHPUnit\Framework\TestCase as BaseTestCase;
|
use PHPUnit\Framework\TestCase as BaseTestCase;
|
||||||
|
use WPMultiCity\Helpers;
|
||||||
|
|
||||||
abstract class TestCase extends BaseTestCase
|
abstract class TestCase extends BaseTestCase
|
||||||
{
|
{
|
||||||
@@ -13,6 +14,7 @@ abstract class TestCase extends BaseTestCase
|
|||||||
parent::setUp();
|
parent::setUp();
|
||||||
Monkey\setUp();
|
Monkey\setUp();
|
||||||
Monkey\Functions\stubTranslationFunctions();
|
Monkey\Functions\stubTranslationFunctions();
|
||||||
|
Helpers::reset_cache();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function tearDown(): void
|
protected function tearDown(): void
|
||||||
|
|||||||
Reference in New Issue
Block a user