問題点 #22281
BcAppModel::expects()のリネーム
Status: | 終了 | Start date: | ||
---|---|---|---|---|
Priority: | 通常 | Due date: | ||
Assignee: | 滝下 真玄 | % Done: | 100% | |
Category: | その他 | |||
Target version: | 4.1.3 |
Description
expects()というメソッド名があるため、現状モデルのモックを作ることができない。
テストの記述が著しく制限されるため、別の名前にしてほしい。
「expect」は「期待する」で、実際の処理(列挙されていないアソシエーションを削除する)を推測しにくい名前なので「cleanAssociations()」のような名前に変えたほうが良いと思う。
【エラーの内容】
Declaration of Mock_Reminder_0874e992::expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher) should be compatible with BcAppModel::expects($arguments, $reset = true) /var/www/html/lib/Cake/TestSuite/CakeTestCase.php:821 /var/www/html/lib/Cake/TestSuite/CakeTestCase.php:864 /var/www/html/lib/Cake/TestSuite/ControllerTestCase.php:380
【定義されている場所】
https://github.com/baserproject/basercms/blob/dev-4/lib/Baser/Model/BcAppModel.php#L1243
【使用している箇所】
https://github.com/baserproject/basercms/blob/dev-4/lib/Baser/Model/BcAppModel.php#L1303
https://github.com/baserproject/basercms/blob/dev-4/lib/Baser/Plugin/Blog/Model/BlogPost.php#L891
https://github.com/baserproject/basercms/blob/dev-4/lib/Baser/Plugin/Blog/Test/Case/View/Helper/BlogHelperTest.php#L104
https://github.com/baserproject/basercms/blob/dev-4/lib/Baser/Plugin/Mail/View/Helper/MailHelper.php#L52
https://github.com/baserproject/basercms/blob/dev-4/lib/Baser/Test/Case/Model/BcAppTest.php#L751
Associated revisions
History
#1 Updated by 滝下 真玄 over 2 years ago
- Status changed from 担当 to 解決
- Assignee set to 滝下 真玄
- % Done changed from 0 to 100
#2 Updated by 江頭 竜二 over 2 years ago
- Target version changed from 4.2.0 to 4.1.3
#3 Updated by 江頭 竜二 over 2 years ago
- Status changed from 解決 to 終了