Skip to content

Commit

Permalink
add unitTest_BcMailServiceProvider_services
Browse files Browse the repository at this point in the history
  • Loading branch information
thangnn committed Apr 23, 2024
1 parent 73395b3 commit d2cae6b
Show file tree
Hide file tree
Showing 2 changed files with 45 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,44 @@
<?php

namespace BcMail\Test\TestCase\ServiceProvider;

use BaserCore\TestSuite\BcTestCase;
use BcMail\ServiceProvider\BcMailServiceProvider;
use Cake\Core\Container;

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

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

public function testServices()
{
$container = new Container();
$this->Provider->services($container);
$mailConfigsService = $container->get('BcMail\Service\MailConfigsServiceInterface');
$this->assertEquals('BcMail\Service\MailConfigsService', get_class($mailConfigsService));
$mailContentsService = $container->get('BcMail\Service\MailContentsServiceInterface');
$this->assertEquals('BcMail\Service\MailContentsService', get_class($mailContentsService));
$mailContentsAdminService = $container->get('BcMail\Service\Admin\MailContentsAdminServiceInterface');
$this->assertEquals('BcMail\Service\Admin\MailContentsAdminService', get_class($mailContentsAdminService));
$mailFieldsService = $container->get('BcMail\Service\MailFieldsServiceInterface');
$this->assertEquals('BcMail\Service\MailFieldsService', get_class($mailFieldsService));
$mailFieldsAdminService = $container->get('BcMail\Service\Admin\MailFieldsAdminServiceInterface');
$this->assertEquals('BcMail\Service\Admin\MailFieldsAdminService', get_class($mailFieldsAdminService));
$mailMessagesService = $container->get('BcMail\Service\MailMessagesServiceInterface');
$this->assertEquals('BcMail\Service\MailMessagesService', get_class($mailMessagesService));
$mailMessagesAdminService = $container->get('BcMail\Service\Admin\MailMessagesAdminServiceInterface');
$this->assertEquals('BcMail\Service\Admin\MailMessagesAdminService', get_class($mailMessagesAdminService));
$mailFrontService = $container->get('BcMail\Service\Front\MailFrontServiceInterface');
$this->assertEquals('BcMail\Service\Front\MailFrontService', get_class($mailFrontService));
}
}

0 comments on commit d2cae6b

Please sign in to comment.