2015-10-28 04:44:14 +01:00
|
|
|
<?php
|
|
|
|
|
2016-10-14 03:30:05 +02:00
|
|
|
namespace SilverStripe\Forms\Tests;
|
|
|
|
|
2016-08-19 00:51:35 +02:00
|
|
|
use SilverStripe\Dev\SapphireTest;
|
|
|
|
use SilverStripe\Forms\InlineFormAction;
|
|
|
|
|
2015-10-28 04:44:14 +01:00
|
|
|
/**
|
|
|
|
* Tests {@see InlineFormAction}
|
|
|
|
*/
|
2016-12-16 05:34:21 +01:00
|
|
|
class InlineFormActionTest extends SapphireTest
|
|
|
|
{
|
2015-10-28 04:44:14 +01:00
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
public function testField()
|
|
|
|
{
|
|
|
|
$action = new InlineFormAction('dothing', 'My Title', 'ss-action');
|
2015-10-28 04:44:14 +01:00
|
|
|
$html = (string)$action->Field();
|
|
|
|
$this->assertContains('<input', $html);
|
|
|
|
$this->assertContains('type="submit"', $html);
|
|
|
|
$this->assertContains('name="action_dothing"', $html);
|
|
|
|
$this->assertContains('value="My Title"', $html);
|
|
|
|
$this->assertContains('id="dothing"', $html);
|
|
|
|
$this->assertContains('class="action ss-action"', $html);
|
2016-12-16 05:34:21 +01:00
|
|
|
}
|
2015-10-28 04:44:14 +01:00
|
|
|
}
|