Skip to content

Commit

Permalink
Use reserved TLD for default dev hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
franzliedke committed Sep 27, 2020
1 parent 65766a8 commit 6860b24
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Install/Console/FileDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct(InputInterface $input)

// Define configuration variables
$this->debug = $configuration['debug'] ?? false;
$this->baseUrl = $configuration['baseUrl'] ?? 'http://flarum.local';
$this->baseUrl = $configuration['baseUrl'] ?? 'http://flarum.localhost';
$this->databaseConfiguration = $configuration['databaseConfiguration'] ?? [];
$this->adminUser = $configuration['adminUser'] ?? [];
$this->settings = $configuration['settings'] ?? [];
Expand Down
2 changes: 1 addition & 1 deletion src/Install/Console/UserDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private function getDatabaseConfiguration(): DatabaseConfig

private function getBaseUrl(): BaseUrl
{
$baseUrl = $this->ask('Base URL (Default: http://flarum.local):', 'http://flarum.local');
$baseUrl = $this->ask('Base URL (Default: http://flarum.localhost):', 'http://flarum.localhost');

return $this->baseUrl = BaseUrl::fromString($baseUrl);
}
Expand Down
24 changes: 12 additions & 12 deletions tests/unit/Foundation/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,27 @@ public function it_complains_when_base_url_is_missing()
public function it_wraps_base_url_in_value_object()
{
$config = new Config([
'url' => 'https://flarum.local/myforum/',
'url' => 'https://flarum.localhost/myforum/',
]);

$url = $config->url();
$this->assertEquals('https', $url->getScheme());
$this->assertEquals('/myforum', $url->getPath()); // Note that trailing slashes are removed
$this->assertEquals('https://flarum.local/myforum', (string) $url);
$this->assertEquals('https://flarum.localhost/myforum', (string) $url);
}

/** @test */
public function it_has_a_helper_for_debug_mode()
{
$config = new Config([
'url' => 'https://flarum.local',
'url' => 'https://flarum.localhost',
'debug' => false,
]);

$this->assertFalse($config->inDebugMode());

$config = new Config([
'url' => 'https://flarum.local',
'url' => 'https://flarum.localhost',
'debug' => true,
]);

Expand All @@ -59,7 +59,7 @@ public function it_has_a_helper_for_debug_mode()
public function it_turns_off_debug_mode_by_default()
{
$config = new Config([
'url' => 'https://flarum.local',
'url' => 'https://flarum.localhost',
]);

$this->assertFalse($config->inDebugMode());
Expand All @@ -69,14 +69,14 @@ public function it_turns_off_debug_mode_by_default()
public function it_has_a_helper_for_maintenance_mode()
{
$config = new Config([
'url' => 'https://flarum.local',
'url' => 'https://flarum.localhost',
'offline' => false,
]);

$this->assertFalse($config->inMaintenanceMode());

$config = new Config([
'url' => 'https://flarum.local',
'url' => 'https://flarum.localhost',
'offline' => true,
]);

Expand All @@ -87,7 +87,7 @@ public function it_has_a_helper_for_maintenance_mode()
public function it_turns_off_maintenance_mode_by_default()
{
$config = new Config([
'url' => 'https://flarum.local',
'url' => 'https://flarum.localhost',
]);

$this->assertFalse($config->inMaintenanceMode());
Expand All @@ -97,7 +97,7 @@ public function it_turns_off_maintenance_mode_by_default()
public function it_exposes_additional_keys_via_array_access()
{
$config = new Config([
'url' => 'https://flarum.local',
'url' => 'https://flarum.localhost',
'custom_a' => 'b',
]);

Expand All @@ -108,7 +108,7 @@ public function it_exposes_additional_keys_via_array_access()
public function it_exposes_nested_keys_via_dot_syntax()
{
$config = new Config([
'url' => 'https://flarum.local',
'url' => 'https://flarum.localhost',
'nested' => [
'first' => '1',
'second' => '2',
Expand All @@ -123,7 +123,7 @@ public function it_exposes_nested_keys_via_dot_syntax()
public function it_does_not_allow_mutation_via_array_access()
{
$config = new Config([
'url' => 'https://flarum.local',
'url' => 'https://flarum.localhost',
'custom_a' => 'b',
]);

Expand All @@ -140,7 +140,7 @@ public function it_does_not_allow_mutation_via_array_access()
public function it_does_not_allow_removal_via_array_access()
{
$config = new Config([
'url' => 'https://flarum.local',
'url' => 'https://flarum.localhost',
'custom_a' => 'b',
]);

Expand Down

0 comments on commit 6860b24

Please sign in to comment.