Skip to content

Commit

Permalink
unitTest_BcUploaderPlugin_services
Browse files Browse the repository at this point in the history
  • Loading branch information
thangnn committed May 16, 2024
1 parent 74b7c6f commit 0e36d4e
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/bc-uploader/src/BcUploaderPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class BcUploaderPlugin extends BcPlugin
* @param ContainerInterface $container
* @noTodo
* @checked
* @UnitTest
*/
public function services(ContainerInterface $container): void
{
Expand Down
45 changes: 45 additions & 0 deletions plugins/bc-uploader/tests/TestCase/BcUploaderPluginTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

namespace BcUploader\Test\TestCase;

use BaserCore\TestSuite\BcTestCase;
use BaserCore\Utility\BcUtil;
use BcUploader\Service\Admin\UploaderFilesAdminServiceInterface;
use BcUploader\Service\UploaderCategoriesServiceInterface;
use BcUploader\Service\UploaderConfigsServiceInterface;
use BcUploader\Service\UploaderFilesServiceInterface;
use Cake\Core\Container;
use Cake\Core\Plugin;

class BcUploaderPluginTest extends BcTestCase
{
public function setUp(): void
{
parent::setUp();
BcUtil::includePluginClass('BcUploader');
$plugins = Plugin::getCollection();
$this->BcUploader = $plugins->create('BcUploader');
$plugins->add($this->BcUploader);
}

public function tearDown(): void
{
unset($this->BcUploader);
parent::tearDown();
}

public function test_services()
{
$container = new Container();
$this->BcUploader->services($container);
$this->assertTrue($container->has(UploaderCategoriesServiceInterface::class));
$this->assertTrue($container->has(UploaderConfigsServiceInterface::class));
$this->assertTrue($container->has(UploaderFilesServiceInterface::class));
$this->assertTrue($container->has(UploaderFilesAdminServiceInterface::class));
}

public function test_routes()
{
$this->markTestIncomplete('このテストは、まだ実装されていません。');
}
}

0 comments on commit 0e36d4e

Please sign in to comment.