Skip to content

Commit 2b960c1

Browse files
committed
Unit test cases updated
1 parent 3d4e6b3 commit 2b960c1

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

app/code/Magento/RemoteStorage/Driver/Adapter/Cache/Generic.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -222,16 +222,6 @@ private function setFromStorage(string $json)
222222
$this->cacheData = array_merge($this->cacheData, $this->serializer->unserialize($json));
223223
}
224224

225-
/**
226-
* Setter for cache data
227-
*
228-
* @param array $cacheData
229-
*/
230-
public function setCacheData(array $cacheData): void
231-
{
232-
$this->cacheData = $cacheData;
233-
}
234-
235225
/**
236226
* Ensure parent directories of an object.
237227
*

app/code/Magento/RemoteStorage/Test/Unit/Driver/Adpater/Cache/GenericTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,14 @@ protected function setUp(): void
5959
public function testGetMetaData(string $input, ?array $expectedOutput): void
6060
{
6161
$cacheData = include __DIR__ . '/_files/CacheData.php';
62-
$this->generic->setCacheData($cacheData);
62+
$this->cacheAdapterMock
63+
->expects($this->once())
64+
->method('load')
65+
->willReturn(json_encode($cacheData));
66+
$this->serializerMock
67+
->expects($this->once())
68+
->method('unserialize')
69+
->willReturn($cacheData);
6370

6471
$this->assertEquals($expectedOutput, $this->generic->getMetaData($input));
6572
}

0 commit comments

Comments
 (0)