Skip to content

Commit

Permalink
add unitTest_BcWidgetAreaPlugin_services
Browse files Browse the repository at this point in the history
  • Loading branch information
thangnn committed May 7, 2024
1 parent 3ae812d commit 3a84c36
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/bc-widget-area/src/BcWidgetAreaPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class BcWidgetAreaPlugin extends BcPlugin
* @param ContainerInterface $container
* @noTodo
* @checked
* @unitTest
*/
public function services(ContainerInterface $container): void
{
Expand Down
32 changes: 32 additions & 0 deletions plugins/bc-widget-area/tests/TestCase/BcWidgetAreaPluginTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace BcWidgetArea\Test\TestCase;

use BaserCore\TestSuite\BcTestCase;
use BcWidgetArea\BcWidgetAreaPlugin;
use BcWidgetArea\Service\Admin\WidgetAreasAdminServiceInterface;
use BcWidgetArea\Service\WidgetAreasServiceInterface;
use Cake\Core\Container;

class BcWidgetAreaPluginTest extends BcTestCase
{
public function setUp(): void
{
parent::setUp();
$this->BcWidgetAreaPlugin = new BcWidgetAreaPlugin(['name' => 'BcWidgetArea']);
}

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

public function test_services(): void
{
$container = new Container();
$this->BcWidgetAreaPlugin->services($container);
$this->assertTrue($container->has(WidgetAreasServiceInterface::class));
$this->assertTrue($container->has(WidgetAreasAdminServiceInterface::class));
}
}

0 comments on commit 3a84c36

Please sign in to comment.