Not sure how to accurately describe the situation (please advise if I'm missing something)
All functional tests return a blank page but I believe they hit the correct routes/urls because when I try to go to a route that requires login it is correctly redirected to the login page but the page is stil blank.
Can you help me figuring out what I am doing wrong? Thanks!
The test: func2Cept.php
<?php
$I = new FunctionalTester($scenario);
$I->wantTo('try to make functional tests work');
$I->amOnPage("/");
$x = $I->grabPageSource();
var_dump($x);
I followed the setup here: https://github.com/Codeception/phalcon-demo as well as the setup here: https://codeception.com/docs/modules/Phalcon
Running the test in debug mode gives me the following (note that the output of var_dump()
is an empty string)
$ vendor/bin/codecept run functional --debug
Codeception PHP Testing Framework v2.4.0
Powered by PHPUnit 7.0.3 by Sebastian Bergmann and contributors.
Functional Tests (1)
----------------------------------------------------------------------------------
Modules: \Helper\Functional, Asserts, Phalcon
----------------------------------------------------------------------------------
func2Cept: Try to make functional tests work
Signature: func2Cept
Test: tests/functional/func2Cept.php
Scenario --
[Database] Transaction started
I am on page "/"
[Request Headers] []
[Page] /
[Response] 200
[Request Cookies] []
[Response Headers] []
I grab page source
/var/www/phalcon/kdlab/tests/functional/func2Cept.php:19:
string(0) ""
PASSED
[Database] Transaction cancelled; all changes reverted.
----------------------------------------------------------------------------------
Time: 18 ms, Memory: 12.00MB
OK (1 test, 0 assertions)
Test redirect (try to go to a url which requires login, redirects to the login page)
$ vendor/bin/codecept run functional --debug
Codeception PHP Testing Framework v2.4.0
Powered by PHPUnit 7.0.3 by Sebastian Bergmann and contributors.
Functional Tests (1)
----------------------------------------------------------------------------------
Modules: \Helper\Functional, Asserts, Phalcon
----------------------------------------------------------------------------------
func2Cept: Try to make functional tests work
Signature: func2Cept
Test: tests/functional/func2Cept.php
Scenario --
[Database] Transaction started
I am on page "/welcome"
[Request Headers] []
[Page] /welcome
[Response] 302
[Request Cookies] []
[Response Headers] {"HTTP/1.1 302 Found":null,"Status":"302 Found","Location":"/login"}
[Redirecting to] /login
[Page] /login
[Response] 200
[Request Cookies] []
[Response Headers] []
I grab page source
/var/www/phalcon/kdlab/tests/functional/func2Cept.php:19:
string(0) ""
PASSED
[Database] Transaction cancelled; all changes reverted.
----------------------------------------------------------------------------------
Time: 22 ms, Memory: 12.00MB
OK (1 test, 0 assertions)