当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPUnit_Extensions_Database_DataSet_ITable类代码示例

本文整理汇总了PHP中PHPUnit_Extensions_Database_DataSet_ITable的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Extensions_Database_DataSet_ITable类的具体用法?PHP PHPUnit_Extensions_Database_DataSet_ITable怎么用?PHP PHPUnit_Extensions_Database_DataSet_ITable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PHPUnit_Extensions_Database_DataSet_ITable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: buildInsertValues

 /**
  *
  * @param PHPUnit_Extensions_Database_DataSet_ITable $table
  * @param int $rowNum
  * @return array
  */
 protected function buildInsertValues(\PHPUnit_Extensions_Database_DataSet_ITable $table, $rowNum)
 {
     $values = array();
     foreach ($table->getTableMetaData()->getColumns() as $columnName) {
         $values[$columnName] = $table->getValue($rowNum, $columnName);
     }
     return $values;
 }
开发者ID:heiglandreas,项目名称:zf2,代码行数:14,代码来源:Insert.php

示例2: buildOperationArguments

 protected function buildOperationArguments(PHPUnit_Extensions_Database_DataSet_ITableMetaData $databaseTableMetaData, PHPUnit_Extensions_Database_DataSet_ITable $table, $row)
 {
     $args = array();
     foreach ($table->getTableMetaData()->getColumns() as $columnName) {
         $args[] = $table->getValue($row, $columnName);
     }
     return $args;
 }
开发者ID:sethcasana,项目名称:phpunit,代码行数:8,代码来源:Insert.php

示例3: 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);
 }
开发者ID:nizarbey,项目名称:phpunit-all-in-one,代码行数:12,代码来源:Abstract.php

示例4: row

 /**
  * Override to save a table row.
  *
  * @param array                                      $row
  * @param PHPUnit_Extensions_Database_DataSet_ITable $table
  */
 protected function row(array $row, PHPUnit_Extensions_Database_DataSet_ITable $table)
 {
     fwrite($this->fh, "\t<{$table->getTableMetaData()->getTableName()}\n");
     foreach ($table->getTableMetaData()->getColumns() as $columnName) {
         if (isset($row[$columnName])) {
             fwrite($this->fh, "\t\t{$columnName}=\"" . htmlspecialchars($row[$columnName]) . "\"\n");
         }
     }
     fwrite($this->fh, "\t/>\n");
 }
开发者ID:AndyDune,项目名称:rzn.phpunit4,代码行数:16,代码来源:FlatXml.php

示例5: buildInsertValues

 /**
  *
  * @param \PHPUnit_Extensions_Database_DataSet_ITable $table
  * @param int $rowNum
  * @return array
  */
 protected function buildInsertValues(\PHPUnit_Extensions_Database_DataSet_ITable $table, $rowNum)
 {
     $values = array();
     foreach ($table->getTableMetaData()->getColumns() as $columnName) {
         try {
             $values[$columnName] = $table->getValue($rowNum, $columnName);
         } catch (FixtureValueNotExistsException $doNothing) {
         }
     }
     return $values;
 }
开发者ID:rukzuk,项目名称:rukzuk,代码行数:17,代码来源:DbOperationInsert.php

示例6: 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);
     }
 }
开发者ID:EmmanuelFernando,项目名称:rapport-stock-control,代码行数:17,代码来源:DefaultTable.php

示例7: evaluate

 /**
  * Determines whether or not the given table matches the table used to
  * create this constraint.
  *
  * @param PHPUnit_Extensions_Database_DataSet_ITable $other
  * @return bool
  */
 public function evaluate($other)
 {
     if ($other instanceof PHPUnit_Extensions_Database_DataSet_ITable) {
         try {
             $this->value->assertEquals($other);
             return TRUE;
         } catch (Exception $e) {
             $this->failure_reason = $e->getMessage();
             return FALSE;
         }
     } else {
         throw new InvalidArgumentException("PHPUnit_Extensions_Database_DataSet_ITable expected");
     }
 }
开发者ID:ninodafonte,项目名称:SIFO,代码行数:21,代码来源:TableIsEqual.php

示例8: matches

 /**
  * Evaluates the constraint for parameter $other. Returns TRUE if the
  * constraint is met, FALSE otherwise.
  *
  * This method can be overridden to implement the evaluation algorithm.
  *
  * @param mixed $other Value or object to evaluate.
  * @return bool
  */
 protected function matches($other)
 {
     if (!$other instanceof PHPUnit_Extensions_Database_DataSet_ITable) {
         throw new InvalidArgumentException('PHPUnit_Extensions_Database_DataSet_ITable expected');
     }
     return $this->value->matches($other);
 }
开发者ID:nbalonso,项目名称:MunkiFace,代码行数:16,代码来源:TableIsEqual.php

示例9: row

 /**
  * Override to save a table row.
  *
  * @param array                                      $row
  * @param PHPUnit_Extensions_Database_DataSet_ITable $table
  */
 protected function row(array $row, PHPUnit_Extensions_Database_DataSet_ITable $table)
 {
     fwrite($this->fh, "\t\t<row>\n");
     foreach ($table->getTableMetaData()->getColumns() as $columnName) {
         if (isset($row[$columnName])) {
             fwrite($this->fh, "\t\t\t<value>" . htmlspecialchars($row[$columnName]) . "</value>\n");
         } else {
             fwrite($this->fh, "\t\t\t<null />\n");
         }
     }
     fwrite($this->fh, "\t\t</row>\n");
 }
开发者ID:AndyDune,项目名称:rzn.phpunit4,代码行数:18,代码来源:Xml.php

示例10: 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;
 }
开发者ID:amptools-net,项目名称:midori-php,代码行数:23,代码来源:ReplacementTable.php

示例11: assertTableContains

 /**
  * Asserts that a given table contains a given row
  *
  * @param array $expectedRow Row expected to find
  * @param PHPUnit_Extensions_Database_DataSet_ITable $table Table to look into
  * @param string $message Optional message
  */
 public function assertTableContains(array $expectedRow, PHPUnit_Extensions_Database_DataSet_ITable $table, $message = '')
 {
     self::assertThat($table->assertContainsRow($expectedRow), self::isTrue(), $message);
 }
开发者ID:pdkhuong,项目名称:BBG,代码行数:11,代码来源:TestCase.php

示例12: row

 /**
  * Override to save a table row.
  *
  * @param array $row
  * @param PHPUnit_Extensions_Database_DataSet_ITable $table
  */
 protected function row(array $row, PHPUnit_Extensions_Database_DataSet_ITable $table)
 {
     fwrite($this->fh, "\t" . '<row>' . "\n");
     foreach ($table->getTableMetaData()->getColumns() as $columnName) {
         fwrite($this->fh, "\t\t" . '<field name="' . $columnName . '"');
         if (isset($row[$columnName])) {
             fwrite($this->fh, '>' . htmlspecialchars($row[$columnName]) . '</field>' . "\n");
         } else {
             fwrite($this->fh, ' xsi:nil="true" />' . "\n");
         }
     }
     fwrite($this->fh, "\t" . '</row>' . "\n");
 }
开发者ID:arjenschol,项目名称:phpunit,代码行数:19,代码来源:MysqlXml.php

示例13: 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;
 }
开发者ID:DaveNascimento,项目名称:civicrm-packages,代码行数:23,代码来源:AbstractTable.php

示例14: matches

 public function matches(\PHPUnit_Extensions_Database_DataSet_ITable $other)
 {
     return $this->table->getName() == $other->getTable()->getTableName();
 }
开发者ID:seytar,项目名称:psx,代码行数:4,代码来源:Table.php

示例15: __toString

 public function __toString()
 {
     $columns = $this->getTableMetaData()->getColumns();
     $lineSeperator = str_repeat('+----------------------', count($columns)) . "+\n";
     $lineLength = strlen($lineSeperator) - 1;
     $tableString = $lineSeperator;
     $tableString .= '| ' . str_pad($this->getTableMetaData()->getTableName(), $lineLength - 4, ' ', STR_PAD_RIGHT) . " |\n";
     $tableString .= $lineSeperator;
     $tableString .= $this->rowToString($columns);
     $tableString .= $lineSeperator;
     $rowCount = $this->getRowCount();
     for ($i = 0; $i < $rowCount; $i++) {
         $values = array();
         foreach ($columns as $columnName) {
             if ($this->other) {
                 try {
                     if ($this->getValue($i, $columnName) != $this->other->getValue($i, $columnName)) {
                         $values[] = sprintf('%s != actual %s', var_export($this->getValue($i, $columnName), TRUE), var_export($this->other->getValue($i, $columnName), TRUE));
                     } else {
                         $values[] = $this->getValue($i, $columnName);
                     }
                 } catch (\InvalidArgumentException $ex) {
                     $values[] = $this->getValue($i, $columnName) . ': no row';
                 }
             } else {
                 $values[] = $this->getValue($i, $columnName);
             }
         }
         $tableString .= $this->rowToString($values) . $lineSeperator;
     }
     return ($this->other ? '(table diff enabled)' : '') . "\n" . $tableString . "\n";
 }
开发者ID:AndyDune,项目名称:rzn.phpunit4,代码行数:32,代码来源:AbstractTable.php


注:本文中的PHPUnit_Extensions_Database_DataSet_ITable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。