Skip to content

Commit

Permalink
metaタグのテストの Symfony4.4 対応
Browse files Browse the repository at this point in the history
  • Loading branch information
okazy committed Apr 6, 2021
1 parent ef3463d commit 4e3cf4c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/Eccube/Tests/Web/TopControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@

namespace Eccube\Tests\Web;

use Eccube\Entity\BaseInfo;
use Eccube\Entity\Page;
use Eccube\Repository\BaseInfoRepository;
use Eccube\Repository\PageRepository;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;

class TopControllerTest extends AbstractWebTestCase
{
Expand All @@ -39,11 +40,15 @@ public function testMetaTags()
{
// description を設定
$description = 'あのイーハトーヴォのすきとおった風、夏でも底に冷たさをもつ青いそら、うつくしい森で飾られたモリーオ市、郊外のぎらぎらひかる草の波。';
$page = $this->container->get(PageRepository::class)->getByUrl('homepage');
/** @var PageRepository $pageRepository */
$pageRepository = $this->entityManager->getRepository(Page::class);
$page = $pageRepository->getByUrl('homepage');
$page->setDescription($description);
$this->entityManager->flush();

$shopName = $this->container->get(BaseInfoRepository::class)->get()->getShopName();
/** @var BaseInfoRepository $baseInfoRepository */
$baseInfoRepository = $this->entityManager->getRepository(BaseInfo::class);
$shopName = $baseInfoRepository->get()->getShopName();
$expected_desc = mb_substr($description, 0, 120, 'utf-8');

$crawler = $this->client->request('GET', $this->generateUrl('homepage'));
Expand Down

0 comments on commit 4e3cf4c

Please sign in to comment.