mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge remote-tracking branch 'origin/3.0'
This commit is contained in:
commit
15a687f1e7
@ -191,15 +191,14 @@ class FunctionalTest extends SapphireTest {
|
||||
if($items) foreach($items as $item) $actuals[trim(preg_replace("/[ \n\r\t]+/", " ", $item. ''))] = true;
|
||||
|
||||
foreach($expectedMatches as $match) {
|
||||
if(!isset($actuals[$match])) {
|
||||
throw new PHPUnit_Framework_AssertionFailedError(
|
||||
$this->assertTrue(
|
||||
isset($actuals[$match]),
|
||||
"Failed asserting the CSS selector '$selector' has a partial match to the expected elements:\n'"
|
||||
. implode("'\n'", $expectedMatches) . "'\n\n"
|
||||
. "Instead the following elements were found:\n'" . implode("'\n'", array_keys($actuals)) . "'"
|
||||
);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -224,14 +223,12 @@ class FunctionalTest extends SapphireTest {
|
||||
$actuals = array();
|
||||
if($items) foreach($items as $item) $actuals[] = trim(preg_replace("/[ \n\r\t]+/", " ", $item. ''));
|
||||
|
||||
if($expectedMatches != $actuals) {
|
||||
throw new PHPUnit_Framework_AssertionFailedError(
|
||||
$this->assertTrue(
|
||||
$expectedMatches == $actuals,
|
||||
"Failed asserting the CSS selector '$selector' has an exact match to the expected elements:\n'"
|
||||
. implode("'\n'", $expectedMatches) . "'\n\n"
|
||||
. "Instead the following elements were found:\n'" . implode("'\n'", $actuals) . "'"
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -257,14 +254,12 @@ class FunctionalTest extends SapphireTest {
|
||||
if($items) foreach($items as $item) $actuals[$item->asXML()] = true;
|
||||
|
||||
foreach($expectedMatches as $match) {
|
||||
if(!isset($actuals[$match])) {
|
||||
throw new PHPUnit_Framework_AssertionFailedError(
|
||||
$this->assertTrue(
|
||||
isset($actuals[$match]),
|
||||
"Failed asserting the CSS selector '$selector' has a partial match to the expected elements:\n'"
|
||||
. implode("'\n'", $expectedMatches) . "'\n\n"
|
||||
. "Instead the following elements were found:\n'" . implode("'\n'", array_keys($actuals)) . "'"
|
||||
);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -288,14 +283,13 @@ class FunctionalTest extends SapphireTest {
|
||||
$actuals = array();
|
||||
if($items) foreach($items as $item) $actuals[] = $item->asXML();
|
||||
|
||||
if($expectedMatches != $actuals) {
|
||||
throw new PHPUnit_Framework_AssertionFailedError(
|
||||
$this->assertTrue(
|
||||
$expectedMatches == $actuals,
|
||||
"Failed asserting the CSS selector '$selector' has an exact match to the expected elements:\n'"
|
||||
. implode("'\n'", $expectedMatches) . "'\n\n"
|
||||
. "Instead the following elements were found:\n'" . implode("'\n'", $actuals) . "'"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Log in as the given member
|
||||
|
@ -272,6 +272,8 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
||||
* for tearing down the state again.
|
||||
*/
|
||||
public function setUpOnce() {
|
||||
$isAltered = false;
|
||||
|
||||
// Remove any illegal extensions that are present
|
||||
foreach($this->illegalExtensions as $class => $extensions) {
|
||||
foreach($extensions as $extension) {
|
||||
@ -298,7 +300,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
||||
}
|
||||
|
||||
// If we have made changes to the extensions present, then migrate the database schema.
|
||||
if($this->extensionsToReapply || $this->extensionsToRemove || $this->extraDataObjects) {
|
||||
if($isAltered || $this->extensionsToReapply || $this->extensionsToRemove || $this->extraDataObjects) {
|
||||
if(!self::using_temp_db()) self::create_temp_db();
|
||||
$this->resetDBSchema(true);
|
||||
}
|
||||
@ -540,8 +542,7 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
||||
* 'customHeaders', 'htmlContent', inlineImages'
|
||||
*/
|
||||
public function assertEmailSent($to, $from = null, $subject = null, $content = null) {
|
||||
// To do - this needs to be turned into a "real" PHPUnit ass
|
||||
if(!$this->findEmail($to, $from, $subject, $content)) {
|
||||
$found = (bool)$this->findEmail($to, $from, $subject, $content);
|
||||
|
||||
$infoParts = "";
|
||||
$withParts = array();
|
||||
@ -551,11 +552,11 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
||||
if($content) $withParts[] = "content '$content'";
|
||||
if($withParts) $infoParts .= " with " . implode(" and ", $withParts);
|
||||
|
||||
throw new PHPUnit_Framework_AssertionFailedError(
|
||||
$this->assertTrue(
|
||||
$found,
|
||||
"Failed asserting that an email was sent$infoParts."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@ -594,15 +595,13 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
||||
}
|
||||
|
||||
// We couldn't find a match - assertion failed
|
||||
if(!$matched) {
|
||||
throw new PHPUnit_Framework_AssertionFailedError(
|
||||
$this->assertTrue(
|
||||
$matched,
|
||||
"Failed asserting that the SS_List contains an item matching "
|
||||
. var_export($match, true) . "\n\nIn the following SS_List:\n"
|
||||
. $this->DOSSummaryForMatch($dataObjectSet, $match)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -640,24 +639,22 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
||||
}
|
||||
|
||||
// We couldn't find a match - assertion failed
|
||||
if(!$matched) {
|
||||
throw new PHPUnit_Framework_AssertionFailedError(
|
||||
$this->assertTrue(
|
||||
$matched,
|
||||
"Failed asserting that the SS_List contains an item matching "
|
||||
. var_export($match, true) . "\n\nIn the following SS_List:\n"
|
||||
. $this->DOSSummaryForMatch($dataObjectSet, $match)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// If we have leftovers than the DOS has extra data that shouldn't be there
|
||||
if($extracted) {
|
||||
$this->assertTrue(
|
||||
(count($extracted) == 0),
|
||||
// If we didn't break by this point then we couldn't find a match
|
||||
throw new PHPUnit_Framework_AssertionFailedError(
|
||||
"Failed asserting that the SS_List contained only the given items, the "
|
||||
. "following items were left over:\n" . var_export($extracted, true)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert that the every record in the given {@link SS_List} matches the given key-value
|
||||
@ -676,14 +673,13 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
||||
foreach($dataObjectSet as $item) $extracted[] = $item->toMap();
|
||||
|
||||
foreach($extracted as $i => $item) {
|
||||
if(!$this->dataObjectArrayMatch($item, $match)) {
|
||||
throw new PHPUnit_Framework_AssertionFailedError(
|
||||
$this->assertTrue(
|
||||
$this->dataObjectArrayMatch($item, $match),
|
||||
"Failed asserting that the the following item matched "
|
||||
. var_export($match, true) . ": " . var_export($item, true)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function for the DOS matchers
|
||||
@ -799,6 +795,8 @@ class SapphireTest extends PHPUnit_Framework_TestCase {
|
||||
*/
|
||||
public function resetDBSchema($includeExtraDataObjects = false) {
|
||||
if(self::using_temp_db()) {
|
||||
DataObject::reset();
|
||||
|
||||
// clear singletons, they're caching old extension info which is used in DatabaseAdmin->doBuild()
|
||||
Injector::inst()->unregisterAllObjects();
|
||||
|
||||
|
@ -1245,7 +1245,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
||||
}
|
||||
|
||||
// Deleting a record without an ID shouldn't do anything
|
||||
if(!$this->ID) throw new Exception("DataObject::delete() called on a DataObject without an ID");
|
||||
if(!$this->ID) throw new LogicException("DataObject::delete() called on a DataObject without an ID");
|
||||
|
||||
// TODO: This is quite ugly. To improve:
|
||||
// - move the details of the delete code in the DataQuery system
|
||||
|
@ -26,7 +26,7 @@ class RequestHandlingTest extends FunctionalTest {
|
||||
}
|
||||
|
||||
public function testRequestHandlerChainingAllParams() {
|
||||
// TODO
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
|
||||
public function testMethodCallingOnController() {
|
||||
|
@ -161,7 +161,7 @@ class ConfigTest extends SapphireTest {
|
||||
}
|
||||
|
||||
public function testFragmentOrder() {
|
||||
// $manifest = new SS_ConfigManifest(BASE_PATH, false, true);
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -296,6 +296,7 @@ class ObjectTest extends SapphireTest {
|
||||
}
|
||||
|
||||
public function testCacheToFile() {
|
||||
$this->markTestIncomplete();
|
||||
/*
|
||||
// This doesn't run properly on our build slave.
|
||||
$obj = new ObjectTest_CacheTest();
|
||||
|
@ -25,7 +25,7 @@ class DeprecationTest extends SapphireTest {
|
||||
|
||||
public function testLesserVersionTriggersNoNotice() {
|
||||
Deprecation::notification_version('1.0.0');
|
||||
Deprecation::notice('2.0', 'Deprecation test failed');
|
||||
$this->assertNull(Deprecation::notice('2.0', 'Deprecation test failed'));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -38,8 +38,8 @@ class DeprecationTest extends SapphireTest {
|
||||
|
||||
public function testBetaVersionDoesntTriggerNoticeWhenDeprecationDoesntSpecifyReleasenum() {
|
||||
Deprecation::notification_version('2.0.0-beta1');
|
||||
Deprecation::notice('2.0', 'Deprecation test failed');
|
||||
Deprecation::notice('2.0.0', 'Deprecation test failed');
|
||||
$this->assertNull(Deprecation::notice('2.0', 'Deprecation test failed'));
|
||||
$this->assertNull(Deprecation::notice('2.0.0', 'Deprecation test failed'));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -99,7 +99,7 @@ class DeprecationTest extends SapphireTest {
|
||||
|
||||
protected function callThatOriginatesFromFramework() {
|
||||
$this->assertEquals(DeprecationTest_Deprecation::get_module(), FRAMEWORK_DIR);
|
||||
Deprecation::notice('2.0', 'Deprecation test passed');
|
||||
$this->assertNull(Deprecation::notice('2.0', 'Deprecation test passed'));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -164,6 +164,8 @@ class FileTest extends SapphireTest {
|
||||
|
||||
/**
|
||||
* @see http://open.silverstripe.org/ticket/5693
|
||||
*
|
||||
* @expectedException ValidationException
|
||||
*/
|
||||
public function testSetNameWithInvalidExtensionDoesntChangeFilesystem() {
|
||||
$origExts = File::$allowed_extensions;
|
||||
@ -177,11 +179,8 @@ class FileTest extends SapphireTest {
|
||||
$file->write();
|
||||
} catch(ValidationException $e) {
|
||||
File::$allowed_extensions = $origExts;
|
||||
return;
|
||||
throw $e;
|
||||
}
|
||||
|
||||
$this->fail('Expected ValidationException not raised');
|
||||
File::$allowed_extensions = $origExts;
|
||||
}
|
||||
|
||||
public function testLinkAndRelativeLink() {
|
||||
|
@ -30,9 +30,8 @@ class EmailFieldTest extends FunctionalTest {
|
||||
$val = new EmailFieldTest_Validator();
|
||||
try {
|
||||
$field->validate($val);
|
||||
if (!$expectSuccess) {
|
||||
$this->assertTrue(false,$checkText . " (/$email/ passed validation, but not expected to)");
|
||||
}
|
||||
// If we expect failure and processing gets here without an exception, the test failed
|
||||
$this->assertTrue($expectSuccess,$checkText . " (/$email/ passed validation, but not expected to)");
|
||||
} catch (Exception $e) {
|
||||
if ($e instanceof PHPUnit_Framework_AssertionFailedError) throw $e; // re-throw assertion failure
|
||||
else if ($expectSuccess) {
|
||||
|
@ -273,13 +273,15 @@ class GridFieldTest extends SapphireTest {
|
||||
* @covers GridField::gridFieldAlterAction
|
||||
*/
|
||||
public function testGridFieldAlterAction() {
|
||||
$config = GridFieldConfig::create()->addComponent(new GridFieldTest_Component);
|
||||
$obj = new GridField('testfield', 'testfield', ArrayList::create(), $config);
|
||||
$id = 'testGridStateActionField';
|
||||
Session::set($id, array('grid'=>'', 'actionName'=>'jump'));
|
||||
$form = new Form(new Controller(), 'mockform', new FieldList(array($obj)), new FieldList());
|
||||
$request = new SS_HTTPRequest('POST', 'url');
|
||||
$obj->gridFieldAlterAction(array('StateID'=>$id), $form, $request);
|
||||
$this->markTestIncomplete();
|
||||
|
||||
// $config = GridFieldConfig::create()->addComponent(new GridFieldTest_Component);
|
||||
// $obj = new GridField('testfield', 'testfield', ArrayList::create(), $config);
|
||||
// $id = 'testGridStateActionField';
|
||||
// Session::set($id, array('grid'=>'', 'actionName'=>'jump'));
|
||||
// $form = new Form(new Controller(), 'mockform', new FieldList(array($obj)), new FieldList());
|
||||
// $request = new SS_HTTPRequest('POST', 'url');
|
||||
// $obj->gridFieldAlterAction(array('StateID'=>$id), $form, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -281,29 +281,29 @@ class RequirementsTest extends SapphireTest {
|
||||
// to something else
|
||||
$basePath = 'framework' . substr($basePath, strlen(FRAMEWORK_DIR));
|
||||
|
||||
$backend = new RequirementsTest_Backend();
|
||||
$backend = new Requirements_Backend();
|
||||
$holder = Requirements::backend();
|
||||
Requirements::set_backend($backend);
|
||||
$data = new ArrayData(array(
|
||||
'FailTest' => true,
|
||||
));
|
||||
$data->renderWith('RequirementsTest_Conditionals');
|
||||
$backend->assertFileIncluded('css', $basePath .'/RequirementsTest_a.css');
|
||||
$backend->assertFileIncluded('js',
|
||||
$this->assertFileIncluded($backend, 'css', $basePath .'/RequirementsTest_a.css');
|
||||
$this->assertFileIncluded($backend, 'js',
|
||||
array($basePath .'/RequirementsTest_b.js', $basePath .'/RequirementsTest_c.js'));
|
||||
$backend->assertFileNotIncluded('js', $basePath .'/RequirementsTest_a.js');
|
||||
$backend->assertFileNotIncluded('css',
|
||||
$this->assertFileNotIncluded($backend, 'js', $basePath .'/RequirementsTest_a.js');
|
||||
$this->assertFileNotIncluded($backend, 'css',
|
||||
array($basePath .'/RequirementsTest_b.css', $basePath .'/RequirementsTest_c.css'));
|
||||
$backend->clear();
|
||||
$data = new ArrayData(array(
|
||||
'FailTest' => false,
|
||||
));
|
||||
$data->renderWith('RequirementsTest_Conditionals');
|
||||
$backend->assertFileNotIncluded('css', $basePath .'/RequirementsTest_a.css');
|
||||
$backend->assertFileNotIncluded('js',
|
||||
$this->assertFileNotIncluded($backend, 'css', $basePath .'/RequirementsTest_a.css');
|
||||
$this->assertFileNotIncluded($backend, 'js',
|
||||
array($basePath .'/RequirementsTest_b.js', $basePath .'/RequirementsTest_c.js'));
|
||||
$backend->assertFileIncluded('js', $basePath .'/RequirementsTest_a.js');
|
||||
$backend->assertFileIncluded('css',
|
||||
$this->assertFileIncluded($backend, 'js', $basePath .'/RequirementsTest_a.js');
|
||||
$this->assertFileIncluded($backend, 'css',
|
||||
array($basePath .'/RequirementsTest_b.css', $basePath .'/RequirementsTest_c.css'));
|
||||
Requirements::set_backend($holder);
|
||||
}
|
||||
@ -323,82 +323,93 @@ class RequirementsTest extends SapphireTest {
|
||||
$html = $backend->includeInHTML(false, $template);
|
||||
$this->assertNotContains('<head><script', $html);
|
||||
$this->assertContains('</script></body>', $html);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class RequirementsTest_Backend extends Requirements_Backend implements TestOnly {
|
||||
public function assertFileIncluded($type, $files) {
|
||||
public function assertFileIncluded($backend, $type, $files) {
|
||||
$type = strtolower($type);
|
||||
switch (strtolower($type)) {
|
||||
case 'css':
|
||||
$var = 'css';
|
||||
$method = 'get_css';
|
||||
$type = 'CSS';
|
||||
break;
|
||||
case 'js':
|
||||
case 'javascript':
|
||||
case 'script':
|
||||
$var = 'javascript';
|
||||
$method = 'get_javascript';
|
||||
$type = 'JavaScript';
|
||||
break;
|
||||
}
|
||||
$includedFiles = $backend->$method();
|
||||
|
||||
// Workaround for inconsistent return formats
|
||||
if($method == 'get_javascript') {
|
||||
$includedFiles = array_combine(array_values($includedFiles), array_values($includedFiles));
|
||||
}
|
||||
|
||||
if(is_array($files)) {
|
||||
$failedMatches = array();
|
||||
foreach ($files as $file) {
|
||||
if(!array_key_exists($file, $this->$var)) {
|
||||
if(!array_key_exists($file, $includedFiles)) {
|
||||
$failedMatches[] = $file;
|
||||
}
|
||||
}
|
||||
if(count($failedMatches) > 0) throw new PHPUnit_Framework_AssertionFailedError(
|
||||
$this->assertTrue(
|
||||
(count($failedMatches) == 0),
|
||||
"Failed asserting the $type files '"
|
||||
. implode("', '", $failedMatches)
|
||||
. "' have exact matches in the required elements:\n'"
|
||||
. implode("'\n'", array_keys($this->$var)) . "'"
|
||||
. implode("'\n'", array_keys($includedFiles)) . "'"
|
||||
);
|
||||
} else {
|
||||
if(!array_key_exists($files, $this->$var)) {
|
||||
throw new PHPUnit_Framework_AssertionFailedError(
|
||||
$this->assertTrue(
|
||||
(array_key_exists($files, $includedFiles)),
|
||||
"Failed asserting the $type file '$files' has an exact match in the required elements:\n'"
|
||||
. implode("'\n'", array_keys($this->$var)) . "'"
|
||||
. implode("'\n'", array_keys($includedFiles)) . "'"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function assertFileNotIncluded($type, $files) {
|
||||
public function assertFileNotIncluded($backend, $type, $files) {
|
||||
$type = strtolower($type);
|
||||
switch ($type) {
|
||||
case 'css':
|
||||
$var = 'css';
|
||||
$method = 'get_css';
|
||||
$type = 'CSS';
|
||||
break;
|
||||
case 'js':
|
||||
case 'javascript':
|
||||
case 'get_javascript':
|
||||
case 'script':
|
||||
$var = 'javascript';
|
||||
$method = 'get_javascript';
|
||||
$type = 'JavaScript';
|
||||
break;
|
||||
}
|
||||
$includedFiles = $backend->$method();
|
||||
|
||||
// Workaround for inconsistent return formats
|
||||
if($method == 'get_javascript') {
|
||||
$includedFiles = array_combine(array_values($includedFiles), array_values($includedFiles));
|
||||
}
|
||||
|
||||
if(is_array($files)) {
|
||||
$failedMatches = array();
|
||||
foreach ($files as $file) {
|
||||
if(array_key_exists($file, $this->$var)) {
|
||||
if(array_key_exists($file, $includedFiles)) {
|
||||
$failedMatches[] = $file;
|
||||
}
|
||||
}
|
||||
if(count($failedMatches) > 0) throw new PHPUnit_Framework_AssertionFailedError(
|
||||
$this->assertTrue(
|
||||
(count($failedMatches) == 0),
|
||||
"Failed asserting the $type files '"
|
||||
. implode("', '", $failedMatches)
|
||||
. "' do not have exact matches in the required elements:\n'"
|
||||
. implode("'\n'", array_keys($this->$var)) . "'"
|
||||
. implode("'\n'", array_keys($includedFiles)) . "'"
|
||||
);
|
||||
} else {
|
||||
if(array_key_exists($files, $this->$var)) {
|
||||
throw new PHPUnit_Framework_AssertionFailedError(
|
||||
$this->assertFalse(
|
||||
(array_key_exists($files, $includedFiles)),
|
||||
"Failed asserting the $type file '$files' does not have an exact match in the required elements:"
|
||||
. "\n'" . implode("'\n'", array_keys($this->$var)) . "'"
|
||||
. "\n'" . implode("'\n'", array_keys($includedFiles)) . "'"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -148,7 +148,7 @@ class AggregateTest extends SapphireTest {
|
||||
* Test aggregates are cached properly
|
||||
*/
|
||||
public function testCache() {
|
||||
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
/* */
|
||||
|
||||
|
@ -195,7 +195,7 @@ class DataListTest extends SapphireTest {
|
||||
}
|
||||
|
||||
public function testFilter() {
|
||||
// coming soon!
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
|
||||
public function testWhere() {
|
||||
|
@ -1021,24 +1021,19 @@ class DataObjectTest extends SapphireTest {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException LogicException
|
||||
*/
|
||||
public function testInvalidate() {
|
||||
$do = new DataObjectTest_Fixture();
|
||||
$do->write();
|
||||
|
||||
$do->delete();
|
||||
|
||||
try {
|
||||
// Prohibit invalid object manipulation
|
||||
$do->delete();
|
||||
$do->delete(); // Prohibit invalid object manipulation
|
||||
$do->write();
|
||||
$do->duplicate();
|
||||
}
|
||||
catch(Exception $e) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->fail('Should throw an exception');
|
||||
}
|
||||
|
||||
public function testToMap() {
|
||||
$obj = $this->objFromFixture('DataObjectTest_SubTeam', 'subteam1');
|
||||
|
@ -51,7 +51,11 @@ class DatabaseTest extends SapphireTest {
|
||||
}
|
||||
|
||||
public function testMySQLCreateTableOptions() {
|
||||
if(DB::getConn() instanceof MySQLDatabase) {
|
||||
if(!(DB::getConn() instanceof MySQLDatabase)) {
|
||||
$this->markTestSkipped('MySQL only');
|
||||
}
|
||||
|
||||
|
||||
$ret = DB::query(sprintf(
|
||||
'SHOW TABLE STATUS WHERE "Name" = \'%s\'',
|
||||
'DatabaseTest_MyObject'
|
||||
@ -60,7 +64,6 @@ class DatabaseTest extends SapphireTest {
|
||||
"MySQLDatabase tables can be changed to InnoDB through DataObject::\$create_table_options"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function testIsSchemaUpdating() {
|
||||
$db = DB::getConn();
|
||||
|
@ -39,6 +39,6 @@ class PasswordValidatorTest extends SapphireTest {
|
||||
}
|
||||
|
||||
public function testHistoricalPasswordCount() {
|
||||
// TODO
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
}
|
||||
|
@ -11,9 +11,12 @@ class SecurityDefaultAdminTest extends SapphireTest {
|
||||
}
|
||||
|
||||
public function testCheckDefaultAdmin() {
|
||||
// TODO There's currently no way to inspect default admin state,
|
||||
// hence we don't override existing settings
|
||||
if(Security::has_default_admin()) return;
|
||||
if(Security::has_default_admin()) {
|
||||
$this->markTestSkipped(
|
||||
'Default admin present. There\'s no way to inspect default admin state, ' .
|
||||
'so we don\'t override existing settings'
|
||||
);
|
||||
}
|
||||
|
||||
Security::setDefaultAdmin('admin', 'password');
|
||||
|
||||
|
@ -206,7 +206,7 @@ class SSViewerCacheBlockTest extends SapphireTest {
|
||||
|
||||
public function testNoErrorMessageForControlWithinCached() {
|
||||
$this->_reset(true);
|
||||
$this->_runtemplate('<% cached %><% control Foo %>$Bar<% end_control %><% end_cached %>');
|
||||
$this->assertNotNull($this->_runtemplate('<% cached %><% control Foo %>$Bar<% end_control %><% end_cached %>'));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -220,8 +220,8 @@ class SSViewerCacheBlockTest extends SapphireTest {
|
||||
|
||||
public function testNoErrorMessageForCachedWithinControlWithinUncached() {
|
||||
$this->_reset(true);
|
||||
$this->_runtemplate(
|
||||
'<% uncached %><% control Foo %><% cached %>$Bar<% end_cached %><% end_control %><% end_uncached %>');
|
||||
$this->assertNotNull($this->_runtemplate(
|
||||
'<% uncached %><% control Foo %><% cached %>$Bar<% end_cached %><% end_control %><% end_uncached %>'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user