/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/Cache/Test/Unit/CompositeStaleCacheNotifierTest.php
43 строки
1 KB
Manish Ranjan
AC-16248: PHPUnit 12 Upgrade | Fix Framework unit tests
09 янв 2026, 19:35
09 янв 2026, 19:35
de6cafc
Код
Авторство
О чём код?
<?php /** * Copyright 2019 Adobe * All Rights Reserved. */ namespace Magento\Framework\Cache\Test\Unit; use Magento\Framework\Cache\CompositeStaleCacheNotifier; use Magento\Framework\Cache\StaleCacheNotifierInterface; use PHPUnit\Framework\TestCase; /** Test case for composite cache notifier */ class CompositeStaleCacheNotifierTest extends TestCase implements StaleCacheNotifierInterface { /** @var string[] */ private $notifications = []; /** @test */ public function testNoNotifications() { new CompositeStaleCacheNotifier([$this, $this, $this]); $this->assertEquals([], $this->notifications); } /** @test */ public function testNotifiesAllRegisteredNotifiersOfStaleContent() { $notifier = new CompositeStaleCacheNotifier([$this, $this]); $notifier->cacheLoaderIsUsingStaleCache(); $this->assertEquals(['staleCacheLoaded', 'staleCacheLoaded'], $this->notifications); } /** * Self-shunting notifier to test behavior of composite */ public function cacheLoaderIsUsingStaleCache(): void { $this->notifications[] = 'staleCacheLoaded'; } }