originalStore = $this->prophesize(StoreInterface::class)->reveal(); $this->delegator = new RetryLockStoreDelegatorFactory(); } /** @test */ public function originalStoreIsWrappedInRetryStore(): void { $callback = function () { return $this->originalStore; }; $result = ($this->delegator)(new ServiceManager(), '', $callback); $ref = new ReflectionObject($result); $prop = $ref->getProperty('decorated'); $prop->setAccessible(true); $this->assertSame($this->originalStore, $prop->getValue($result)); } }