publicCookieMetadata = $objectManager->getObject( \Magento\Framework\Stdlib\Cookie\PublicCookieMetadata::class ); } /** * @param StringUtils $setMethodName * @param StringUtils $getMethodName * @param StringUtils $expectedValue * @dataProvider getMethodData */ public function testGetters($setMethodName, $getMethodName, $expectedValue) { $this->publicCookieMetadata->$setMethodName($expectedValue); $this->assertSame($expectedValue, $this->publicCookieMetadata->$getMethodName()); } /** * @return array */ public function getMethodData() { return [ "getDomain" => ["setDomain", 'getDomain', "example.com"], "getPath" => ["setPath", 'getPath', "path"], "getDuration" => ["setDuration", 'getDuration', 125], "getHttpOnly" => ["setHttpOnly", 'getHttpOnly', true], "getSecure" => ["setSecure", 'getSecure', true], "getDurationOneYear" => ["setDurationOneYear", 'getDuration', (3600*24*365)], ]; } }