Update for SilverStripe\ORM namespace

Lock master branch to 4.x compat due to incompatibliities
This commit is contained in:
Damian Mooyman 2016-06-27 14:51:15 +12:00
parent e66772fdce
commit cbcd808dde
No known key found for this signature in database
GPG Key ID: 78B823A10DE27D1A
6 changed files with 33 additions and 15 deletions

View File

@ -15,12 +15,8 @@ matrix:
include: include:
- php: 5.6 - php: 5.6
env: DB=PGSQL CORE_RELEASE=master env: DB=PGSQL CORE_RELEASE=master
- php: 5.5 - php: 5.6
env: DB=MYSQL CORE_RELEASE=master env: DB=MYSQL CORE_RELEASE=master
- php: 5.3
env: DB=MYSQL CORE_RELEASE=3.2
- php: 5.3
env: DB=MYSQL CORE_RELEASE=3
before_script: before_script:
- phpenv rehash - phpenv rehash

View File

@ -1,5 +1,7 @@
<?php <?php
use SilverStripe\ORM\DB;
// Determine whether there is a testsession currently running, and if so - setup the persistent details for it. // Determine whether there is a testsession currently running, and if so - setup the persistent details for it.
Injector::inst()->get('TestSessionEnvironment')->loadFromFile(); Injector::inst()->get('TestSessionEnvironment')->loadFromFile();

View File

@ -1,4 +1,9 @@
<?php <?php
use SilverStripe\ORM\DB;
use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\FieldType\DBHTMLText;
/** /**
* Requires PHP's mycrypt extension in order to set the database name as an encrypted cookie. * Requires PHP's mycrypt extension in order to set the database name as an encrypted cookie.
*/ */
@ -55,7 +60,7 @@ class TestSessionController extends Controller
public function Link($action = null) public function Link($action = null)
{ {
return Controller::join_links(Director::baseUrl(), 'dev/testsession', $action); return Controller::join_links(Director::baseURL(), 'dev/testsession', $action);
} }
public function index() public function index()
@ -137,6 +142,8 @@ class TestSessionController extends Controller
/** /**
* Set $_SESSION state for the current browser session. * Set $_SESSION state for the current browser session.
*
* @param SS_HTTPRequest $request
*/ */
public function browsersessionstate($request) public function browsersessionstate($request)
{ {
@ -252,7 +259,7 @@ class TestSessionController extends Controller
* Updates an in-progress {@link TestSessionEnvironment} object with new details. This could be loading in new * Updates an in-progress {@link TestSessionEnvironment} object with new details. This could be loading in new
* fixtures, setting the mocked date to another value etc. * fixtures, setting the mocked date to another value etc.
* *
* @return HTMLText Rendered Template * @return DBHTMLText Rendered Template
* @throws LogicException * @throws LogicException
*/ */
public function set() public function set()

View File

@ -1,5 +1,9 @@
<?php <?php
use SilverStripe\ORM\DB;
use SilverStripe\ORM\DatabaseAdmin;
use SilverStripe\ORM\Versioning\Versioned;
/** /**
* Responsible for starting and finalizing test sessions. * Responsible for starting and finalizing test sessions.
* Since these session span across multiple requests, session information is persisted * Since these session span across multiple requests, session information is persisted

View File

@ -1,4 +1,9 @@
<?php <?php
use SilverStripe\ORM\DataModel;
use SilverStripe\ORM\FieldType\DBDatetime;
use SilverStripe\ORM\DB;
/** /**
* Sets state previously initialized through {@link TestSessionController}. * Sets state previously initialized through {@link TestSessionController}.
*/ */
@ -25,13 +30,13 @@ class TestSessionRequestFilter implements RequestFilter
// Date and time // Date and time
if (isset($testState->datetime)) { if (isset($testState->datetime)) {
SS_Datetime::set_mock_now($testState->datetime); DBDatetime::set_mock_now($testState->datetime);
} }
// Register mailer // Register mailer
if (isset($testState->mailer)) { if (isset($testState->mailer)) {
$mailer = $testState->mailer; $mailer = $testState->mailer;
Email::set_mailer(new $mailer()); Injector::inst()->registerService(new $mailer(), 'Mailer');
Config::inst()->update("Email", "send_all_emails_to", null); Config::inst()->update("Email", "send_all_emails_to", null);
} }

View File

@ -12,9 +12,13 @@
} }
], ],
"require": { "require": {
"php": ">=5.3.2",
"composer/installers": "*", "composer/installers": "*",
"silverstripe/framework": ">=3.2.0" "silverstripe/framework": "^4"
},
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
}, },
"minimum-stability": "dev" "minimum-stability": "dev"
} }