app['env'] = 'production'; config(['illustrations.enabled' => true, 'illustrations.base_url' => 'http://resource.loc:8612']); $this->assertFalse(IllustrationPool::enabled()); config(['illustrations.base_url' => 'https://resource-v2.gemcook.net']); $this->assertTrue(IllustrationPool::enabled()); config(['illustrations.enabled' => false]); $this->assertFalse(IllustrationPool::enabled()); } public function test_local_and_unregistered_environments_cannot_use_production_origin(): void { $this->app['env'] = 'local'; config(['illustrations.enabled' => true, 'illustrations.base_url' => 'https://resource-v2.gemcook.net']); $this->assertFalse(IllustrationPool::enabled()); config(['illustrations.base_url' => 'http://resource.loc:8612']); $this->assertTrue(IllustrationPool::enabled()); $this->app['env'] = 'staging'; $this->assertFalse(IllustrationPool::enabled()); config(['illustrations.base_url' => 'https://test.clashfreenode.com/resource-v2']); $this->assertTrue(IllustrationPool::enabled()); $this->app['env'] = 'production'; $this->assertFalse(IllustrationPool::enabled()); } }