Skip to content

Commit d97b076

Browse files
authored
Merge pull request #32 from Weebly/laravel-8
Laravel 8
2 parents 815dda7 + b2b6b56 commit d97b076

File tree

5 files changed

+80
-36
lines changed

5 files changed

+80
-36
lines changed

.circleci/config.yml

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

.github/workflows/test.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
php-tests:
9+
runs-on: ubuntu-latest
10+
11+
services:
12+
mysql:
13+
image: mysql:5.6
14+
env:
15+
MYSQL_ALLOW_EMPTY_PASSWORD: true
16+
MYSQL_USER: mutate
17+
MYSQL_PASSWORD: secret
18+
MYSQL_DATABASE: circle-test
19+
ports:
20+
- 3306
21+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
22+
23+
strategy:
24+
matrix:
25+
php: [7.2, 7.3, 7.4, 8.0]
26+
laravel: [6.*, 7.*, 8.*]
27+
include:
28+
- laravel: 6.*
29+
testbench: 4.*
30+
- laravel: 7.*
31+
testbench: 5.*
32+
- laravel: 8.*
33+
testbench: 6.*
34+
exclude:
35+
# Laravel 8 only support >= PHP 7.3
36+
- laravel: 8.*
37+
php: 7.1
38+
- laravel: 8.*
39+
php: 7.2
40+
41+
42+
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
43+
44+
steps:
45+
- name: Checkout code
46+
uses: actions/checkout@v2
47+
48+
- name: Setup PHP
49+
uses: shivammathur/setup-php@v2
50+
with:
51+
php-version: ${{ matrix.php }}
52+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick
53+
coverage: none
54+
tools: composer:v2
55+
56+
- name: Install PHP dependencies
57+
run: |
58+
composer require --dev "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
59+
composer update --prefer-stable --no-interaction --no-progress
60+
61+
- name: Execute Unit Tests
62+
run: vendor/bin/phpunit --testsuite Unit
63+
64+
- name: Execute Integration Tests
65+
run: vendor/bin/phpunit --testsuite Integration
66+
env:
67+
DB_PORT: ${{ job.services.mysql.ports[3306] }}

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Eloquent Mutators
55
[![Latest Stable Version](https://img.shields.io/packagist/v/Weebly/laravel-mutate.svg)](https://packagist.org/packages/weebly/laravel-mutate)
66
[![StyleCI](https://styleci.io/repos/102659341/shield?branch=master)](https://styleci.io/repos/102659341)
77
[![CircleCI](https://circleci.com/gh/Weebly/laravel-mutate/tree/master.svg?style=shield)](https://circleci.com/gh/Weebly/laravel-mutate)
8+
![Tests](https://github.com/Weebly/laravel-mutate/actions/workflows/test.yaml/badge.svg)
9+
810

911
This package allows you to map your model attributes to database columns when the type in the PHP model does not match the type in the database column.
1012

composer.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@
55
"license": "BSD-2-Clause",
66
"keywords": ["laravel", "eloquent", "uuid", "encrypt", "database"],
77
"require": {
8-
"ramsey/uuid": "~3.0",
9-
"illuminate/database": "^6.0",
10-
"illuminate/support": "^6.0",
11-
"illuminate/encryption": "^6.0"
8+
"php": ">=7.2",
9+
"ramsey/uuid": "~3.0 || ~4.0",
10+
"illuminate/database": "^6.0 || ^7.0 || ^8.0",
11+
"illuminate/support": "^6.0 || ^7.0 || ^8.0",
12+
"illuminate/encryption": "^6.0 || ^7.0 || ^8.0"
1213
},
1314
"require-dev": {
1415
"mockery/mockery": "^1.0",
1516
"phpunit/phpunit": "^8.0",
16-
"laravel/framework": "6.*",
17-
"orchestra/testbench": ">=3.0 <5.0.0"
17+
"laravel/framework": "8.*",
18+
"orchestra/testbench": "^6.0"
1819
},
1920
"autoload": {
2021
"psr-4": {

tests/Integration/PivotTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ public function setUp(): void
5959

6060
public function testAttach()
6161
{
62-
$id1 = Uuid::uuid1()->getHex();
63-
$id2 = Uuid::uuid1()->getHex();
62+
$id1 = (string) Uuid::uuid1()->getHex();
63+
$id2 = (string) Uuid::uuid1()->getHex();
6464
$first = (new FirstModel())->create(['id' => $id1, 'name' => 'First']);
6565
$second = (new SecondModel())->create(['id' => $id2, 'name' => 'Second']);
6666

@@ -74,8 +74,8 @@ public function testAttach()
7474

7575
public function testDetach()
7676
{
77-
$id1 = Uuid::uuid1()->getHex();
78-
$id2 = Uuid::uuid1()->getHex();
77+
$id1 = (string) Uuid::uuid1()->getHex();
78+
$id2 = (string) Uuid::uuid1()->getHex();
7979
$first = (new FirstModel())->create(['id' => $id1, 'name' => 'First']);
8080
$second = (new SecondModel())->create(['id' => $id2, 'name' => 'Second']);
8181

0 commit comments

Comments
 (0)