From 28c3e4581c73135ec546447657e3d1fca7ebcff9 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Thu, 10 Sep 2020 19:48:09 +0200 Subject: [PATCH] fix: unit test --- .../Symfony/Bundle/DataCollector/RequestDataCollectorTest.php | 4 ++-- .../Symfony/Bundle/Twig/ApiPlatformProfilerPanelTest.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Bridge/Symfony/Bundle/DataCollector/RequestDataCollectorTest.php b/tests/Bridge/Symfony/Bundle/DataCollector/RequestDataCollectorTest.php index 3bfd06d05f0..52e482ff848 100644 --- a/tests/Bridge/Symfony/Bundle/DataCollector/RequestDataCollectorTest.php +++ b/tests/Bridge/Symfony/Bundle/DataCollector/RequestDataCollectorTest.php @@ -30,8 +30,8 @@ use ApiPlatform\Core\Metadata\Resource\ResourceMetadata; use ApiPlatform\Core\Tests\Fixtures\DummyEntity; use ApiPlatform\Core\Tests\ProphecyTrait; +use PackageVersions\Versions; use PHPUnit\Framework\TestCase; -use ProxyManager\Version; use Psr\Container\ContainerInterface; use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpFoundation\Request; @@ -231,7 +231,7 @@ public function testVersionCollection() $this->response ); - $this->assertSame(null !== $dataCollector->getVersion(), class_exists(Version::class)); + $this->assertSame(null !== $dataCollector->getVersion(), class_exists(Versions::class)); } private function apiResourceClassWillReturn($data, $context = []) diff --git a/tests/Bridge/Symfony/Bundle/Twig/ApiPlatformProfilerPanelTest.php b/tests/Bridge/Symfony/Bundle/Twig/ApiPlatformProfilerPanelTest.php index 9ff6806e6d9..3ea58ad0f04 100644 --- a/tests/Bridge/Symfony/Bundle/Twig/ApiPlatformProfilerPanelTest.php +++ b/tests/Bridge/Symfony/Bundle/Twig/ApiPlatformProfilerPanelTest.php @@ -81,7 +81,7 @@ public function testDebugBarContentNotResourceClass() // Check extra info content $this->assertStringContainsString('sf-toolbar-status-default', $block->attr('class'), 'The toolbar block should have the default color.'); - $this->assertSame('Not an API Platform resource', $block->filter('.sf-toolbar-info-piece span')->html()); + $this->assertSame('Not an API Platform resource', $block->filterXPath('//div[@class="sf-toolbar-info-piece"][./b[contains(., "Resource Class")]]/span')->html()); } public function testDebugBarContent() @@ -99,7 +99,7 @@ public function testDebugBarContent() // Check extra info content $this->assertStringContainsString('sf-toolbar-status-default', $block->attr('class'), 'The toolbar block should have the default color.'); - $this->assertSame('mongodb' === $this->env ? DocumentDummy::class : Dummy::class, $block->filter('.sf-toolbar-info-piece span')->html()); + $this->assertSame('mongodb' === $this->env ? DocumentDummy::class : Dummy::class, $block->filterXPath('//div[@class="sf-toolbar-info-piece"][./b[contains(., "Resource Class")]]/span')->html()); } public function testProfilerGeneralLayoutNotResourceClass()