Created
February 24, 2012 21:31
-
-
Save mikedfunk/1903888 to your computer and use it in GitHub Desktop.
PHPUnit CodeIgniter library mock example
This file contains 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 | |
// inside the test class... | |
// mock | |
require_once(BASEPATH.'libraries/email.php'); | |
$this->_ci->email = $this->getMock('CI_Email'); | |
$this->_ci->email->expects($this->any()) | |
->method('send') | |
->will($this->returnValue(true)); | |
$this->assertTrue($this->_ci->email->send()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment