-
Notifications
You must be signed in to change notification settings - Fork 60
/
PanelTest.phpt
50 lines (39 loc) · 1.01 KB
/
PanelTest.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* Test: Kdyby\Events\Event.
*
* @testCase
*/
namespace KdybyTests\Events;
use Kdyby\Events\DI\EventsExtension;
use Kdyby\Events\Diagnostics\Panel;
use Nette\Configurator;
use Tester\Assert;
require_once __DIR__ . '/../bootstrap.php';
class PanelTest extends \Tester\TestCase
{
/**
* @param string $configFile
* @return \Nette\DI\Container
*/
public function createContainer($configFile)
{
$config = new Configurator();
$config->setTempDirectory(TEMP_DIR);
$config->addParameters(['container' => ['class' => 'SystemContainer_' . md5($configFile)]]);
EventsExtension::register($config);
$config->addConfig(__DIR__ . '/../nette-reset.neon');
$config->addConfig(__DIR__ . '/config/' . $configFile . '.neon');
return $config->createContainer();
}
public function testRender()
{
$container = $this->createContainer('panel');
$panel = new Panel($container);
Assert::noError(function () use ($panel) {
$panel->getTab();
$panel->getPanel();
});
}
}
(new PanelTest())->run();