Phalcon\Test\Annotations\Adapter\AerospikeTest::testShouldGetCacheBackendThroughReflectionSetter PHP Method

testShouldGetCacheBackendThroughReflectionSetter() public method

    public function testShouldGetCacheBackendThroughReflectionSetter()
    {
        $object = new Aerospike(['hosts' => [['addr' => TEST_AS_HOST, 'port' => TEST_AS_PORT]]]);
        $mock = $this->getMock(CacheBackend::class, [], [], '', false);
        $reflectedProperty = new ReflectionProperty(get_class($object), 'aerospike');
        $reflectedProperty->setAccessible(true);
        $reflectedProperty->setValue($object, $mock);
        $reflectedMethod = new ReflectionMethod(get_class($object), 'getCacheBackend');
        $reflectedMethod->setAccessible(true);
        $this->assertInstanceOf(CacheBackend::class, $reflectedMethod->invoke($object));
    }