コード例 #1
0
ファイル: AbstractTest.php プロジェクト: rafalwrzeszcz/zf2
 /**
  * @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');
 }