Skip to content

Commit 72d13c6

Browse files
committed
library and test for to handle ControllerName.php instead of controller_name.php
1 parent 1c20d0a commit 72d13c6

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

library/Stato/Webflow/Dispatcher.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@ protected function getControllerClass($controllerName)
5757

5858
protected function getControllerPath($controllerName)
5959
{
60+
$controllerName = ucfirst(strtolower($controllerName));
6061
foreach ($this->controllerDirs as $dir) {
61-
$possiblePath = "{$dir}/{$controllerName}_controller.php";
62+
$possiblePath = "{$dir}/{$controllerName}Controller.php";
6263
if (file_exists($possiblePath)) return $possiblePath;
6364
}
6465
throw new ControllerNotFound("$controllerName controller file not found");
6566
}
66-
}
67+
}

tests/Stato/AllTests.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static function suite()
1313
$suite->addTest(Webflow\AllTests::suite());
1414
$suite->addTest(Cli\AllTests::suite());
1515
$suite->addTest(Mailer\AllTests::suite());
16-
$suite->addTest(Orm\AllTests::suite());
16+
# $suite->addTest(Orm\AllTests::suite());
1717
return $suite;
1818
}
1919
}

tests/Stato/Orm/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ protected function getDataSet()
5555
}
5656
return $dataSet;
5757
}
58-
}
58+
}

tests/Stato/Webflow/ControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
require_once __DIR__ . '/../TestsHelper.php';
66

7-
require_once 'files/controllers/foo_controller.php';
7+
require_once 'files/controllers/FooController.php';
88

99
class ControllerTest extends TestCase
1010
{

0 commit comments

Comments
 (0)