2010-04-12 05:31:02 +02:00
|
|
|
<?php
|
2016-08-19 00:51:35 +02:00
|
|
|
|
|
|
|
use SilverStripe\Dev\SapphireTest;
|
|
|
|
use SilverStripe\Forms\LabelField;
|
|
|
|
|
2010-04-12 05:31:02 +02:00
|
|
|
/**
|
2012-04-12 08:02:46 +02:00
|
|
|
* @package framework
|
2010-04-12 05:31:02 +02:00
|
|
|
* @subpackage tests
|
|
|
|
*/
|
|
|
|
|
|
|
|
class LabelFieldTest extends SapphireTest {
|
|
|
|
|
2012-09-19 12:07:39 +02:00
|
|
|
public function testFieldHasNoNameAttribute() {
|
2010-04-12 05:31:02 +02:00
|
|
|
$field = new LabelField('MyName', 'MyTitle');
|
2015-08-30 07:02:55 +02:00
|
|
|
$this->assertEquals(trim($field->Field()), '<label id="MyName" class="readonly">MyTitle</label>');
|
2010-04-12 05:31:02 +02:00
|
|
|
}
|
|
|
|
}
|