silverstripe-framework/tests/forms/EnumFieldTest.php

20 lines
486 B
PHP
Raw Normal View History

2014-03-30 08:51:38 +02:00
<?php
/**
* @package framework
* @subpackage tests
*/
class EnumFieldTest extends SapphireTest {
public function testAnyFieldIsPresentInSearchField() {
$values = array (
2014-08-15 08:53:05 +02:00
'Key' => 'Value'
2014-03-30 08:51:38 +02:00
);
$enumField = new Enum('testField', $values);
2014-08-15 08:53:05 +02:00
2014-03-30 08:51:38 +02:00
$searchField = $enumField->scaffoldSearchField();
2014-08-15 08:53:05 +02:00
2014-03-30 08:51:38 +02:00
$anyText = "(" . _t('Enum.ANY', 'Any') . ")";
$this->assertEquals(true, $searchField->getHasEmptyDefault());
$this->assertEquals($anyText, $searchField->getEmptyString());
}
}