Skip to content

Instantly share code, notes, and snippets.

Created Aug 24, 2015
What would you like to do?
App::uses('PwfSource', 'Model/Datasource');
App::uses('Model', 'Model');
public function setUp() {
$this->Source = ClassRegistry::init('PwfSource');
$this->sourceMethods = get_class_methods($this->Source);
$methods = array_diff($this->sourceMethods, ['read', '__call', '__isset', '__get']);
$this->Source = $this->getMock('PwfSource', $methods);
$this->Model = $this->getMock('Model');
public function testRead() {
$result = $this->Source->read($this->Model, ['conditions' => array('id' => 9379)]);
$this->assertEquals($expected_result, $result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment