Completed
Push — master ( 7b9b82...f4954a )
by Roberto
07:53 queued 11s
created

ReCaptchaLangTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 9
c 1
b 0
f 1
dl 0
loc 46
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 7 1
A testHtmlScriptTagJsApiGetHtmlScriptWithHlParam() 0 5 1
A getEnvironmentSetUp() 0 4 1
1
<?php
2
/**
3
 * Copyright (c) 2017 - present
4
 * LaravelGoogleRecaptcha - ReCaptchaLangTest.php
5
 * author: Roberto Belotti - [email protected]
6
 * web : robertobelotti.com, github.com/biscolab
7
 * Initial version created on: 7/8/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\Facades\ReCaptcha;
14
use Biscolab\ReCaptcha\ReCaptchaBuilderInvisible;
15
use Biscolab\ReCaptcha\ReCaptchaBuilderV2;
16
17
class ReCaptchaLangTest extends TestCase
18
{
19
20
	/**
21
	 * @var ReCaptchaBuilderInvisible
22
	 */
23
	protected $recaptcha_invisible;
24
25
	/**
26
	 * @var ReCaptchaBuilderV2
27
	 */
28
	protected $recaptcha_v2;
29
30
	/**
31
	 * @tests
32
	 */
33
	public function testHtmlScriptTagJsApiGetHtmlScriptWithHlParam()
34
	{
35
36
		$r = ReCaptcha::htmlScriptTagJsApi();
0 ignored issues
show
Bug introduced by
The method htmlScriptTagJsApi() does not exist on Biscolab\ReCaptcha\Facades\ReCaptcha. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

36
		/** @scrutinizer ignore-call */ 
37
  $r = ReCaptcha::htmlScriptTagJsApi();
Loading history...
37
		$this->assertEquals('<script src="https://www.google.com/recaptcha/api.js?hl=it" async defer></script>', $r);
38
	}
39
40
	/**
41
	 * Define environment setup.
42
	 *
43
	 * @param  \Illuminate\Foundation\Application $app
44
	 *
45
	 * @return void
46
	 */
47
	protected function getEnvironmentSetUp($app)
48
	{
49
50
		$app['config']->set('recaptcha.default_language', 'it');
51
	}
52
53
	/**
54
	 * Setup the test environment.
55
	 */
56
	protected function setUp(): void
57
	{
58
59
		parent::setUp(); // TODO: Change the autogenerated stub
60
61
		$this->recaptcha_invisible = new ReCaptchaBuilderInvisible('api_site_key', 'api_secret_key');
62
		$this->recaptcha_v2 = new ReCaptchaBuilderV2('api_site_key', 'api_secret_key');
63
64
	}
65
}