Skip to content

Commit 2f2d105

Browse files
committed
Fix test cases
1 parent df64026 commit 2f2d105

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/Unit/Http/Middleware/Api/AuthenticateIPAccessTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function testWithNoIPRestrictions()
2626
*/
2727
public function testWithValidIP()
2828
{
29-
$model = factory(ApiKey::class)->make(['allowed_ips' => '["127.0.0.1"]']);
29+
$model = factory(ApiKey::class)->make(['allowed_ips' => ['127.0.0.1']]);
3030
$this->setRequestAttribute('api_key', $model);
3131

3232
$this->request->shouldReceive('ip')->withNoArgs()->once()->andReturn('127.0.0.1');
@@ -39,7 +39,7 @@ public function testWithValidIP()
3939
*/
4040
public function testValidIPAgainstCIDRRange()
4141
{
42-
$model = factory(ApiKey::class)->make(['allowed_ips' => '["192.168.1.1/28"]']);
42+
$model = factory(ApiKey::class)->make(['allowed_ips' => ['192.168.1.1/28']]);
4343
$this->setRequestAttribute('api_key', $model);
4444

4545
$this->request->shouldReceive('ip')->withNoArgs()->once()->andReturn('192.168.1.15');
@@ -55,7 +55,7 @@ public function testWithInvalidIP()
5555
{
5656
$this->expectException(AccessDeniedHttpException::class);
5757

58-
$model = factory(ApiKey::class)->make(['allowed_ips' => '["127.0.0.1"]']);
58+
$model = factory(ApiKey::class)->make(['allowed_ips' => ['127.0.0.1']]);
5959
$this->setRequestAttribute('api_key', $model);
6060

6161
$this->request->shouldReceive('ip')->withNoArgs()->twice()->andReturn('127.0.0.2');

0 commit comments

Comments
 (0)