Skip to content

Commit

Permalink
Merge pull request #1309 from phalcon/revert-1275-3.4.x-fix-issue-1233
Browse files Browse the repository at this point in the history
Revert "Fixing phalcon serve on newer PHP versions - issue #1233"
  • Loading branch information
Jeckerson authored Jun 28, 2019
2 parents ac85384 + aa6a209 commit 83a4ad9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions scripts/Phalcon/Commands/Builtin/Serve.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ public function shellCommand()
$this->printServerDetails();

return sprintf(
'%s -S %s:%s -t %s -t %s %s',
'%s -S %s:%s -t %s %s %s',
$binary_path,
$this->hostname,
$this->port,
$this->base_path,
$this->document_root,
$this->base_path,
$this->config
);
}
Expand Down
12 changes: 6 additions & 6 deletions tests/unit/ServeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function testGeneratedCommandWithNoParameters()
$_SERVER['argv'] = ['',''];
$this->command->parseParameters([], []);
$command = $this->command->shellCommand();
$this->assertContains('php -S 0.0.0.0:8000 -t .htrouter.php -t public', $command);
$this->assertContains('php -S 0.0.0.0:8000 -t public .htrouter.php', $command);
}

/**
Expand Down Expand Up @@ -103,7 +103,7 @@ public function testGeneratedCommandWithHostnameOnly()
$_SERVER['argv'] = ['','', 'localhost'];
$this->command->parseParameters([], []);
$command = $this->command->shellCommand();
$this->assertContains('php -S localhost:8000 -t .htrouter.php -t public', $command);
$this->assertContains('php -S localhost:8000 -t public .htrouter.php', $command);
}

/**
Expand Down Expand Up @@ -137,7 +137,7 @@ public function testGeneratedCommandWithPortOnly()
$_SERVER['argv'] = ['','', null, 1111];
$this->command->parseParameters([], []);
$command = $this->command->shellCommand();
$this->assertContains('php -S 0.0.0.0:1111 -t .htrouter.php -t public', $command);
$this->assertContains('php -S 0.0.0.0:1111 -t public .htrouter.php', $command);
}

/**
Expand Down Expand Up @@ -171,7 +171,7 @@ public function testGeneratedCommandWithBasepathOnly()
$_SERVER['argv'] = ['','', null, null, '/root/bin.php'];
$this->command->parseParameters([], []);
$command = $this->command->shellCommand();
$this->assertContains('php -S 0.0.0.0:8000 -t /root/bin.php -t public', $command);
$this->assertContains('php -S 0.0.0.0:8000 -t public /root/bin.php', $command);
}

/**
Expand Down Expand Up @@ -205,7 +205,7 @@ public function testGeneratedCommandWithDocumentRootOnly()
$_SERVER['argv'] = ['','', null, null, null, 'not_too_public'];
$this->command->parseParameters([], []);
$command = $this->command->shellCommand();
$this->assertContains('php -S 0.0.0.0:8000 -t .htrouter.php -t not_too_public', $command);
$this->assertContains('php -S 0.0.0.0:8000 -t not_too_public .htrouter.php', $command);
}

/**
Expand Down Expand Up @@ -239,6 +239,6 @@ public function testGeneratedCommandWithConfigOnly()
$_SERVER['argv'] = ['','', null, null, null, '--config=awesome.ini'];
$this->command->parseParameters([], []);
$command = $this->command->shellCommand();
$this->assertContains('php -S 0.0.0.0:8000 -t .htrouter.php -t public -c awesome.ini', $command);
$this->assertContains('php -S 0.0.0.0:8000 -t public .htrouter.php -c awesome.ini', $command);
}
}

0 comments on commit 83a4ad9

Please sign in to comment.