This repository was archived by the owner on Jun 10, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 10
10
11
11
namespace Biscolab \ReCaptcha \Tests ;
12
12
13
+ use Biscolab \ReCaptcha \Controllers \ReCaptchaController ;
13
14
use Biscolab \ReCaptcha \ReCaptchaBuilderV3 ;
15
+ use Illuminate \Support \Facades \App ;
14
16
15
17
/**
16
18
* Class ReCaptchaV3Test
@@ -73,6 +75,33 @@ public function testCustomValidationFunction() {
73
75
$ this ->assertRegexp ('/functionCustomValidation\(token\)/ ' , $ r );
74
76
}
75
77
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
+ */
76
105
protected function setUp () {
77
106
78
107
parent ::setUp (); // TODO: Change the autogenerated stub
You can’t perform that action at this time.
0 commit comments