Skip to content

Commit

Permalink
add unitTest_BcMailServiceProvider_services (#3375)
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 93c9d8e commit e32b8fe
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class BcMailServiceProvider extends ServiceProvider
* @param \Cake\Core\ContainerInterface $container
* @checked
* @noTodo
* @unitTest
*/
public function services($container): void
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

namespace BcMail\Test\TestCase\ServiceProvider;

use BaserCore\TestSuite\BcTestCase;
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 BcMail\ServiceProvider\BcMailServiceProvider;
use Cake\Core\Container;

class BcMailServiceProviderTest extends BcTestCase
{
public function setUp(): void
{
parent::setUp();
$this->BcMailServiceProvider = new BcMailServiceProvider();
}

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

/**
* test services
*/
public function testServices()
{
$container = new Container();
$this->BcMailServiceProvider->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 e32b8fe

Please sign in to comment.