1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-01-17 21:38:14 +01:00
php-debugbar/tests/DebugBar/Tests/DataCollector/ConfigCollectorTest.php
2013-08-14 21:37:24 +10:00

29 lines
888 B
PHP

<?php
namespace DebugBar\Tests\DataCollector;
use DebugBar\Tests\DebugBarTestCase;
use DebugBar\DebugBar;
use DebugBar\DataCollector\ConfigCollector;
class ConfigCollectorTest extends DebugBarTestCase
{
public function testCollect()
{
$c = new ConfigCollector(array('s' => 'bar', 'a' => array(), 'o' => new \stdClass()));
$data = $c->collect();
$this->assertArrayHasKey('s', $data);
$this->assertEquals('bar', $data['s']);
$this->assertArrayHasKey('a', $data);
$this->assertEquals("Array\n(\n)\n", $data['a']);
$this->assertArrayHasKey('o', $data);
$this->assertEquals('Object(stdClass)', $data['o']);
}
public function testName()
{
$c = new ConfigCollector(array(), 'foo');
$this->assertEquals('foo', $c->getName());
$this->assertArrayHasKey('foo', $c->getWidgets());
}
}