modified classes for GeneralException thrown
This commit is contained in:
@ -14,6 +14,7 @@ require_once dirname(__FILE__) . '/../../model/DbDriver.php';
|
||||
require_once dirname(__FILE__) . '/../../model/NoSqlDbDriver.php';
|
||||
require_once dirname(__FILE__) . '/../../model/MongoDriver.php';
|
||||
require_once dirname(__FILE__) . '/../../model/MongoDbCommand.php';
|
||||
require_once dirname(__FILE__) . '/../../exception/GeneralException.php';
|
||||
|
||||
class MongoDbCommandTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
@ -90,7 +91,7 @@ class MongoDbCommandTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Exception
|
||||
* @expectedException GeneralException
|
||||
* @expectedExceptionMessage FindMongoCommand error. Bind all required params first.
|
||||
*/
|
||||
public function testFindCommandNotAllParamsBinded()
|
||||
@ -120,7 +121,7 @@ class MongoDbCommandTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Exception
|
||||
* @expectedException GeneralException
|
||||
* @expectedExceptionMessage InsertMongoCommand error. Bind all required params first.
|
||||
*/
|
||||
public function testInsertCommandNotAllParamsBinded()
|
||||
@ -155,7 +156,7 @@ class MongoDbCommandTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Exception
|
||||
* @expectedException GeneralException
|
||||
* @expectedExceptionMessage UpdateMongoCommand error. Bind all required params first.
|
||||
*/
|
||||
public function testUpdateCommandNotAllParamsBinded()
|
||||
@ -191,7 +192,7 @@ class MongoDbCommandTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Exception
|
||||
* @expectedException GeneralException
|
||||
* @expectedExceptionMessage RemoveMongoCommand error. Bind all required params first.
|
||||
*/
|
||||
public function testRemoveCommandNotAllParamsBinded()
|
||||
@ -201,7 +202,7 @@ class MongoDbCommandTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Exception
|
||||
* @expectedException GeneralException
|
||||
* @expectedExceptionMessage CommandMongoCommand error. Bind all required params first.
|
||||
*/
|
||||
public function testCommandCommandNotAllParamsBinded()
|
||||
|
@ -17,6 +17,7 @@ require_once dirname(__FILE__) . '/../../model/MongoDbCommand.php';
|
||||
require_once dirname(__FILE__) . '/../../model/DbStatement.php';
|
||||
require_once dirname(__FILE__) . '/../../model/MongoStatement.php';
|
||||
require_once dirname(__FILE__) . '/../../model/MongoDriver.php';
|
||||
require_once dirname(__FILE__) . '/../../exception/GeneralException.php';
|
||||
|
||||
class MongoDriverTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
@ -72,7 +73,7 @@ class MongoDriverTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Exception
|
||||
* @expectedException GeneralException
|
||||
* @expectedExceptionMessage Configuration must have a "hostname".
|
||||
*/
|
||||
public function testGetConnectionNoHostname()
|
||||
|
@ -101,6 +101,20 @@ class MongoModelTest extends PHPUnit_Framework_TestCase
|
||||
/**
|
||||
* @runInSeparateProcess
|
||||
*/
|
||||
public function testDeleteAll()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
|
||||
$this->assertEquals(2, $this->model->count(array('name' => 'eggs')));
|
||||
$this->assertEquals(0, $this->model->deleteAll(array('name' => 'eggs')));
|
||||
$this->assertFalse($this->model->find(array('name' => 'eggs'))->fetch());
|
||||
}
|
||||
|
||||
/**
|
||||
* @runInSeparateProcess
|
||||
*/
|
||||
public function testCount()
|
||||
{
|
||||
if (!defined('DEBUG')) {
|
||||
|
@ -16,6 +16,7 @@ require_once dirname(__FILE__) . '/../../model/Db.php';
|
||||
require_once dirname(__FILE__) . '/../../model/DbDriver.php';
|
||||
require_once dirname(__FILE__) . '/../../model/DbStatement.php';
|
||||
require_once dirname(__FILE__) . '/../../model/MongoStatement.php';
|
||||
require_once dirname(__FILE__) . '/../../exception/GeneralException.php';
|
||||
|
||||
class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
@ -136,7 +137,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* @runInSeparateProcess
|
||||
* @expectedException Exception
|
||||
* @expectedException GeneralException
|
||||
* @expectedExceptionMessage MongoDB request error.
|
||||
*/
|
||||
public function testExecuteNoResult()
|
||||
@ -154,7 +155,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* @runInSeparateProcess
|
||||
* @expectedException Exception
|
||||
* @expectedException GeneralException
|
||||
* @expectedExceptionMessage No connection to MongoDB server.
|
||||
*/
|
||||
public function testExecuteNoConnection()
|
||||
@ -283,7 +284,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* @runInSeparateProcess
|
||||
* @expectedException Exception
|
||||
* @expectedException GeneralException
|
||||
* @expectedExceptionMessage Invalid fetch mode "222" specified
|
||||
*/
|
||||
public function testFetchWrongMode()
|
||||
@ -324,7 +325,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* @runInSeparateProcess
|
||||
* @expectedException Exception
|
||||
* @expectedException GeneralException
|
||||
* @expectedExceptionMessage MongoStatement error. Impossible order results of opened cursor
|
||||
*/
|
||||
public function testOrderException()
|
||||
@ -344,7 +345,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* @runInSeparateProcess
|
||||
* @expectedException Exception
|
||||
* @expectedException GeneralException
|
||||
* @expectedExceptionMessage MongoStatement error. Impossible skip results of opened cursor
|
||||
*/
|
||||
public function testSkipException()
|
||||
@ -364,7 +365,7 @@ class MongoStatementTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* @runInSeparateProcess
|
||||
* @expectedException Exception
|
||||
* @expectedException GeneralException
|
||||
* @expectedExceptionMessage MongoStatement error. Impossible limit results of opened cursor
|
||||
*/
|
||||
public function testLimitException()
|
||||
|
@ -63,7 +63,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Exception
|
||||
* @expectedException GeneralException
|
||||
* @expectedExceptionMessage Placeholder must be an array or string
|
||||
* @TODO: change Exception Message 'Placeholder must be an array or string' - no arrays available
|
||||
*/
|
||||
@ -74,7 +74,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Exception
|
||||
* @expectedException GeneralException
|
||||
* @expectedExceptionMessage Objects excepts DbExpr not allowed.
|
||||
*/
|
||||
public function testBindParamExceptionWrongObject()
|
||||
@ -101,7 +101,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
|
||||
$this->setDriverGetConnectionMethod();
|
||||
|
||||
$result = $this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val'));
|
||||
$this->assertEquals('SELECT * place_val FROM place_val AND new_val', $result);
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -116,7 +116,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
$this->sql = 'PLAIN SQL';
|
||||
$result = $this->stmt->execute(array());
|
||||
$this->assertEquals('PLAIN SQL', $result);
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -217,7 +217,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase
|
||||
->will($this->returnValue($mysqliMock));
|
||||
|
||||
$this->stmt->execute(array('place' => 'place_val', 'new' => 'new_val'));
|
||||
$this->assertEquals(array('pair' => 'value'), $this->stmt->fetchPairs());
|
||||
$this->assertSame(array('pair' => 'value'), $this->stmt->fetchPairs());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user