Created
May 11, 2015 07:08
-
-
Save memememomo/f3ae6fd253ab339ce0b9 to your computer and use it in GitHub Desktop.
コントローラのユニットテストでHTMLを描画しようとするとAssetファイルが正常の読み込まれない ref: http://qiita.com/uchiko/items/2461783d60441012423b
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 | |
return array( | |
'paths' => [DOCROOT.'public/assets/'] | |
); |
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
public function test_index() | |
{ | |
$request = \Fuel\Core\Request::forge('/'); | |
$response = $request->execute()->response(); | |
// この行のrender()メソッドでエラーが出る。 | |
$html = $response->body()->render(); | |
$pattern = '/' . preg_quote('トップページ', '/') . '/u'; | |
$this->assertRegExp($pattern, $body); | |
} |
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
Fuel\Core\FuelException: Could not find asset: bootstrap.css |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment