
日 落
找不到 mock Eloquent ORM 的方法,難道只能在 test case 裡面寫 sql 建立 in memory table 嗎 ... Orz

l• ܫ•) Davyキュルッ
有什麼不好嗎

日 落
ORM 相當於 DB schema 封裝出來的類別,我明明只需要用到 ORM,但是為了寫 test case 跑去建立一個 in memory table ,那不就破壞了原本封裝的原則?

__CA__.py
createMock 有什麼問題嗎?

日 落
__CA__.py
: Eloquent ORM 的 query builder 是 static method .....

日 落
手上的 code 剛好可以做 DI,暫時先用類似的方法處理掉了
Laravel Dependency Injection: When do you have to? W...

__CA__.py
PHPUnit Mock Objects and Static Methods
不知道 AspectMock 有沒有用

日 落
理論上有用,但是因為新版的 AspectMock composer 會和 Laravel 4.2 的 composer 相衝,所以手上的專案沒辦法用 AspectMock ...