/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/BrowserKit/Test/Constraint/BrowserHistoryIsOnFirstPage.php
37 строк
931 B
Santiago San Martin
[BrowserKit] Add PHPUnit constraints: `BrowserHistoryIsOnFirstPage` and `BrowserHistoryIsOnLastPage`
30 июн 2025, 07:20
30 июн 2025, 07:20
76e80c1
Код
Авторство
О чём код?
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\BrowserKit\Test\Constraint; use PHPUnit\Framework\Constraint\Constraint; use Symfony\Component\BrowserKit\AbstractBrowser; final class BrowserHistoryIsOnFirstPage extends Constraint { public function toString(): string { return 'is on the first page'; } protected function matches($other): bool { if (!$other instanceof AbstractBrowser) { throw new \LogicException('Can only test on an AbstractBrowser instance.'); } return $other->getHistory()->isFirstPage(); } protected function failureDescription($other): string { return 'the Browser history '.$this->toString(); } }