示例#1
0
 public function testFieldsCanBeUpdated()
 {
     $mockBuilder = m::mock('Illuminate\\Database\\Query\\Builder');
     $mockBuilder->shouldReceive('update')->with(array('field1' => 'blah', 'field2' => 'blah'))->once();
     $mockBuilder->shouldReceive('select', 'where')->atLeast()->once()->withAnyArgs()->andReturn($mockBuilder);
     $mockDb = $this->mock($mockBuilder, true);
     $obj = new Scaffold($mockDb, self::TEST_TABLE);
     $obj->addElements(array('field1' => array(), 'field2' => array()));
     $obj->update(array('field1' => 'blah', 'field2' => 'blah', 'column1' => '1', 'column2' => '2'));
 }