Update for security namespace

This commit is contained in:
Damian Mooyman 2016-07-20 10:34:52 +12:00
parent f03b0ab6c9
commit ef723bb265
6 changed files with 43 additions and 32 deletions

View File

@ -1,5 +1,7 @@
<?php
use SilverStripe\Security\Member;
Member::add_extension('FrameworkTestRole');
Member::add_extension('FileUploadRole');
SiteTree::add_extension('FrameworkTestSiteTreeExtension');

View File

@ -3,6 +3,8 @@
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\DB;
use SilverStripe\ORM\DataExtension;
use SilverStripe\Security\Member;
class FrameworkTestRole extends DataExtension
{
@ -21,7 +23,7 @@ class FrameworkTestRole extends DataExtension
public function requireDefaultRecords()
{
$hasTestMembers = DataObject::get('Member')->find('Email', 'hayley@test.com');
$hasTestMembers = Member::get()->find('Email', 'hayley@test.com');
if (!$hasTestMembers) {
foreach ($this->data() as $name) {
$member = new Member(array(

View File

@ -1,4 +1,8 @@
<?php
use SilverStripe\Security\Permission;
use SilverStripe\Security\Security;
/**
* Starts a test session with various configurations set in session.
* These configurations are assumed to be evaluated in mysite/_config.php,

View File

@ -2,6 +2,7 @@
use SilverStripe\FrameworkTest\Model\TestPage;
use SilverStripe\FrameworkTest\Model\TestPage_Controller;
use SilverStripe\Security\Member;
class TestFileUploadPage extends TestPage
{

View File

@ -1,6 +1,7 @@
<?php
use SilverStripe\ORM\DataObject;
use SilverStripe\Security\Member;
class Page2MultiForm extends MultiForm
{

View File

@ -1,6 +1,7 @@
<?php
use SilverStripe\ORM\DataObject;
use SilverStripe\Security\Member;
class Page3MultiForm extends MultiForm
{