Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public function testInsertingSomething()
{
$something = array(
'something_id' => 123,
'someother_value' => 10
);
$dbMock = m::mock('Zend_Db_Adapter_Mysqli');
$dbMock->shouldReceive('fetchOne')
->with('SELECT something_id FROM somethings WHERE something_id = ?', 123)
->andReturn(false);
$dbMock->shouldReceive('insert')
->with('somethings', $something)
->andReturn(1);
$this->model->setDb($dbMock);
$this->model->saveSomething($something);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.