コード例 #1
0
ファイル: TableGatewayTest.php プロジェクト: rikaix/zf2
 /**
  * @covers Zend\Db\TableGateway\TableGateway::update
  */
 public function testUpdate()
 {
     $mockUpdate = $this->mockSql->update();
     // assert select::from() is called
     $mockUpdate->expects($this->once())->method('where')->with($this->equalTo('id = 2'));
     $this->table->update(array('foo' => 'bar'), 'id = 2');
 }
コード例 #2
0
 /**
  * @covers Zend\Db\TableGateway\AbstractTableGateway::update
  * @covers Zend\Db\TableGateway\AbstractTableGateway::updateWith
  * @covers Zend\Db\TableGateway\AbstractTableGateway::executeUpdate
  */
 public function testUpdateWithNoCriteria()
 {
     $mockUpdate = $this->mockSql->update();
     $affectedRows = $this->table->update(array('foo' => 'bar'));
     $this->assertEquals(5, $affectedRows);
 }