22 $this->_frontend = $this->createMock(\
Magento\Framework\Cache\FrontendInterface::class);
23 $this->_object = new \Magento\Framework\Cache\Frontend\Decorator\TagScope($this->_frontend,
'enforced_tag');
28 $this->_object =
null;
29 $this->_frontend =
null;
34 $this->assertEquals(
'enforced_tag', $this->_object->getTag());
39 $expectedResult = new \stdClass();
40 $this->_frontend->expects(
47 [
'test_tag_one',
'test_tag_two',
'enforced_tag'],
50 $this->returnValue($expectedResult)
52 $actualResult = $this->_object->save(
'test_value',
'test_id', [
'test_tag_one',
'test_tag_two'], 111);
53 $this->assertSame($expectedResult, $actualResult);
58 $expectedResult = new \stdClass();
59 $this->_frontend->expects(
67 $this->returnValue($expectedResult)
69 $actualResult = $this->_object->clean(
71 [
'ignored_tag_one',
'ignored_tag_two']
73 $this->assertSame($expectedResult, $actualResult);
78 $expectedResult = new \stdClass();
79 $this->_frontend->expects(
85 [
'test_tag_one',
'test_tag_two',
'enforced_tag']
87 $this->returnValue($expectedResult)
89 $actualResult = $this->_object->clean(
91 [
'test_tag_one',
'test_tag_two']
93 $this->assertSame($expectedResult, $actualResult);
104 $this->_frontend->expects(
110 [
'test_tag_one',
'enforced_tag']
112 $this->returnValue($fixtureResultOne)
114 $this->_frontend->expects(
120 [
'test_tag_two',
'enforced_tag']
122 $this->returnValue($fixtureResultTwo)
124 $actualResult = $this->_object->clean(
126 [
'test_tag_one',
'test_tag_two']
128 $this->assertEquals($expectedResult, $actualResult);
137 'failure, failure' => [
false,
false,
false],
138 'failure, success' => [
false,
true,
true],
139 'success, failure' => [
true,
false,
true],
140 'success, success' => [
true,
true,
true]
testCleanModeMatchingTag()
cleanModeMatchingAnyTagDataProvider()
testCleanModeMatchingAnyTag($fixtureResultOne, $fixtureResultTwo, $expectedResult)
const CLEANING_MODE_MATCHING_ANY_TAG
const CLEANING_MODE_MATCHING_TAG