Created
May 29, 2013 21:34
-
-
Save JeffreyWay/5674014 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 | |
class User extends Eloquent { | |
public function getOldest() | |
{ | |
return $this->orderBy('age', 'desc')->first(); | |
} | |
} |
2 because we're dealing with datas from the database. Otherwise 3 if you intend to test a method that format a given data.
2 and 3
2
2, using an in-memory database. Good tutorial here: http://code.tutsplus.com/tutorials/testing-like-a-boss-in-laravel-models--net-30087
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
2