Browse Source

little changes in files

master
Anton Grebnev 13 years ago
parent
commit
b5acfc433c
  1. 4
      tests/ConfigTest.php
  2. 10
      tests/LoadTest.php
  3. 2
      tests/RegistryTest.php

4
tests/ConfigTest.php

@ -10,8 +10,8 @@
* Unit tests for Config class * Unit tests for Config class
*/ */
require_once '../Registry.php';
require_once '../Config.php';
require_once dirname(__FILE__) . '/../Registry.php';
require_once dirname(__FILE__) . '/../Config.php';
class ConfigTest extends PHPUnit_Framework_TestCase class ConfigTest extends PHPUnit_Framework_TestCase
{ {

10
tests/LoadTest.php

@ -10,6 +10,8 @@
* Unit tests for Load class * Unit tests for Load class
*/ */
require dirname(__FILE__) . '/../Load.php';
class LoadTest extends PHPUnit_Framework_TestCase class LoadTest extends PHPUnit_Framework_TestCase
{ {
@ -23,14 +25,16 @@ class LoadTest extends PHPUnit_Framework_TestCase
*/ */
public static function setUpBeforeClass() public static function setUpBeforeClass()
{ {
if (!defined('PATH')) {
define('PATH', realpath(dirname(__FILE__) . '/../../..')); define('PATH', realpath(dirname(__FILE__) . '/../../..'));
}
// default application name // default application name
if (!defined('APP')) { if (!defined('APP')) {
define('APP', 'lib/core/tests/face'); define('APP', 'lib/core/tests/face');
} }
self::$file = PATH . '/'. APP. '/cache//autoload.php';
self::$file = PATH . '/' . APP . '/cache/autoload.php';
// value - if dir exists (to delete it if it was created), default true // value - if dir exists (to delete it if it was created), default true
self::$inc_dirs[PATH . '/' . APP . '/src'] = true; self::$inc_dirs[PATH . '/' . APP . '/src'] = true;
@ -45,11 +49,9 @@ class LoadTest extends PHPUnit_Framework_TestCase
} }
} }
public function testSetAutoLoadFrom() public function testSetAutoLoadFrom()
{ {
// autoload // autoload
require (PATH . '/lib/core/Load.php');
Load::setAutoloadFrom(self::$file); Load::setAutoloadFrom(self::$file);
$autoload = require(self::$file); $autoload = require(self::$file);
@ -91,10 +93,8 @@ class LoadTest extends PHPUnit_Framework_TestCase
{ {
$autoload = require(self::$file); $autoload = require(self::$file);
$this->assertNotEmpty($autoload['anton']); $this->assertNotEmpty($autoload['anton']);
} }
public static function tearDownAfterClass() public static function tearDownAfterClass()
{ {
if (file_exists(self::$file)) { if (file_exists(self::$file)) {

2
tests/RegistryTest.php

@ -10,7 +10,7 @@
* Unit tests for Registry * Unit tests for Registry
*/ */
require_once '../Registry.php';
require_once dirname(__FILE__) . '/../Registry.php';
class RegistryTest extends PHPUnit_Framework_TestCase class RegistryTest extends PHPUnit_Framework_TestCase
{ {

Loading…
Cancel
Save