Skip to content

Commit

Permalink
Making all Mysql dbo source tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jan 6, 2011
1 parent aea5607 commit 406e7b7
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions lib/Cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php
Expand Up @@ -63,8 +63,7 @@ class DboMysqlTest extends CakeTestCase {
*/
public function setUp() {
$this->Dbo = ConnectionManager::getDataSource('test');
$this->skipIf(!($this->Dbo instanceof DboMysql));
if ($this->Dbo->config['driver'] !== 'mysql') {
if (!($this->Dbo instanceof Mysql)) {
$this->markTestSkipped('The MySQL extension is not available.');
}
$this->_debug = Configure::read('debug');
Expand Down Expand Up @@ -309,7 +308,7 @@ function testBuildColumn() {
function testIndexOnMySQL4Output() {
$name = $this->Dbo->fullTableName('simple');

$mockDbo = $this->getMock('DboMysql', array('connect', '_execute', 'getVersion'));
$mockDbo = $this->getMock('Mysql', array('connect', '_execute', 'getVersion'));
$columnData = array(
array('0' => array(
'Table' => 'with_compound_keys',
Expand Down Expand Up @@ -776,7 +775,7 @@ function testDescribeGettingFieldParameters() {
* @return void
*/
public function testListSources() {
$db = $this->getMock('DboMysql', array('connect', '_execute'));
$db = $this->getMock('Mysql', array('connect', '_execute'));
$queryResult = $this->getMock('PDOStatement');
$db->expects($this->once())
->method('_execute')
Expand Down Expand Up @@ -810,7 +809,7 @@ public function testGetVersion() {
* @return void
*/
public function testGetEncoding() {
$db = $this->getMock('DboMysql', array('connect', '_execute'));
$db = $this->getMock('Mysql', array('connect', '_execute'));
$queryResult = $this->getMock('PDOStatement');
$db->expects($this->once())
Expand All @@ -834,7 +833,7 @@ public function testGetEncoding() {
* @return void
*/
function testFieldDoubleEscaping() {
$test = $this->getMock('DboMysql', array('connect', '_execute', 'execute'));
$test = $this->getMock('Mysql', array('connect', '_execute', 'execute'));
$this->Model = $this->getMock('Article2', array('getDataSource'));
$this->Model->alias = 'Article';
$this->Model->expects($this->any())
Expand Down Expand Up @@ -876,7 +875,7 @@ function testFieldDoubleEscaping() {
* @return void
*/
function testGenerateAssociationQuerySelfJoin() {
$this->Dbo = $this->getMock('DboMysql', array('connect', '_execute', 'execute'));
$this->Dbo = $this->getMock('Mysql', array('connect', '_execute', 'execute'));
$this->startTime = microtime(true);
$this->Model = new Article2();
$this->_buildRelatedModels($this->Model);
Expand Down Expand Up @@ -1012,7 +1011,7 @@ function &_prepareAssociationQuery(&$model, &$queryData, $binding) {
* @return void
*/
function testGenerateInnerJoinAssociationQuery() {
$test = $this->getMock('DboMysql', array('connect', '_execute', 'execute'));
$test = $this->getMock('Mysql', array('connect', '_execute', 'execute'));
$this->Model = $this->getMock('TestModel9', array('getDataSource'));
$this->Model->expects($this->any())
->method('getDataSource')
Expand Down Expand Up @@ -2829,7 +2828,7 @@ function testBuildColumn2() {
* @return void
*/
function testHasAny() {
$this->Dbo = $this->getMock('DboMysql', array('connect', '_execute', 'execute', 'value'));
$this->Dbo = $this->getMock('Mysql', array('connect', '_execute', 'execute', 'value'));
$this->Model = $this->getMock('TestModel', array('getDataSource'));
$this->Model->expects($this->any())
->method('getDataSource')
Expand Down Expand Up @@ -3374,7 +3373,7 @@ function testRealQueries() {
* @return void
*/
function testExceptionOnBrokenConnection() {
$dbo = new DboMysql(array(
$dbo = new Mysql(array(
'driver' => 'mysql',
'host' => 'imaginary_host',
'login' => 'mark',
Expand Down

0 comments on commit 406e7b7

Please sign in to comment.