예제 #1
0
 /**
  * @group ZF-3486
  */
 public function testTableRelationshipCanFindManyToManyRowsetViaConcreteInstantiation()
 {
     Table\Table::setDefaultAdapter($this->_db);
     $definition = $this->_getTableDefinition();
     $bugsTable = new Table\Table('Bugs', $definition);
     $bugsRowset = $bugsTable->find(1);
     $bugRow = $bugsRowset->current();
     $m2mRowset = $bugRow->findManyToManyRowset('Products', 'BugsProducts');
     $this->assertEquals(3, $m2mRowset->count());
 }
예제 #2
0
파일: AbstractTest.php 프로젝트: rexmac/zf2
 /**
  * @group ZF-5674
  */
 public function testTableAndIdentityWithVeryLongName()
 {
     Table\Table::setDefaultAdapter($this->_db);
     // create test table using no identifier quoting
     $this->_util->createTable('thisisaveryverylongtablename', array('thisisalongtablenameidentity' => 'IDENTITY', 'stuff' => 'VARCHAR(32)'));
     $tableName = $this->_util->getTableName('thisisaveryverylongtablename');
     $table = new Table\Table('thisisaveryverylongtablename');
     $row = $table->createRow($this->_getRowForTableAndIdentityWithVeryLongName());
     $row->save();
     $rowset = $table->find(1);
     $this->assertEquals(1, count($rowset));
     $this->_util->dropTable('thisisaveryverylongtablename');
 }