public function testLoadCached()
{
$expectedState = new SPIObjectState(array('id' => 1, 'identifier' => 'test_state', 'name' => 'Test State', 'groupId' => 1));
$cacheItemMock = $this->getMock('Stash\\Interfaces\\ItemInterface');
$this->cacheMock->expects($this->once())->method('getItem')->with('objectstate', 1)->will($this->returnValue($cacheItemMock));
$cacheItemMock->expects($this->once())->method('get')->will($this->returnValue($expectedState));
$handler = $this->persistenceCacheHandler->objectStateHandler();
$state = $handler->load(1);
$this->assertEquals($state, $expectedState);
}