How to unit test this? Im trying to write test for that. I tried it with returnCallback to manipulate $success but i cant get it to work. The code is finished but i do stuck with that one test.

So the code is:

    $cache      = $this->serviceLocator->get('BjyAuthorize\Cache');
        $success    = false;
        $this->acl  = $cache->getItem($this->config['cache_key'], $success);


        if (!($this->acl instanceof Acl) || !$success) {
            $this->loadAcl();
            $cache->setItem($this->config['cache_key'], $this->acl);
        }

How to write a test for that? I need to manipulate $success, so that its value is true.