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-backend
Test
Unit
Console
Command
CacheStatusCommandTest.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Backend\Test\Unit\Console\Command
;
8
9
use
Magento\Backend\Console\Command\CacheStatusCommand
;
10
use Symfony\Component\Console\Tester\CommandTester;
11
12
class
CacheStatusCommandTest
extends
AbstractCacheCommandTest
13
{
14
protected
function
setUp
()
15
{
16
parent::setUp();
17
$this->command =
new
CacheStatusCommand
($this->cacheManagerMock);
18
}
19
20
public
function
testExecute
()
21
{
22
$cacheTypes = [
'A'
=> 0,
'B'
=> 1,
'C'
=> 1];
23
$this->cacheManagerMock->expects($this->once())->method(
'getStatus'
)->willReturn($cacheTypes);
24
$commandTester =
new
CommandTester($this->command);
25
$commandTester->execute([]);
26
27
$this->assertEquals($this->
getExpectedExecutionOutput
($cacheTypes), $commandTester->getDisplay());
28
}
29
33
public
function
getExpectedExecutionOutput
(array $types)
34
{
35
$output
=
'Current status:'
. PHP_EOL;
36
foreach
($types as
$type
=>
$status
) {
37
$output
.= sprintf(
'%30s: %d'
,
$type
,
$status
) . PHP_EOL;
38
}
39
return
$output
;
40
}
41
}
Magento\Backend\Test\Unit\Console\Command
Definition:
AbstractCacheCommandTest.php:7
Magento\Backend\Test\Unit\Console\Command\CacheStatusCommandTest\getExpectedExecutionOutput
getExpectedExecutionOutput(array $types)
Definition:
CacheStatusCommandTest.php:33
Magento\Backend\Test\Unit\Console\Command\CacheStatusCommandTest\testExecute
testExecute()
Definition:
CacheStatusCommandTest.php:20
Magento\Backend\Test\Unit\Console\Command\AbstractCacheCommandTest
Definition:
AbstractCacheCommandTest.php:11
$type
$type
Definition:
item.phtml:13
Magento\Backend\Test\Unit\Console\Command\CacheStatusCommandTest\setUp
setUp()
Definition:
CacheStatusCommandTest.php:14
$output
$output
Definition:
classmap_generator.php:100
$status
$status
Definition:
order_status.php:8
Magento\Backend\Test\Unit\Console\Command\CacheStatusCommandTest
Definition:
CacheStatusCommandTest.php:12
Magento\Backend\Console\Command\CacheStatusCommand
Definition:
CacheStatusCommand.php:18