mirror of
https://github.com/silverstripe/silverstripe-testsession
synced 2024-10-22 14:06:00 +02:00
Compare commits
10 Commits
466c966e26
...
dc76ac2877
Author | SHA1 | Date | |
---|---|---|---|
|
dc76ac2877 | ||
|
d7c4b0c420 | ||
|
8f4771385c | ||
|
3eb61e353f | ||
|
a8efc75702 | ||
|
b966a32e0c | ||
|
c1cf2b4106 | ||
|
bc4cb87627 | ||
|
2a9fb2b1e3 | ||
|
b87e4d46d0 |
@ -15,9 +15,9 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^8.1",
|
||||
"php": "^8.3",
|
||||
"composer/installers": "*",
|
||||
"silverstripe/framework": "^5",
|
||||
"silverstripe/framework": "^6",
|
||||
"silverstripe/vendor-plugin": "^2"
|
||||
},
|
||||
"require-dev": {
|
||||
@ -38,4 +38,4 @@
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
}
|
||||
}
|
||||
|
@ -16,14 +16,14 @@ use SilverStripe\Forms\Form;
|
||||
use SilverStripe\Forms\FormAction;
|
||||
use SilverStripe\Forms\HiddenField;
|
||||
use SilverStripe\Forms\TextField;
|
||||
use SilverStripe\ORM\ArrayList;
|
||||
use SilverStripe\Model\List\ArrayList;
|
||||
use SilverStripe\ORM\Connect\TempDatabase;
|
||||
use SilverStripe\ORM\DB;
|
||||
use SilverStripe\ORM\FieldType\DBHTMLText;
|
||||
use SilverStripe\Security\Permission;
|
||||
use SilverStripe\Security\RandomGenerator;
|
||||
use SilverStripe\Security\Security;
|
||||
use SilverStripe\View\ArrayData;
|
||||
use SilverStripe\Model\ArrayData;
|
||||
use SilverStripe\View\Requirements;
|
||||
|
||||
/**
|
||||
@ -67,7 +67,7 @@ class TestSessionController extends Controller
|
||||
{
|
||||
parent::init();
|
||||
|
||||
$this->extend('init');
|
||||
$this->extend('onInit');
|
||||
|
||||
$canAccess = (
|
||||
!Director::isLive()
|
||||
|
@ -15,9 +15,10 @@ use SilverStripe\Core\Extensible;
|
||||
use SilverStripe\Core\Injector\Injectable;
|
||||
use SilverStripe\Core\Injector\Injector;
|
||||
use SilverStripe\Dev\FixtureFactory;
|
||||
use SilverStripe\PolyExecution\Command\DbBuild;
|
||||
use SilverStripe\PolyExecution\PolyOutput;
|
||||
use SilverStripe\Dev\YamlFixture;
|
||||
use SilverStripe\ORM\Connect\TempDatabase;
|
||||
use SilverStripe\ORM\DatabaseAdmin;
|
||||
use SilverStripe\ORM\DB;
|
||||
use SilverStripe\ORM\FieldType\DBDatetime;
|
||||
use SilverStripe\Versioned\Versioned;
|
||||
@ -372,9 +373,13 @@ class TestSessionEnvironment
|
||||
}
|
||||
|
||||
// In case the dump involved CREATE TABLE commands, we need to ensure the schema is still up to date
|
||||
$dbAdmin = new DatabaseAdmin();
|
||||
$dbBuild = new DbBuild();
|
||||
Versioned::set_reading_mode('');
|
||||
$dbAdmin->doBuild(true, $requireDefaultRecords);
|
||||
$output = new PolyOutput(
|
||||
Director::is_cli() ? PolyOutput::FORMAT_ANSI : PolyOutput::FORMAT_HTML,
|
||||
PolyOutput::VERBOSITY_QUIET
|
||||
);
|
||||
$dbBuild->doBuild($output, $requireDefaultRecords);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -382,9 +387,13 @@ class TestSessionEnvironment
|
||||
*/
|
||||
public function requireDefaultRecords()
|
||||
{
|
||||
$dbAdmin = new DatabaseAdmin();
|
||||
$dbBuild = new DbBuild();
|
||||
Versioned::set_reading_mode('');
|
||||
$dbAdmin->doBuild(true, true);
|
||||
$output = new PolyOutput(
|
||||
Director::is_cli() ? PolyOutput::FORMAT_ANSI : PolyOutput::FORMAT_HTML,
|
||||
PolyOutput::VERBOSITY_QUIET
|
||||
);
|
||||
$dbBuild->doBuild($output, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user