Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php declare(strict_types=1); namespace Sabre\DAV\Auth\Backend; use Sabre\HTTP; class..
Decoded Output download
<?php
declare(strict_types=1);
namespace Sabre\DAV\Auth\Backend;
use Sabre\HTTP;
class BasicCallBackTest extends \PHPUnit\Framework\TestCase
{
public function testCallBack()
{
$args = [];
$callBack = function ($user, $pass) use (&$args) {
$args = [$user, $pass];
return true;
};
$backend = new BasicCallBack($callBack);
$request = new HTTP\Request('GET', '/', [
'Authorization' => 'Basic '.base64_encode('foo:bar'),
]);
$response = new HTTP\Response();
self::assertEquals(
[true, 'principals/foo'],
$backend->check($request, $response)
);
self::assertEquals(['foo', 'bar'], $args);
}
}
?>
Did this file decode correctly?
Original Code
<?php
declare(strict_types=1);
namespace Sabre\DAV\Auth\Backend;
use Sabre\HTTP;
class BasicCallBackTest extends \PHPUnit\Framework\TestCase
{
public function testCallBack()
{
$args = [];
$callBack = function ($user, $pass) use (&$args) {
$args = [$user, $pass];
return true;
};
$backend = new BasicCallBack($callBack);
$request = new HTTP\Request('GET', '/', [
'Authorization' => 'Basic '.base64_encode('foo:bar'),
]);
$response = new HTTP\Response();
self::assertEquals(
[true, 'principals/foo'],
$backend->check($request, $response)
);
self::assertEquals(['foo', 'bar'], $args);
}
}
Function Calls
None |
Stats
MD5 | 02183018a393e9d189e7106a54a88484 |
Eval Count | 0 |
Decode Time | 102 ms |