Passed
Push — master ( b01395...c75806 )
by Roberto
05:23 queued 13s
created

ReCaptchaInvalidConfigurationTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 28
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getEnvironmentSetUp() 0 7 1
A testV2HtmlScriptTagJsApiThrowsInvalidConfigurationException() 0 6 1
1
<?php
2
/**
3
 * Copyright (c) 2017 - present
4
 * LaravelGoogleRecaptcha - ReCaptchaInvalidConfigurationTest.php
5
 * author: Roberto Belotti - [email protected]
6
 * web : robertobelotti.com, github.com/biscolab
7
 * Initial version created on: 4/9/2019
8
 * MIT license: https://github.com/biscolab/laravel-recaptcha/blob/master/LICENSE
9
 */
10
11
namespace Biscolab\ReCaptcha\Tests;
12
13
use Biscolab\ReCaptcha\Exceptions\InvalidConfigurationException;
14
use Biscolab\ReCaptcha\ReCaptchaBuilder;
15
16
/**
17
 * Class ReCaptchaInvalidConfigurationTest
18
 * @package Biscolab\ReCaptcha\Tests
19
 */
20
class ReCaptchaInvalidConfigurationTest extends TestCase
21
{
22
23
    /**
24
     * @test
25
     */
26
    public function testV2HtmlScriptTagJsApiThrowsInvalidConfigurationException()
27
    {
28
29
        $this->expectException(InvalidConfigurationException::class);
30
31
        htmlScriptTagJsApi();
32
    }
33
34
    /**
35
     * Define environment setup.
36
     *
37
     * @param  \Illuminate\Foundation\Application $app
38
     *
39
     * @return void
40
     */
41
    protected function getEnvironmentSetUp($app)
42
    {
43
44
        $app['config']->set('recaptcha.api_site_key', 'api_site_key');
45
        $app['config']->set('recaptcha.api_secret_key', 'api_secret_key');
46
        $app['config']->set('recaptcha.explicit', true);
47
        $app['config']->set('recaptcha.tag_attributes.callback', ReCaptchaBuilder::DEFAULT_ONLOAD_JS_FUNCTION);
48
    }
49
50
}