Migrating test cases to be PHP 5.2 compliant
This commit is contained in:
parent
bb1cf022a3
commit
097adf5142
@ -130,7 +130,7 @@ class Doctrine_Connection_TestCase extends Doctrine_UnitTestCase {
|
||||
$this->conn->exec('DROP TABLE entity');
|
||||
}
|
||||
public function testGetManager() {
|
||||
$this->assertEqual($this->connection->getManager(),$this->manager);
|
||||
$this->assertTrue($this->connection->getManager() === $this->manager);
|
||||
}
|
||||
public function testDelete() {
|
||||
$user = $this->connection->create('User');
|
||||
|
@ -259,6 +259,31 @@ class Doctrine_Export_Mysql_TestCase extends Doctrine_UnitTestCase
|
||||
|
||||
$this->assertEqual($this->adapter->pop(), 'CREATE TABLE mysql_index_test_record (id BIGINT AUTO_INCREMENT, name TEXT, code INT, content TEXT, FULLTEXT INDEX content_idx (content), UNIQUE INDEX namecode_idx (name, code), PRIMARY KEY(id)) ENGINE = MYISAM');
|
||||
}
|
||||
public function testExportSupportsForeignKeys()
|
||||
{
|
||||
$r = new MysqlForeignKeyTest;
|
||||
//print $this->adapter->pop();
|
||||
//$this->assertEqual($this->adapter->pop());
|
||||
}
|
||||
}
|
||||
class MysqlForeignKeyTest extends Doctrine_Record
|
||||
{
|
||||
public function setTableDefinition()
|
||||
{
|
||||
$this->hasColumn('name', 'string', null);
|
||||
$this->hasColumn('code', 'integer', 4);
|
||||
$this->hasColumn('content', 'string', 4000);
|
||||
$this->hasColumn('parent_id', 'integer');
|
||||
|
||||
$this->foreignKey(array('local' => 'id',
|
||||
'foreign' => 'parent_id',
|
||||
'foreignTable' => 'mysql_foreign_key_test',
|
||||
'onDelete' => 'CASCADE')
|
||||
);
|
||||
|
||||
$this->option('type', 'INNODB');
|
||||
|
||||
}
|
||||
}
|
||||
class MysqlIndexTestRecord extends Doctrine_Record
|
||||
{
|
||||
@ -283,7 +308,7 @@ class MysqlTestRecord extends Doctrine_Record
|
||||
$this->hasColumn('name', 'string', null, 'primary');
|
||||
$this->hasColumn('code', 'integer', null, 'primary');
|
||||
|
||||
$this->option('engine', 'INNODB');
|
||||
$this->option('type', 'INNODB');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -1,7 +1,36 @@
|
||||
<?php
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* This software consists of voluntary contributions made by many individuals
|
||||
* and is licensed under the LGPL. For more information, see
|
||||
* <http://www.phpdoctrine.com>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Doctrine_Query_MultiJoin_TestCase
|
||||
*
|
||||
* @package Doctrine
|
||||
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
|
||||
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
||||
* @category Object Relational Mapping
|
||||
* @link www.phpdoctrine.com
|
||||
* @since 1.0
|
||||
* @version $Revision$
|
||||
*/
|
||||
class Doctrine_Query_MultiJoin_TestCase extends Doctrine_UnitTestCase {
|
||||
|
||||
|
||||
public function testInitializeData() {
|
||||
|
||||
$query = new Doctrine_Query($this->connection);
|
||||
|
@ -10,6 +10,8 @@ class Doctrine_Query_ReferenceModel_TestCase extends Doctrine_UnitTestCase {
|
||||
parent::prepareTables();
|
||||
$this->connection->clear();
|
||||
}
|
||||
public function prepareData()
|
||||
{ }
|
||||
|
||||
public function testInitializeData() {
|
||||
$query = new Doctrine_Query($this->connection);
|
||||
|
@ -70,7 +70,7 @@ class Doctrine_Relation_Access_TestCase extends Doctrine_UnitTestCase {
|
||||
}
|
||||
|
||||
public function prepareTables() {
|
||||
$this->tables = array("MyUser",
|
||||
$this->tables += array("MyUser",
|
||||
"MyOneThing",
|
||||
"MyUserOneThing",
|
||||
"MyOtherThing",
|
||||
|
Loading…
Reference in New Issue
Block a user