Skip to content

Commit

Permalink
add unitTest_BcMailPlugin_services (#3374)
Browse files Browse the repository at this point in the history
Co-authored-by: thangnn <[email protected]>
  • Loading branch information
thangnnmd and thangnn authored Apr 29, 2024
1 parent 83526ab commit 93c9d8e
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/bc-mail/src/BcMailPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class BcMailPlugin extends BcPlugin
* @param ContainerInterface $container
* @noTodo
* @checked
* @unitTest
*/
public function services(ContainerInterface $container): void
{
Expand Down
47 changes: 47 additions & 0 deletions plugins/bc-mail/tests/BcMailPluginTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

namespace BcMail\Test;

use BaserCore\TestSuite\BcTestCase;
use BcMail\BcMailPlugin;
use BcMail\Service\Admin\MailContentsAdminServiceInterface;
use BcMail\Service\Admin\MailFieldsAdminServiceInterface;
use BcMail\Service\Admin\MailMessagesAdminServiceInterface;
use BcMail\Service\Front\MailFrontServiceInterface;
use BcMail\Service\MailConfigsServiceInterface;
use BcMail\Service\MailContentsServiceInterface;
use BcMail\Service\MailFieldsServiceInterface;
use BcMail\Service\MailMessagesServiceInterface;
use Cake\Core\Container;

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

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

/**
* test services
*/
public function testServices(): void
{
$container = new Container();
$this->BcMailPlugin->services($container);
$this->assertTrue($container->has(MailConfigsServiceInterface::class));
$this->assertTrue($container->has(MailContentsServiceInterface::class));
$this->assertTrue($container->has(MailContentsAdminServiceInterface::class));
$this->assertTrue($container->has(MailFieldsServiceInterface::class));
$this->assertTrue($container->has(MailFieldsAdminServiceInterface::class));
$this->assertTrue($container->has(MailMessagesServiceInterface::class));
$this->assertTrue($container->has(MailMessagesAdminServiceInterface::class));
$this->assertTrue($container->has(MailFrontServiceInterface::class));
}
}

0 comments on commit 93c9d8e

Please sign in to comment.