Browse Source

Fixed tests with inc Config and Registry classes. Use LOGGING in logger tests.

master
Alexander Demidov 12 years ago
parent
commit
7a26da1034
  1. 2
      tests/LoadTest.php
  2. 2
      tests/app/Action_TestCase.php
  3. 2
      tests/layout/ErrorLayoutTest.php
  4. 2
      tests/layout/LayoutTest.php
  5. 3
      tests/logger/CliLoggerTest.php
  6. 1
      tests/logger/FileLoggerTest.php
  7. 28
      tests/model/MongoStatementTest.php
  8. 2
      tests/model/MySQLiStatementTest.php
  9. 2
      tests/redis/RedisDebugTest.php
  10. 2
      tests/util/profiler/ProfilerTest.php

2
tests/LoadTest.php

@ -10,6 +10,8 @@
* Unit tests for Load class
*/
require_once dirname(__FILE__) . '/../Registry.php';
require_once dirname(__FILE__) . '/../Config.php';
require_once dirname(__FILE__) . '/../Load.php';
require_once 'vfsStream/vfsStream.php';

2
tests/app/Action_TestCase.php

@ -10,6 +10,8 @@
* Action_TestCase class for testing Actions
*/
require_once dirname(__FILE__) . '/../../Registry.php';
require_once dirname(__FILE__) . '/../../Config.php';
require_once dirname(__FILE__) . '/../../Load.php';
require_once dirname(__FILE__) . '/../../classes/Env.class.php';
require_once dirname(__FILE__) . '/../../exception/ErrorHandler.php';

2
tests/layout/ErrorLayoutTest.php

@ -8,6 +8,8 @@
* @user: agrebnev
*/
require_once dirname(__FILE__) . '/../../Registry.php';
require_once dirname(__FILE__) . '/../../Config.php';
require_once dirname(__FILE__) . '/../../exception/ErrorHandler.php';
require_once dirname(__FILE__) . '/../../exception/GeneralException.php';
require_once dirname(__FILE__) . '/../../app/FrontController.php';

2
tests/layout/LayoutTest.php

@ -10,6 +10,8 @@
* Unit tests for Layout class
*/
require_once dirname(__FILE__) . '/../../Registry.php';
require_once dirname(__FILE__) . '/../../Config.php';
require_once dirname(__FILE__) . '/../../exception/ErrorHandler.php';
require_once dirname(__FILE__) . '/../../app/FrontController.php';
require_once dirname(__FILE__) . '/../../layout/Layout.php';

3
tests/logger/CliLoggerTest.php

