Created
February 11, 2015 05:31
-
-
Save alihammad-gist/f2a1516c095dd2522392 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @expectedException \Postit\Db\Exception | |
*/ | |
function testInsertPost_throwsException() | |
{ | |
$pdoMock = $this->getMockBuilder('PDO') | |
->disableOriginalConstructor() | |
->getMock(); | |
$pdoMock->expects($this->once()) | |
->method('prepare') | |
->will($this->throwException(new \PDOException)); | |
$repo = new PostRepo($pdoMock); | |
$repo->insertPost(new PostEntity(null, null), 23); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment