2010-04-12 03:31:02 +00:00
|
|
|
<?php
|
2016-08-19 10:51:35 +12:00
|
|
|
|
2016-10-14 14:30:05 +13:00
|
|
|
namespace SilverStripe\ORM\Tests;
|
|
|
|
|
2016-08-19 10:51:35 +12:00
|
|
|
use SilverStripe\Dev\SapphireTest;
|
|
|
|
use SilverStripe\Forms\LabelField;
|
|
|
|
|
2016-12-16 17:34:21 +13:00
|
|
|
class LabelFieldTest extends SapphireTest
|
|
|
|
{
|
2010-04-12 03:31:02 +00:00
|
|
|
|
2016-12-16 17:34:21 +13:00
|
|
|
public function testFieldHasNoNameAttribute()
|
|
|
|
{
|
|
|
|
$field = new LabelField('MyName', 'MyTitle');
|
2022-04-14 13:12:59 +12:00
|
|
|
$this->assertEquals(trim($field->Field() ?? ''), '<label id="MyName" class="readonly">MyTitle</label>');
|
2016-12-16 17:34:21 +13:00
|
|
|
}
|
2010-04-12 03:31:02 +00:00
|
|
|
}
|