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 Pagekit\Config\Tests; use Pagekit\Config\Config; use Pagekit\Config\Load..
Decoded Output download
<?php
namespace Pagekit\Config\Tests;
use Pagekit\Config\Config;
use Pagekit\Config\Loader\PhpLoader;
class ConfigTest extends \PHPUnit_Framework_TestCase
{
/**
* @var Config
*/
protected $config;
/**
* @var array
*/
protected $values;
public function setUp()
{
$values = [
'foo' => [
'bar' => 'test'
]
];
$this->config = new Config($values);
$this->values = $values;
}
public function testHas()
{
$this->assertTrue($this->config->has('foo'));
$this->assertTrue(!$this->config->has('none'));
}
public function testGet()
{
$this->assertEquals($this->config->get('foo.bar'), 'test');
}
public function testToArray()
{
$this->assertEquals($this->config->toArray(), $this->values);
}
public function testSet()
{
$this->config->set('foo.bar2', 'test2');
$this->assertEquals($this->config->get('foo.bar2'), 'test2');
$this->config->offsetSet('foo.bar', 'test3');
$this->assertTrue($this->config->offsetExists('foo.bar'));
$this->assertEquals($this->config->offsetGet('foo.bar'), 'test3');
$this->config->offsetUnset('foo.bar');
$this->assertEquals($this->config->offsetGet('foo.bar'), null);
}
public function testDump()
{
$this->config->dump();
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace Pagekit\Config\Tests;
use Pagekit\Config\Config;
use Pagekit\Config\Loader\PhpLoader;
class ConfigTest extends \PHPUnit_Framework_TestCase
{
/**
* @var Config
*/
protected $config;
/**
* @var array
*/
protected $values;
public function setUp()
{
$values = [
'foo' => [
'bar' => 'test'
]
];
$this->config = new Config($values);
$this->values = $values;
}
public function testHas()
{
$this->assertTrue($this->config->has('foo'));
$this->assertTrue(!$this->config->has('none'));
}
public function testGet()
{
$this->assertEquals($this->config->get('foo.bar'), 'test');
}
public function testToArray()
{
$this->assertEquals($this->config->toArray(), $this->values);
}
public function testSet()
{
$this->config->set('foo.bar2', 'test2');
$this->assertEquals($this->config->get('foo.bar2'), 'test2');
$this->config->offsetSet('foo.bar', 'test3');
$this->assertTrue($this->config->offsetExists('foo.bar'));
$this->assertEquals($this->config->offsetGet('foo.bar'), 'test3');
$this->config->offsetUnset('foo.bar');
$this->assertEquals($this->config->offsetGet('foo.bar'), null);
}
public function testDump()
{
$this->config->dump();
}
}
Function Calls
None |
Stats
MD5 | 41d69176422bb33cb6c2c9cfa152a0ef |
Eval Count | 0 |
Decode Time | 80 ms |