/
FormTextareaTest.php
54 lines (43 loc) · 1.35 KB
/
FormTextareaTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
namespace Larrock\Core\Tests\Helpers\FormBuilder;
use Larrock\Core\Helpers\FormBuilder\FormTextarea;
use Larrock\Core\LarrockCoreServiceProvider;
use Larrock\Core\Helpers\FormBuilder\FBElement;
class FormTextareaTest extends \Orchestra\Testbench\TestCase
{
/** @var FormTextarea */
protected $FormTextarea;
protected function setUp()
{
parent::setUp();
$this->FormTextarea = new FormTextarea('test_name', 'test_title');
}
public function tearDown()
{
parent::tearDown();
unset($this->FormTextarea);
}
protected function getPackageProviders($app)
{
return [
LarrockCoreServiceProvider::class
];
}
public function testSetTypo()
{
$this->FormTextarea->setTypo();
$this->assertTrue($this->FormTextarea->typo);
}
public function testSetNotEditor()
{
$this->FormTextarea->setNotEditor();
$this->assertEquals('uk-width-1-1 not-editor', $this->FormTextarea->css_class);
$this->assertInstanceOf(FBElement::class, $this->FormTextarea);
$this->assertInstanceOf(FormTextarea::class, $this->FormTextarea);
}
public function testRender()
{
$this->FormTextarea->setDefaultValue('test');
$this->assertNotEmpty($this->FormTextarea->render($this->FormTextarea, collect([])));
}
}