<?php // bootstrap require_once realpath('../lean/init.php'); $autoload = new \lean\Autoload(); $autoload->loadLean(); $autoload->register('test', __DIR__ . '/lib'); class LeanSuite { public static function suite() { $suite = new \PHPUnit_Framework_TestSuite('lean'); $suite->addTestSuite('test\\UtilTest'); $suite->addTestSuite('test\\I18NTest'); $suite->addTestSuite('test\\TextTest'); $suite->addTestSuite('test\\EnvironmentTest'); $suite->addTestSuite('test\\MigrationTest'); return $suite; } }
namespace stack\test; /* * Copyright (C) 2012 Michael Saller * Licensed under MIT License, see /path/to/stack/LICENSE */ use lean\Registry; use lean\util\Dump; use stack\Environment; date_default_timezone_set('Europe/Berlin'); define('STACK_ROOT', realpath(__DIR__ . '/..')); define('STACK_APPLICATION_ROOT', __DIR__); include STACK_ROOT . '/init.php'; // initialize lean include STACK_ROOT . '/vendor/klawd-prime/lean/lean/init.php'; $autoload = new \lean\Autoload(); $autoload->loadLean(); $autoload->register('stack', STACK_APPLICATION_ROOT . '/../stack/lib'); class StackTest extends \PHPUnit_Framework_TestCase { protected $environment; protected $client; public function setUp() { // create environment $this->environment = new Environment('test'); $client = $this->client = new \couchClient($this->environment->get('stack.database.dsn'), $this->environment->get('stack.database.name')); if ($client->databaseExists()) { $client->deleteDatabase(); } $client->createDatabase();