Skip to content

Commit a94f920

Browse files
authoredFeb 24, 2025··
Merge pull request #76 from whitecube/laravel-12
Laravel 12
2 parents 7f2df97 + 5006ac1 commit a94f920

File tree

3 files changed

+51
-3
lines changed

3 files changed

+51
-3
lines changed
 

‎.github/workflows/run-tests.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: run-tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
os: [ubuntu-latest]
12+
php: [8.4, 8.3, 8.2]
13+
laravel: [12.*, 11.*, 10.*]
14+
stability: [prefer-stable]
15+
include:
16+
- laravel: 12.*
17+
testbench: 10.*
18+
- laravel: 11.*
19+
testbench: 9.*
20+
- laravel: 10.*
21+
testbench: 8.*
22+
23+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: Setup PHP
30+
uses: shivammathur/setup-php@v2
31+
with:
32+
php-version: ${{ matrix.php }}
33+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
34+
coverage: none
35+
36+
- name: Install dependencies
37+
run: |
38+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction
39+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
40+
41+
- name: Execute tests
42+
run: vendor/bin/pest --color=always

‎composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
],
2323
"require": {
2424
"php": ">=8.1",
25-
"laravel/framework": "^9|^10|^11"
25+
"laravel/framework": "^9|^10|^11|^12"
2626
},
2727
"require-dev": {
28-
"pestphp/pest": "^2.6",
28+
"pestphp/pest": "^2.0|^3.7",
2929
"mockery/mockery": "^1.5",
30-
"orchestra/testbench": "^8.5|^9.0"
30+
"orchestra/testbench": "^8.5|^9.0|^10.0"
3131
},
3232
"config": {
3333
"allow-plugins": {

‎tests/Unit/EssentialCookiesCategoryTest.php

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
it('can register consent cookie', function () {
88
Config::shouldReceive('get')->with('app.locale')->andReturn('en');
99
Config::shouldReceive('get')->with('app.fallback_locale')->andReturn('en');
10+
Config::shouldReceive('get')->with('database.default')->andReturn('test');
11+
Config::shouldReceive('get')->with('database.connections.test')->andReturn(null);
1012
Config::shouldReceive('get')->once()->with('cookieconsent.cookie.name')->andReturn('foo_consent');
1113
Config::shouldReceive('get')->once()->with('cookieconsent.cookie.duration')->andReturn(365 * 24 * 60);
1214

@@ -21,6 +23,8 @@
2123
it('can register session cookie', function () {
2224
Config::shouldReceive('get')->with('app.locale')->andReturn('en');
2325
Config::shouldReceive('get')->with('app.fallback_locale')->andReturn('en');
26+
Config::shouldReceive('get')->with('database.default')->andReturn('test');
27+
Config::shouldReceive('get')->with('database.connections.test')->andReturn(null);
2428
Config::shouldReceive('get')->once()->with('session.cookie')->andReturn('foo_session');
2529
Config::shouldReceive('get')->once()->with('session.lifetime')->andReturn(120);
2630

@@ -35,6 +39,8 @@
3539
it('can register csrf cookie', function () {
3640
Config::shouldReceive('get')->with('app.locale')->andReturn('en');
3741
Config::shouldReceive('get')->with('app.fallback_locale')->andReturn('en');
42+
Config::shouldReceive('get')->with('database.default')->andReturn('test');
43+
Config::shouldReceive('get')->with('database.connections.test')->andReturn(null);
3844
Config::shouldReceive('get')->once()->with('session.lifetime')->andReturn(120);
3945

4046
$category = new EssentialCookiesCategory('foo');

0 commit comments

Comments
 (0)
Please sign in to comment.