Skip to content

Laravel 9 tests and styling fixed #327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@
"php": "^8.0.0|^8.1.0",
"ext-json": "*",
"doctrine/dbal": "^3.1",
"illuminate/bus": "^8.11",
"illuminate/console": "^8.11",
"illuminate/contracts": "^8.11",
"illuminate/database": "^8.11",
"illuminate/events": "^8.11",
"illuminate/notifications": "^8.11",
"illuminate/bus": "^8.11|^9.0",
"illuminate/console": "^8.11|^9.0",
"illuminate/contracts": "^8.11|^9.0",
"illuminate/database": "^8.11|^9.0",
"illuminate/events": "^8.11|^9.0",
"illuminate/notifications": "^8.11|^9.0",
"laravelcollective/html": "^6.0"
},
"require-dev": {
"mockery/mockery": "^1.0",
"orchestra/database": "^6.0",
"orchestra/testbench" : "^6.0",
"orchestra/database": "^6.0|^7.0",
"orchestra/testbench" : "^6.0|^7.0",
"phpunit/phpunit": "^9.0"
},
"suggest": {
Expand Down
2 changes: 1 addition & 1 deletion src/Contracts/TaskInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function builder(): Builder;
* @param int|Task $id
* @return Task
*/
public function find(Task|int $id): Task;
public function find(Task|int $id);

/**
* Returns all tasks.
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Middleware/Authenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Authenticate
* @param Closure $next
* @return Response
*/
public function handle(Request $request, Closure $next): Response
public function handle($request, $next)
{
return Totem::check($request) ? $next($request) : abort(403);
}
Expand Down
6 changes: 4 additions & 2 deletions src/Http/Requests/ImportRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public function messages()
*
* @param array|mixed $keys
* @return array
*
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
*/
public function all($keys = null)
Expand All @@ -68,9 +69,10 @@ public function all($keys = null)
* Get the validated data from the request.
*
* @return array
*
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
*/
public function validated()
public function validated($key = null, $default = null)
{
$content = '';

Expand All @@ -84,7 +86,7 @@ public function validated()
/**
* * Handle a failed validation attempt.
*
* @param Validator $validator
* @param Validator $validator
*/
protected function failedValidation(Validator $validator)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Repositories/EloquentTaskRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function builder(): Builder
* @param int|Task $id
* @return Task
*/
public function find(Task|int $id): Task
public function find(Task|int $id)
{
if ($id instanceof Task) {
return $id;
Expand Down
7 changes: 3 additions & 4 deletions src/Totem.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ class Totem
/**
* Determine if the given request can access the Totem dashboard.
*
* @param Request $request
* @param Request|string|null $request
* @return bool
*/
public static function check(Request $request): bool
public static function check($request): bool
{
return (static::$authUsing ?: function () {
return app()->environment('local');
Expand All @@ -36,8 +36,7 @@ public static function check(Request $request): bool
/**
* Set the callback that should be used to authenticate Totem users.
*
* @param Closure $callback
*
* @param Closure $callback
* @return static
*/
public static function auth(Closure $callback)
Expand Down
3 changes: 2 additions & 1 deletion tests/Feature/TaskExecutionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public function it_executes_a_scheduled_task()

Event::fake();

$this->get(route('totem.task.execute', $task->id))
$this->signIn()
->get(route('totem.task.execute', $task->id))
->assertSuccessful();

$this->assertEquals(1, Result::count());
Expand Down