Skip to content

Commit a3530cc

Browse files
committed
require must be absolute since included file in deeper directory than test
1 parent 7d462f0 commit a3530cc

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

test/unit/AjaxSshValidateTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function testSshValidate(bool $is_valid, string $pubkey)
2424
$_SERVER["REQUEST_METHOD"] = "POST";
2525
$_POST["key"] = $pubkey;
2626
ob_start();
27-
include __DIR__ . "/../../webroot/js/ajax/ssh_validate.php";
27+
include "../../webroot/js/ajax/ssh_validate.php";
2828
$output = ob_get_clean();
2929
if ($is_valid) {
3030
$this->assertEquals("true", $output);

webroot/js/ajax/ssh_validate.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
<?php
2-
3-
require "../../../resources/autoload.php";
4-
2+
require __DIR__ . "/../../../resources/autoload.php";
53
use UnityWebPortal\lib\UnitySite;
6-
use phpseclib3\Crypt\PublicKeyLoader;
74

8-
echo (UnitySite::testValidSSHKey($_POST["key"]) ? "true" : "false");
5+
echo UnitySite::testValidSSHKey($_POST["key"]) ? "true" : "false";

0 commit comments

Comments
 (0)