I'll be more specific,
- there is a special .env.test file
test/_bootstrap.php
define('ENV', '.env.test');
codeception.yml
modules:
config:
Db:
dsn: 'mysql:host=localhost;dbname=test'
user: 'test'
password: 'test'
dump: tests/_data/dump.sql
api.suite.yml
class_name: ApiTester
modules:
enabled:
- \Helper\Api
- \Helper\JsonSchema
- Db:
cleanup: true
- REST:
depends: PhpBrowser
url: https://localhost:8888
part: Json
defined('ENV') or define('ENV', '.env');
$dotenv = new \Dotenv\Dotenv(__DIR__.'/../', ENV);
$dotenv->load();
So, when request is created via PhpBrowser module, it doesn't use a '.env.test' but '.env' like a regular request to API, should I use Phalcon2 module for REST, or there is some better way to load a test database?