factory = new CacheFactory(); } public static function tearDownAfterClass() { putenv('APP_ENV'); } /** * @test */ public function productionReturnsApcAdapter() { putenv('APP_ENV=pro'); $instance = $this->factory->__invoke(new ServiceManager(), ''); $this->assertInstanceOf(ApcuCache::class, $instance); } /** * @test */ public function developmentReturnsArrayAdapter() { putenv('APP_ENV=dev'); $instance = $this->factory->__invoke(new ServiceManager(), ''); $this->assertInstanceOf(ArrayCache::class, $instance); } }