mirror of
https://github.com/silverstripe/silverstripe-testsession
synced 2024-10-22 14:06:00 +02:00
API Update API to reflect changes to CLI interaction (#93)
This commit is contained in:
parent
a8efc75702
commit
3eb61e353f
@ -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;
|
||||
@ -370,9 +371,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);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -380,9 +385,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