Skip to content

Commit 837c1f5

Browse files
authored
Merge pull request #1416 from phalcon/4.0.x
4.0.1
2 parents f286de9 + 0022167 commit 837c1f5

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

src/Providers/RouterProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
namespace Phalcon\DevTools\Providers;
1414

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

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

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

5151
$resources = [];

src/Version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Version extends PhVersion
2727
// phpcs:disable
2828
protected static function _getVersion(): array
2929
{
30-
return [4, 0, 0, 0, 0];
30+
return [4, 0, 1, 0, 0];
3131
}
3232
// phpcs:enable
3333
}

tests/acceptance/Web/Tools/Controllers/ErrorControllerCest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ final class ErrorControllerCest
1111
* @covers \Phalcon\Devtools\Web\Tools\Controllers\ErrorController::route404Action
1212
* @param AcceptanceTester $I
1313
*/
14-
public function testRoute404Action(AcceptanceTester $I): void
14+
public function testRoute404Action(AcceptanceTester $I, $scenario): void
1515
{
16+
$scenario->skip('Deprecated approach');
17+
1618
$I->amOnPage('/webtools.php/404');
1719
$I->see('404');
1820
$I->see('Not Found');

tests/acceptance/Web/Tools/Controllers/IndexControllerCest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,9 @@ public function testIndexAction(AcceptanceTester $I): void
1616
$I->amOnPage('/webtools.php/');
1717
$I->see('Dashboard');
1818
$I->see('Welcome to WebTools');
19+
20+
$I->amOnPage('/webtools.php');
21+
$I->see('Dashboard');
22+
$I->see('Welcome to WebTools');
1923
}
2024
}

0 commit comments

Comments
 (0)