Skip to content

Commit dc01641

Browse files
committed
fix for test failure in php
1 parent 1eaa892 commit dc01641

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/csrfprotector_test.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -420,20 +420,20 @@ public function testgetCurrentUrl()
420420
$stub = new ReflectionClass('csrfprotector');
421421
$method = $stub->getMethod('getCurrentUrl');
422422
$method->setAccessible(true);
423-
$this->assertEquals($method->invoke(null, []), "http://test/index.php");
423+
$this->assertEquals($method->invoke(null, array()), "http://test/index.php");
424424

425425
$tmp_request_scheme = $_SERVER['REQUEST_SCHEME'];
426426
unset($_SERVER['REQUEST_SCHEME']);
427427

428428
// server-https is not set
429-
$this->assertEquals($method->invoke(null, []), "http://test/index.php");
429+
$this->assertEquals($method->invoke(null, array()), "http://test/index.php");
430430

431431
$_SERVER['HTTPS'] = 'on';
432-
$this->assertEquals($method->invoke(null, []), "https://test/index.php");
432+
$this->assertEquals($method->invoke(null, array()), "https://test/index.php");
433433
unset($_SERVER['HTTPS']);
434434

435435
$_SERVER['REQUEST_SCHEME'] = "https";
436-
$this->assertEquals($method->invoke(null, []), "https://test/index.php");
436+
$this->assertEquals($method->invoke(null, array()), "https://test/index.php");
437437

438438
$_SERVER['REQUEST_SCHEME'] = $tmp_request_scheme;
439439
}
@@ -448,7 +448,7 @@ public function testLoggingException()
448448
$method->setAccessible(true);
449449

450450
try {
451-
$method->invoke(null, []);
451+
$method->invoke(null, array());
452452
$this->fail("logFileWriteError was not caught");
453453
} catch (Exception $ex) {
454454
// pass
@@ -457,7 +457,7 @@ public function testLoggingException()
457457

458458
if (!is_dir($this->logDir))
459459
mkdir($this->logDir);
460-
$method->invoke(null, []);
460+
$method->invoke(null, array());
461461
$this->assertTrue(file_exists($this->logDir ."/" .date("m-20y") .".log"));
462462
}
463463

0 commit comments

Comments
 (0)