Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
takielias committed Sep 15, 2024
1 parent db696d6 commit 8762b83
Show file tree
Hide file tree
Showing 24 changed files with 37 additions and 34 deletions.
6 changes: 2 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@
"takielias/tablar": "*"
},
"require-dev": {
"phpunit/phpunit": "~10.0",
"orchestra/testbench": "~9",
"gajus/dindent": "^2.0",
"league/commonmark": "^1.4|^2.0",
"lorisleiva/cron-translator": "^0.1.1"
"phpunit/phpunit": "^10.0"
},
"autoload": {
"psr-4": {
Expand All @@ -40,7 +38,7 @@
},
"autoload-dev": {
"psr-4": {
"Takielias\\TablarKit\\Tests\\": "tests/"
"TakiElias\\TablarKit\\Tests\\": "tests/"
}
},
"extra": {
Expand Down
2 changes: 0 additions & 2 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
<testsuites>
<testsuite name="Package">
<directory suffix=".php">./tests/Components</directory>
<exclude>tests/Components/ComponentTestCase.php</exclude>

</testsuite>
</testsuites>
<source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

declare(strict_types=1);

namespace TakiElias\TablarKit\Tests\Components;
namespace TakiElias\TablarKit\Tests;

use Gajus\Dindent\Exception\InvalidArgumentException;
use Gajus\Dindent\Exception\RuntimeException;
use Gajus\Dindent\Indenter;
use Orchestra\Testbench\TestCase;
use Takielias\TablarKit\TablarKitServiceProvider;
use TakiElias\TablarKit\Tests\InteractsWithViews;

abstract class ComponentTestCase extends TestCase
{
Expand Down
14 changes: 11 additions & 3 deletions tests/Components/Alerts/AlertTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

namespace TakiElias\TablarKit\Tests\Components\Alerts;

use TakiElias\TablarKit\Tests\Components\ComponentTestCase;
use Gajus\Dindent\Exception\InvalidArgumentException;
use Gajus\Dindent\Exception\RuntimeException;
use TakiElias\TablarKit\Tests\ComponentTestCase;

class AlertTest extends ComponentTestCase
{
Expand All @@ -19,7 +21,10 @@ public function the_component_can_be_rendered()
</div>
HTML;

$this->assertComponentRenders($expected, '<x-alert/>');
try {
$this->assertComponentRenders($expected, '<x-alert/>');
} catch (InvalidArgumentException|RuntimeException $e) {
}
}

/** @test */
Expand Down Expand Up @@ -79,6 +84,9 @@ public function multiple_messages_can_be_used()
</div>
HTML;

$this->assertComponentRenders($expected, $template);
try {
$this->assertComponentRenders($expected, $template);
} catch (InvalidArgumentException|RuntimeException $e) {
}
}
}
4 changes: 2 additions & 2 deletions tests/Components/Buttons/FormButtonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace TakiElias\TablarKit\Tests\Components\Buttons;
namespace TakiElias\TablarKit\Tests\Components;

use Illuminate\Support\Facades\Route;
use TakiElias\TablarKit\Tests\Components\ComponentTestCase;
use TakiElias\TablarKit\Tests\ComponentTestCase;

class FormButtonTest extends ComponentTestCase
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Components/Buttons/LogoutTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace TakiElias\TablarKit\Tests\Components\Buttons;
namespace TakiElias\TablarKit\Tests\Components;

use Illuminate\Support\Facades\Route;
use TakiElias\TablarKit\Tests\Components\ComponentTestCase;
use TakiElias\TablarKit\Tests\ComponentTestCase;

class LogoutTest extends ComponentTestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Components/Cards/CardTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace TakiElias\TablarKit\Tests\Components\Cards;


use TakiElias\TablarKit\Tests\Components\ComponentTestCase;
use TakiElias\TablarKit\Tests\ComponentTestCase;

class CardTest extends ComponentTestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Components/Editors/JoditTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace TakiElias\TablarKit\Tests\Components\Editors;

use TakiElias\TablarKit\Tests\Components\ComponentTestCase;
use TakiElias\TablarKit\Tests\ComponentTestCase;

class JoditTest extends ComponentTestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Components/Forms/ErrorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace TakiElias\TablarKit\Tests\Components\Forms;

use TakiElias\TablarKit\Tests\Components\ComponentTestCase;
use TakiElias\TablarKit\Tests\ComponentTestCase;

class ErrorTest extends ComponentTestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Components/Forms/FormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace TakiElias\TablarKit\Tests\Components\Forms;


use TakiElias\TablarKit\Tests\Components\ComponentTestCase;
use TakiElias\TablarKit\Tests\ComponentTestCase;

class FormTest extends ComponentTestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Components/Forms/Inputs/CheckboxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace TakiElias\TablarKit\Tests\Components\Forms\Inputs;


use TakiElias\TablarKit\Tests\Components\ComponentTestCase;
use TakiElias\TablarKit\Tests\ComponentTestCase;

class CheckboxTest extends ComponentTestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Components/Forms/Inputs/DependentSelectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


use Illuminate\Support\Facades\Route;
use TakiElias\TablarKit\Tests\Components\ComponentTestCase;
use TakiElias\TablarKit\Tests\ComponentTestCase;

class DependentSelectTest extends ComponentTestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Components/Forms/Inputs/EmailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace TakiElias\TablarKit\Tests\Components\Forms\Inputs;

use TakiElias\TablarKit\Tests\Components\ComponentTestCase;
use TakiElias\TablarKit\Tests\ComponentTestCase;

class EmailTest extends ComponentTestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Components/Forms/Inputs/FilePondTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace TakiElias\TablarKit\Tests\Components\Forms\Inputs;


use TakiElias\TablarKit\Tests\Components\ComponentTestCase;
use TakiElias\TablarKit\Tests\ComponentTestCase;

class FilePondTest extends ComponentTestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Components/Forms/Inputs/FlatPickerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace TakiElias\TablarKit\Tests\Components\Forms\Inputs;

use TakiElias\TablarKit\Tests\Components\ComponentTestCase;
use TakiElias\TablarKit\Tests\ComponentTestCase;

class FlatPickerTest extends ComponentTestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Components/Forms/Inputs/InputTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace TakiElias\TablarKit\Tests\Components\Forms\Inputs;


use TakiElias\TablarKit\Tests\Components\ComponentTestCase;
use TakiElias\TablarKit\Tests\ComponentTestCase;

class InputTest extends ComponentTestCase
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Components/Forms/Inputs/LitePickerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

namespace TakiElias\TablarKit\Tests\Components\Forms\Inputs;

use TakiElias\TablarKit\Tests\Components\ComponentTestCase;
use TakiElias\TablarKit\Tests\ComponentTestCase;

class LitePickerTest extends ComponentTestCase
{
/** @test */
public function the_lite_picker_component_can_be_rendered()
{
$expected = <<<'HTML'
<input name="date" type="text" id="lite-picker" placeholder="Y-m-d H:i" class="form-control litepickr" />
<input name="date" type="text" id="lite-picker" placeholder="YYYY-MM-DD" class="form-control litepickr" />
HTML;

$this->assertComponentRenders($expected, '<x-lite-picker name="date" id="lite-picker"/>');
Expand Down
2 changes: 1 addition & 1 deletion tests/Components/Forms/Inputs/PasswordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace TakiElias\TablarKit\Tests\Components\Forms\Inputs;


use TakiElias\TablarKit\Tests\Components\ComponentTestCase;
use TakiElias\TablarKit\Tests\ComponentTestCase;

class PasswordTest extends ComponentTestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Components/Forms/Inputs/RadioTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace TakiElias\TablarKit\Tests\Components\Forms\Inputs;


use TakiElias\TablarKit\Tests\Components\ComponentTestCase;
use TakiElias\TablarKit\Tests\ComponentTestCase;

class RadioTest extends ComponentTestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Components/Forms/Inputs/SelectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace TakiElias\TablarKit\Tests\Components\Forms\Inputs;


use TakiElias\TablarKit\Tests\Components\ComponentTestCase;
use TakiElias\TablarKit\Tests\ComponentTestCase;

class SelectTest extends ComponentTestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Components/Forms/Inputs/TextareaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace TakiElias\TablarKit\Tests\Components\Forms\Inputs;


use TakiElias\TablarKit\Tests\Components\ComponentTestCase;
use TakiElias\TablarKit\Tests\ComponentTestCase;

class TextareaTest extends ComponentTestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Components/Forms/Inputs/ToggleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace TakiElias\TablarKit\Tests\Components\Forms\Inputs;


use TakiElias\TablarKit\Tests\Components\ComponentTestCase;
use TakiElias\TablarKit\Tests\ComponentTestCase;

class ToggleTest extends ComponentTestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Components/Forms/Inputs/TomSelectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace TakiElias\TablarKit\Tests\Components\Forms\Inputs;


use TakiElias\TablarKit\Tests\Components\ComponentTestCase;
use TakiElias\TablarKit\Tests\ComponentTestCase;

class TomSelectTest extends ComponentTestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Components/Forms/LabelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace TakiElias\TablarKit\Tests\Components\Forms;


use TakiElias\TablarKit\Tests\Components\ComponentTestCase;
use TakiElias\TablarKit\Tests\ComponentTestCase;

class LabelTest extends ComponentTestCase
{
Expand Down

0 comments on commit 8762b83

Please sign in to comment.