Permalink
Browse files

added Nette\Tester

  • Loading branch information...
1 parent 7e16247 commit ad5bb9ad8fd9314ecdc31f0dbf138728b7034cb4 @dg dg committed Nov 2, 2012
Showing with 63 additions and 1 deletion.
  1. +4 −1 composer.json
  2. +37 −0 tests/ExampleTest.phpt
  3. +22 −0 tests/bootstrap.php
View
5 composer.json
@@ -19,5 +19,8 @@
"require": {
"php": ">= 5.3.0",
"nette/nette": "@dev"
- }
+ },
+ "require-dev": {
+ "nette/tester": "@dev"
+ }
}
View
37 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();
View
22 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.