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 namespace Alchemy\Zippy\Tests\Resource; use Alchemy\Zippy\Tests\TestCase; use Alch..
Decoded Output download
<?php
namespace Alchemy\Zippy\Tests\Resource;
use Alchemy\Zippy\Tests\TestCase;
use Alchemy\Zippy\Resource\PathUtil;
class PathUtilTest extends TestCase
{
/**
* @dataProvider providePathData
*/
public function testBasename($expected, $context)
{
$this->assertEquals($expected, PathUtil::basename($context));
}
public function providePathData()
{
return array(
array('file.ext', 'input/path/to/local/file.ext'),
array('file.ext', 'input\path o\localile.ext'),
array('file.ext', 'ile.ext'),
array('file.ext', 'file.ext'),
array('ngelholm.jpg', '/tmp/ngelholm.jpg'),
array('ngelholm.jpg', ' mp\ngelholm.jpg'),
array('ngelholm.jpg', '\ngelholm.jpg'),
array('ngelholm.jpg', 'ngelholm.jpg'),
array('-utf8-name.jpg', '/tmp/-utf8-name.jpg'),
array('-utf8-name.jpg', ' mp\u044f-utf8-name.jpg'),
array('-utf8-name.jpg', '-utf8-name.jpg'),
array('-utf8-name.jpg', '/-utf8-name.jpg'),
array('logo.png', 'http://google.com/tmp/logo.png'),
array('ngelholm.png', 'http://google.com/city/ngelholm.png'),
array('ngelholm.png', 'http://google.com//ngelholm.png')
);
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace Alchemy\Zippy\Tests\Resource;
use Alchemy\Zippy\Tests\TestCase;
use Alchemy\Zippy\Resource\PathUtil;
class PathUtilTest extends TestCase
{
/**
* @dataProvider providePathData
*/
public function testBasename($expected, $context)
{
$this->assertEquals($expected, PathUtil::basename($context));
}
public function providePathData()
{
return array(
array('file.ext', 'input/path/to/local/file.ext'),
array('file.ext', 'input\path\to\local\file.ext'),
array('file.ext', '\file.ext'),
array('file.ext', 'file.ext'),
array('ngelholm.jpg', '/tmp/ngelholm.jpg'),
array('ngelholm.jpg', '\tmp\ngelholm.jpg'),
array('ngelholm.jpg', '\ngelholm.jpg'),
array('ngelholm.jpg', 'ngelholm.jpg'),
array('-utf8-name.jpg', '/tmp/-utf8-name.jpg'),
array('-utf8-name.jpg', '\tmp\-utf8-name.jpg'),
array('-utf8-name.jpg', '-utf8-name.jpg'),
array('-utf8-name.jpg', '/-utf8-name.jpg'),
array('logo.png', 'http://google.com/tmp/logo.png'),
array('ngelholm.png', 'http://google.com/city/ngelholm.png'),
array('ngelholm.png', 'http://google.com//ngelholm.png')
);
}
}
Function Calls
| None |
Stats
| MD5 | 297f969d1c422b3472206fc8711912bf |
| Eval Count | 0 |
| Decode Time | 89 ms |