/
githubmirror
/
joomla-cms
Обзор
Документация
Войти
/
githubmirror
/
joomla-cms
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
5.4-dev
tests/Unit/Component/Actionlogs/Administrator/Model/ActionlogConfigModelTest.php
62 строки
2 KB
Allon Moritz
Fixes various code style issues and integrate PHP CS Fixer into drone (#39745)
31 янв 2023, 13:20
Не верифицирован
31 янв 2023, 13:20
1e7527b
Код
Авторство
О чём код?
<?php /** * @package Joomla.UnitTest * @subpackage Extension * * @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Tests\Unit\Component\Actionlogs\Administrator\Model; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\Component\Actionlogs\Administrator\Model\ActionlogConfigModel; use Joomla\Database\DatabaseInterface; use Joomla\Tests\Unit\UnitTestCase; /** * Test class for ActionlogConfigModel * * @package Joomla.UnitTest * @subpackage Actionlog * @since 4.2.0 */ class ActionlogConfigModelTest extends UnitTestCase { /** * @testdox Test that getLogContentTypeParams returns the correct params * * @return void * * @since 4.2.0 */ public function testGetLogContentTypeParams() { $config = new \stdClass(); $db = $this->createStub(DatabaseInterface::class); $db->method('getQuery')->willReturn($this->getQueryStub($db)); $db->method('loadObject')->willReturn($config); $model = new ActionlogConfigModel(['dbo' => $db], $this->createStub(MVCFactoryInterface::class)); $this->assertEquals($config, $model->getLogContentTypeParams('test')); } /** * @testdox Test that getLogContentTypeParams returns null when not found * * @return void * * @since 4.2.0 */ public function testGetNullLogContentTypeParams() { $db = $this->createStub(DatabaseInterface::class); $db->method('getQuery')->willReturn($this->getQueryStub($db)); $model = new ActionlogConfigModel(['dbo' => $db], $this->createStub(MVCFactoryInterface::class)); $this->assertNull($model->getLogContentTypeParams('test')); } }