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

testShouldGetCacheBackendThroughReflectionSetter() public method

    public function testShouldGetCacheBackendThroughReflectionSetter()
    {
        $object = new Memcached(['host' => TEST_MC_HOST]);
        $mock = $this->getMockBuilder(Libmemcached::class)->disableOriginalConstructor()->getMock();
        $this->tester->setProtectedProperty($object, 'memcached', $mock);
        $reflectedMethod = new ReflectionMethod(get_class($object), 'getCacheBackend');
        $reflectedMethod->setAccessible(true);
        $this->assertInstanceOf(Libmemcached::class, $reflectedMethod->invoke($object));
    }