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

Commit 26ab0df

Browse files
committed
Merge branch 'develop' into release/v3
* develop: phpunit xml changed with "exclude" directories test improved for controller .gitignore updated .scrutinizer.yml file added with clover coverage test .gitattributes file added .editorconfig file added php 7.3 added to travis yml pull_request_template.md moved in .github folder Create PULL_REQUEST_TEMPLATE.md Update bug_report.md Update issue templates Update README.md
2 parents 78bf0a3 + 67ae3dd commit 26ab0df

File tree

10 files changed

+135
-15
lines changed

10 files changed

+135
-15
lines changed

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[*]
2+
charset=utf-8
3+
end_of_line=lf
4+
insert_final_newline=false
5+
indent_style=space
6+
indent_size=4
7+
8+
[{*.hphp,*.phtml,*.module,*.php,*.php5,*.php4,*.inc}]
9+
indent_style=tab
10+
tab_width=4
11+
12+
[{*.yml,*.yaml}]
13+
indent_style=space
14+
indent_size=2

.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/tests export-ignore
2+
/.gitattributes export-ignore
3+
/.gitignore export-ignore
4+
/.scrutinizer.yml export-ignore
5+
/.travis.yml export-ignore
6+
/phpunit.xml export-ignore
7+
/changelog.md export-ignore
8+
/readme.md export-ignore

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Environment:**
27+
- OS: [e.g. Ubuntu 16.04]
28+
- PHP version [7.1.x]
29+
30+
**Additional context**
31+
Add any other context about the problem here.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Bug Fixes **ONLY**. NO NEW FEATURE ACCEPTED!
2+
3+
<!--- Provide a general summary of your changes in the Title above -->
4+
5+
## Description
6+
<!--- Describe your changes in detail -->
7+
8+
## Related Issue
9+
<!--- This project only accepts pull requests related to open issues -->
10+
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
11+
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
12+
<!--- Please link to the issue here: -->
13+
14+
## Motivation and Context
15+
<!--- Why is this change required? What problem does it solve? -->
16+
<!--- If it fixes an open issue, please link to the issue here. -->
17+
18+
## How Has This Been Tested?
19+
<!--- Please describe in detail how you tested your changes. -->
20+
<!--- Include details of your testing environment, and the tests you ran to -->
21+
<!--- see how your change affects other areas of the code, etc. -->
22+
23+
## Screenshots (if appropriate):

.gitignore

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
vendor/
2-
node_modules/
32
/.idea
43

5-
# Laravel 4 specific
6-
bootstrap/compiled.php
7-
app/storage/
8-
9-
# Laravel 5 & Lumen specific
10-
bootstrap/cache/
11-
.env.*.php
12-
.env.php
13-
.env
14-
154
# Rocketeer PHP task runner and deployment package. https://github.com/rocketeers/rocketeer
165
.rocketeer/
176

187
# composer
198
/composer.lock
209
/composer.local.*
2110
/composer.phar
22-
/coverage.clover
11+
12+
# coverage reports
13+
/coverage.clover
14+
coverage.xml
15+
clover.xml
16+
report/

.scrutinizer.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
build:
2+
nodes:
3+
coverage:
4+
tests:
5+
override:
6+
- command: vendor/bin/phpunit --coverage-clover=clover.xml
7+
coverage:
8+
file: clover.xml
9+
format: clover

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ language: php
33
php:
44
- 7.1
55
- 7.2
6+
- 7.3
67
- hhvm
78

89
before_script:

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
# Laravel ReCAPTCHA - v3
2-
Simple Google reCAPTCHA package for Laravel 5
2+
Simple and painless Google reCAPTCHA package for Laravel 5
33

44
[![Build Status](https://travis-ci.org/biscolab/laravel-recaptcha.svg?branch=master)](https://travis-ci.org/biscolab/laravel-recaptcha) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/biscolab/laravel-recaptcha/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/biscolab/laravel-recaptcha/?branch=master) ![Packagist version](https://img.shields.io/packagist/v/biscolab/laravel-recaptcha.svg)
55

66
## System requirements
7-
PHP 7.1 or greater
7+
| Package version | PHP version | Laravel version |
8+
|-----------------|-------------|-----------------|
9+
| 3.x | 7.1 or greater | 5.5 or greater |
810

911
Are you still using PHP 5.x or 7.0? Please go to [V2](https://github.com/biscolab/laravel-recaptcha/tree/v2.0.4)
1012

13+
## !!! Documentation !!!
14+
15+
Since version 3.2.0 you can find online complete documentation at [https://laravel-recaptcha-docs.biscolab.com/](https://laravel-recaptcha-docs.biscolab.com/).
16+
For previous releases continue reading.
17+
1118
## Installation
1219

1320
You can install the package via composer:

phpunit.xml.dist

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
</testsuites>
1616
<filter>
1717
<whitelist processUncoveredFilesFromWhitelist="true">
18-
<directory suffix=".php">./app</directory>
18+
<directory suffix=".php">./src</directory>
19+
<exclude>
20+
<directory suffix=".php">./vendor</directory>
21+
<directory suffix=".php">./config</directory>
22+
</exclude>
1923
</whitelist>
2024
</filter>
2125
</phpunit>

tests/ReCaptchaV3Test.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111
namespace Biscolab\ReCaptcha\Tests;
1212

13+
use Biscolab\ReCaptcha\Controllers\ReCaptchaController;
1314
use Biscolab\ReCaptcha\ReCaptchaBuilderV3;
15+
use Illuminate\Support\Facades\App;
1416

1517
/**
1618
* Class ReCaptchaV3Test
@@ -73,6 +75,33 @@ public function testCustomValidationFunction() {
7375
$this->assertRegexp('/functionCustomValidation\(token\)/', $r);
7476
}
7577

78+
/**
79+
* @test
80+
*/
81+
public function testValidateController() {
82+
83+
$controller = App::make(ReCaptchaController::class);
84+
$return = $controller->validateV3();
85+
86+
$this->assertArrayHasKey("success", $return);
87+
$this->assertArrayHasKey("error-codes", $return);
88+
}
89+
90+
/**
91+
* Define environment setup.
92+
*
93+
* @param \Illuminate\Foundation\Application $app
94+
*
95+
* @return void
96+
*/
97+
protected function getEnvironmentSetUp($app) {
98+
99+
$app['config']->set('recaptcha.version', 'v3');
100+
}
101+
102+
/**
103+
* Setup the test environment.
104+
*/
76105
protected function setUp() {
77106

78107
parent::setUp(); // TODO: Change the autogenerated stub

0 commit comments

Comments
 (0)