Skip to content

Commit

Permalink
テスト追加
Browse files Browse the repository at this point in the history
  • Loading branch information
kurozumi committed May 20, 2024
1 parent 1344831 commit 6fad8c4
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
55 changes: 55 additions & 0 deletions tests/Eccube/Tests/CustomizeBundleTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php

/*
* This file is part of EC-CUBE
*
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
*
* http://www.ec-cube.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Eccube\Tests;

use Customize\Bundle\CustomizeBundle;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Filesystem\Filesystem;

class CustomizeBundleTest extends KernelTestCase
{
public function tearDown(): void
{
$fs = new Filesystem();
$fs->remove(__DIR__.'/../../../app/Customize/Bundle');
$fs->remove(__DIR__.'/../../../app/Customize/Resource/config/bundles.php');
}

public function testContainsCustomizeBundle()
{
$fs = new Filesystem();
$originDir = __DIR__.'/../../Fixtures/Customize';
$targetDir = __DIR__.'/../../../app/Customize';
$fs->mirror($originDir, $targetDir);

$kernel = static::bootKernel();
$bundleNames = [];
foreach ($kernel->getBundles() as $bundle) {
$bundleNames[] = get_class($bundle);
}

self::assertContains(CustomizeBundle::class, $bundleNames);
}

public function testNotContainsCustomizeBundle()
{
$kernel = static::bootKernel();
$bundleNames = [];
foreach ($kernel->getBundles() as $bundle) {
$bundleNames[] = get_class($bundle);
}

self::assertNotContains(CustomizeBundle::class, $bundleNames);
}
}
21 changes: 21 additions & 0 deletions tests/Fixtures/Customize/Bundle/CustomizeBundle.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

/*
* This file is part of EC-CUBE
*
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
*
* http://www.ec-cube.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Customize\Bundle;

use Customize\DependencyInjection\CustomizeExtension;
use Symfony\Component\HttpKernel\Bundle\Bundle;

class CustomizeBundle extends Bundle
{
}
16 changes: 16 additions & 0 deletions tests/Fixtures/Customize/Resource/config/bundles.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

/*
* This file is part of EC-CUBE
*
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
*
* http://www.ec-cube.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

return [
Customize\Bundle\CustomizeBundle::class => ['all' => true],
];

0 comments on commit 6fad8c4

Please sign in to comment.