Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-developer
Test
Unit
Console
Command
QueryLogDisableCommandTest.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Developer\Test\Unit\Console\Command
;
8
9
use
Magento\Developer\Console\Command\QueryLogDisableCommand
;
10
use
Magento\Framework\App\DeploymentConfig\Writer
;
11
use
Magento\Framework\Config\File\ConfigFilePool
;
12
use
Magento\Framework\DB\Logger\LoggerProxy
;
13
use Symfony\Component\Console\Tester\CommandTester;
14
21
class
QueryLogDisableCommandTest
extends
\PHPUnit\Framework\TestCase
22
{
26
private
$configWriter;
27
31
private
$command;
32
36
public
function
setUp
()
37
{
38
$this->configWriter = $this->getMockBuilder(Writer::class)
39
->disableOriginalConstructor()
40
->getMock();
41
$this->command =
new
QueryLogDisableCommand
($this->configWriter);
42
}
43
47
public
function
testExecute
()
48
{
49
$data
= [
LoggerProxy::PARAM_ALIAS
=>
LoggerProxy::LOGGER_ALIAS_DISABLED
];
50
51
$this->configWriter
52
->expects($this->once())
53
->method(
'saveConfig'
)
54
->with([
ConfigFilePool::APP_ENV
=> [
LoggerProxy::CONF_GROUP_NAME
=>
$data
]]);
55
56
$commandTester =
new
CommandTester($this->command);
57
$commandTester->execute([]);
58
$this->assertSame(
59
QueryLogDisableCommand::SUCCESS_MESSAGE
. PHP_EOL,
60
$commandTester->getDisplay()
61
);
62
}
63
}
Magento\Framework\DB\Logger\LoggerProxy\LOGGER_ALIAS_DISABLED
const LOGGER_ALIAS_DISABLED
Definition:
LoggerProxy.php:45
Magento\Developer\Test\Unit\Console\Command\QueryLogDisableCommandTest\setUp
setUp()
Definition:
QueryLogDisableCommandTest.php:36
Magento\Framework\Config\File\ConfigFilePool
Definition:
ConfigFilePool.php:14
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Developer\Console\Command\QueryLogDisableCommand
Definition:
QueryLogDisableCommand.php:16
Magento\Framework\DB\Logger\LoggerProxy\PARAM_ALIAS
const PARAM_ALIAS
Definition:
LoggerProxy.php:20
Magento\Developer\Test\Unit\Console\Command
Definition:
ProfilerDisableCommandTest.php:7
Magento\Developer\Console\Command\QueryLogDisableCommand\SUCCESS_MESSAGE
const SUCCESS_MESSAGE
Definition:
QueryLogDisableCommand.php:26
Magento\Developer\Test\Unit\Console\Command\QueryLogDisableCommandTest
Definition:
QueryLogDisableCommandTest.php:21
Magento\Framework\App\DeploymentConfig\Writer
Definition:
FormatterInterface.php:7
Magento\Framework\Config\File\ConfigFilePool\APP_ENV
const APP_ENV
Definition:
ConfigFilePool.php:17
Magento\Framework\DB\Logger\LoggerProxy
Definition:
LoggerProxy.php:10
Magento\Framework\DB\Logger\LoggerProxy\CONF_GROUP_NAME
const CONF_GROUP_NAME
Definition:
LoggerProxy.php:15
Magento\Developer\Test\Unit\Console\Command\QueryLogDisableCommandTest\testExecute
testExecute()
Definition:
QueryLogDisableCommandTest.php:47