/** * @test * @expectedException \TYPO3\Flow\Cache\Exception\InvalidDataException */ public function setThrowsInvalidDataExceptionOnNonStringValues() { $backend = $this->getMockBuilder(\TYPO3\Flow\Cache\Backend\AbstractBackend::class)->disableOriginalConstructor()->setMethods(array('get', 'set', 'has', 'remove', 'findIdentifiersByTag', 'flush', 'flushByTag', 'collectGarbage'))->getMock(); $cache = new \TYPO3\Flow\Cache\Frontend\StringFrontend('StringFrontend', $backend); $cache->set('StringCacheTest', array()); }
/** * @test * @expectedException \TYPO3\Flow\Cache\Exception\InvalidDataException */ public function setThrowsInvalidDataExceptionOnNonStringValues() { $backend = $this->getMock(\TYPO3\Flow\Cache\Backend\AbstractBackend::class, array('get', 'set', 'has', 'remove', 'findIdentifiersByTag', 'flush', 'flushByTag', 'collectGarbage'), array(), '', false); $cache = new \TYPO3\Flow\Cache\Frontend\StringFrontend('StringFrontend', $backend); $cache->set('StringCacheTest', array()); }