]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - tests/include/database/FreeTDSManagerTest.php
Added unit tests.
[Github/sugarcrm.git] / tests / include / database / FreeTDSManagerTest.php
1 <?php
2 require_once 'include/database/DBManagerFactory.php';
3
4 /**
5  * @group bug33049
6  */
7 class FreeTDSManagerTest extends Sugar_PHPUnit_Framework_TestCase
8 {
9     private $_db;
10     
11     public function setUp()
12     {
13         $this->_db = DBManagerFactory::getInstance();
14         if(get_class($this->_db) != 'FreeTDSManager') {
15            $this->markTestSkipped("Skipping test if not mssql configuration");
16     }
17     }
18     
19     public function testAppendnAddsNCorrectly()
20     {
21        $sql = $this->_db->appendN('SELECT name FROM accounts where name = \'Test\'');
22        $this->assertEquals($sql, 'SELECT name FROM accounts where name = N\'Test\'', 'Assert N was added.');
23         
24            $sql = $this->_db->appendN('SELECT name FROM accounts where name = \'O\\\'Rielly\'');
25        $this->assertEquals($sql, 'SELECT name FROM accounts where name = N\'O\\\'Rielly\'', 'Assert N was added.');    
26     }
27     
28 }