-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
MenuTest.php
40 lines (30 loc) · 1.12 KB
/
MenuTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
declare(strict_types=1);
/*
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\AdminBundle\Tests\Functional\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
final class MenuTest extends WebTestCase
{
public function testDynamicMenuInLongRunningProcess(): void
{
$client = static::createClient();
$client->disableReboot();
for ($i = 1; $i < 5; ++$i) {
$client->request(Request::METHOD_GET, '/admin/dashboard');
static::assertSame(Response::HTTP_OK, $client->getResponse()->getStatusCode());
$crawler = $client->getCrawler();
$menu = $crawler->filter('.sidebar-menu .dynamic-menu a');
static::assertCount(1, $menu);
static::assertSame(sprintf('Dynamic Menu %s', $i), $menu->innerText());
}
}
}