-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update test scripts for improved test coverage
Signed-off-by: Sam Poyigi <[email protected]>
- Loading branch information
Showing
218 changed files
with
16,701 additions
and
1,002 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
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
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,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\Config\RectorConfig; | ||
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictNewArrayRector; | ||
|
||
return RectorConfig::configure() | ||
->withPaths([__DIR__.'/src', __DIR__.'/tests']) | ||
->withSkip([ | ||
ReturnTypeFromStrictNewArrayRector::class, | ||
]) | ||
->withTypeCoverageLevel(1) | ||
->withDeadCodeLevel(0) | ||
->withCodeQualityLevel(0); |
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 |
---|---|---|
@@ -1,22 +1,20 @@ | ||
<?php | ||
|
||
use Illuminate\Http\Request; | ||
use Illuminate\Routing\Route; | ||
use Igniter\User\Models\User; | ||
|
||
uses(Igniter\Tests\TestCase::class)->in(__DIR__.'/src'); | ||
|
||
pest()->group('admin')->in('src/Admin'); | ||
pest()->group('main')->in('src/Main'); | ||
pest()->group('system')->in('src/System'); | ||
pest()->group('flame')->in('src/Flame'); | ||
|
||
function testThemePath() | ||
{ | ||
return realpath(__DIR__.'/resources/themes/tests-theme'); | ||
} | ||
|
||
function createRequest($uri, $routeName) | ||
function actingAsSuperUser() | ||
{ | ||
$request = new Request([], [], [], [], [], ['REQUEST_URI' => $uri]); | ||
|
||
$request->setRouteResolver(function() use ($uri, $routeName, $request) { | ||
return (new Route('GET', $uri, ['as' => $routeName]))->bind($request); | ||
}); | ||
|
||
return $request; | ||
return test()->actingAs(User::factory()->superUser()->create(), 'igniter-admin'); | ||
} |
Empty file.
Empty file.
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,14 @@ | ||
<?php | ||
|
||
return [ | ||
'form' => [ | ||
'toolbar' => [], | ||
'fields' => [ | ||
'name' => [ | ||
'label' => 'Name', | ||
'type' => 'text', | ||
'span' => 'left', | ||
], | ||
], | ||
], | ||
]; |
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,4 @@ | ||
body { | ||
background-color: #f00; | ||
color: #fff; | ||
} |
1 change: 1 addition & 0 deletions
1
tests/resources/themes/tests-theme/_content/test-content.blade.php
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 @@ | ||
This is a test content |
12 changes: 12 additions & 0 deletions
12
tests/resources/themes/tests-theme/_layouts/default-with-lifecycle.blade.php
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,12 @@ | ||
--- | ||
name: Default Layout | ||
|
||
'[testComponentWithLifecycle]': | ||
--- | ||
<html> | ||
<body> | ||
|
||
@themePage | ||
|
||
</body> | ||
</html> |
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,12 @@ | ||
--- | ||
name: Default Layout | ||
|
||
'[testComponent]': | ||
--- | ||
<html> | ||
<body> | ||
|
||
@themePage | ||
|
||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.
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,17 @@ | ||
<?php | ||
|
||
return [ | ||
'form' => [ | ||
'general' => [ | ||
'title' => 'lang:igniter.tests::default.theme.label_title', | ||
'fields' => [ | ||
'field1' => [ | ||
'label' => 'lang:igniter.tests::default.theme.label_field1', | ||
'type' => 'text', | ||
'span' => 'left', | ||
'cssClass' => 'flex-width', | ||
], | ||
], | ||
], | ||
], | ||
]; |
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
13 changes: 13 additions & 0 deletions
13
tests/resources/themes/tests-theme/_pages/layout-with-lifecycle.blade.php
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,13 @@ | ||
--- | ||
title: Layout with Lifecycle | ||
description: '' | ||
permalink: /layout-with-lifecycle | ||
layout: default-with-lifecycle | ||
|
||
'[testComponent]': | ||
--- | ||
<div class="container"> | ||
<div class="row"> | ||
<p>This is a logged customer</p> | ||
</div> | ||
</div> |
13 changes: 13 additions & 0 deletions
13
tests/resources/themes/tests-theme/_pages/page-with-lifecycle.blade.php
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,13 @@ | ||
--- | ||
title: Page with Lifecycle | ||
description: '' | ||
permalink: /page-with-lifecycle | ||
layout: default | ||
|
||
'[testComponentWithLifecycle]': | ||
--- | ||
<div class="container"> | ||
<div class="row"> | ||
<p>This is a logged customer</p> | ||
</div> | ||
</div> |
1 change: 1 addition & 0 deletions
1
tests/resources/themes/tests-theme/_partials/test-partial.blade.php
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 @@ | ||
This is a test partial content |
Empty file.
1 change: 1 addition & 0 deletions
1
tests/resources/views/_components/testcomponent/default.blade.php
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 @@ | ||
{{ 'This is a test component partial content' }} |
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,3 @@ | ||
name = 'Test Layout' | ||
=== | ||
This is a test layout! |
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,3 @@ | ||
name = 'Test Partial' | ||
=== | ||
This is a test partial! |
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 |
---|---|---|
@@ -1 +1 @@ | ||
This is a test partial view | ||
This is a test partial content |
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,7 @@ | ||
<html> | ||
<body> | ||
|
||
{{Template::getBlock('body')}} | ||
|
||
</body> | ||
</html> |
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 |
---|---|---|
@@ -1,3 +1 @@ | ||
<html> | ||
<body>Hello World!</body> | ||
</html> | ||
This is a test view content |
Empty file.
3 changes: 3 additions & 0 deletions
3
tests/resources/views/testcontroller/view-with-exception.blade.php
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,3 @@ | ||
<?php | ||
throw new Exception('This is a test exception'); | ||
?> |
3 changes: 3 additions & 0 deletions
3
tests/resources/views/testcontroller/view-with-throwable.blade.php
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,3 @@ | ||
<?php | ||
throw new Error('This is a test error');; | ||
?> |
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
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
Oops, something went wrong.