Skip to content

Commit 84c7570

Browse files
committed
Merge inertia-laravel-testing library into inertia-laravel
See https://github.com/claudiodekker/inertia-laravel-testing
1 parent 726b1e0 commit 84c7570

22 files changed

+2034
-25
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at https://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
indent_size = 4
9+
indent_style = space
10+
end_of_line = lf
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
[*.md]
15+
trim_trailing_whitespace = false

.gitattributes

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Path-based git attributes
2+
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3+
4+
# Ignore all test and documentation with "export-ignore".
5+
/.editorconfig export-ignore
6+
/.gitattributes export-ignore
7+
/.gitignore export-ignore
8+
/.github export-ignore
9+
/.php_cs.dist export-ignore
10+
/.styleci.yml export-ignore
11+
/.scrutinizer.yml export-ignore
12+
/.travis.yml export-ignore
13+
/phpunit.xml.dist export-ignore
14+
/tests export-ignore
15+
/CHANGELOG.md export-ignore
16+
/CONTRIBUTING.md export-ignore
17+
/README.md export-ignore

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/vendor
2-
.DS_Store
1+
.env
32
.phpunit.result.cache
43
composer.lock
4+
phpunit.xml
5+
/vendor

.scrutinizer.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
filter:
2+
excluded_paths: [tests/*]
3+
checks:
4+
php:
5+
code_rating: true
6+
remove_extra_empty_lines: true
7+
remove_php_closing_tag: true
8+
remove_trailing_whitespace: true
9+
fix_use_statements:
10+
remove_unused: true
11+
preserve_multiple: false
12+
preserve_blanklines: true
13+
order_alphabetically: true
14+
fix_php_opening_tag: true
15+
fix_linefeed: true
16+
fix_line_ending: true
17+
fix_identation_4spaces: true
18+
fix_doc_comments: true
19+
tools:
20+
external_code_coverage: false
21+
php_analyzer: true
22+
php_code_coverage: false
23+
php_code_sniffer:
24+
config:
25+
standard: PSR2
26+
filter:
27+
paths: ['src']
28+
php_loc:
29+
enabled: true
30+
excluded_dirs: [vendor, tests]
31+
php_cpd:
32+
enabled: true
33+
excluded_dirs: [vendor, tests]
34+
build:
35+
nodes:
36+
analysis:
37+
environment:
38+
php:
39+
version: 7.4
40+
tests:
41+
override:
42+
- php-scrutinizer-run

_ide_helpers.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
/** @noinspection PhpUndefinedClassInspection */
4+
/** @noinspection PhpFullyQualifiedNameUsageInspection */
5+
/** @noinspection PhpUnusedAliasInspection */
6+
7+
namespace Illuminate\Testing {
8+
9+
/**
10+
* @see \ClaudioDekker\Inertia\TestResponseMacros
11+
*
12+
* @method self assertInertia(\Closure $assert = null)
13+
*/
14+
class TestResponse
15+
{
16+
//
17+
}
18+
}
19+
20+
namespace Illuminate\Foundation\Testing {
21+
22+
/**
23+
* @see \ClaudioDekker\Inertia\TestResponseMacros
24+
*
25+
* @method self assertInertia(\Closure $assert = null)
26+
*/
27+
class TestResponse
28+
{
29+
//
30+
}
31+
}

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
}
2626
},
2727
"require": {
28+
"ext-json": "*",
2829
"laravel/framework": "^5.4|^6.0|^7.0|^8.0"
2930
},
3031
"require-dev": {

config/inertia.php

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?php
2+
3+
return [
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Force top-level property interaction
8+
|--------------------------------------------------------------------------
9+
|
10+
| This setting allows you to toggle the automatic property interaction
11+
| check for your page's top-level properties. While this feature is
12+
| useful in property scopes, it is generally not as useful on the
13+
| top-level of the page, as it forces you to interact with each
14+
| (shared) property on the page, or to use the `etc` method.
15+
|
16+
*/
17+
18+
'force_top_level_property_interaction' => false,
19+
20+
/*
21+
|--------------------------------------------------------------------------
22+
| Page
23+
|--------------------------------------------------------------------------
24+
|
25+
| The values described here are used to locate Inertia components on the
26+
| filesystem. For instance, when using `assertInertia`, the assertion
27+
| attempts to locate the component as a file relative to any of the
28+
| paths AND with any of the extensions specified here.
29+
|
30+
*/
31+
32+
'page' => [
33+
34+
/**
35+
* Determines whether assertions should check that Inertia page components
36+
* actually exist on the filesystem instead of just checking responses.
37+
*/
38+
'should_exist' => true,
39+
40+
/*
41+
* A list of root paths to your Inertia page components.
42+
*/
43+
'paths' => [
44+
45+
resource_path('js/Pages'),
46+
47+
],
48+
49+
/*
50+
* A list of valid Inertia page component extensions.
51+
*/
52+
'extensions' => [
53+
54+
'vue',
55+
'svelte',
56+
57+
],
58+
59+
],
60+
61+
];

phpunit.xml

Lines changed: 0 additions & 20 deletions
This file was deleted.

phpunit.xml.dist

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit bootstrap="vendor/autoload.php"
3+
backupGlobals="false"
4+
backupStaticAttributes="false"
5+
colors="true"
6+
verbose="true"
7+
convertErrorsToExceptions="true"
8+
convertNoticesToExceptions="true"
9+
convertWarningsToExceptions="true"
10+
processIsolation="false"
11+
stopOnFailure="false">
12+
<testsuites>
13+
<testsuite name="Test Suite">
14+
<directory>tests</directory>
15+
</testsuite>
16+
</testsuites>
17+
<filter>
18+
<whitelist>
19+
<directory suffix=".php">src/</directory>
20+
</whitelist>
21+
</filter>
22+
</phpunit>
23+

src/Inertia.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
* @method static array getShared($key = null)
1111
* @method static void version($version)
1212
* @method static int|string getVersion()
13-
* @method static \Inertia\Response render($component, $props = [])
13+
* @method static Response render($component, $props = [])
1414
* @method static \Illuminate\Http\Response location($url)
15-
* @method static \Inertia\LazyProp lazy(callable $callback)
15+
* @method static LazyProp lazy(callable $callback)
1616
*
1717
* @see \Inertia\ResponseFactory
1818
*/

0 commit comments

Comments
 (0)