@ -44,7 +44,8 @@ class CliLoggerTest extends PHPUnit_Framework_TestCase
public function testLog()
{
Config::set('DEBUG', 1);
Config::set('LOGGING', 1);
Config::set('Logger', array('logger' => 'CliLogger'));
$logger = Logger::getInstance();
ob_start();
$logger->setPid(123);

1
tests/logger/FileLoggerTest.php

@ -33,6 +33,7 @@ class FileLoggerTest extends PHPUnit_Framework_TestCase
vfsStream::setup();
$root = vfsStream::create(array());
vfsStreamWrapper::setRoot($root);
Config::set('LOGGING', 1);
$this->conf = array('logger' => 'FileLogger', 'filepath' => vfsStream::url('root/log.txt'));
Config::set('Logger', $this->conf);
if ($root->hasChild('log.txt')) {

28
tests/model/MongoStatementTest.php

@ -10,6 +10,8 @@
* Unit tests for MySQLiStatement class
*/
require_once dirname(__FILE__) . '/../../Registry.php';
require_once dirname(__FILE__) . '/../../Config.php';
require_once dirname(__FILE__) . '/../../util/profiler/CommandProfiler.php';
require_once dirname(__FILE__) . '/../../util/profiler/Profiler.php';
require_once dirname(__FILE__) . '/../../model/Db.php';
@ -168,7 +170,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
*/
public function testExecuteWithDebug()
{
Config::set('DEBUG', 1;
Config::set('DEBUG', 1);
$this->setDriverGetConnectionMethod()->setRequestExecuteMethod();
$this->assertTrue($this->stmt->execute());
$this->assertEquals(10, $this->stmt->numRows());
@ -180,7 +182,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
*/
public function testBindParam()
{
Config::set('DEBUG', 1;
Config::set('DEBUG', 1);
$this->request
->expects($this->once())
@ -201,7 +203,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
*/
public function testFetch()
{
Config::set('DEBUG', 1;
Config::set('DEBUG', 1);
$this->assertFalse($this->stmt->fetch());
$this->setDriverGetConnectionMethod()->setRequestForFetch();
@ -218,7 +220,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
*/
public function testFetchWithInitialArray()
{
Config::set('DEBUG', 1;
Config::set('DEBUG', 1);
$this->assertFalse($this->stmt->fetch());
$this->setDriverGetConnectionMethod();
@ -237,7 +239,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
*/
public function testFetchAssocFromCursor()
{
Config::set('DEBUG', 1;
Config::set('DEBUG', 1);
$this->assertFalse($this->stmt->fetch());
$this->setDriverGetConnectionMethod()->setRequestForFetch();
@ -254,7 +256,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
*/
public function testFetchAssocFromArray()
{
Config::set('DEBUG', 1;
Config::set('DEBUG', 1);
$this->assertFalse($this->stmt->fetch());
$this->setDriverGetConnectionMethod();
@ -274,7 +276,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
*/
public function testFetchWrongMode()
{
Config::set('DEBUG', 1;
Config::set('DEBUG', 1);
$this->assertFalse($this->stmt->fetch());
$this->setDriverGetConnectionMethod();
@ -294,7 +296,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
*/
public function testSkipOrderLimit()
{
Config::set('DEBUG', 1;
Config::set('DEBUG', 1);
$this->setDriverGetConnectionMethod()->setRequestForFetch();
$this->stmt->execute();
@ -312,7 +314,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
*/
public function testCount()
{
Config::set('DEBUG', 1;
Config::set('DEBUG', 1);
$this->setDriverGetConnectionMethod()->setRequestForFetch();
$this->stmt->execute();
@ -327,7 +329,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
*/
public function testCountException()
{
Config::set('DEBUG', 1;
Config::set('DEBUG', 1);
$this->setDriverGetConnectionMethod();
$this->request
->expects($this->once())
@ -345,7 +347,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
*/
public function testOrderException()
{
Config::set('DEBUG', 1;
Config::set('DEBUG', 1);
$this->setDriverGetConnectionMethod();
$this->request
->expects($this->once())
@ -363,7 +365,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
*/
public function testSkipException()
{
Config::set('DEBUG', 1;
Config::set('DEBUG', 1);
$this->setDriverGetConnectionMethod();
$this->request
->expects($this->once())
@ -381,7 +383,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
*/
public function testLimitException()
{
Config::set('DEBUG', 1;
Config::set('DEBUG', 1);
$this->setDriverGetConnectionMethod();
$this->request
->expects($this->once())

2
tests/model/MySQLiStatementTest.php

@ -10,6 +10,8 @@
* Unit tests for MySQLiStatement class
*/
require_once dirname(__FILE__) . '/../../Registry.php';
require_once dirname(__FILE__) . '/../../Config.php';
require_once dirname(__FILE__) . '/../../util/profiler/CommandProfiler.php';
require_once dirname(__FILE__) . '/../../util/profiler/Profiler.php';
require_once dirname(__FILE__) . '/../../model/Db.php';

2
tests/redis/RedisDebugTest.php

@ -10,6 +10,8 @@
* Unit tests for RedisDebug class
*/
require_once dirname(__FILE__) . '/../../Registry.php';
require_once dirname(__FILE__) . '/../../Config.php';
require_once dirname(__FILE__) . '/../../exception/GeneralException.php';
require_once dirname(__FILE__) . '/../../util/profiler/CommandProfiler.php';
require_once dirname(__FILE__) . '/../../util/profiler/Profiler.php';

2
tests/util/profiler/ProfilerTest.php

@ -10,6 +10,8 @@
* Unit tests for CommandProfiler class
*/
require_once dirname(__FILE__) . '/../../../Registry.php';
require_once dirname(__FILE__) . '/../../../Config.php';
require_once dirname(__FILE__) . '/../../../exception/GeneralException.php';
require_once dirname(__FILE__) . '/../../../util/FirePHPCore-0.3.2/lib/FirePHPCore/fb.php';
require_once dirname(__FILE__) . '/../../../util/profiler/Profiler.php';

Loading…
Cancel
Save