Created
January 21, 2012 11:34
-
-
Save icambridge/1652449 to your computer and use it in GitHub Desktop.
Mock Model Class
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 | |
namespace app\tests\mocks\models; | |
use lithium\data\collection\RecordSet; | |
class Articles extends \app\models\Articles { | |
public static function find($type = 'all', array $options = array()) { | |
switch($type) { | |
case 'first': | |
return new RecordSet(array('data' => array( | |
'id' => 1, 'title' => 'Top ten reasons why this is a bad title.' | |
))); | |
break; | |
case 'all': | |
default : | |
return new RecordSet(array('data' => array( | |
array('id' => 1, 'title' => 'Top ten reasons why this is a bad title.'), | |
array('id' => 2, 'title' => 'Sensationalist Over-dramatization!'), | |
array('id' => 3, 'title' => 'Heavy Editorializing!'), | |
))); | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment