Skip to content

Commit 2a62f0c

Browse files
committed
ACPT-867: STRUCTURE LAYOUT cache generates
- Fix static test failures;
1 parent 315027f commit 2a62f0c

File tree

1 file changed

+28
-15
lines changed

1 file changed

+28
-15
lines changed

lib/internal/Magento/Framework/App/Test/Unit/Cache/LayoutTest.php

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,35 @@ public function testSaveData(string $data, string $identifier)
5454
$invocation = 0;
5555

5656
$this->cacheFrontendMock->method('save')
57-
->willReturnCallback(function ($passedData, $passedIdentifier, $passedTags, $passedLifeTime)
58-
use (&$invocation, $data, $identifierForHash, $expectedTags, $lifeTime, $identifier) {
59-
if ($invocation === 0) {
60-
$this->assertEquals($data, $passedData);
61-
$this->assertEquals($identifierForHash, $passedIdentifier);
62-
$this->assertEquals($expectedTags, $passedTags);
63-
$this->assertEquals(Layout::DATA_LIFETIME, $passedLifeTime);
64-
} elseif ($invocation === 1) {
65-
$this->assertEquals($identifierForHash, $passedData);
66-
$this->assertEquals($identifier, $passedIdentifier);
67-
$this->assertEquals($expectedTags, $passedTags);
68-
$this->assertEquals($lifeTime, $passedLifeTime);
57+
->willReturnCallback(
58+
function (
59+
$passedData,
60+
$passedIdentifier,
61+
$passedTags,
62+
$passedLifeTime
63+
) use (
64+
&$invocation,
65+
$data,
66+
$identifierForHash,
67+
$expectedTags,
68+
$lifeTime,
69+
$identifier
70+
) {
71+
if ($invocation === 0) {
72+
$this->assertEquals($data, $passedData);
73+
$this->assertEquals($identifierForHash, $passedIdentifier);
74+
$this->assertEquals($expectedTags, $passedTags);
75+
$this->assertEquals(Layout::DATA_LIFETIME, $passedLifeTime);
76+
} elseif ($invocation === 1) {
77+
$this->assertEquals($identifierForHash, $passedData);
78+
$this->assertEquals($identifier, $passedIdentifier);
79+
$this->assertEquals($expectedTags, $passedTags);
80+
$this->assertEquals($lifeTime, $passedLifeTime);
81+
}
82+
$invocation++;
83+
return true;
6984
}
70-
$invocation++;
71-
return true;
72-
});
85+
);
7386

7487
$result = $this->layoutCacheType->save($data, $identifier, $tags, $lifeTime);
7588
$this->assertTrue($result);

0 commit comments

Comments
 (0)