We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 29098ce + e56ab0a commit 03791d1Copy full SHA for 03791d1
tests/Http/Controller/CreateSecurityCookieControllerTest.php
@@ -0,0 +1,18 @@
1
+<?php
2
+
3
+it('create security cookie', function () {
4
+ $response = $this->get('_native/api/cookie')->assertRedirect('/');
5
+ $cookie = $response->headers->getCookies()[0];
6
7
+ $this->assertEquals('_php_native', $cookie->getName());
8
+ $this->assertEquals('localhost', $cookie->getDomain());
9
+ $this->assertTrue($cookie->isHttpOnly());
10
+});
11
12
+it('check if secret is not equal of config secret key abort 403 page', function () {
13
+ config()->set('native-php.secret', 'milwad');
14
15
+ $response = $this->get('_native/api/cookie')->assertStatus(403);
16
17
+ $this->assertEquals([], $response->headers->getCookies());
18
0 commit comments