Skip to content

Commit

Permalink
Merge pull request #1416 from phalcon/4.0.x
Browse files Browse the repository at this point in the history
4.0.1
  • Loading branch information
Jeckerson authored Jan 12, 2020
2 parents f286de9 + 0022167 commit 837c1f5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Providers/RouterProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
namespace Phalcon\DevTools\Providers;

use DirectoryIterator;
use Phalcon\DevTools\Utils\FsUtils;
use Phalcon\Di\DiInterface;
use Phalcon\Di\ServiceProviderInterface;
use Phalcon\Mvc\Router\Annotations as AnnotationsRouter;
Expand All @@ -36,16 +37,15 @@ public function register(DiInterface $di): void
$di->setShared($this->providerName, function () use ($ptoolsPath) {
/** @var DiInterface $this */
$em = $this->getShared('eventsManager');
$fs = new FsUtils();

$router = new AnnotationsRouter(false);
$router->removeExtraSlashes(true);
$router->notFound(['controller' => 'error', 'action' => 'route404']);
$router->setDefaultAction('index');
$router->setDefaultController('index');
$router->setDefaultNamespace('Phalcon\DevTools\Web\Tools\Controllers');

// @todo Use Path::normalize()
$controllersDir = $ptoolsPath . DS . str_replace('/', DS, 'src/Web/Tools/Controllers');
$controllersDir = $fs->normalize($ptoolsPath . '/src/Web/Tools/Controllers');
$dir = new DirectoryIterator($controllersDir);

$resources = [];
Expand Down
2 changes: 1 addition & 1 deletion src/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Version extends PhVersion
// phpcs:disable
protected static function _getVersion(): array
{
return [4, 0, 0, 0, 0];
return [4, 0, 1, 0, 0];
}
// phpcs:enable
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ final class ErrorControllerCest
* @covers \Phalcon\Devtools\Web\Tools\Controllers\ErrorController::route404Action
* @param AcceptanceTester $I
*/
public function testRoute404Action(AcceptanceTester $I): void
public function testRoute404Action(AcceptanceTester $I, $scenario): void
{
$scenario->skip('Deprecated approach');

$I->amOnPage('/webtools.php/404');
$I->see('404');
$I->see('Not Found');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@ public function testIndexAction(AcceptanceTester $I): void
$I->amOnPage('/webtools.php/');
$I->see('Dashboard');
$I->see('Welcome to WebTools');

$I->amOnPage('/webtools.php');
$I->see('Dashboard');
$I->see('Welcome to WebTools');
}
}

0 comments on commit 837c1f5

Please sign in to comment.