Skip to content

Commit

Permalink
Str::random
Browse files Browse the repository at this point in the history
  • Loading branch information
inxilpro committed Sep 3, 2019
1 parent 4d930be commit deb0e76
Show file tree
Hide file tree
Showing 16 changed files with 77 additions and 62 deletions.
2 changes: 1 addition & 1 deletion bin/codegen.php
Expand Up @@ -244,7 +244,7 @@ function print_setter_test($attribute, $attribute_config, $tag = 'form') {
echo "\t\t\n";
}
} else {
echo "\t\t\$value = str_random();\n";
echo "\t\t\$value = Str::random();\n";
echo "\t\t\n";
echo "\t\t$target->$method(\$value);\n";
echo "\t\t\$this->assertSelectorAttribute($target, '$tag', '$attribute', \$value);\n";
Expand Down
5 changes: 3 additions & 2 deletions bin/codegen/element_tests.php
Expand Up @@ -26,8 +26,9 @@
$class_name = studly_case($tag);

echo "use Galahad\\Aire\\DTD\\$class_name;\n";
echo "use Galahad\Aire\Tests\TestCase;\n\n";

echo "use Galahad\Aire\Tests\TestCase;\n";
echo "use use Illuminate\Support\Str;\n\n";

echo "class {$class_name}Test extends TestCase\n";
echo "{\n";

Expand Down
3 changes: 2 additions & 1 deletion bin/codegen/global_attribute_tests.php
Expand Up @@ -17,7 +17,8 @@

echo "namespace Galahad\Aire\Tests\DTD;\n\n";

echo "use Galahad\Aire\Tests\TestCase;\n\n";
echo "use Galahad\Aire\Tests\TestCase;\n";
echo "use Illuminate\Support\Str;\n\n";

echo "class GlobalAttributesTest extends TestCase\n";
echo "{\n";
Expand Down
9 changes: 5 additions & 4 deletions tests/DTD/ButtonTest.php
Expand Up @@ -32,6 +32,7 @@

use Galahad\Aire\DTD\Button;
use Galahad\Aire\Tests\TestCase;
use Illuminate\Support\Str;

class ButtonTest extends TestCase
{
Expand Down Expand Up @@ -61,7 +62,7 @@ public function test_form_attribute_can_be_set_and_unset() : void
{
$button = new Button($this->aire(), $this->aire()->form());

$value = str_random();
$value = Str::random();

$button->form($value);
$this->assertSelectorAttribute($button, 'button', 'form', $value);
Expand All @@ -74,7 +75,7 @@ public function test_form_action_attribute_can_be_set_and_unset() : void
{
$button = new Button($this->aire(), $this->aire()->form());

$value = str_random();
$value = Str::random();

$button->formAction($value);
$this->assertSelectorAttribute($button, 'button', 'formaction', $value);
Expand Down Expand Up @@ -149,7 +150,7 @@ public function test_name_attribute_can_be_set_and_unset() : void
{
$button = new Button($this->aire(), $this->aire()->form());

$value = str_random();
$value = Str::random();

$button->name($value);
$this->assertSelectorAttribute($button, 'button', 'name', $value);
Expand Down Expand Up @@ -179,7 +180,7 @@ public function test_value_attribute_can_be_set_and_unset() : void
{
$button = new Button($this->aire(), $this->aire()->form());

$value = str_random();
$value = Str::random();

$button->value($value);
$this->assertSelectorAttribute($button, 'button', 'value', $value);
Expand Down
7 changes: 4 additions & 3 deletions tests/DTD/FormTest.php
Expand Up @@ -32,14 +32,15 @@

use Galahad\Aire\DTD\Form;
use Galahad\Aire\Tests\TestCase;
use Illuminate\Support\Str;

class FormTest extends TestCase
{
public function test_accept_charset_attribute_can_be_set_and_unset() : void
{
$form = $this->aire()->form();

$value = str_random();
$value = Str::random();

$form->acceptCharset($value);
$this->assertSelectorAttribute($form, 'form', 'accept-charset', $value);
Expand All @@ -52,7 +53,7 @@ public function test_action_attribute_can_be_set_and_unset() : void
{
$form = $this->aire()->form();

$value = str_random();
$value = Str::random();

$form->action($value);
$this->assertSelectorAttribute($form, 'form', 'action', $value);
Expand Down Expand Up @@ -290,7 +291,7 @@ public function test_name_attribute_can_be_set_and_unset() : void
{
$form = $this->aire()->form();

$value = str_random();
$value = Str::random();

$form->name($value);
$this->assertSelectorAttribute($form, 'form', 'name', $value);
Expand Down
29 changes: 15 additions & 14 deletions tests/DTD/GlobalAttributesTest.php
Expand Up @@ -31,14 +31,15 @@
namespace Galahad\Aire\Tests\DTD;

use Galahad\Aire\Tests\TestCase;
use Illuminate\Support\Str;

class GlobalAttributesTest extends TestCase
{
public function test_access_key_attribute_can_be_set_and_unset() : void
{
$form = $this->aire()->form();

$value = str_random();
$value = Str::random();

$form->accessKey($value);
$this->assertSelectorAttribute($form, 'form', 'accesskey', $value);
Expand All @@ -51,7 +52,7 @@ public function test_class_attribute_can_be_set() : void
{
$form = $this->aire()->form();

$value = str_random();
$value = Str::random();

$form->class($value);
$this->assertSelectorAttribute($form, 'form', 'class', $value);
Expand All @@ -75,7 +76,7 @@ public function test_context_menu_attribute_can_be_set_and_unset() : void
{
$form = $this->aire()->form();

$value = str_random();
$value = Str::random();

$form->contextMenu($value);
$this->assertSelectorAttribute($form, 'form', 'contextmenu', $value);
Expand Down Expand Up @@ -147,7 +148,7 @@ public function test_id_attribute_can_be_set_and_unset() : void
{
$form = $this->aire()->form();

$value = str_random();
$value = Str::random();

$form->id($value);
$this->assertSelectorAttribute($form, 'form', 'id', $value);
Expand Down Expand Up @@ -808,7 +809,7 @@ public function test_style_attribute_can_be_set_and_unset() : void
{
$form = $this->aire()->form();

$value = str_random();
$value = Str::random();

$form->style($value);
$this->assertSelectorAttribute($form, 'form', 'style', $value);
Expand All @@ -821,7 +822,7 @@ public function test_tab_index_attribute_can_be_set_and_unset() : void
{
$form = $this->aire()->form();

$value = str_random();
$value = Str::random();

$form->tabIndex($value);
$this->assertSelectorAttribute($form, 'form', 'tabindex', $value);
Expand All @@ -834,7 +835,7 @@ public function test_title_attribute_can_be_set_and_unset() : void
{
$form = $this->aire()->form();

$value = str_random();
$value = Str::random();

$form->title($value);
$this->assertSelectorAttribute($form, 'form', 'title', $value);
Expand All @@ -847,7 +848,7 @@ public function test_aria_active_descendant_attribute_can_be_set_and_unset() : v
{
$form = $this->aire()->form();

$value = str_random();
$value = Str::random();

$form->ariaActiveDescendant($value);
$this->assertSelectorAttribute($form, 'form', 'aria-activedescendant', $value);
Expand Down Expand Up @@ -888,7 +889,7 @@ public function test_aria_controls_attribute_can_be_set_and_unset() : void
{
$form = $this->aire()->form();

$value = str_random();
$value = Str::random();

$form->ariaControls($value);
$this->assertSelectorAttribute($form, 'form', 'aria-controls', $value);
Expand All @@ -901,7 +902,7 @@ public function test_aria_described_by_attribute_can_be_set_and_unset() : void
{
$form = $this->aire()->form();

$value = str_random();
$value = Str::random();

$form->ariaDescribedBy($value);
$this->assertSelectorAttribute($form, 'form', 'aria-describedby', $value);
Expand Down Expand Up @@ -954,7 +955,7 @@ public function test_aria_flow_to_attribute_can_be_set_and_unset() : void
{
$form = $this->aire()->form();

$value = str_random();
$value = Str::random();

$form->ariaFlowTo($value);
$this->assertSelectorAttribute($form, 'form', 'aria-flowto', $value);
Expand Down Expand Up @@ -1032,7 +1033,7 @@ public function test_aria_label_attribute_can_be_set_and_unset() : void
{
$form = $this->aire()->form();

$value = str_random();
$value = Str::random();

$form->ariaLabel($value);
$this->assertSelectorAttribute($form, 'form', 'aria-label', $value);
Expand All @@ -1045,7 +1046,7 @@ public function test_aria_labelled_by_attribute_can_be_set_and_unset() : void
{
$form = $this->aire()->form();

$value = str_random();
$value = Str::random();

$form->ariaLabelledBy($value);
$this->assertSelectorAttribute($form, 'form', 'aria-labelledby', $value);
Expand Down Expand Up @@ -1075,7 +1076,7 @@ public function test_aria_owns_attribute_can_be_set_and_unset() : void
{
$form = $this->aire()->form();

$value = str_random();
$value = Str::random();

$form->ariaOwns($value);
$this->assertSelectorAttribute($form, 'form', 'aria-owns', $value);
Expand Down

0 comments on commit deb0e76

Please sign in to comment.