本文整理汇总了PHP中PHPUnit_Extensions_Database_DataSet_ITable::getRowCount方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Extensions_Database_DataSet_ITable::getRowCount方法的具体用法?PHP PHPUnit_Extensions_Database_DataSet_ITable::getRowCount怎么用?PHP PHPUnit_Extensions_Database_DataSet_ITable::getRowCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Extensions_Database_DataSet_ITable
的用法示例。
在下文中一共展示了PHPUnit_Extensions_Database_DataSet_ITable::getRowCount方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveTable
/**
* @param PHPUnit_Extensions_Database_DataSet_ITable $table
*/
protected function saveTable(PHPUnit_Extensions_Database_DataSet_ITable $table)
{
$rowCount = $table->getRowCount();
$this->startTable($table);
for ($i = 0; $i < $rowCount; $i++) {
$this->row($table->getRow($i), $table);
}
$this->endTable($table);
}
示例2: addTableRows
/**
* Adds the rows in the passed table to the current table.
*
* @param PHPUnit_Extensions_Database_DataSet_ITable $table
*/
public function addTableRows(PHPUnit_Extensions_Database_DataSet_ITable $table)
{
$tableColumns = $this->getTableMetaData()->getColumns();
$rowCount = $table->getRowCount();
for ($i = 0; $i < $rowCount; $i++) {
$newRow = array();
foreach ($tableColumns as $columnName) {
$newRow[$columnName] = $table->getValue($i, $columnName);
}
$this->addRow($newRow);
}
}
示例3: loadData
/**
* Loads data into local data table if it's not already loaded
*/
protected function loadData()
{
if ($this->data === NULL) {
$data = array();
for ($row = 0; $row < $this->originalTable->getRowCount(); $row++) {
$tRow = array();
foreach ($this->getTableMetaData()->getColumns() as $col) {
$tRow[$col] = $this->getValue($row, $col);
}
$data[$row] = $tRow;
}
$this->data = $data;
}
}
示例4: matches
/**
* Asserts that the given table matches this table.
*
* @param PHPUnit_Extensions_Database_DataSet_ITable $other
*/
public function matches(PHPUnit_Extensions_Database_DataSet_ITable $other)
{
$thisMetaData = $this->getTableMetaData();
$otherMetaData = $other->getTableMetaData();
if (!$thisMetaData->matches($otherMetaData) || $this->getRowCount() != $other->getRowCount()) {
return FALSE;
}
$columns = $thisMetaData->getColumns();
$rowCount = $this->getRowCount();
for ($i = 0; $i < $rowCount; $i++) {
foreach ($columns as $columnName) {
if ($this->getValue($i, $columnName) != $other->getValue($i, $columnName)) {
return FALSE;
}
}
}
return TRUE;
}
示例5: getRowCount
/**
* Returns the number of rows in this table.
*
* @return int
*/
public function getRowCount()
{
return $this->originalTable->getRowCount();
}
示例6: startTable
/**
* Override to save the start of a table.
*
* @param PHPUnit_Extensions_Database_DataSet_ITable $table
*/
protected function startTable(PHPUnit_Extensions_Database_DataSet_ITable $table)
{
if ($table->getRowCount() == 0) {
fwrite($this->fh, "\t<{$table->getTableMetaData()->getTableName()} />\n");
}
}
示例7: assertEquals
/**
* Asserts that the given table matches this table.
*
* @param PHPUnit_Extensions_Database_DataSet_ITable $other
*/
public function assertEquals(PHPUnit_Extensions_Database_DataSet_ITable $other)
{
$thisMetaData = $this->getTableMetaData();
$otherMetaData = $other->getTableMetaData();
$thisMetaData->assertEquals($otherMetaData);
if ($this->getRowCount() != $other->getRowCount()) {
throw new Exception("Expected row count of {$this->getRowCount()}, has a row count of {$other->getRowCount()}");
}
$columns = $thisMetaData->getColumns();
for ($i = 0; $i < $this->getRowCount(); $i++) {
foreach ($columns as $columnName) {
if ($this->getValue($i, $columnName) != $other->getValue($i, $columnName)) {
throw new Exception("Expected value of {$this->getValue($i, $columnName)} for row {$i} column {$columnName}, has a value of {$other->getValue($i, $columnName)}");
}
}
}
return TRUE;
}