Skip to content
This repository was archived by the owner on Sep 13, 2024. It is now read-only.

Commit d33986a

Browse files
authored
Merge pull request #17 from Saritasa/github-actions
GitHub actions
2 parents 7e7093a + 4e1bfe8 commit d33986a

File tree

5 files changed

+70
-26
lines changed

5 files changed

+70
-26
lines changed

.github/workflows/phpcs.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: PHP Codesniffer
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
phpcs:
7+
name: PHP Codesniffer
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
13+
- name: Setup PHP
14+
uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: '7.4'
17+
18+
- name: Validate composer.json and composer.lock
19+
run: composer validate
20+
21+
- name: Install dependencies
22+
run: composer install --dev --prefer-dist --no-progress --no-suggest --no-interaction
23+
24+
- name: Run code sniffer
25+
run: vendor/bin/phpcs

.github/workflows/phpunit.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: PHP Unit
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build-test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
php-versions: [ '7.1', '7.2', '7.3', '7.4' ]
11+
name: PHP ${{ matrix.php-versions }} - PHPUnit
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
16+
- name: Setup PHP
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: ${{ matrix.php-versions }}
20+
coverage: xdebug
21+
22+
- name: Check PHP Version
23+
run: php -v
24+
25+
- name: Validate composer.json and composer.lock
26+
run: composer validate
27+
28+
- name: Install dependencies
29+
run: composer install --dev --prefer-dist --no-progress --no-suggest --no-interaction
30+
31+
- name: Run test suite
32+
run: vendor/bin/phpunit --coverage-clover=coverage.xml
33+
34+
- name: Upload Codecov
35+
uses: codecov/codecov-action@v1
36+
with:
37+
file: ./coverage.xml
38+
flags: unittests
39+
fail_ci_if_error: false
40+
verbose: true

.travis.yml

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

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Fluent Validation Rules builders for Laravel
22

3-
[![Build Status](https://travis-ci.org/Saritasa/php-laravel-fluent-validation.svg?branch=master)](https://travis-ci.org/Saritasa/php-laravel-fluent-validation)
3+
[![PHP Unit](https://github.com/Saritasa/php-laravel-fluent-validation/workflows/PHP%20Unit/badge.svg)](https://github.com/Saritasa/php-laravel-fluent-validation/actions)
4+
[![PHP CodeSniffer](https://github.com/Saritasa/php-laravel-fluent-validation/workflows/PHP%20Codesniffer/badge.svg)](https://github.com/Saritasa/php-laravel-fluent-validation/actions)
45
[![codecov](https://codecov.io/gh/Saritasa/php-laravel-fluent-validation/branch/master/graph/badge.svg)](https://codecov.io/gh/Saritasa/php-laravel-fluent-validation)
56
[![Release](https://img.shields.io/github/release/saritasa/php-laravel-fluent-validation.svg)](https://github.com/Saritasa/php-laravel-fluent-validation/releases)
67
[![PHPv](https://img.shields.io/packagist/php-v/saritasa/laravel-fluent-validation.svg)](http://www.php.net)

tests/DatabaseRulesTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function testExistsWithBuilder()
7474
->whereNull('activation_date')
7575
->whereNot('blocked', true);
7676
})->required();
77-
$this->assertEquals('exists:users,email,login,NOT_NULL,role,user,activation_date,NULL,blocked,!1|required', $rules);
77+
$this->assertEquals('exists:users,email,login,"NOT_NULL",role,"user",activation_date,"NULL",blocked,"!1"|required', $rules->toString());
7878
}
7979

8080
/**
@@ -101,7 +101,7 @@ public function testUniqueWithBuilder()
101101
->whereNull('deleted_at');
102102
})->requiredWithout('facebook_id');
103103

104-
$this->assertEquals('unique:users,email,"123",id,deleted_at,NULL|required_without:facebook_id', $rules);
104+
$this->assertEquals('unique:users,email,"123",id,deleted_at,"NULL"|required_without:facebook_id', $rules->toString());
105105
}
106106

107107
/*
@@ -123,7 +123,7 @@ public function testModelExistsWithBuilder()
123123
$rules = Rule::modelExists(TestUserModel::class, function (Exists $rule) {
124124
$rule->whereNull('avatar_url')->where('active', 1);
125125
});
126-
$this->assertEquals('exists:users,user_id,avatar_url,NULL,active,1', $rules->toString());
126+
$this->assertEquals('exists:users,user_id,avatar_url,"NULL",active,"1"', $rules->toString());
127127
}
128128

129129
/*

0 commit comments

Comments
 (0)