mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Compare commits
3 Commits
211c9cb246
...
6af66030fb
Author | SHA1 | Date | |
---|---|---|---|
|
6af66030fb | ||
|
00fd636f71 | ||
|
666b4094b4 |
@ -627,9 +627,8 @@ class Controller extends RequestHandler implements TemplateGlobalProvider
|
|||||||
* Caution: All parameters are expected to be URI-encoded already.
|
* Caution: All parameters are expected to be URI-encoded already.
|
||||||
*
|
*
|
||||||
* @param string|array $arg One or more link segments, or list of link segments as an array
|
* @param string|array $arg One or more link segments, or list of link segments as an array
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public static function join_links($arg = null)
|
public static function join_links($arg = null): string
|
||||||
{
|
{
|
||||||
if (func_num_args() === 1 && is_array($arg)) {
|
if (func_num_args() === 1 && is_array($arg)) {
|
||||||
$args = $arg;
|
$args = $arg;
|
||||||
|
@ -179,10 +179,18 @@ class DBEnumTest extends SapphireTest
|
|||||||
public function testSaveDefaultValue()
|
public function testSaveDefaultValue()
|
||||||
{
|
{
|
||||||
$obj = new FieldType\DBEnumTestObject();
|
$obj = new FieldType\DBEnumTestObject();
|
||||||
$obj->Colour = null;
|
|
||||||
$id = $obj->write();
|
$id = $obj->write();
|
||||||
// Fetch the object from the database
|
// Fetch the object from the database
|
||||||
$colour = FieldType\DBEnumTestObject::get()->byID($id)->Colour;
|
$obj = FieldType\DBEnumTestObject::get()->byID($id);
|
||||||
$this->assertEquals('Red', $colour);
|
$this->assertEquals('Red', $obj->Colour);
|
||||||
|
$this->assertEquals('Blue', $obj->ColourWithDefault);
|
||||||
|
// Set value to null and save
|
||||||
|
$obj->Colour = null;
|
||||||
|
$obj->ColourWithDefault = null;
|
||||||
|
$obj->write();
|
||||||
|
// Fetch the object from the database
|
||||||
|
$obj = FieldType\DBEnumTestObject::get()->byID($id);
|
||||||
|
$this->assertEquals(null, $obj->Colour);
|
||||||
|
$this->assertEquals(null, $obj->ColourWithDefault);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,6 @@ class DBEnumTestObject extends DataObject
|
|||||||
|
|
||||||
private static $db = [
|
private static $db = [
|
||||||
'Colour' => 'Enum("Red,Blue,Green")',
|
'Colour' => 'Enum("Red,Blue,Green")',
|
||||||
|
'ColourWithDefault' => 'Enum("Red,Blue,Green","Blue")',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user