Skip to content

Instantly share code, notes, and snippets.

@eminetto
Created September 28, 2012 18:01
Show Gist options
  • Save eminetto/3801293 to your computer and use it in GitHub Desktop.
Save eminetto/3801293 to your computer and use it in GitHub Desktop.
test unit ego trip
public function testUpdate()
{
$tableGateway = $this->getTable('Skel\Model\Post');
$post = $this->addPost();
$saved = $tableGateway->save($post);
$id = $saved->id;
$this->assertEquals(1, $id);
$post = $tableGateway->get($id);
$this->assertEquals('Apple compra a Coderockr', $post->title);
$post->title = 'Coderockr compra a Apple';
$updated = $tableGateway->save($post);
$post = $tableGateway->get($id);
$this->assertEquals('Coderockr compra a Apple', $post->title);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment