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