HogeとFuga、プラグインを両方入れてHogeのテストを動かした時に出るエラーです。
エラーのなかで、Hoge=Mcc, Fuga=MemberAdmin,それぞれこのようなプラグイン名です。
ほかにもプラグインが入っていて絡んでるんですが、FugaのFixtureを読み込めばエラーは消えます。
MISSINGTABLEEXCEPTION
Table mysite_test_member_admins for model MemberAdmin was not found in datasource test.
Test case: MccCallTest(testReserveDelete)
Stack trace:
/home/kusanagi/dev_nomiss/DocumentRoot/lib/Cake/Model/Model.php : 3673
/home/kusanagi/dev_nomiss/DocumentRoot/lib/Cake/Model/Model.php : 834
/home/kusanagi/dev_nomiss/DocumentRoot/app/Plugin/MemberAdmin/Event/MemberAdminModelEventListener.php : 37
/home/kusanagi/dev_nomiss/DocumentRoot/app/Plugin/MemberAdmin/Event/MemberAdminModelEventListener.php : 37
MemberAdminModelEventListener::pointPointUserAfterFind
/home/kusanagi/dev_nomiss/DocumentRoot/lib/Baser/Event/CakeEventManager.php : 243
/home/kusanagi/dev_nomiss/DocumentRoot/lib/Baser/Event/BcEventDispatcher.php : 64
/home/kusanagi/dev_nomiss/DocumentRoot/lib/Baser/Model/BcAppModel.php : 1553
/home/kusanagi/dev_nomiss/DocumentRoot/lib/Baser/Event/BcModelEventDispatcher.php : 71
BcModelEventDispatcher::afterFind
/home/kusanagi/dev_nomiss/DocumentRoot/lib/Baser/Event/CakeEventManager.php : 243
/home/kusanagi/dev_nomiss/DocumentRoot/lib/Cake/Model/Model.php : 3358
/home/kusanagi/dev_nomiss/DocumentRoot/lib/Baser/Model/BcAppModel.php : 1523
/home/kusanagi/dev_nomiss/DocumentRoot/lib/Baser/Model/Datasource/DboSource.php : 619
/home/kusanagi/dev_nomiss/DocumentRoot/lib/Cake/Model/Model.php : 834
/home/kusanagi/dev_nomiss/DocumentRoot/app/Plugin/Point/Model/PointUser.php : 186
/home/kusanagi/dev_nomiss/DocumentRoot/app/Plugin/Point/Model/PointUser.php : 186
/home/kusanagi/dev_nomiss/DocumentRoot/app/Plugin/Mcc/Model/MccCall.php : 137
/home/kusanagi/dev_nomiss/DocumentRoot/app/Plugin/Mcc/Test/Case/Model/MccCallTest.php : 61
MccCallTest::testReserveDelete
/home/kusanagi/dev_nomiss/DocumentRoot/vendors/phpunit/phpunit/PHPUnit/Framework/TestCase.php : 988
/home/kusanagi/dev_nomiss/DocumentRoot/vendors/phpunit/phpunit/PHPUnit/Framework/TestCase.php : 838
/home/kusanagi/dev_nomiss/DocumentRoot/vendors/phpunit/phpunit/PHPUnit/Framework/TestResult.php : 648
/home/kusanagi/dev_nomiss/DocumentRoot/vendors/phpunit/phpunit/PHPUnit/Framework/TestCase.php : 783
/home/kusanagi/dev_nomiss/DocumentRoot/lib/Cake/TestSuite/CakeTestCase.php : 84
/home/kusanagi/dev_nomiss/DocumentRoot/vendors/phpunit/phpunit/PHPUnit/Framework/TestSuite.php : 779
/home/kusanagi/dev_nomiss/DocumentRoot/vendors/phpunit/phpunit/PHPUnit/Framework/TestSuite.php : 749
/home/kusanagi/dev_nomiss/DocumentRoot/vendors/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php : 350
/home/kusanagi/dev_nomiss/DocumentRoot/lib/Cake/TestSuite/CakeTestRunner.php : 67
/home/kusanagi/dev_nomiss/DocumentRoot/lib/Cake/TestSuite/CakeTestSuiteCommand.php : 98
/home/kusanagi/dev_nomiss/DocumentRoot/lib/Baser/Lib/TestSuite/BaserTestSuiteDispatcher.php : 147
/home/kusanagi/dev_nomiss/DocumentRoot/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php : 96
/home/kusanagi/dev_nomiss/DocumentRoot/lib/Baser/Lib/TestSuite/BaserTestSuiteDispatcher.php : 57
/home/kusanagi/dev_nomiss/DocumentRoot/app/webroot/test.php : 118
で、FugaのFixtureを読み込んだまま、Fugaを外してHogeだけにすると、それはそれでエラーになります。
さらにすいません、datasourceエラーではなかったです。
Plugin MemberAdmin could not be found.
エラー: 内部エラーが発生しました。
普通にプラグインが無い。のエラーでした。
FugaはHogeに影響を与えるためのプラグインで、組み合わせた場合と、Hoge単体でも使用できる。
というのができないかと思って、一応できたんですが、テストが通らない。という問題にあたってしまいまして、投稿させていただきました。
こういう場合のうまいやり方などありましたら、お願い致します。
引用:
テストを通すためのFixtureの切り替えやイベントのdetachは行わない方がいいように思います。
やっぱりですよね、共通ビヘイビアとかに逃して、プラグインはそれぞれ独立させるとか、考えてみたいと思います。うーん。