Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Commit

Permalink
added Nette\Tester
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Nov 7, 2012
1 parent 7e16247 commit ad5bb9a
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 1 deletion.
5 changes: 4 additions & 1 deletion composer.json
Expand Up @@ -19,5 +19,8 @@
"require": { "require": {
"php": ">= 5.3.0", "php": ">= 5.3.0",
"nette/nette": "@dev" "nette/nette": "@dev"
} },
"require-dev": {
"nette/tester": "@dev"
}
} }
37 changes: 37 additions & 0 deletions tests/ExampleTest.phpt
@@ -0,0 +1,37 @@
<?php

namespace Test;

use Nette,
Tester,
Tester\Assert;

$container = require __DIR__ . '/bootstrap.php';



class ExampleTest extends Tester\TestCase
{
private $container;


function __construct(Nette\DI\Container $container)
{
$this->container = $container;
}


function setUp()
{
}


function testSomething()
{
Assert::true( true );
}

}


id(new ExampleTest($container))->run();
22 changes: 22 additions & 0 deletions tests/bootstrap.php
@@ -0,0 +1,22 @@
<?php

require __DIR__ . '/../libs/autoload.php';

if (!include __DIR__ . '/../libs/Nette/tester/Tester/bootstrap.php') {
die('Install Nette Tester using `composer update --dev`');
}

function id($val) {
return $val;
}

$configurator = new Nette\Config\Configurator;
$configurator->setDebugMode(FALSE);
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()
->addDirectory(__DIR__ . '/../app')
->register();

$configurator->addConfig(__DIR__ . '/../app/config/config.neon');
$configurator->addConfig(__DIR__ . '/../app/config/config.local.neon');
return $configurator->createContainer();

0 comments on commit ad5bb9a

Please sign in to comment.