Skip to content

Commit 837273b

Browse files
authored
Laravel 12 updates (#402)
* Updating composer deps for laravel 12; Removed old versions from readme; Updating workflows; updated phpunit version
1 parent 776d9b4 commit 837273b

13 files changed

+74
-112
lines changed

.github/workflows/laravel.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,26 @@ jobs:
99
fail-fast: true
1010
matrix:
1111
os: [ ubuntu-latest ]
12-
php: [ 8.1, 8.2 ]
13-
laravel: [ 10.*, 11.* ]
12+
php: [ 8.2, 8.3, 8.4 ]
13+
laravel: [ 10.*, 11.*, 12.* ]
1414
stability: [ prefer-stable ]
15-
include:
16-
- laravel: 10.*
17-
testbench: ^8.0
18-
- laravel: 11.*
19-
testbench: ^9.0
20-
exclude:
21-
- laravel: 11.*
22-
php: 8.1
2315
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
2416

2517
steps:
26-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
2719
- name: Setup PHP
2820
uses: shivammathur/setup-php@v2
2921
with:
3022
php-version: ${{ matrix.php }}
3123
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
3224
coverage: none
3325
- name: Cache dependencies
34-
uses: actions/cache@v2
26+
uses: actions/cache@v4
3527
with:
3628
path: ~/.composer/cache/files
37-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
29+
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
3830
restore-keys: |
39-
${{ runner.os }}-composer-
31+
${{ runner.os }}-${{ matrix.php }}-composer-
4032
- name: Install dependencies
4133
run: |
4234
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update

README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,14 @@ Manage your `Laravel Schedule` from a pretty dashboard. Schedule your `Laravel C
1717
#### Compatiblity Matrix
1818

1919
| <span align="left">Laravel</span> | <span align="left">Totem</span> |
20-
| :-------------------------------- | ------------------------------: |
20+
|:----------------------------------|--------------------------------:|
21+
| 12.x | 11.x |
2122
| 11.x | 11.x |
2223
| 10.x | 10.x |
23-
| 9.x | 9.x |
24-
| 8.x | 8.x |
25-
| 7.x | 7.x |
26-
| 6.x | 6.x |
27-
| 5.8 | 5.x |
28-
| 5.7 | 4.x |
29-
| 5.6 | 3.x |
30-
| 5.5 | 2.x |
31-
| 5.4 | 1.x |
3224

3325
#### Installing
3426

35-
`Totem` requires Laravel v5.4 and above, please refer to the above table for compatability. Use composer to install totem to your Laravel project
27+
`Totem` requires Laravel v10 and above, please refer to the above table for compatability. Use composer to install totem to your Laravel project
3628

3729
```
3830
composer require studio/laravel-totem

composer.json

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,33 @@
55
"laravel",
66
"schedule",
77
"manager",
8-
"Code Studio",
9-
"totem"
8+
"totem",
9+
"cron"
1010
],
1111
"license": "MIT",
1212
"authors": [
13+
{
14+
"name": "Quentin Schmick",
15+
"email": "qschmick@gmail.com"
16+
},
1317
{
1418
"name": "Roshan Gautam",
1519
"email": "roshan.gautam@hotmail.com"
1620
}
1721
],
1822
"require": {
19-
"php": "^8.1.0",
23+
"php": "^8.2.0",
2024
"ext-json": "*",
21-
"doctrine/dbal": "^3.1",
22-
"illuminate/bus": "^9.0|^10.0|^11.0",
23-
"illuminate/console": "^9.0|^10.0|^11.0",
24-
"illuminate/contracts": "^9.0|^10.0|^11.0",
25-
"illuminate/database": "^9.0|^10.0|^11.0",
26-
"illuminate/events": "^9.0|^10.0|^11.0",
27-
"illuminate/notifications": "^9.0|^10.0|^11.0"
25+
"illuminate/bus": "^10.0|^11.0|^12.0",
26+
"illuminate/console": "^10.0|^11.0|^12.0",
27+
"illuminate/contracts": "^10.0|^11.0|^12.0",
28+
"illuminate/database": "^10.0|^11.0|^12.0",
29+
"illuminate/events": "^10.0|^11.0|^12.0",
30+
"illuminate/notifications": "^10.0|^11.0|^12.0"
2831
},
2932
"require-dev": {
30-
"mockery/mockery": "^1.0",
31-
"orchestra/testbench" : "^8.0|^9.0",
32-
"phpunit/phpunit": "^9.0|^10.0|^11.0"
33+
"orchestra/testbench" : "^8.0|^9.0|^10.0",
34+
"phpunit/phpunit": "^10.0|^11.0|^12.0"
3335
},
3436
"suggest": {
3537
"nexmo/client": "Required for sms notifications."
@@ -46,9 +48,6 @@
4648
},
4749
"extra": {
4850
"component": "package",
49-
"branch-alias": {
50-
"dev-8.0": "8.0.x-dev"
51-
},
5251
"laravel": {
5352
"providers": [
5453
"Studio\\Totem\\Providers\\TotemServiceProvider"

phpunit.xml

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3-
<coverage>
4-
<include>
5-
<directory suffix=".php">./src/</directory>
6-
</include>
7-
<exclude>
8-
<file>./src/ServiceProvider.php</file>
9-
</exclude>
10-
</coverage>
11-
<testsuites>
12-
<testsuite name="Laravel Totem Test Suite">
13-
<directory suffix="Test.php">./tests/</directory>
14-
</testsuite>
15-
</testsuites>
16-
<php>
17-
<env name="APP_ENV" value="testing"/>
18-
<env name="CACHE_DRIVER" value="array"/>
19-
<env name="SESSION_DRIVER" value="array"/>
20-
<env name="QUEUE_DRIVER" value="sync"/>
21-
<env name="DB_CONNECTION" value="sqlite"/>
22-
<env name="DB_DATABASE" value=":memory:"/>
23-
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
24-
</php>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php"
3+
colors="true" processIsolation="false" stopOnFailure="false"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/12.2/phpunit.xsd" cacheDirectory=".phpunit.cache"
5+
backupStaticProperties="false">
6+
<testsuites>
7+
<testsuite name="Laravel Totem Test Suite">
8+
<directory suffix="Test.php">./tests/</directory>
9+
</testsuite>
10+
</testsuites>
11+
<php>
12+
<env name="APP_ENV" value="testing"/>
13+
<env name="CACHE_DRIVER" value="array"/>
14+
<env name="SESSION_DRIVER" value="array"/>
15+
<env name="QUEUE_DRIVER" value="sync"/>
16+
<env name="DB_CONNECTION" value="sqlite"/>
17+
<env name="DB_DATABASE" value=":memory:"/>
18+
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
19+
</php>
20+
<source>
21+
<include>
22+
<directory suffix=".php">./src/</directory>
23+
</include>
24+
<exclude>
25+
<file>./src/ServiceProvider.php</file>
26+
</exclude>
27+
</source>
2528
</phpunit>

src/Task.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function results(): HasMany
146146
*
147147
* @return Result|null
148148
*/
149-
public function getLastResultAttribute(): Result|null
149+
public function getLastResultAttribute(): ?Result
150150
{
151151
return $this->results()->orderBy('id', 'desc')->first();
152152
}

tests/Feature/AuthTest.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88

99
class AuthTest extends TestCase
1010
{
11-
/** @test */
12-
public function auth_callback_works()
11+
public function test_auth_callback_works()
1312
{
1413
$this->assertFalse(Totem::check('roshan'));
1514

@@ -22,8 +21,7 @@ public function auth_callback_works()
2221
$this->assertFalse(Totem::check(null));
2322
}
2423

25-
/** @test */
26-
public function auth_middleware_works()
24+
public function test_auth_middleware_works()
2725
{
2826
Totem::auth(function () {
2927
return true;
@@ -42,10 +40,7 @@ function ($value) {
4240
$this->assertEquals('response', $response);
4341
}
4442

45-
/**
46-
* @test
47-
*/
48-
public function auth_middleware_responds_with_403_on_failure()
43+
public function test_auth_middleware_responds_with_403_on_failure()
4944
{
5045
$this->expectException('\Symfony\Component\HttpKernel\Exception\HttpException');
5146
Totem::auth(function () {

tests/Feature/CreateTaskTest.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66

77
class CreateTaskTest extends TestCase
88
{
9-
/** @test */
10-
public function user_can_view_create_task_form()
9+
public function test_user_can_view_create_task_form()
1110
{
1211
$this->disableExceptionHandling()->signIn();
1312

@@ -16,16 +15,14 @@ public function user_can_view_create_task_form()
1615
$response->assertStatus(200);
1716
}
1817

19-
/** @test */
20-
public function guest_can_not_view_create_task_form()
18+
public function test_guest_can_not_view_create_task_form()
2119
{
2220
$response = $this->get(route('totem.task.create'));
2321

2422
$response->assertStatus(403);
2523
}
2624

27-
/** @test */
28-
public function user_can_create_task_with_cron_expression()
25+
public function test_user_can_create_task_with_cron_expression()
2926
{
3027
$this->disableExceptionHandling()->signIn();
3128

@@ -39,8 +36,7 @@ public function user_can_create_task_with_cron_expression()
3936
$response->assertRedirect(route('totem.tasks.all'));
4037
}
4138

42-
/** @test */
43-
public function user_can_create_task_with_frequencies()
39+
public function test_user_can_create_task_with_frequencies()
4440
{
4541
$this->disableExceptionHandling()->signIn();
4642

tests/Feature/EditTaskTest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
class EditTaskTest extends TestCase
99
{
10-
/** @test */
11-
public function user_can_view_edit_task_form()
10+
public function test_user_can_view_edit_task_form()
1211
{
1312
$this->disableExceptionHandling()->signIn();
1413
$task = Task::factory()->create();
@@ -18,16 +17,14 @@ public function user_can_view_edit_task_form()
1817
$response->assertSee($task->expression);
1918
}
2019

21-
/** @test */
22-
public function guest_can_not_view_edit_task_form()
20+
public function test_guest_can_not_view_edit_task_form()
2321
{
2422
$task = Task::factory()->create();
2523
$response = $this->get(route('totem.task.edit', $task));
2624
$response->assertStatus(403);
2725
}
2826

29-
/** @test */
30-
public function user_can_edit_task()
27+
public function test_user_can_edit_task()
3128
{
3229
$this->disableExceptionHandling()->signIn();
3330
$task = Task::factory()->create();

tests/Feature/ExportTasksTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88

99
class ExportTasksTest extends TestCase
1010
{
11-
/** @test */
12-
public function it_exports_tasks_as_json()
11+
public function test_it_exports_tasks_as_json()
1312
{
1413
$tasks = Task::factory()->count(5)->create();
1514

tests/Feature/ImportTasksTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111

1212
class ImportTasksTest extends TestCase
1313
{
14-
/** @test */
15-
public function it_imports_tasks_from_a_json_file()
14+
public function test_it_imports_tasks_from_a_json_file()
1615
{
1716
Event::fake();
1817

0 commit comments

Comments
 (0)