-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Cone\Root\Tests\Fields; | ||
|
||
use Cone\Root\Fields\Dropdown; | ||
use Cone\Root\Tests\TestCase; | ||
|
||
class DropdownTest extends TestCase | ||
{ | ||
protected Dropdown $field; | ||
|
||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
|
||
$this->field = Dropdown::make('Sizes') | ||
->options([ | ||
's' => 'S', | ||
'm' => 'M', | ||
'l' => 'L', | ||
]); | ||
} | ||
|
||
public function test_a_fieldset_field_has_fieldset_template(): void | ||
{ | ||
$this->assertSame('root::fields.dropdown', $this->field->getTemplate()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Cone\Root\Tests\Fields; | ||
|
||
use Cone\Root\Fields\Fieldset; | ||
use Cone\Root\Fields\Text; | ||
use Cone\Root\Tests\TestCase; | ||
|
||
class FieldsetTest extends TestCase | ||
{ | ||
protected Fieldset $field; | ||
|
||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
|
||
$this->field = Fieldset::make('Properties') | ||
->withFields(function () { | ||
return [ | ||
new Text('Name'), | ||
]; | ||
}); | ||
} | ||
|
||
public function test_a_fieldset_field_has_fieldset_template(): void | ||
{ | ||
$this->assertSame('root::fields.fieldset', $this->field->getTemplate()); | ||
} | ||
} |