Merge pull request #36 from open-sausages/pulls/namespace-orm

Update for SilverStripe\ORM namespace
This commit is contained in:
Ingo Schommer 2016-07-01 15:08:17 +12:00 committed by GitHub
commit 3b06f5f738
6 changed files with 33 additions and 15 deletions

View File

@ -15,12 +15,8 @@ matrix:
include:
- php: 5.6
env: DB=PGSQL CORE_RELEASE=master
- php: 5.5
- php: 5.6
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:
- phpenv rehash

View File

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

View File

@ -1,4 +1,9 @@
<?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.
*/
@ -55,7 +60,7 @@ class TestSessionController extends Controller
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()
@ -137,6 +142,8 @@ class TestSessionController extends Controller
/**
* Set $_SESSION state for the current browser session.
*
* @param SS_HTTPRequest $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
* fixtures, setting the mocked date to another value etc.
*
* @return HTMLText Rendered Template
* @return DBHTMLText Rendered Template
* @throws LogicException
*/
public function set()

View File

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

View File

@ -1,4 +1,9 @@
<?php
use SilverStripe\ORM\DataModel;
use SilverStripe\ORM\FieldType\DBDatetime;
use SilverStripe\ORM\DB;
/**
* Sets state previously initialized through {@link TestSessionController}.
*/
@ -25,13 +30,13 @@ class TestSessionRequestFilter implements RequestFilter
// Date and time
if (isset($testState->datetime)) {
SS_Datetime::set_mock_now($testState->datetime);
DBDatetime::set_mock_now($testState->datetime);
}
// Register mailer
if (isset($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);
}

View File

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