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 1010
1111namespace Biscolab \ReCaptcha \Tests ;
1212
13+ use Biscolab \ReCaptcha \Controllers \ReCaptchaController ;
1314use 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
You can’t perform that action at this time.
0 commit comments