Skip to content

Commit 7f1d1bf

Browse files
committed
added check
1 parent 930b432 commit 7f1d1bf

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tests/ViewTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,34 @@ public function testView2()
7979
$this->assertEquals(false, $data['inline']);
8080
$this->assertEquals('en', $data['language']);
8181
}
82+
public function testView4()
83+
{
84+
// Create a stub for the SomeClass class.
85+
$configStub = $this->createMock(ReCaptchaConfigV3::class);
86+
87+
// Configure the stub.
88+
$configStub->method('isServiceEnabled')
89+
->willReturn(true);
90+
91+
$configStub->method('getSiteKey')
92+
->willReturn('test1');
8293

94+
$configStub->method('isInline')
95+
->willReturn(false);
8396

97+
$configStub->method('getLanguage')
98+
->willReturn('en');
99+
100+
$configStub->method('getBackgroundBadgeDisplay')
101+
->willReturn(false);
102+
103+
$clientStub = $this->createMock(GuzzleRequestClient::class);
104+
105+
$_service = new GoogleReCaptchaV3Service($configStub, $clientStub);
106+
$service = new GoogleReCaptchaV3($_service);
107+
GoogleReCaptchaV3::$hasAction = false;
108+
$data = $service->prepareData();
109+
$this->assertEquals(false, $data['display']);
110+
$this->assertEquals('test1', $data['publicKey']);
111+
}
84112
}

0 commit comments

Comments
 (0)