silverstripe-testsession/_config.php
Ingo Schommer 77e29d47c7 Using 3.1 compatible Config API for setup
Avoids deprecation notices when testing against master
2013-06-19 12:12:11 +02:00

19 lines
462 B
PHP

<?php
if(
Config::inst()->get('Security', 'token')
&& DB::get_alternative_database_name()
) {
require_once BASE_PATH . '/vendor/autoload.php';
// Register mailer
if($mailer = Session::get('testsession.mailer')) {
Email::set_mailer(new $mailer());
\Config::inst()->update("Email","send_all_emails_to", null);
}
// Set mock date and time
$date = Session::get('testsession.date');
if($date) {
SS_Datetime::set_mock_now($date);
}
}