slimとcodeceptionを知っている前提で話させていただきます
こちらのリポジトリのサンプルを動かしても動きませんでした
https://github.com/herloct/codeception-slim-module-example
やり方
PHP
1$ git clone git@github.com:herloct/codeception-slim-module-example.git 2$ cd codeception-slim-module-example 3$ composer install 4$ sudo php -S 0.0.0.0:80 -t public public/index.php
この状態で「http://localhost:80/hello/test」にアクセス
以下のエラーが出て画面は「このページは動作していません」と出てしまいます
[Mon Jun 12 14:00:34 2017] PHP Fatal error: Uncaught exception 'Slim\Exception\ContainerValueNotFoundException' with message 'Identifier "app" is not defined.' in /home/XXX/codeception-slim-module-example/vendor/slim/slim/Slim/Container.php:120 Stack trace: #0 /home/XXX/codeception-slim-module-example/vendor/slim/slim/Slim/Container.php(172): Slim\Container->get('app') #1 /home/XXX/codeception-slim-module-example/public/index.php(3): Slim\Container->__get('app') #2 {main} thrown in /home/XXX/codeception-slim-module-example/vendor/slim/slim/Slim/Container.php on line 120
そもそもこのリポジトリはslimのサンプルというよりは
slimでCodeception(機能テスト)を行うためのmoduleなので画面を見るような用途は元々ないということなのでしょうか?
参考:https://github.com/herloct/codeception-slim-module
あなたの回答
tips
プレビュー